Re: pattern matching for serial number

2002-04-26 Thread Joshua Hayden
Let's remember to anchor the location of the string... $serial = "455WD165"; if ($serial !~ m/^[0-9]{3}[A-Z]{2}[0-9]{3}$/ ) { print "Bad!"; } else { print "Good!"; } The caret and dollar sign are very important. Without it, someone could type HK45J455WD165AGKB and it would still pass the re

Re: Probably a stupid question

2002-04-26 Thread drieux
On Friday, April 26, 2002, at 10:01 , Alex Read wrote: [..] > #!/usr/bin/perl > use strict; > > defined(my $pid = fork ) or die "Could not fork: $!"; > if ($pid){ > print "Content-type: text/html\n\n"; > print "\nHI1\n\n\n\n"; > exit; > } else { >close(STDIN); >close(STDOUT); >close(S

RE: Probably a stupid question

2002-04-26 Thread Bob Showalter
> -Original Message- > From: Alex Read [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 26, 2002 1:01 PM > To: Bob Showalter > Cc: [EMAIL PROTECTED] > Subject: Re: Probably a stupid question > > > Thanks guys, > > I think this should be able to do what I want, as the browser goes > stra

Re: Probably a stupid question

2002-04-26 Thread Alex Read
Thanks guys, I think this should be able to do what I want, as the browser goes straight to the return page and prints 'HI1'. Thanks again, Alex #!/usr/bin/perl use strict; defined(my $pid = fork ) or die "Could not fork: $!"; if ($pid){ print "Content-type: text/html\n\n"; print "\nHI1\n\n\

RE: Probably a stupid question

2002-04-26 Thread Bob Showalter
> -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 26, 2002 12:45 PM > To: 'Alex Read'; [EMAIL PROTECTED] > Subject: RE: Probably a stupid question > > ... > > The way to code this to do something like: > >defined(my $pid = fork) or die "Coul

Re: Probably a stupid question

2002-04-26 Thread drieux
On Friday, April 26, 2002, at 09:40 , Alex Read wrote: > Hello, > > OK, we now have the following; > > #!/usr/bin/perl > use strict; > > my $pid = fork; > if ($pid == 0){ > exec 'sleep 2; echo "hi"' || die "Cannot sleep: $!" ; > } else { > print "Content-type: text/html\n\n"; > print "\nhi\n\n\

RE: Probably a stupid question

2002-04-26 Thread Bob Showalter
> -Original Message- > From: Alex Read [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 26, 2002 12:01 PM > To: [EMAIL PROTECTED] > Subject: Probably a stupid question > > > Hello, > > OK, I have a nice a simple test case, but I just can't get it > to do what > I want it to. How do I

Re: Probably a stupid question

2002-04-26 Thread Alex Read
Hello, OK, we now have the following; #!/usr/bin/perl use strict; my $pid = fork; if ($pid == 0){ exec 'sleep 2; echo "hi"' || die "Cannot sleep: $!" ; } else { print "Content-type: text/html\n\n"; print "\nhi\n\n\n\n"; } So the child process is the only one that sleeps for 2, then prints hi,

Re: Probably a stupid question

2002-04-26 Thread drieux
On Friday, April 26, 2002, at 09:01 , Alex Read wrote: > Hello, > > OK, I have a nice a simple test case, but I just can't get it to do what > I want it to. [..] > > Alex. > > > #!/usr/bin/perl > use strict; > > my $pid = fork && exit; #$pid should return 0 if fork is > successful. > > if (

Re: Multi thread ? Programming Style ? [with update]

2002-04-26 Thread Connie Chan
Thousand Thanks, John, At lease I get the idea on what I am doing is correct. "perl -d" is very useful for tracing errors, better than log down activities. and I've test it and found that the "while (! -e $result) is not nesssary, the case is actually A to B, B to C, C to D, and D gen reult, the

Probably a stupid question

2002-04-26 Thread Alex Read
Hello, OK, I have a nice a simple test case, but I just can't get it to do what I want it to. How do I get this so that when I hit submit it comes straight back with my "hi" message instead of waiting until the sleep command has finished? I've tried playing around with fork and how I execute th

RE: pattern matching for serial number

2002-04-26 Thread Tim Doty
well, the second slash should follow immediately after the bracket (in present case it adds another character to the reg-ex. If you can cut & paste the code segment it would avoid typographical errors. When I use the following it performs as expected w/o syntax error. #!/usr/bin/perl $serial = "

SSI

2002-04-26 Thread Mat Harrison
if i have an html document and I include a CGI script to display some html do I have to have and tags in the include of can it insert the body into that of the html doc? -- Matthew Harrison Webmaster www.genestate.com [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: pattern matching for serial number

2002-04-26 Thread Kamali Muthukrishnan
Sorry, while typing I missed the slash, it is there in my code as - if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} /) Is there any thing wrong with this ? Kamali >>> fliptop <[EMAIL PROTECTED]> 04/26/02 08:54AM >>> Kamali Muthukrishnan wrote: > Hi guys : > I have serial numbers with a pattern : 3 nu

RE: pattern matching for serial number

2002-04-26 Thread Bob Showalter
> -Original Message- > From: Kamali Muthukrishnan [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 26, 2002 9:39 AM > To: [EMAIL PROTECTED] > Subject: pattern matching for serial number > > > Hi guys : > I have serial numbers with a pattern : 3 numbers followed by > 2 capital letters fo

Re: pattern matching for serial number

2002-04-26 Thread fliptop
Kamali Muthukrishnan wrote: > Hi guys : > I have serial numbers with a pattern : 3 numbers followed by 2 capital letters >followed by 3 numbers. > To validate this - > if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} ) > { # display error ; } > I get a syntax error. i think you're missing a

pattern matching for serial number

2002-04-26 Thread Kamali Muthukrishnan
Hi guys : I have serial numbers with a pattern : 3 numbers followed by 2 capital letters followed by 3 numbers. To validate this - if ($serial !~ m/[0-9]{3}[A-Z]{2}[0-9]{3} ) { # display error ; } I get a syntax error. Can you help me , please ? Kamali -- To unsubscribe, e-mail: [EMAI

Thanks alot Boris

2002-04-26 Thread Bruce Ambraal
Hi Boris I see you are still around. Well I just want to take the oportunity in thanking you for all the help that you have given me I really appreciate it. Go well. Psst! Boris is the man of the hour with more power. Cheers Bruce -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: http headers

2002-04-26 Thread Felix Geerinckx
on Fri, 26 Apr 2002 04:00:06 GMT, [EMAIL PROTECTED] (Conan chai) wrote: > more details on what i'm doing: > i'm doing a simple proxy server. Randal Schwartz has done a proxy server in one of his Webtechniques columns. Maybe you can get some ideas from it. See