Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a little help on Perl

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,
Please can someone tell me what to do exactly here with these instructions:

«You can either write an encoding function that would replace blank space
with some invisible character such as \s using regular expression and
replace it back before output or use a if then statement to replace the
system variable with output that is 2 words.»

My problem: example: "Services Financiers" appear as "Services_Financiers"
on the web but I want to have a blankspace. Thank you for helping me :)))
Script behind:


# List Categories in your links script

@Categorie =

"Associés\/Franchises\/Occasions d'affaire",
"Capital Risque & Financement",
"Cours\/Formation",
"Divers",
"Services Financiers",
"Services Professionnels"
);

# Define Categorie description

%Categorie_desc =

"Associés\/Franchises\/Occasions d'affaire" => "",
"Capital Risque & Financement" => "",
"Cours\/Formation" => "",
"Divers" => "",
"Services Financiers" => "",
"Services Professionnels" => ""
);
 
I'm not sure I understand the question, but I'll take a stab at it.....

You can replace a string or group of characters inside another string using.....
Code:
$string =~ s/$what_to_replace/$replace_it_with/;


So, with your string in a variable, $string,
Code:
$string =~ s/_/ /; # replace an underline with a space

'hope this helps...




keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top