Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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
Domain Nodelet?
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 pondering the Monastery: (3)
As of 2023-05-28 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?