Hi -

I give up. Can someone help? I want to 'dup' an
IO::xxx handle to STDIN. My latest try is:

#/usr/bin/perl
use strict;
use warnings;
use IO::File;
    my $fh = new IO::File;
    $fh->open("< some.file") or die "cannot open some.file";
    open (STDIN, "<&$fh") or die "cannot dup \$fh: $!\n";
    print "\$fh duped\n";
    $fh->close;

outputs:
cannot dup $fh: Invalid argument

A 'regular' file handle works:

#/usr/bin/perl
use strict;
use warnings;
    open (IN, "< some.file") or die "cannot open some.file";
    open (STDIN, "<&IN") or die "cannot dup IN: $!\n";
    print "IN duped\n";
    close IN;

outputs:
IN duped

What am I doing wrong?

Aloha => Beau.

PS: Tried on -
Win2K - AP 5.8.0 (804)
Win2K - AP 5.6.1 (633)
Linux - SuSE 8.1 Perl 5.8.0


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to