Ohhh ok I understand now !!!
I was not doing a CTRL-D, I was doing a CTRL-Z and the consequence was that the file it is suppose to write in stayed empty.
You're right, my code does work now that I do a CTRL-D.
Thank you so much for this nuance I did not know.
Regards,
> Ctrl-D on a blank line.
I don't understand the difference of my code and MillerH code in regards to the signal EOF to STDIN. Where does MillerH include the signal EOF to STDIN in his code ?
Regards
Thanks a lot MillerH,
your code works perfectly, it does exactly what I was expecting.
For rovf comment, I work for an ISP and we need to take some show output from Cisco equipments and copy and paste SOME of the output to a file. It's just quicker/easier to do this this way.
Thanks again...
I want to write all(5) user lines from STDIN into a file.
This is my code, it doesn't work:
================================
#!/usr/perl5/bin/perl
open (TMPMSG,">tempFile.txt");
while (<STDIN>) {
print TMPMSG $_;
}
close (TMPMSG);
================================
I tried many...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.