On Friday 06 May 2005 22:41, Jason Balicki wrote:
> Hello,
>
> I have several locations with a hardware VPN device and
> I've set them up to log to a central logging server.
>
> Some of the managers of these facilities would like to
> have a report showing who's using the VPN and when.
>
> I've written a script that does that.  It works, but as
> I'm pretty new at Perl (this is only my second real
> life application) I'm sure it could be improved
> (significantly).
>
> Would some kind soul like to take a look at this
> script, make suggestions or otherwise completely
> destroy my ego?  :)
>
> Thanks in advance to anyone who takes this up...
>
> The script can be found at:
>
> http://www.zeffert.com/vpn_report

Two quickies to save you time:

1. Use File::Temp http://search.cpan.org/search?query=file%3A%3Atemp&mode=all
2. Use HERE documents to save loads of print statements eg

 To begin a here document, follow print by the "<<" operator and a label

print << EOF;
my $stuff here
EOF




My tuppence.

Gavin.

> And some fake (sanitized) data to run it against (you'll
> have to make changes to the script accordingly):
>
> http://www.zeffert.com/fake_data (60k text file, some
> gunk has been pre-filtered)
>
> HINT: you can change $date in the script to get
> more hits.
>
> Thanks again,
>
> --J(K)

-- 
Walking the road to enlightenment... I found a penguin and a camel on the 
way.....
Fancy a [EMAIL PROTECTED] Just ask!!!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to