more useful options | |
PerlMonks |
Re: Mistakenly Believing split is using @_by Maestro_007 (Hermit) |
on Sep 19, 2001 at 22:15 UTC ( [id://113428]=note: print w/replies, xml ) | Need Help?? |
It's doesn't warn as a result of what you're splitting on, but what you're assigning to. In the olden days, the idiom would look like this:
which would automatically assign the contents to @_. Maybe the warning should say Implicitly assigning result of split() to @_ is deprecated. I got burned on that one once upon a time, myself. The reason the second snippet doesn't warn is that you have assigned the result to @chars. I think it's safe to say that the newer behavior is a Good Thing. As to why the warning doesn't understand that you are still using the results in another context is a little puzzling, something that merlyn can probably answer. MM Update: void context =~ scalar context, got it. Thanks japhy!
In Section
Seekers of Perl Wisdom
|
|