mosh has asked for the wisdom of the Perl Monks concerning the following question:
I need an explanation of 2 similar code sections but with different results:
First one:
Second:our $AUTOLOAD = "aaa::bbb::ccc"; my ($func) = $AUTOLOAD =~ /.*::(.*)$/; print "$func\n"; ## ccc print "$AUTOLOAD\n"; ## aaa::bbb::ccc
The only different between the 2 section of code is the parenthesis surrounded the $funcour $AUTOLOAD = "aaa::bbb::ccc"; my $func = $AUTOLOAD =~ /.*::(.*)$/; print "$func\n"; ## 1 print "$AUTOLOAD\n"; ## aaa::bbb::ccc
What's the explanation for it?
Thanks,
Mosh.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strange behavior of parenthesis
by holli (Abbot) on Jul 11, 2005 at 10:12 UTC | |
by broquaint (Abbot) on Jul 11, 2005 at 11:12 UTC | |
by mosh (Scribe) on Jul 11, 2005 at 11:00 UTC | |
by Ultra (Hermit) on Jul 11, 2005 at 11:04 UTC | |
|
Re: strange behavior of parenthesis
by ysth (Canon) on Jul 11, 2005 at 15:49 UTC |