http://qs1969.pair.com?node_id=382783

drock has asked for the wisdom of the Perl Monks concerning the following question:

People of the Perl,
I have tried this code with no errors, but it is not giving me any results. My data file has 3 fileds and I am trying to sort the 3rd field, here is the data file:
05/06/04 11:01:32 E00833 05/06/04 11:01:32 E00545 05/06/04 11:01:32 E00820 05/06/04 11:01:32 E00610 05/06/04 11:01:32 E00333 05/06/04 11:01:32 E01099 05/06/04 11:01:32 E00213 05/06/04 11:01:32 E00612
Below is my code:
snippett...snippett open (FOO, ">$scratches") || die "could not open file:$!"; open (D, "$logf") || die "could not open file:$!"; while (<D>) { ## look for 9840S and ebexpire ## declare OFS = tab ## tell split to split on IRS 0, + 1 & 5. Very similar to awk print $ if (($_ =~ /9840S/) && ($_ =~ /ebexpire, ebexpire/ )) +{ local $, = "\t"; print +(split)[0,1,5], $/; } # end if } # end while foreach (<D>) { print FOO (sort { $a <=> $b } $_ ) } close (FOO); close (D);
My out file is zero bytes! Help!
thanks
drock

janitored by ybiC: Balanced <code> tags around sample data, as per consideration