Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^5: Redirecting Output to shell command from within perl

by LanX (Saint)
on Feb 18, 2018 at 18:08 UTC ( [id://1209451]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Redirecting Output to shell command from within perl
in thread Redirecting Output to shell command from within perl

my version of Windows doesn't have tee installed

D:\Users\Rolf\pm>type call_less.pl open STDOUT, '| tee -i null | more';; print "hello world! $_\n" for 1.. 100; close STDOUT; exit; D:\Users\Rolf\pm>call_less.pl Der Befehl "tee" ist entweder falsch geschrieben oder konnte nicht gefunden werden. D:\Users\Rolf\pm>

Please note that the effect is best seen with small amounts of lines, hence 100.

> but then I wouldn't do it,

Neither would I, but I'm not the OP! :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

UPDATE

Using (and closing) a dedicated PIPE instead of STDOUT solves the issue for me on Win. see Re: Redirecting Output to shell command from within perl (Update "close PIPE")

Replies are listed 'Best First'.
Re^6: Redirecting Output to shell command from within perl
by BrowserUk (Patriarch) on Feb 19, 2018 at 09:06 UTC

    This only uses native commands:

    open STDOUT, '| more | more';; print "hello world! $_" for 1.. 1000; exit;;

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit
      Doesn't work for me.

      What's happening is that I need to always type RET before being able to send a command to "more".

      Looks like the "readline" of %CMD% is also active and interfering.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found