karlgoethebier has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I stumbled over this issue by chance.
As fare as i understand the docs of IO::All this snippet:
say for io($dir)->all;is equivalent to this one:
my $io = IO::All->new(); $io->dir($dir); say for $io->all;
But please take a look at this:
#!/usr/bin/env perl use strict; use warnings; use IO::All; use Cwd; use feature qw(say); my $dir = cwd; say for io($dir)->all; my $io = IO::All->new(); $io->dir($dir); say for $io->all; __END__ karls-mac-mini:Desktop karl$ ./io.pl ...tons of stuff under /Users/karl/Desktop/ Can't use an undefined value as a subroutine reference at /Users/karl/ +perl5/perlbrew/perls/perl-5.20.0threads/lib/site_perl/5.20.0/IO/All/D +ir.pm line 167
The line referred to in Dir.pm is:
my $io = $self->constructor->(File::Spec->catfile($self->pathname, $na +me));
For the moment i don't understand the error message as well as the line referred to.
Is this a bug or do i miss something?
Thank you very much for any hint and best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange IO::All constructor behavior?
by karlgoethebier (Abbot) on Feb 19, 2015 at 08:04 UTC | |
|
Re: Strange IO::All constructor behavior?
by Anonymous Monk on Feb 18, 2015 at 23:50 UTC |