http://qs1969.pair.com?node_id=11127340


in reply to Re^3: I am confused by a "Learning Perl" sample showing "unshift"
in thread I am confused by a "Learning Perl" sample showing "unshift"

Therefore:
unshift @a, @b same* as  push @b, @a

*But see clarification from choroba:

Replies are listed 'Best First'.
Re^5: I am confused by a "Learning Perl" sample showing "unshift"
by choroba (Cardinal) on Jan 23, 2021 at 21:51 UTC
    :-)

    No, as the first one changes @a, but the second one changes @b. The result is the same, but ends up in a different container.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^5: I am confused by a "Learning Perl" sample showing "unshift"
by LanX (Sage) on Jan 23, 2021 at 22:10 UTC
    Yes good point! :)

    ( provided choroba's comment, that the targets are swapped. )

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery