in reply to Re: IO::All problem/bug?
in thread IO::All problem/bug?

You are correct. @files does contain a list of IO::All objects. The docs do say that IO::All objects 'scalar' to their names. That's why when I printed out @files, I got a list of names. This is the fix to my original problem:
my @files = io('.')->all_files; $files[0] > io('/tmp/' . $files[0]->name);

Replies are listed 'Best First'.
Re^3: IO::All problem/bug?
by Aristotle (Chancellor) on Mar 20, 2004 at 08:39 UTC

    Or simpler

    my @files = io('.')->all_files; $files[0] > io( "/tmp/$files[0]" );

    By forcibly stringifying your original solution should work as well:

    my @files = io('.')->all_files; io( "$files[0]" ) > io( "/tmp/$files[0]" );

    But I don't want to be the maintenance programmer then..

    But, are you using @files at all otherwise? Sounds like you just want the first — in which case I'd use

    my $file = io( '.' )->next; $file > io( "/tmp/$file" );

    Also, are you sure you need the file named after the original? If not, it's better to let IO::All pick a temporary name for you.

    my $tmp = io; io( '.' )->next > $tmp;

    Makeshifts last the longest.