=~ is the bind operator.
see perldoc perlop.
Manav
-Original Message-
From: Harold Castro [mailto:[EMAIL PROTECTED]
Sent: Friday, February 18, 2005 12:17 PM
To: beginners@perl.org
Subject: simple substitution question
Hi,
There is something that's bothering me for so
Harold Castro [HC], on Thursday, February 17, 2005 at 22:47 (-0800
(PST)) typed:
HC> for example:
HC> here is my string:
HC> $_ = "but";
HC> s/u/a/g;
HC> print $_;
what about this:
( my $string = "but" ) =~ s/u/a/g;
--
...m8s, cu l8r, Brano.
[Old Farts don't have to be politically correct.]
old Castro [mailto:[EMAIL PROTECTED]
Sent: Friday, February 18, 2005 12:17 PM
To: beginners@perl.org
Subject: simple substitution question
Hi,
There is something that's bothering me for so long
regarding the use of $_ variable.
for example:
here is my string:
$_ = "but";
s/
Hi,
There is something that's bothering me for so long
regarding the use of $_ variable.
for example:
here is my string:
$_ = "but";
s/u/a/g;
print $_;
This will simply print "bat"
My problem is using a variable in place of $_.
how will I tell that the one i'm going to substitute
is the $strin