On 07/17/2014 05:16 PM, Uri Guttman wrote: > On 07/17/2014 09:02 AM, Lars Noodén wrote: >> Or maybe something like this in perl itself? >> >> perl -ne 'print @{[split(/\s+/,)]}[-1],qq(\n);' file > > much earlier in this thread there were one liner examples of perl using > the -a (autosplit option) which is much closer to the awk version.
I see it in the archive now. Memory is too short. > also you don't need the @{[]} stuff in that code. a simple slice will do > but you may need more parens to group things correctly. David's example with the autosplit seems much better but if a slice were done instead, what would be the more elegant (least inelegant?) way of doing it? Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/