in reply to Re: Re: Re: Re: Can PERL know a line without matching?
in thread Can PERL know a line without matching?

The 'and' operator, &&, works very simply. It takes two arguments. It evaluates the first argument, and if it's successful, it evaluates the second argument. If that's successful, it returns '1'.

I hope that helps.

I think what you want for your 'if' statement is something like:

if (($para =~ /$msisdn/) && ($lastHeading eq "MSTerminating")) {
That is, if $para includes the text in $msisdn, and $lastheading exactly equals "MSTerminating", then do the following.

One stylistic point; you should definitely think about use strict and use warnings' and you should definitely indent your code inside loops, because it prevents a number of confusions later.

HTH. -Daniel

___ -DA > perl -MPOSIX -le '$ENV{TZ}="EST";print ctime(1000000000)' Sat Sep 8 20:46:40 2001