CIT 597 More about <STDIN> and <STDOUT> in EasyEclipse
Fall 2008, David Matuszek

Apparently, nobody (including me) has been able to make the following program run properly from EasyEclipse:

copyfile.pl

while ($line = <STDIN>) {
    print $line;
}
From the command line, this program can be run as
     perl copyfile.pl < inputFile > outputFile
but from EasyEclipse, input always comes from the keyboard, and output always goes to the console window--which is worthless for actually copying a file from one place to another.

Since we cannot figure out how to get EasyEclipse to do this, we have to modify the Perl program instead.

copyfile2.pl
open(IN, $ARGV[0]);
open(OUT, ">" . $ARGV[1]);
while ($line = <IN>) {
    print OUT $line;
}
close(IN);
close(OUT);

Running this program from the command line is different:
     perl copyfile2.pl inputFile outputFile

and from EasyEclipse,