Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Mystery interaction between split and gobbling arrays

by saintmike (Vicar)
on Jun 17, 2015 at 23:12 UTC ( #1130901=note: print w/replies, xml ) Need Help??


in reply to Re: Mystery interaction between split and gobbling arrays
in thread Mystery interaction between split and gobbling arrays

Wow, nice find, thanks for that. I'm pretty sure that setting the limit to 4 in the first case saves some cpu cycles, but setting it to 0 in the second case is pretty crazy, given the special behavior of split() in this case.

Here's one more: What's the difference between

( $a, $b, $c ) = split /:/, $str;
and
( $a, $b, $c, @options ) = split /:/, $str;
when $str = "foo:bar:"?

Spoiler: Adding @options to the left hand side makes $c undef'd!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1130901]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2020-05-26 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (150 votes). Check out past polls.

    Notices?