NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
No ducks (Score:1)
But the common Perl 5 solution does seem to be "If it got passed in as a filehandle, assume it's a filehandle". Though I'm not claiming that's not problematic (many modules die spectactularly and unhelpfully if passed the wrong parameters, rather than giving a useful "invalid usage" exception), is it really worth getting your module's users to have to create an iterator function wrapping a filehandle purely because there
osfameron
Re:No ducks (Score:1)
So, yeah, a simple solution is to make it explicit: pass in a named foo_data that's a scalar or foo_stream that's a coderef... or something like that. Then again, with _CALLABLE, a little polymorphism is probably reasonable. As for filehandles, though... yeah, right out the window.
rjbs
Reply to This
Parent