-0 specifies the separator of the record (string). This was the reason that Perl would get three lines:
>echo a:b:c | perl -072 -nE"say" a: b: c
Since there are no spaces on any of these lines, $F[1] will be empty if you need to use -a .
-F indicates the input field separator. Is this what you want.
perl -F: -lanE'say $F[1];'
Or if you are stuck with old Perl:
perl -F: -lane'print $F[1];'
Command line options are documented in perlrun .
source share