Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
"be consistent"
 
PerlMonks  

Re^2: Need help with a simple perl script

by choroba (Abbot)
on May 23, 2012 at 12:07 UTC ( #972021=note: print w/ replies, xml ) Need Help??


in reply to Re: Need help with a simple perl script
in thread Need help with a simple perl script

Actually, no. Why should anyone set $_ to anything just to overwrite the value in a for loop? The code works - why does it need any modification? See perlvar for the special variable $".


Comment on Re^2: Need help with a simple perl script
Select or Download Code
Re^3: Need help with a simple perl script
by uday_sagar (Scribe) on May 24, 2012 at 11:41 UTC

    Okay, I agree with $". Thanks

    For the while loop, as "print" is not contained in while, it ll take the inputs all the time without printing anything.

      For the while loop, as "print" is not contained in while, it ll take the inputs all the time without printing anything.
      Not really. "print" is in a for loop, and it prints the output as desired, because the for loop uses the implicit variable $_.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-04-21 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (490 votes), past polls