Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: is filehandler used ?

by jeanluca (Deacon)
on Mar 01, 2006 at 14:47 UTC ( #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
Node Status?
node history
Node Type: note [id://533658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2019-10-23 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?