if ( ref $thing eq 'GLOB' ) { # its a filehandle } elsif { ! ref $thing ) { # its a scalar - the filename hopefully } else { die 'invalid thing : $thing\n"; }
In reply to Re: Accepting either a filename or a handle
by shemp
in thread Accepting either a filename or a handle
by fizbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |