Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: is filehandler used ?

by jeanluca (Deacon)
on Mar 01, 2006 at 14:47 UTC ( [id://533658]=note: print w/replies, xml ) Need Help??


in reply to is filehandler used ?

Ok, here is the situation, if the filehander is used, I would like to use it
if ( OUT ) { print OUT " bla bla\n" ; }
unfortunately, if ( OUT ) is always true!!
Hopefully this makes sense

Luca

Replies are listed 'Best First'.
Re^2: is filehandler used ?
by Kanji (Parson) on Mar 01, 2006 at 14:53 UTC
    if (defined fileno(OUT)) { print OUT "bla bla\n"; }

        --k.


      any idea of the diff between yours and mine? I've always used *HANDLE:
      use strict; use warnings; open(OUT, ">test.txt") or die "Can't open file to write, $!."; if(defined fileno *OUT){ print "File handle is valid."; }else{ print "Nope."; } close OUT;
        No diff. \*HANDLE also works.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://533658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-20 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found