Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

STDIN inheritance during exec and difference between getc and sysread

by bdimych (Monk)
on Feb 25, 2013 at 19:48 UTC ( #1020557=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    echo -n ab | perl -e "print getc; exec 'perl', '-e', 'print getc'"
    
  2. or download this
    echo -n ab | perl -e "sysread(STDIN, \$b, 1); print \$b; exec 'perl', 
    +'-e', 'sysread(STDIN, \$b, 1); print \$b'"
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2023-12-09 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?