Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

A most obscure bug

by robin (Chaplain)
on Dec 18, 2001 at 20:32 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found