CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
how do you print from keyboard to file2?

 



sysslack
Novice

Jan 30, 2007, 1:22 AM

Post #1 of 4 (244 views)
how do you print from keyboard to file2? Can't Post

Hello
With this program I try to write from keyboard and for every line I want this to be written to file2 when I press CTRL -C.Probably very simple,but I can't figure how!

#!/usr/bin/perl -w
use strict;
open OUT, ">>file2";
while(<>) {
print OUT $_;
}


KevinR
Veteran


Jan 30, 2007, 11:33 AM

Post #2 of 4 (239 views)
Re: [sysslack] how do you print from keyboard to file2? [In reply to] Can't Post

http://perldoc.perl.org/perlipc.html
-------------------------------------------------


sysslack
Novice

Jan 31, 2007, 9:02 AM

Post #3 of 4 (229 views)
problem solved!!!! it was CTRL -D not CTRL -C [In reply to] Can't Post

Hi I understand that you forwarded me to manpage.
I have nothing against reading manuals but I thought I read everything.Read llama at least 3 to 4 times and couldn 't find something wrong, and thanks to a friend he informed me that CTRL -D is the option otherwise as with CTRL -C I cancel the operation.And of course.But I was so in my thoughts I couldn't see.Hope this helps someone else!


KevinR
Veteran


Jan 31, 2007, 12:10 PM

Post #4 of 4 (225 views)
Re: [sysslack] problem solved!!!! it was CTRL -D not CTRL -C [In reply to] Can't Post

OK, glad you got it figured out. I assumed you needed to trap a signal and then do something, but evidently you just had your signals mixed up and wanted to use D instead of C.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives