Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

A most obscure bug

by robin (Chaplain)
on Dec 18, 2001 at 20:32 UTC ( #132862=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        while (CONDITION) { BLOCK }
    
  2. or download this
        STATEMENT while CONDITION;
    
  3. or download this
        while (my $line = <FILE>) {
            # Do something with the $line
        }
    
  4. or download this
        while (defined(my $line = <FILE>)) {
            # Do something with the $line
        }
    
  5. or download this
    $ perl -MO=Deparse -e 'while(my $line=<FILE>) { print; }'
    while (defined(my $line = <FILE>)) {
        print $_;
    }
    -e syntax OK
    
  6. or download this
        while (my $module = glob("*.pm")) {
            print "Found a module: $module\n";
        }
    
  7. or download this
        my $ok=0;
        $ok=1 while my $zero = glob("0");
        print $ok ? "ok\n" : "not ok\n"
    
  8. or download this
        $foo = $bar || $baz
    
  9. or download this
        my $x = 1;
        die("Oh dear!") while my $foo = $x && 0;
    
  10. or download this
        my $x = 1;
        die("Oh dear!") while defined(my $foo = $x && 0);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2014-10-21 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (96 votes), past polls