perlpal has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

Is there a way to redirect the print content of a here-document to a file rather the the user console (stdout)?

Thanks in advance!

Replies are listed 'Best First'.
Re: Redirect Here-document contents
by JavaFan (Canon) on Jul 15, 2009 at 13:19 UTC
    A here document is just a string. Anything you can do with a string, you can do with a here document. You'd print a here document to a file the same way you print any other string to a file.
      Got it! Thanks!
Re: Redirect Here-document contents
by Anonymous Monk on Jul 15, 2009 at 13:17 UTC
    perldoc -f print
    print FOO <<'__FOR_FOO__'; heredoc __FOR_FOO__