Owen wrote:

You need to run something like this. Adapt to your requirements

============================================================
#!/usr/bin/perl -w

use strict;

while (<DATA>) {
    my $line = $_;
    if ( $line =~ /QQQ/ ) {
        my @bits = split;
        print "$bits[$#bits -1]\n";

    }
}

Or more simply:

#!/usr/bin/perl -w
use strict;

while (<DATA>) {
    if ( /QQQ/ ) {
        print +( split )[ -2 ], "\n";
    }
}




John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to