> On Saturday 10 February 2007 09:33, Russ Allbery wrote:
>
>> +  my $diamondop = ref($source) =~ /^(?:GLOB|FileHandle|IO::\w+)$/
>> +    || eval { tied *$source };
>
> Hm, does this disallow subclassing any of those packages?  Would checking
> fileno() be better?

No, it's just checking whether to use <> or ->getline.  For subclasses
it *should* use getline.

> How about using Scalar::Util::blessed() instead of
> ref()?

There's certainly room to do it better, but I was only attempting to do
exactly what Pod::Parser does.  blessed won't work for a vanilla globref.

Reply via email to