On Aug 13, 2004, at 9:16 PM, John W. Krahn wrote:
[EMAIL PROTECTED] wrote:
Can someone please tell me, why
my $pattern = /stuff/;
That is short for:
my $pattern = $_ =~ m/stuff/;
Which assigns 1 to $pattern if the match succeeded or
'' if it failed.
$x =~ $pattern;
Which means that this is either:
[EMAIL PROTECTED] wrote:
Can someone please tell me, why
my $pattern = /stuff/;
That is short for:
my $pattern = $_ =~ m/stuff/;
Which assigns 1 to $pattern if the match succeeded or
'' if it failed.
$x =~ $pattern;
Which means that this is either:
$x =~ /1/;
Or:
$x =~ //;
or
my $pattern = "/stuf
[EMAIL PROTECTED] wrote:
Can someone please tell me, why
my $pattern = /stuff/;
$x =~ $pattern;
or
my $pattern = "/stuff/";
$x =~ $pattern;
don't work the same as
$x =~ /stuff/;
That's best explained in the docs. Start reading:
perldoc perlrequick
perldoc perlop (the m// operator)
After hav