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.
In reply to strange behavior of parenthesis by mosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |