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

what;s the equivalent 3 argument open for pipes and messages?
open $wFH, "| more" ;
i've tried every permutation i could think of. and for "messages" (not sure the term) i can't even use a variable.
print $w_FH<<THEEND;
code snippet :
open FH, "| more" ; print FH " hey "; print FH<<THEEND; LINES: info ## ## this is a test ## THEEND close FH; print "FH\n";
i'm looking for the 3-arg equivalent to the open stmt and how to use a variable for the "<<" stmt. thanks

Replies are listed 'Best First'.
Re: 3 argument opens with pipes & messages
by ikegami (Patriarch) on Oct 11, 2007 at 03:45 UTC

    i'm looking for the 3-arg equivalent to the open stmt

    There isn't one. See BrowserUK's reply.

    and how to use a variable for the "<<" stmt. thanks

    Put a space before the <<

    my $fh = \*STDOUT; print $fh<<'EOI'; # Fails abc EOI
    my $fh = \*STDOUT; print $fh <<'EOI'; # Works abc EOI

    Perl think's you're using the left shift operator with a lexical and no space.