Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
Charles K. Clarkson wrote: JupiterHost.Net wrote: : Thanks for catching my misstatement :) Thanks for finally making one. :) No I make mistakes all the time, no doubt :) : #!/usr/bin/perl : : use strict; : use warnings; : : open my $file1_fh, '<', 'fil

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
JupiterHost.Net wrote: : Thanks for catching my misstatement :) Thanks for finally making one. :) : #!/usr/bin/perl : : use strict; : use warnings; : : open my $file1_fh, '<', 'file1' or die "file1 open failed: $!"; : : open my $file2_fh, '<', 'file2' or die "

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
Charles K. Clarkson wrote: JupiterHost.Net wrote: : This will open both files and check each line of file2 against : each line of file1 (and it alerts you to any problems, is easier : to read, best pratice safe (hopefully ;p), ect etc): Sorry, but it won't. It

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
JupiterHost.Net wrote: : This will open both files and check each line of file2 against : each line of file1 (and it alerts you to any problems, is easier : to read, best pratice safe (hopefully ;p), ect etc): Sorry, but it won't. It will open both files and check t

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
This will open both files and check each line of file2 against each line of file1 (and it alerts you to any problems, is easier to read, best pratice safe (hopefully ;p), ect etc): #!/usr/bin/perl use strict; use warnings; open my $file1_fh, '<', 'file1' or die "file1 open failed: $!"; open

Re: Matching a Scalar Variable

2005-11-29 Thread Dr.Ruud
Muthukumar: Always put these lines on top: use strict; use warnings; >$var=~chomp($var); perldoc -f chomp -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
Muthukumar wrote: On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: Sorry i am passing the OPEN as Open (FILE1," Use like this: No, like this: use strict; use warnings; Always do that, especially when posting code to this list. open FD, "< file1"; open FD1, "< file2"; Is it even open?

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Charles K. Clarkson wrote: : : chomp( my @pix = <$fh ); Darn! chomp( my @pix = <$fh> ); Move along now. :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Muthukumar wrote: : May be it will work: : : : open FD, "< pixconfig.txt"; : open FD1, "< ip.log"; : : @arr=; We need to know more about file size and memory to make this determination. Assuming you are correct about the file and memory size, your algorithm looks fi

Re: Matching a Scalar Variable

2005-11-29 Thread Muthukumar
On 11/29/05, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: > > Muthukumar wrote: > > >No, I don't think so. > >Let's test it. We'll assume that has 3 lines in it. > On the first pass of the outer loop we load the first value > from "file1." We then compare it to

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Muthukumar wrote: No, I don't think so. Let's test it. We'll assume that has 3 lines in it. On the first pass of the outer loop we load the first value from "file1." We then compare it to each value in "file2." Fine so far. On the second pass of the oute

Re: Matching a Scalar Variable

2005-11-29 Thread Mazhar
Ok Muthu, See there is a file called as pixconfig.txt which has the entries such as *PIX-4-106023* *PIX-4-101123* *so on* and there is one more file called ip.log which has the entries below, Nov 29 10:03:24 10.20.1.2 Nov 29 2005 10:33:53: %*PIX-4-106023*: Deny tcp src inside:Blackbe

Re: Matching a Scalar Variable

2005-11-29 Thread Mazhar
Thank You Every Body for the Help i am able to check the same. regards mazhar On 11/29/05, Muthukumar <[EMAIL PROTECTED]> wrote: > > > > On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > > > Sorry i am passing the OPEN as > > Open (FILE1," > Open (FILE," > > > Still the string is ot matching. H

Re: Matching a Scalar Variable

2005-11-29 Thread Muthukumar
On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > Sorry i am passing the OPEN as > Open (FILE1," Open (FILE," > Still the string is ot matching. Help me please Use like this: open FD, "< file1"; open FD1, "< file2"; while () { $line1=chomp($_); # chomp() Needed while () { $line =

RE: Matching a Scalar Variable

2005-11-28 Thread Thomas Bätzler
Hi, Mazhar <[EMAIL PROTECTED]> asked: > Open (FILE1,">one Fuile"); > Open (FILE,">Second File"); Please post working examples, not pseudo code. > while () > { > $line1 = $_; This is bad. I'd suggest you use meaningful variable names. They help people to understand what you're trying to

Re: Matching a Scalar Variable

2005-11-28 Thread Mazhar
Sorry i am passing the OPEN as Open (FILE1," wrote: > > > > On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > > > Hi Folks, > > I have a requirement where in i have to read a file and then > > store > > the line by line items into a scalar variable. And then ihave ti match > > the > > sa

Re: Matching a Scalar Variable

2005-11-28 Thread Muthukumar
On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > Hi Folks, > I have a requirement where in i have to read a file and then > store > the line by line items into a scalar variable. And then ihave ti match the > same. i am providing you a sample code. Just help how can i match a string > wh

Matching a Scalar Variable

2005-11-28 Thread Mazhar
Hi Folks, I have a requirement where in i have to read a file and then store the line by line items into a scalar variable. And then ihave ti match the same. i am providing you a sample code. Just help how can i match a string where in i should pass a scalar variable value. PGM Open (FI