Re: Pattern Variable & Regexp Operators

2004-08-15 Thread ms419
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:

Re: Pattern Variable & Regexp Operators

2004-08-13 Thread John W. Krahn
[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

Re: Pattern Variable & Regexp Operators

2004-08-13 Thread Gunnar Hjalmarsson
[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