Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Need pipe and parameter help

by shmem (Chancellor)
on Nov 18, 2016 at 11:53 UTC ( [id://1176083]=note: print w/replies, xml ) Need Help??


in reply to Re: Need pipe and parameter help
in thread Need pipe and parameter help

Please tidy up that response, it is badly formatted.

$ ( echo Hi; sleep 3; echo Bye ) | ./ReadAPipe.pl a b c
This was read from the pipe:
<Hi
Bye>

This was the read from the parameters:



./ReadAPipe.pl a b c
This was read from the pipe:
<>

This was the read from the parameters:

Saving your (cleaned up) ReadPipe.pm to a sensible location and running your ReadAPipe.pl, I get:

qwurx [shmem] ~> ( echo Hi; sleep 3; echo Bye ) | ./ReadAPipe.pl a b c This was read from the pipe: <Hi Bye> This was the read from the parameters: <a b c> qwurx [shmem] ~> ./ReadAPipe.pl a b c This was read from the pipe: <> This was the read from the parameters: <a b c>

I suspect that the code / result you posted isn't consistent (version mismatch?)

Please note that the value returned requireing your ReadPipe.pm (which is invoked by use) is the number of elements contained in @EXPORT_OK - which might, or might not, be intended. You should be aware of this side-effect. If your module read

... our @EXPORT_OK = qw( ReadPipe ); my $foo; ...

then loading the module would fail, since the value computed from my $foo is undefined.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^3: Need pipe and parameter help
by Todd Chester (Scribe) on Nov 18, 2016 at 21:11 UTC

    > Please tidy up that response, it is badly formatted.

    Thank you for the tidy up. The formatting used on this form is *obnoxious*. Are there any plans to move to a more user friendly format?

    My last post I copied and pasted from the source section of Komposer. What a pain in the neck!

    My original solution with the messy formatting would not respond properly to
    (sleep 3; echo bye) | ReadAPipe.pl

    The last post cleaned that up

    Many thanks,
    -T

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176083]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-23 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found