In regex, the ^ indicates beginning of line/variable.  You must escape it, but 
even more important, you have the value in $a, but you are not running your regex vs 
$a, but the default $_.

        So, you should try:

                $a =~ s/\^/_/g;

        This should change the ^ to _.

Wags ;)

-----Original Message-----
From: siren jones [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 13:37
To: [EMAIL PROTECTED]
Subject: s/// Question from Newbie



I'm trying to replace the ^ in a filename, which by the way, I did not 
create.

Here is the filename:  Wind19^144^0.0^100^.grib

Here is my test code:

$a = "144^0.0^100^";
$a = s/^/_/g;     # replace ^ with underscore character for ftp
print "$a,"\n";
exit;

Here is what gets printed:

144^0.0^100^


What am I doing wrong with the substitution operator?  Thanks in advance.



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to