in reply to Re: Help to split
in thread Help to split
Or you can dispense with map by chaining the calls to split:
#! perl use strict; use warnings; print +(split / /, (split /,/, (split /:/)[4])[0])[0], "\n" while <DAT +A>;
Or as a one-liner:
16:05 >perl -pwe "$_ = (split / /, (split /,/, (split /:/)[4])[0])[0] +. qq[\n];" passwd barry sally sparky sammy sally bill bart bill bart cal tom sally phuong cindy olivo bart celia cindy bart 16:05 >
:-)
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Help to split
by semenych (Initiate) on Mar 17, 2013 at 04:28 UTC | |
by Athanasius (Archbishop) on Mar 17, 2013 at 04:39 UTC |
In Section
Seekers of Perl Wisdom