in reply to Re^2: Opening a file, editing, copying to another
in thread Opening a file, editing, copying to another

Just to be extremely explict, "print STDOUT;" is the same as "print STDOUT $_;". Both of these statements print the value of the special Perl variable, $_, to STDOUT. Similarly, "print OTHER;", which is the same as "print OTHER $_;", prints the value of $_ to the "OTHER" file.
  • Comment on Re^3: Opening a file, editing, copying to another

Replies are listed 'Best First'.
Re^4: Opening a file, editing, copying to another
by GrandFather (Saint) on Jun 20, 2007 at 23:44 UTC

    Actually

    print;

    suffices. STDOUT is assumed if no file handle is provided. However I used print STDOUT; in the sample code to maintain consistency with the OP's sample code.

    The important thing for Grundle is to be aware of $_ and where it is used as the default.


    DWIM is Perl's answer to Gödel