IO :: All:如何从ARGV和DATA读取?

use*_*481 2 perl

如何创建一个IO :: All对象来读取文件处理ARGV和DATA?

use strict;
use warnings;
use 5.010_000;
use IO::All;

# none of these work...
my $io = io->handle(DATA);
my $io = io->handle(\*DATA);
my $f = \*DATA;
my $io = io->handle($f);
my $io = io->handle({$f});
my $io = io->handle({DATA});
my $io = io->handle({\*DATA});

say $io->slurp();

__DATA__
FOO
BAR
QUUX
Run Code Online (Sandbox Code Playgroud)

Sch*_*ern 5

看起来像个bug.即使文档说它应该,传入句柄似乎也不起作用.这是一个消除可能的复杂性的例子DATA.

use strict;
use warnings;

use IO::All;

open my $fh, "<", "/etc/passwd" or die $!;

# Either of these should work according to the docs.
# my $io = IO::All->new($fh);
my $io = io->file->handle($fh);
print $io->all;
Run Code Online (Sandbox Code Playgroud)

请提交一个错误.