Re: make perl script into a service

2007-08-05 Thread Jenda Krynicky
From: [EMAIL PROTECTED] I have a perl script that sits and waits for socket connections and I want to make this into a windows XP service but Im unsure how to do this. Also, Ive seen that there are some libraries like Win32::Service and Win32::Daemon, but the perldocs arent explaining what

customizing eof chatacter

2007-08-05 Thread Jorge Almeida
Is there some variable that will do for a file what $/ does for a record? What I mean is that in $s=STDIN the value of $s depends on the value of $/, but in @arr=STDIN I couldn't find a way to force the reading to stop when some character is found. Note that reading STDIN line by

Re: make perl script into a service

2007-08-05 Thread horizxon
On Aug 4, 4:48 pm, [EMAIL PROTECTED] wrote: I have a perl script that sits and waits for socket connections and I want to make this into a windows XP service but Im unsure how to do this. activestate athttp://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/Windows/Acti... says this

I feel like destroying something!

2007-08-05 Thread Inventor
I think I need to use a destructor in my program. It works just fine, producing repeatable results, but now I put in a parameter sweep loop that runs the whole complicated thing several times and I get unexpected noisy junk instead of smoothly varying hills and valleys and slopes. To be certain

Re: customizing eof chatacter

2007-08-05 Thread Mumia W.
On 08/05/2007 07:21 AM, Jorge Almeida wrote: Is there some variable that will do for a file what $/ does for a record? What I mean is that in $s=STDIN the value of $s depends on the value of $/, but in @arr=STDIN I couldn't find a way to force the reading to stop when some character is

Re: customizing eof chatacter

2007-08-05 Thread Ken Foskey
On Sun, 2007-08-05 at 13:21 +0100, Jorge Almeida wrote: Is there some variable that will do for a file what $/ does for a record? What I mean is that in $s=STDIN the value of $s depends on the value of $/, but in @arr=STDIN You mention EOF and you mean EOL (end of line). Since

Re: customizing eof chatacter

2007-08-05 Thread John W. Krahn
Jorge Almeida wrote: Is there some variable that will do for a file what $/ does for a record? What I mean is that in $s=STDIN the value of $s depends on the value of $/, but in @arr=STDIN I couldn't find a way to force the reading to stop when some character is found. There is no eof

Re: I feel like destroying something!

2007-08-05 Thread Randal L. Schwartz
Inventor == Inventor [EMAIL PROTECTED] writes: Inventor I think I need to use a destructor in my program. You need a destructor when your object holds things that need more care to delete than simply letting the data structure go away. For example: the object changes need to be saved to disk,

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, Mumia W. wrote: On 08/05/2007 07:21 AM, Jorge Almeida wrote: open(F,do-something|); while(F){...} and later open(G,do-something-else|) while(G){...} What do F and G have to do with STDIN? Everything... The code while(F){...} does not read from

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, John W. Krahn wrote: Jorge Almeida wrote: Is there some variable that will do for a file what $/ does for a record? Note that reading STDIN line by line and checking for a character won't do the job, because somewhere in the program I need something like

Re: customizing eof chatacter

2007-08-05 Thread Mr. Shawn H. Corey
Jorge Almeida wrote: OK, I suppose there is no way to do it... I have an interactive, shell-like, program. Some commands read a line from STDIN, or the whole STDIN (meaning until CTRL-D is pressed). Now I want to modify the program to have a batch mode. Commands would be read from STDIN

Re: I feel like destroying something!

2007-08-05 Thread Mr. Shawn H. Corey
Randal L. Schwartz wrote: You need a destructor when your object holds things that need more care to delete than simply letting the data structure go away. For example: the object changes need to be saved to disk, or some temporary files are related to the object. Or you created a cyclic

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, Mr. Shawn H. Corey wrote: How big are these files? Could you read everything at once? If it's They're small enough to be slurped. The problem is that the chunk for a particular command may need to be passed to the shell for processing before being used by the Perl

Re: customizing eof chatacter

2007-08-05 Thread Mr. Shawn H. Corey
Jorge Almeida wrote: They're small enough to be slurped. The problem is that the chunk for a particular command may need to be passed to the shell for processing before being used by the Perl program. Something like this: 1my @all=STDIN; 2my @chunk=(); 3for

Re: customizing eof chatacter

2007-08-05 Thread Jorge Almeida
On Sun, 5 Aug 2007, Mr. Shawn H. Corey wrote: See `perldoc perlfaq8` and search for How can I open a pipe both to and from a command? Thank you. I'll have to decide whether using IPC::Open2 is safe enough... -- Jorge Almeida -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: I feel like destroying something!

2007-08-05 Thread Inventor
On Aug 5, 3:00 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote: Randal L. Schwartz wrote: You need a destructor when your object holds things that need more care to delete than simply letting the data structure go away. For example: the object changes need to be saved to disk, or some

Re: Problem with my code

2007-08-05 Thread perl pra
hi jhon, If I use use opendir/readdir I am getting the default directories . and .. into the directoy handle. Is there any way tha i could eliminate this. For example if i want to copy all contentents of the directory(including sub directories) I open a directory Handle using opendir and read

Re: Problem with my code

2007-08-05 Thread Jeff Pang
-Original Message- From: perl pra [EMAIL PROTECTED] Sent: Aug 6, 2007 12:29 PM To: John W. Krahn [EMAIL PROTECTED] Cc: Perl beginners beginners@perl.org Subject: Re: Problem with my code hi jhon, If I use use opendir/readdir I am getting the default directories . and .. into the

Re: Problem with my code

2007-08-05 Thread Jeff Pang
-Original Message- From: Jeff Pang [EMAIL PROTECTED] while(DIR) { next if /^\.+$/; #or next if $_ eq '.' or $_ eq '..'; } Sorry for the mistake,it's, while(my $obj = readdir DIR) { next if $obj =~ /^\.+$/; #or next if $obj eq '.' or $obj eq '..'; } -- Jeff Pang

Re: Problem with my code

2007-08-05 Thread Mumia W.
On 08/06/2007 12:32 AM, Jeff Pang wrote: [...] while(my $obj = readdir DIR) { next if $obj =~ /^\.+$/; #or [...] More, precisely, you might use this: next if $obj =~ /\A\.\.?\z/; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]