Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: if elsif elsif prints all three.

by pc88mxer (Vicar)
on Feb 27, 2008 at 20:56 UTC ( [id://670750]=note: print w/replies, xml ) Need Help??


in reply to if elsif elsif prints all three.

} elsif ( $line =~ m/best1collect/) { next;

This will omit lines containing 'best1collect' from the input file. Instead I think what you want is to set a flag so that later when you see 'syslogd' you do not insert the bgs stuff. Is that what you want to do?

Replies are listed 'Best First'.
Re^2: if elsif elsif prints all three.
by wcj75019 (Acolyte) on Feb 27, 2008 at 21:23 UTC
    Yes if =~ m/bestcollect/ That means the line is ok. So, leave it alone. if there is no $line. Then insert the here documnet $bgs before 'syslogd' Thanks
Re^2: if elsif elsif prints all three.
by wcj75019 (Acolyte) on Feb 27, 2008 at 21:30 UTC
    I want it to do nothing if the $line has /bestcollect/ It prints every if elseif. I want it to just do one thing. If the line is wrong. fix it. If it isn't there print the $bgs stuff. Thanks,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found