Hello there,
I am a newby trying to learn pearl. I wrote my first little script,
and I would love to se where I could have done things better (in a
more proffesional way).
Feedback would be appreciated!
#!/usr/bin/perl
use strict;
use warnings;
our @scores = `cat /home/johann/smail/Spam/* | grep ^Subject:` ;
# string looks like this: Subject: 10.20 Re: Hallo
our @vals;
our $counter = 0;
for (@scores) {
$_ =~ /([0-9][0-9]\.[0-9][0-9])/;
$vals[$counter] = $1;
$counter++;
}
my $saved = `cat /home/johann/.spamscore` || die $!;
chomp($saved);
push @vals, $saved;
@scores = sort(@vals);
#for (@scores) {
# print $_,"\n";
# }
my $highest = @scores;
$highest -= 1;
open (FH, ">/home/johann/.spamscore") || die $!;
print FH $scores[$highest];
close(FH);
__END__
Thanks!
--
QUIPd 1.02: (342 of 611)
-> A computer's attention span is as long as its power cord.
http://getafix.homelinux.org/
##2155
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]