Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Popping from method that returns a list in one line

by shmem (Chancellor)
on Aug 28, 2019 at 23:52 UTC ( [id://11105201]=note: print w/replies, xml ) Need Help??


in reply to Popping from method that returns a list in one line

perl v5.20.2:

use strict; use warnings; # yadda yadda use 5.10.0; sub foo { my $ary = [1..10]; $ary } my $o = bless \do {my $x}; say "this: ", pop @{$o->foo}; __END__ this: 10

also:

use strict; use warnings; # yadda yadda use 5.10.0; sub foo { (1..10) } my $o = bless \do {my $x}; say "this: ", pop @{[$o->foo]}; __END__ this: 10
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found