Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Re: Re: Re: Can PERL know a line without matching?

by da (Friar)
on Jul 30, 2001 at 23:57 UTC ( [id://100941]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://100941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found