Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Please find out the mistake in substitution function in the code??

by AnomalousMonk (Archbishop)
on May 11, 2015 at 17:40 UTC ( [id://1126325]=note: print w/replies, xml ) Need Help??


in reply to Re: Please find out the mistake in substitution function in the code??
in thread Please find out the mistake in substitution function in the code??

Your print OUT if (...) needs something to print.

print will output the value of  $_ localized in the enclosing  while (<IN1>) { ... } loop.


Give a man a fish:  <%-(-(-(-<

Replies are listed 'Best First'.
Re^3: Please find out the mistake in substitution function in the code??
by GotToBTru (Prior) on May 11, 2015 at 19:17 UTC

    I had to look at that again; of course you're right. But only lines for which the substitution is performed will print. I think that is not exactly what is wanted. Perhaps more like:

    while(...) { s/.../.../; print OUT; }

    The lines with recognized codes will be corrected; lines without codes will still be copied to the output.

    Dum Spiro Spero

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-23 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found