Re: confusion with splitting columns using [-n, -n] (e.g; my ( $country, $bytes ) = ( split )[ -2, -1 ])





On Jan 30, 1:49 pm, "jeevs" <jeevan.ing...@xxxxxxxxx> wrote:
On Jan 30, 1:21 pm, "jeevs" <jeevan.ing...@xxxxxxxxx> wrote:

-2 and -1 are the indexes used by split which tells -1 is the last
column selected by split in your case its the bytes column. and -2 is
the country column.To add more the syntax used that is
(split)[-1,-2];

is nothing more than split used like

@arr = split (/ /,$string) ; ######## corrected line
and then later
accessing array with indexes i.e @arr[-1,-2];


.