Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: "defined" in while loop Edit | Delete | Quote | Reply | Private Reply

by ELISHEVA (Prior)
on Feb 17, 2009 at 00:34 UTC ( #744249=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $  perl -e'print 0' | perl -e'while ($line = <>) { print "\$line=<$lin
    +e> \$line=<" . ($line ? "true" : "false") . "> defined=<" . (defined(
    +$line) ? "true" : "false") . ">\n"};'
    $line=<0> $line=<false> defined=<true>
    
  2. or download this
    $ perl -e'print 0' | perl -e'while ($line = readline(*STDIN)) { print 
    +"\$line=<$line> \$line=<" . ($line ? "true" : "false") . "> defined=<
    +" . (defined($line) ? "true" : "false") . ">\n"};'
    $line=<0> $line=<false> defined=<true>
    
  3. or download this
    use strict;
    use warnings;
    ...
      #print "wrapped_readline: <$sLine>\n";
      return $sLine;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-08-02 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (54 votes), past polls