Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20

by Anonymous Monk
on Nov 23, 2013 at 11:39 UTC ( #1064028=note: print w/ replies, xml ) Need Help??


in reply to Re: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20
in thread use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20

I'll translate for you

my @in = ( 2, 3 ); my @out = ( 1, \@in, 4 ); my $r = \@out; $r = [ 1, [ 2, 3 ], 4 ]; $r->[1]->@*; # equivalent to @{ $r->[1] } # equivalent to @{ $out[1] } # equivalent to @{ \@in }


Comment on Re^2: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20
Download Code
Replies are listed 'Best First'.
Re^3: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20
by Anonymous Monk on Nov 23, 2013 at 11:48 UTC
    How does that answers if $r->[1]@* is valid?

      How does that answers if $r->[1]@* is valid?

      It doesn't, it answers only the question I understood  Why is the second arrow necessary in $r->[1]->@*?  

      I've no idea if  $r->[1]@*   I usually don't run development builds of perl

      From the documentation I would guess the answer is no, but the test suite might be more revealing https://metacpan.org/source/SHAY/perl-5.19.5/t/op/postfixderef.t ; short look, looks like answer is no

Re^3: use feature 'postderef'; # Postfix Dereference Syntax is coming in 5.20
by Anonymous Monk on Nov 23, 2013 at 11:40 UTC
    or $r->1->flatten

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2015-07-07 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls