in reply to Re^3: backtick operator
in thread backtick operator

Found the problem - I needed to increment $| to autoflush. I had a long running sql statement after the call to dbConnect that made it seem as if it was hanging.

I added the following:

$|++;

after

#!/usr/bin/perl

Replies are listed 'Best First'.
Re^5: backtick operator
by Anonymous Monk on May 14, 2010 at 06:41 UTC
    FWIW, always set $| to the value you want, ie on $|=1; or $|=0; off, because $|++; $|++; turns it on, then turns it off.

      $|++ doesn't toggle the value of the variable; $|-- does. Just checked it on 5.8 and 5.10.

      --
       David Serrano
       (Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling errors. Thank you!).

        Still, I find $|++ a piece of pointless cargo cult. It isn't any shorter than $|=1, and it only add negative clarity.
        Thanks. Not remembering this correctly is probably why I prefer assignment.