in reply to Capturing the nth word in a string
And speaking of Davido's thread, if you're shamelessly going for extra XP, there's always the ever-present @ARGV array:echo elem1 elem2 elem3 elem4 elem5 | perl -lane 'print $F[3];' elem4
perl -le 'print $ARGV[3]' elem1 elem2 elem3 elem4 elem5 elem4
|
|---|