On Fri, 10 Aug 2001, Tyler Longren wrote:

> I did:
> print "$scans[0]";
> and nothing is printed...where 192.168.1.1 SHOULD be printed...
> here's what I have:
> open (LOGFILE, $log_file) || die ("Could not open $log_file: $!");
> my @array;
> while (<LOGFILE>) {
>       chomp;
>       push (@array, $_)
>       if m/ida/i;
> }
> my $last_host = "192.168.1.1";
> my @scans;
> while (<LOGFILE>) {
>       push (@scans, $_)
>       if m/$last_host/i;
> }
> close(LOGFILE);
> print "$scans[0]";

The values are not getting into the array.

Try it with the $last_host value directly in the regexp and then you'll
discover that your regexp is incorrect (hint: what does . mean in a
regular expression?)

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Small things make base men proud.
                -- William Shakespeare, "Henry VI"


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to