Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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
  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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://132862]
Approved by root
[Eily]: and Hilarity Ensues
Eily says, while failing to write a link properly
[Your Mother]: Goodbye Fancy Feast! Hello Friskies!!!
[LanX]: CB sidebar auto-expansion problem
[Eily]: "tail: warning: following standard input indefinitely is ineffective". I can't help but feel that tail is judging me...
[Your Mother]: Someone had to say it. Better it came from tail.
[LanX]: Cat Mama!
[Your Mother]: Das right.
[Eily]: actually I forgot to provide the filename as a parameter
LanX it reeks.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2017-03-27 16:44 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.