What am I doing wrong?!
From: Tony Walker (tony.walker_at_dhl.com)
Date: 10/29/03
- Next message: Purl Gurl: "Re: DOS window."
- Previous message: Mark Jason Dominus: "Re: Singleton process"
- Next in thread: Jürgen Exner: "Re: What am I doing wrong?!"
- Reply: Jürgen Exner: "Re: What am I doing wrong?!"
- Reply: Tore Aursand: "Re: What am I doing wrong?!"
- Reply: Michael Budash: "Re: What am I doing wrong?!"
- Reply: Jeff Boes: "Re: What am I doing wrong?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Oct 2003 08:36:05 -0800
Hi Guys,
OK, what I'm doing is a basic search of a logfile for specific
strings. At present I have this working fine by manually creating an
array and foreaching it..
However, I now want to read these strings from a file and perform the
same actions as before but I'm hitting a problem. I slurp the file
into and array and it only ever finds ONE of the strings in the file,
not the other!!
Any help much appreciated..
Tony
p.s this is my first attempt at perl so it may not look great...
##
#!/opt/perl/bin/perl
open (ER,"ALL_errors") or die "$!";
my @entry = <ER>;
open (LOG,"all.log") or die "$!";
while (<LOG>){
my $CUR=$_;
for (my $i=0;$i<=$#entry;$i++) {
my $LINE = @entry[$i];
if ($CUR =~/$LINE/){
print $CUR;
}
}
}
####
- Next message: Purl Gurl: "Re: DOS window."
- Previous message: Mark Jason Dominus: "Re: Singleton process"
- Next in thread: Jürgen Exner: "Re: What am I doing wrong?!"
- Reply: Jürgen Exner: "Re: What am I doing wrong?!"
- Reply: Tore Aursand: "Re: What am I doing wrong?!"
- Reply: Michael Budash: "Re: What am I doing wrong?!"
- Reply: Jeff Boes: "Re: What am I doing wrong?!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|