[Gllug] perl and arrays

Will Macdonald wfm at macscan.co.uk
Fri Jun 29 00:53:50 UTC 2001


Hi,

I have a quick, and probably simple Perl question.

I am trying to feed in a load of Webserver log files into a MySQL 
database, for detailed analysis,

To minimize load I am ignoring all .gif, .jpeg, .jpg, .png, .css, .js files.

I am trying to write a perl script to do this. I have created an array 
to hold the file type to ignore:

@ignored_entries = qw(.gif, .jpg, .jpeg, .css, .js);

To weed out the unwanted files, I use the following loop:

while (<file>)....{
if ($_ !=~ @ignored_entries) {
                 put in to database;
                 }

For some reason using the ! causes a problem. I haven't done any perl in 
a while but why doesn't this work ?

Will


-- 
Per mare, per terras.
mailto:wfm at macscan.co.uk
http://www.williammacdonald.com/


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list