Hi Guys,
I have this script:
#!/usr/bin/perl
# track, find email addresses in emails,
# writes them to /var/opt/ITrootmail/bad/ with a date
# set up as a pipe for procmail or use with Pine
$now = `date`;
# find included email-like addresses
while ($line = <STDIN>) {
if ($line =~ /\b([\w_\-\.]+ at [\w_\-\.]+)\b/) {
# exclude email addresses not needed
(next) if ( $1 =~ /\d{8,}/ );
(next) if ( $1 =~ /postmaster/i );
(next) if ( $1 =~ /DAEMON/i );
(next) if ( $1 =~ /nobody/i );
(next) if ( $1 =~ /localhost/i );
push( at names,$1);
}
}
close (STDIN);
foreach $idx (0 .. $#names) {
$uniq{$names[$idx]}=1;
}
undef at names;
foreach $item (keys %uniq) {
push ( at names,$item);
}
foreach $address (0 .. $#names) {
open (RECORD, ">>/var/opt/ITrootmail/bad/
$names[$address]");
print (RECORD $now);
close RECORD;
}
I'm getting these two errors:
Type of arg 1 to push must be array (not subroutine entry) at /etc/opt/
ITrootmail/track line 16, near "$1)"
Type of arg 1 to push must be array (not subroutine entry) at /etc/opt/
ITrootmail/track line 25, near "$item)"
Any idea?
Thanks
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/