Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: why can't I shift a split?

by Tux (Canon)
on Aug 25, 2022 at 15:43 UTC ( [id://11146421]=note: print w/replies, xml ) Need Help??


in reply to why can't I shift a split?

To me, it is not clear what you want at all. Do you want the result of the split excluding the first element in @_? Or do you want @_ only hold the first element and discard the rest?

$ perl -E'$a="a,b,c,d";(undef,@_)=split/,/,$a;say "@_"' b c d $ perl -E'$a="a,b,c,d";@_=(split/,/,$a,2)[0];say "@_"' a

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-16 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found