S
Steve Roscio
Howdy -
How do I write a function that accepts arguments like print(), where a
filehandle is optional. For example, a function myprint() that can be
used like this:
myprint "foo", "bar";
myprint STDERR "foo", "bar";
myprint $fh "foo", "bar";
myprint {$xyz->{fh}} "foo", "bar";
Must I extend IO::Handle to do this, and have two functions?
Thanx!
- Steve
How do I write a function that accepts arguments like print(), where a
filehandle is optional. For example, a function myprint() that can be
used like this:
myprint "foo", "bar";
myprint STDERR "foo", "bar";
myprint $fh "foo", "bar";
myprint {$xyz->{fh}} "foo", "bar";
Must I extend IO::Handle to do this, and have two functions?
Thanx!
- Steve