perlquestion
drock
People of the Perl,<br />
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:
<code>
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
</code>
Below is my code:
<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);
</code>
My out file is zero bytes! Help!<br />
thanks<br />
drock
<sub><p>janitored by [ybiC]: Balanced <code> tags around sample data, as per consideration</p></sub>