Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Why don't file handles have sigils?

by RonW (Parson)
on Jul 08, 2014 at 20:13 UTC ( [id://1092790] : note . print w/replies, xml ) Need Help??


in reply to Why don't file handles have sigils?

You could do this:

my $fh; open($fh, ...);

open will put a ref to an anonymous file handle into $fh. You can then use $fh anywhere a file handle can be used.

(I think it actually puts in a File::IO object reference.)

But I don't know why there isn't a sigil for file handles. Maybe Larry et al didn't want to dedicate a character for that?

Replies are listed 'Best First'.
Re^2: Why don't file handles have sigils?
by 1s44c (Scribe) on Jul 08, 2014 at 23:18 UTC

    I do do that.

    I wasn't trying to say perl was wrong, just asking for enlightenment as to why it is the way it is.

      With so many ways to hang yourself, how could Perl be "wrong"? *grin*