- or download this
if (/^\S+/) {
print "$&\n";
}
- or download this
if (/^(\S+)\s+/) {
print "$1\n";
}
- or download this
xcommand | perl -nae 'print $F[0],"\n"'
- or download this
my $command="xcommand";
open(CMD, "$command |") or die "Error: $!\n";
...
print (split(" "))[0]."\n"; # or whatever else
}
close(CMD);