Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by shmem (Chancellor)
on Aug 28, 2019 at 23:52 UTC ( #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
Node Status?
node history
Node Type: note [id://11105201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2020-06-02 06:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (13 votes). Check out past polls.

    Notices?