[Dshield] Better Perl script (iptables)

k.lichtenwalder@computer.org k.lichtenwalder at computer.org
Mon Aug 27 18:39:14 GMT 2001


Dan Crooks schrieb:
> 
> When attempting to run this client I receive the following error:
> 
> Can't call method "ctime" on an undefined value at ./dshield_iptables.pl
> line 122.
> 
> lines 120-125:
> 
> 120> $roll_date = 0;
> 121> $stat=stat($rolllogfile);
> 122> $roll_date=$stat->ctime;
> 123> if ($roll_date >= $last_date) {
> 124>        parselog ($rolllogfile, $last_date, $tmp);
> 125> }

Well except if stat is overridden by a module it's not returning a has
to an object but a list. Then it would be

	$roll_date = ($stat($rolllogfile))[12];
if I counted correctly. This would merge line 121 and 122.

Klaus
-- 
------------------------------------------------------------------------ 
 Klaus Lichtenwalder, Dipl. Inform.,       http://www.webforum.de/Klaus/
 Fax +49-(0)89-91072699                            Lichtenwalder at ACM.org
 NIC: KL2100, KL76-RIPE                     K.Lichtenwalder at Computer.org
 PGP Key fingerprint = 2658 EA97 E1A1 2680 5ECA  0036 80F5 F250 3CF8
C2C7




More information about the list mailing list