
Alux
New User
Oct 6, 2011, 11:41 PM
Post #3 of 4
(2611 views)
|
Re: [FishMonger] My Variable is not valid in while loop
[In reply to]
|
Can't Post
|
|
yes , i loaded them before and its not working.... here is my complete script
#!/usr/bin/perl -w use strict; use warnings; my $file = '1.csv'; my $line4 = ''; open(FILE, "<$file") or die("Could not open log file. $!\n"); while(<FILE>) { my($line) = $_; chomp($line); my ($q1,$q2,$q3,$q4) = split(/,/,$line); my $tmp=$q4; open(FILE2, "SyslogCatchAll2010-$ARGV[0]-$ARGV[1].txt") or die("Could not open log file. $!\n"); if($line =~ /2010\/$ARGV[0]\/$ARGV[1]/){ my @q22 = split(' ', $q2); # extracting time my @date = split(':', $q22[1]); #date of IP ! foreach $line4 (<FILE2>){ chomp($line4); # print "$line4 \n"; while ($tmp > 0){ Some code... print "$line4 \n"; my $Time= "$date[0]:$date[1]:$date[2]"; if ($line4 =~ m/$Time/){ if ($line4 =~ m/$q3/){ print "$line4\n";} }#for if }#for while 2 my $tmp=$q4; }#for while time } } close(FILE);
|