On Fri, Jul 5, 2013 at 2:48 PM, Naveed Massjouni <[email protected]> wrote:
> Can you explain what you mean when you say open creates objects? I am
> running 5.14 and when I run:
>
> perl -E 'open $x, "foo"; say ref $x'
>
> It prints "GLOB".
The IO slot of the GLOB holds an IO::File object:
$ perl -wE 'open my $fh, ">", "foo.txt"; say ref( *{$fh}{IO} )'
IO::File
At least as of Perl v5.12, anyway -- before that the IO slot could be
a FileHandle or an IO::Handle, IIRC. However, even now Perl doesn't
actually load IO::File, it merely blesses. In Perl v5.14, I added a
feature to automatically load IO::File on demand if you try to call a
method on a file handle. Previously, it just died.
David
--
David Golden <[email protected]>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg
_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users