Shawn H Corey wrote: > On Thu, 17 Jul 2014 17:36:28 +0300 > Lars Noodén <[email protected]> wrote: > >> 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? > > I wouldn't use a slice at all: > > perl -nE'say((split/\s+/)[-1])' file > > > -- > Don't stop where the ink does. > Shawn
You say you wouldn't use a slice but then go ahead and use a slice? According to the perldata documentation, that is a list slice. Maybe you meant to say you wouldn't use an array slice? --- Ron Bergin -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
