I guess I need a mnemonic device to trick myself into remembering
which way the pipe with dash symbol goes.

  And I suppose I should apologize for the cry baby rant in
   advance:

Even now I'm flopping around trying to remember...

I've written scripts involving sending mail with sendmail from perl.
Or capturing the output of rsync etc.

I used a piped open like this:

  open my $ch, '|-', "$sendm" or die
                     "Can't open $sendm: $!";

  while (<$sch>){
    print $ch bleh;
    print $ch blah;
 }

Or perhaps it was like this:

  open my $ch, '-|', "$sendm" or die
   [...]

It may have been either way.  I don't have it handy.  But one way,
string $bleh and $blah get sent as mail.

My question is not so much which was right for that usage (although
that would be helpful too), but how to know at a moments thought, how
to setup the pipe for that usage.

One way might inject mail into sendmail with a while loop, the other
might allow one to track (or search etc.) the output of some command
in a while loop.

One way fails and can cause some confusion in tracking the
problem.

So the need here (beyond importing someone elses' brain) is how
to remember which way.

There must be something that would make even an intellectually
challenged sort like me ... remember.

Yes, yes, I know I can test and get it right.... which I've done
repeatedly. Here, I'm looking for a way to fix it in my mind.

As soon as I think I've got it right by thinking:

  ok, left side is into the command
     right side is out.

If I start pondering over that ... it begins to seem it is the other
way.

Gack.... I'm sick of it.


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to