in reply to Re^2: Printing line before matching expression
in thread Printing line before matching expression

compared to other proposals is the pushing and shifting which involves a lot of copying data around.

Sure it doesn't :)

This can be done more easily by cycling through the buffer using the modulo operator on the line number of the data.

If all the data you want is at the end

my @data = ( undef, undef, qw/ bingo nameo / ); print @data[ -1,-2,-3 ]; __END__ nameobingo

Replies are listed 'Best First'.
Re^4: Printing line before matching expression
by hdb (Monsignor) on Sep 11, 2013 at 08:21 UTC