in reply to Re^3: why can't I shift a split?
in thread why can't I shift a split?

"LAST array element"

my $last = ( split /,/,join "\n",$myscalar )[-1];

Replies are listed 'Best First'.
Re^5: why can't I shift a split?
by LanX (Saint) on Aug 25, 2022 at 17:33 UTC
    This

    join "\n",$myscalar

    looks like a useless no-op.

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

      Sure, but let's just fix one problem at a time :)