Re: server side includes using cgi

2003-10-10 Thread Todd Wade
Dale Young [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I have been trying include a 'server side include' in a cgi script used to generate a html page with no success. I have redirected the output from the script to a static html file which displays correctly in my

Re: Form creation and parsing

2003-10-10 Thread [EMAIL PROTECTED]
Thanks for your hints, I've tried to use the script from Jonathan (I've just received the scripts from zentara), but I got an error in this line: use CGI::FormBuilder; I think I miss some package. Is this right? I use Debian Linux, does anyone know which package do I have to install? Thanks alot!

RE: Form creation and parsing

2003-10-10 Thread Jonathan E. Hogue
I use windows/activestate, so I use the ppm to install modules. There is the cpan module for other distros which works similarly. http://www.perl.com/pub/a/2002/03/26/cpanplus.html From the documentation, the command should look something like cpanp cpan i cgi::formbuilder ( I'm just guessing

Re: server side includes using cgi

2003-10-10 Thread Todd Farmer
I think I remember this was to change with Apache 2.0. Does anybody know if this is true or just wishful thinking? Todd F. Dale Young [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I have been trying include a 'server side include' in a cgi script used to

CGI Scripts

2003-10-10 Thread Phillip Bruce
Hi, I have the following form that I use as survey I that I'm building for my web site. form METHOD=POST ACTION=https://www726.vwh1.net/peggy1/cgi-local/surve y.cgi Are you a new cutomer or a returning customer?BR input TYPE=CHECKBOX NAME=Customer VALUE=New CustomerNew Customer BR input

Re: server side includes using cgi

2003-10-10 Thread Todd Farmer
It looks like Apache 2.0 supports parsing CGI scripts for SSI. I found this at http://httpd.apache.org/docs-2.0/new_features_2_0.html: Filtering Apache modules may now be written as filters which act on the stream of content as it is delivered to or from the server. This allows, for example,

Re: CGI Scripts

2003-10-10 Thread Wiggins d'Anconia
Phillip Bruce wrote: Hi, I have the following form that I use as survey I that I'm building for my web site. snip form Now here is the CGI script I've written so far. #!/usr/bin/perl # use Mail::Internet; use strict; # always use warnings; # usually, at least during development # Collect

Re: CGI Scripts

2003-10-10 Thread Phillip Bruce
Wiggins d'Anconia wrote: Phillip Bruce wrote: Hi, I have the following form that I use as survey I that I'm building for my web site. snip form Now here is the CGI script I've written so far. #!/usr/bin/perl # use Mail::Internet; use strict; # always use warnings; # usually, at least

Re: CGI Scripts

2003-10-10 Thread Wiggins d'Anconia
Phillip Bruce wrote: Wiggins d'Anconia wrote: snip Thanks for the suggestions. Now I get totally different error. I ran this on the command line and get following: % ./survey.cgi Content-type: text/html Substitution replacement not terminated at ./survey.cgi line 37. Here is my code changes

Re: Reg ex help

2003-10-10 Thread Wiggins d'Anconia
Johnstone, Colin wrote: Gidday All, I am writing a print this page script. I have slurped in the page to be printed and now want to strip out the stuff to print. To do this I have created the following tag sets in the html page. date/date headline/headline story/story I need to write a regex to

Re: Best Token Char For Template

2003-10-10 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: 1 - What is the best char to use in a file template? Also, please give me a good regex? A character *guaranteed* (which is a very strong word) not to exist in the template, but that's in an ideal world... I will have a formatted html page with some keys that I want

how do I pass null arguement?

2003-10-10 Thread perl
How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname = $_[1]]; } my procByLastName{ mySubA(null, doe); } ... This is the error message: Bareword null not allowed while strict subs in use thanks,

Re: how do I pass null arguement?

2003-10-10 Thread simran
Try 'undef'. eg. my procByLastName{ mySubA(undef, doe); } On Fri, 2003-10-10 at 16:39, [EMAIL PROTECTED] wrote: How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname = $_[1]]; } my

Re: how do I pass null arguement?

2003-10-10 Thread perl
thanks. it works! -rkl Try 'undef'. eg. my procByLastName{ mySubA(undef, doe); } On Fri, 2003-10-10 at 16:39, [EMAIL PROTECTED] wrote: How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname

regex require a period

2003-10-10 Thread perl
here's the rules: starts with alphanumeric 4 chars long require one period /^[a-zA-Z][\w\-\.]{3,}$/ I think my regex is not doing the required period. thanks, -rkl - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL

Re: grep argument list too long...how to get around it?

2003-10-10 Thread Steve Grazzini
On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote: Are you sure about using ls? We have directory here that has several thousand files in it and when doing an ls *.whatever-extension we always get an argument list too long. Any idea what the actual file limit is for grep? It's a

Re: finding a spot in a file

2003-10-10 Thread John W. Krahn
Chad Kellerman wrote: Hello, Hello, I am opening up a file (actually a my.conf). I only want 2 lines in the file. port and datadir The problem I am running into is that there is a port = 3324 in both the [client] section and the [mysqld] section. I want to open the file

Re: regex require a period

2003-10-10 Thread Steve Grazzini
On Fri, Oct 10, 2003 at 12:49:51AM -0700, [EMAIL PROTECTED] wrote: I couldn't get it to work. Whoops -- sub validate { local $_ = shift; return( length == 4 and tr/.// == 1 and /^[[:alpha:]]/ ) } -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: grep argument list too long...how to get around it?

2003-10-10 Thread Egleton, Gary
What version of unix are you using? It was fixed in a patch on HPUX -Original Message- From: Kevin Old [SMTP:[EMAIL PROTECTED] Sent: 09 October 2003 17:22 To: Dan Muey Cc: [EMAIL PROTECTED] Subject: RE: grep argument list too long...how to get around it? On Thu,

Re: File::Path question

2003-10-10 Thread Rob Dixon
Prasad Karpur wrote: I initially set $value1, $value2 and $value3 to null values $value1 = ; $value2 = ; $value3 = ; I get the values of $value1, $value2 and $value from input $valuexyz = $value1$value2$value3; I don't see how you think this will 'get the values ... from input'. All it

Re: finding a spot in a file

2003-10-10 Thread Rob Dixon
Chad Kellerman wrote: I am opening up a file (actually a my.conf). I only want 2 lines in the file. port and datadir The problem I am running into is that there is a port = 3324 in both the [client] section and the [mysqld] section. I want to open the file and go straight to

File::Path question

2003-10-10 Thread Chetak Sasalu M
Hi Prasad, Try this, use strict; use warnings; use File::Path; my ($val1,$val2,$valxy); print enter value for val1 and val2 \n; chomp($val1 = STDIN); chomp($val2 = STDIN); $valxy = $val1$val2; mkpath ([./$valxy],1); -- Cheers, Chetak. I am a perl newbie .So

Re: Form creation and parsing

2003-10-10 Thread Shaun Fryer
On Thu, Oct 09, 2003 at 04:15:41PM +0200, [EMAIL PROTECTED] wrote: Hi, I'm quite new to Perl scripting, so any help could be really most valuable. I'm trying to write a Perl script which creates a Form (I know how to create a form with HTML or Php), and after the user has compiled the form and

Trouble with subdir search

2003-10-10 Thread Daniel Stellwagen
Hi Perl Guys, I found this code in the O'Reilly book Perl for System Administration: use Cwd; use DirHandle; scan_dir(.); sub scan_dir { my ($workdir) = shift; my ($startdir) = cwd; chdir ($workdir) or die $!\n; opendir(DIR,.) or die $!\n; my @names =

traversing a variable with regex instead of a file

2003-10-10 Thread angie ahl
Hi everyone This is my first posting to the list, although I've been burried knee deep in perl books for some time and have been doing web development in other languages for some time. I'm working with Mod_perl on Apache on Linux. I have a simple question (I think ;) I keep seeing pattern

Re: traversing a variable with regex instead of a file

2003-10-10 Thread James Edward Gray II
On Friday, October 10, 2003, at 08:17 AM, angie ahl wrote: while ($line = ) { if ($line =~ /$pattern/o) { # do something } } It's almost exactly what I want to do. I want to see if a line starts with a pattern and if doesn't do something, so I would use unless instead of if.

Re: grep argument list too long...how to get around it?

2003-10-10 Thread Kevin Old
On Fri, 2003-10-10 at 02:44, Steve Grazzini wrote: On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote: Are you sure about using ls? We have directory here that has several thousand files in it and when doing an ls *.whatever-extension we always get an argument list too long. Any

Re: Trouble with subdir search

2003-10-10 Thread Rob Dixon
Daniel Stellwagen wrote: I found this code in the O'Reilly book Perl for System Administration: use Cwd; use DirHandle; scan_dir(.); sub scan_dir { my ($workdir) = shift; my ($startdir) = cwd; chdir ($workdir) or die $!\n; opendir(DIR,.) or die $!\n; my @names = readdir(DIR) or die

Re: traversing a variable with regex instead of a file

2003-10-10 Thread James Edward Gray II
Keep your replies on the list, so you can get help from all the people smarter than me. ;) On Friday, October 10, 2003, at 08:58 AM, angie ahl wrote: Or did you mean, how would you go through a variable's content line-by-line? For that, try something like this: my @lines = split /(\n)/,

perl install on redhat 9

2003-10-10 Thread Rick Bragg
Hi, I have installed perl 8 on redhat 9 and I installed it from source. (not an rpm) however, when I did a redhat up2date, the rpm's were then re-installed. I think that the rpm installed perl in /usr/bin and the source install put it in /usr/local/bin can I safely uninstall the perl rpm's

Hash Print and Delete

2003-10-10 Thread Jeff Westman
Question: If I have an array and want to take the first element off and return it, I would do it like this: return (@myArray) ? shift(@myArray) : undef; How would I do similarly with a hash? I have something like this: return (exists $myHash{$val1} ) ? $Hash{$val2} : undef; But these

Error while installing PPM

2003-10-10 Thread ramakrishna
Hi, I am new to perl. After installing Perl on Win 2000 Adv server, when i enter into PPM mode and use 'Search *' for listing the packages it is showing the following error ppm search * Searching in Active Repositories Error: No valid repositories: Error: 500 Can't connect to

RE: Hash Print and Delete

2003-10-10 Thread Paul Kraus
Why wouldn't you just return(shift(@myarray) As far as the hash why are you trying to remove it? I would assume it because you don't have a use for it outside of the scope of the subroutine. If so why don't you just make the hash scoped to the sub. Then you return the value you want and when the

Re: Hash Print and Delete

2003-10-10 Thread Casey West
It was Friday, October 10, 2003 when Jeff Westman took the soap box, saying: : Question: : : If I have an array and want to take the first element off and return it, I : would do it like this: : :return (@myArray) ? shift(@myArray) : undef; : : How would I do similarly with a hash? I have

RE: Hash Print and Delete

2003-10-10 Thread Paul Kraus
Opps type return(shift(@myarray)) -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 11:46 AM To: 'Jeff Westman'; 'beginners' Subject: RE: Hash Print and Delete Why wouldn't you just return(shift(@myarray) As far as the hash why are you trying

Re: traversing a variable with regex instead of a file

2003-10-10 Thread angie ahl
on 2003-10-10 James Edward Gray II said: Keep your replies on the list, so you can get help from all the people smarter than me. ;) If there are people smarter than you out there I must be an amoeba ;) Okay, why put this inside an if block. If it doesn't find a match it will fail and do

Re: Hash Print and Delete

2003-10-10 Thread Rob Dixon
Jeff Westman wrote: If I have an array and want to take the first element off and return it, I would do it like this: return (@myArray) ? shift(@myArray) : undef; How would I do similarly with a hash? I have something like this: return (exists $myHash{$val1} ) ? $Hash{$val2} :

Re: grep argument list too long...how to get around it?

2003-10-10 Thread Steve Grazzini
On Fri, Oct 10, 2003 at 09:35:25AM -0400, Kevin Old wrote: On Fri, 2003-10-10 at 02:44, Steve Grazzini wrote: On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote: Are you sure about using ls? We have directory here that has several thousand files in it and when doing an ls

Re: Hash Print and Delete

2003-10-10 Thread Jeff Westman
Rob Dixon [EMAIL PROTECTED] wrote: Jeff Westman wrote: If I have an array and want to take the first element off and return it, I would do it like this: return (@myArray) ? shift(@myArray) : undef; How would I do similarly with a hash? I have something like this:

CPAN install failure...

2003-10-10 Thread Rick Bragg
Hi, I just tried to install HTML::Parser on my Redhat9 system and I got the following. Should I just force it? if so how is that done... Thanks Rick sorry for all the output... - Running install for module HTML::Parser Running make for G/GA/GAAS/HTML-Parser-3.31.tar.gz Is already

Re: working on time

2003-10-10 Thread Bill Akins
Bill Akins SSS III Emory Healthcare (404) 712-2879 - Office 12674 - PIC [EMAIL PROTECTED] [EMAIL PROTECTED] 10/10/03 08:57AM Hi, i search hiw can i work on time. i want to get day number and make -1 Try this: #!/usr/bin/perl -w my @now = localtime; my $sec = ( $now[0] ); my

RE: Hash Print and Delete

2003-10-10 Thread Jeff Westman
Paul Kraus [EMAIL PROTECTED] wrote: Why wouldn't you just return(shift(@myarray) Yes, this works for a normal(?) array, but I was asking about hashes. As far as the hash why are you trying to remove it? I would assume it because you don't have a use for it outside of the scope of the

RE: working on time

2003-10-10 Thread Bob Showalter
Bill Akins wrote: ... Try this: #!/usr/bin/perl -w my @now = localtime; my $sec = ( $now[0] ); my $min = ( $now[1] ); my $hr = ( $now[2] ); my $day = ( $now[3] ); my $mth = ( $now[4] + 1 ); my $yr = ( $now[5] + 1900 ); $day = ($day -1); print Yesterday

Re: perl install on redhat 9

2003-10-10 Thread Dan Anderson
I have installed perl 8 Perl 8? What cool features does that have? Can I borrow your time machine? on redhat 9 and I installed it from source. (not an rpm) however, when I did a redhat up2date, the rpm's were then re-installed. Hmmm... I don't use RedHat, so I'm not sure how up2date

Re: grep argument list too long...how to get around it?

2003-10-10 Thread Kevin Old
On Fri, 2003-10-10 at 11:46, Steve Grazzini wrote: On Fri, Oct 10, 2003 at 09:35:25AM -0400, Kevin Old wrote: On Fri, 2003-10-10 at 02:44, Steve Grazzini wrote: On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote: Are you sure about using ls? We have directory here that has

Re: Hash Print and Delete

2003-10-10 Thread Rob Dixon
Jeff Westman wrote: Rob Dixon [EMAIL PROTECTED] wrote: Jeff Westman wrote: If I have an array and want to take the first element off and return it, I would do it like this: return (@myArray) ? shift(@myArray) : undef; How would I do similarly with a hash? I have

Re: grep argument list too long...how to get around it?

2003-10-10 Thread Steve Grazzini
On Fri, Oct 10, 2003 at 12:37:02PM -0400, Kevin Old wrote: On Fri, 2003-10-10 at 11:46, Steve Grazzini wrote: No. (It's ARG_MAX...) I'm running Mandrake 9.0 and my ARG_MAX is not set, so is it unlimited? If not, what is the default? It's not an environment variable. (Check limits.h.)

Re: traversing a variable with regex instead of a file

2003-10-10 Thread James Edward Gray II
On Friday, October 10, 2003, at 10:51 AM, angie ahl wrote: on 2003-10-10 James Edward Gray II said: Keep your replies on the list, so you can get help from all the people smarter than me. ;) If there are people smarter than you out there I must be an amoeba ;) There are some very brilliant

RE: grep argument list too long...how to get around it?

2003-10-10 Thread Alexandru Colea
You can put arguments in a file and then open and parse the file inside perl. -Alex C. -Original Message- From: Steve Grazzini [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 12:29 PM To: Kevin Old Cc: Dan Muey; [EMAIL PROTECTED] Subject: Re: grep argument list too long...how

Re: working on time

2003-10-10 Thread Tore Aursand
On Fri, 10 Oct 2003 14:57:47 +0200, [EMAIL PROTECTED] wrote: i search hiw can i work on time. i want to get day number and make -1 Check out the heap of Date-related modules on http://www.cpan.org/. -- Tore Aursand [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: working on time

2003-10-10 Thread Bill Akins
I thought of that right after hitting send... This may be better if he wants to do a lot of date manipulation down the road: #!/usr/bin/perl -w use Date::Manip; my ($day, $mnth, $yr); my $date = DateCalc(today,- 1day); ($yr, $mnth, $day) = ($date =~ /(\d\d\d\d)(\d\d)(\d\d)/); print

Re: working on time

2003-10-10 Thread Tore Aursand
On Fri, 10 Oct 2003 12:13:45 -0400, Bill Akins wrote: Try this: #!/usr/bin/perl -w my @now = localtime; my $sec = ( $now[0] ); my $min = ( $now[1] ); my $hr = ( $now[2] ); my $day = ( $now[3] ); my $mth = ( $now[4] + 1 ); my $yr = ( $now[5] + 1900 );

Re: Fwd: required help

2003-10-10 Thread Tore Aursand
On Fri, 10 Oct 2003 08:40:17 -0500, James Edward Gray II wrote: I want to insert data from sms_log ie 10.100.208.254 server to 10.100.200.47 table ie sms_log1. Well. What have you tried so far? It should be easy as long as you create two database connections? -- Tore Aursand [EMAIL

Beginner Help Please- Oracle How To?

2003-10-10 Thread jeffrey pearson
Im hoping I could get some beginner help please. Im in the middle of writing my first PERL program. My development machine is WinXP. Ive downloaded, installed and am working with the ActivePERL 5.8. Im trying to connect and access an oracle database. Ive figured out how and successfully

RE: Beginner Help Please- Oracle How To?

2003-10-10 Thread Paul Kraus
perldoc DBI Or http://safari.oreilly.com/JVXSL.asp?x=1mode=sectionsortKey=ranksortOr der=descview=bookxmlid=1-56592-699-4open=falseg=srchText=dbicode= h=m=l=1catid=s=1b=1f=1t=1c=1u=1r=o=1page=0 -Original Message- From: jeffrey pearson [mailto:[EMAIL PROTECTED] Sent: Friday, October

Re: traversing a variable with regex instead of a file

2003-10-10 Thread Rob Dixon
James Edward Gray II wrote: On Friday, October 10, 2003, at 08:17 AM, angie ahl wrote: while ($line = ) { if ($line =~ /$pattern/o) { # do something } } It's almost exactly what I want to do. I want to see if a line starts with a pattern and if doesn't do

Re: Hash Print and Delete

2003-10-10 Thread Jeff Westman
Rob Dixon [EMAIL PROTECTED] wrote: [...snip...] return (exists $myHash{$val1} ) ? $Hash{$val2} : undef; Likewise, 'delete' returns either the element deleted or 'undef' if it didn't exist. [...snip...] I didn't know 'delete' returned the value as well. Simple and perfect!

RE: Beginner Help Please- Oracle How To?

2003-10-10 Thread Bob Showalter
jeffrey pearson wrote: Im hoping I could get some beginner help please. Im in the middle of writing my first PERL program. My development machine is WinXP. Ive downloaded, installed and am working with the ActivePERL 5.8. Im trying to connect and access an oracle database. Ive figured out how

Re: Hash Print and Delete

2003-10-10 Thread Rob Dixon
Jeff Westman wrote: Rob Dixon [EMAIL PROTECTED] wrote: [...snip...] return (exists $myHash{$val1} ) ? $Hash{$val2} : undef; Likewise, 'delete' returns either the element deleted or 'undef' if it didn't exist. [...snip...] I didn't know 'delete' returned the value as

Re: traversing a variable with regex instead of a file

2003-10-10 Thread James Edward Gray II
On Friday, October 10, 2003, at 12:46 PM, Rob Dixon wrote: my @lines = split /(\n)/, $data; foreach (@lines) { do_something() if /pattern/; } $data = join '', @lines; Hi James. I'm not sure if the group saw all of the dialogue? Later postings seem to assume an enclosing loop as you wrote above.

Re: grep argument list too long...how to get around it?

2003-10-10 Thread david
Kevin Old wrote: On Fri, 2003-10-10 at 11:46, Steve Grazzini wrote: On Fri, Oct 10, 2003 at 09:35:25AM -0400, Kevin Old wrote: On Fri, 2003-10-10 at 02:44, Steve Grazzini wrote: On Thu, Oct 09, 2003 at 12:21:57PM -0400, Kevin Old wrote: Are you sure about using ls? We have directory

Re: RE: Beginner Help Please- Oracle How To?

2003-10-10 Thread jeffrey pearson
My apologies for being vague. I have the client sw installed. I can connect and work with my databases via SQLPlus just fine. The issue Im having is I understand I need DBD::Oracle. I cant find it. If I go into ppm and do a search Oracle, I get: 1. Class-DBI-Oracle 2. Class-DBI-Oracle 3.

2 newbie questions

2003-10-10 Thread Bee
hello all, I've just start my learning on perl, and recently still learning some basic syntax. So I hope my question is still making sense. I am now learning about how to write files and wondering is that possible to inserting / overwriting bytes in files ( text / binary ). and I am on Win32.

RE: RE: Beginner Help Please- Oracle How To?

2003-10-10 Thread Tristram Nefzger
http://www.perl.com/CPAN/modules/by-module/DBD/ -Original Message- From: jeffrey pearson [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 2:21 PM To: Bob Showalter Cc: [EMAIL PROTECTED] Subject: Re: RE: Beginner Help Please- Oracle How To? My apologies for being vague. I have

Re: 2 newbie questions

2003-10-10 Thread Jeff Westman
Bee [EMAIL PROTECTED] wrote: hello all, I've just start my learning on perl, and recently still learning some basic syntax. So I hope my question is still making sense. I am now learning about how to write files and wondering is that possible to inserting / overwriting bytes in files (

Re: Hash Print and Delete

2003-10-10 Thread Wiggins d'Anconia
On Fri, 10 Oct 2003 09:11:28 -0700 (PDT), Jeff Westman [EMAIL PROTECTED] wrote: I know perl returns the last value (statement?) by default, but doesn't it make it more readable (or self-documenting) to the next person who may come along what

Re: Hash Print and Delete

2003-10-10 Thread Jeff Westman
Wiggins d'Anconia [EMAIL PROTECTED] wrote: On Fri, 10 Oct 2003 09:11:28 -0700 (PDT), Jeff Westman [EMAIL PROTECTED] wrote: I know perl returns the last value (statement?) by default, but doesn't it make it more readable (or

Re: traversing a variable with regex instead of a file

2003-10-10 Thread John W. Krahn
Angie Ahl wrote: on 2003-10-10 James Edward Gray II said: Keep your replies on the list, so you can get help from all the people smarter than me. ;) If there are people smarter than you out there I must be an amoeba ;) Okay, why put this inside an if block. If it doesn't find a

Re: traversing a variable with regex instead of a file

2003-10-10 Thread John W. Krahn
[Sorry for the line wrapping on my previous post :-)] Angie Ahl wrote: on 2003-10-10 James Edward Gray II said: Keep your replies on the list, so you can get help from all the people smarter than me. ;) If there are people smarter than you out there I must be an amoeba ;) Okay,

Re: Hash Print and Delete

2003-10-10 Thread Wiggins d'Anconia
On Fri, 10 Oct 2003 12:53:48 -0700 (PDT), Jeff Westman [EMAIL PROTECTED] wrote: Wiggins d'Anconia [EMAIL PROTECTED] wrote: On Fri, 10 Oct 2003 09:11:28 -0700 (PDT), Jeff Westman [EMAIL

Re: regex require a period

2003-10-10 Thread perl
This is not working as I expected: if(validate('abc.com')) { print true; } else { print false; } -rkl On Fri, Oct 10, 2003 at 12:49:51AM -0700, [EMAIL PROTECTED] wrote: I couldn't get it to work. Whoops -- sub validate { local $_ = shift; return( length == 4 and

RE: how do I pass null arguement?

2003-10-10 Thread perl
Good info. thanks, -rkl Hi, [EMAIL PROTECTED] wrote: How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname = $_[1]]; } Alternatively, you could write either my $fname = shift; my

Re: regex require a period

2003-10-10 Thread perl
/^[a-zA-Z][\w\-\.]{3,}$/ /\./ The above matches more than 1 period. I MUST have 1 and ONLY 1 period. Also, can I fit it on one line? this doesn't work either sub isValidDomain { return shift =~ /^[a-zA-Z0-9][\w\-\.]{3,}$/ } thanks --- How about something like:

Declaring sub at top or bottom matter?

2003-10-10 Thread perl
Does declaring at the top or the bottom matter? thanks - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regex require a period

2003-10-10 Thread Steve Grazzini
On Fri, Oct 10, 2003 at 03:11:52PM -0700, [EMAIL PROTECTED] wrote: This is not working as I expected: if(validate('abc.com')) { print true; } else { print false; } It prints false (because the length is 4). sub validate { local $_ = shift; return( length == 4 and

Re: regex require a period

2003-10-10 Thread perl
Ok - I got it to work by changing the line to length = 3 If I could push the rule a little further, a new rule added is that an alpha char a-Z MUST be after the period. thanks On Fri, Oct 10, 2003 at 03:11:52PM -0700, [EMAIL PROTECTED] wrote: This is not working as I expected:

Re: regex require a period

2003-10-10 Thread Steve Grazzini
On Fri, Oct 10, 2003 at 03:56:43PM -0700, [EMAIL PROTECTED] wrote: Ok - I got it to work by changing the line to length = 3 Good. If I could push the rule a little further, a new rule added is that an alpha char a-Z MUST be after the period. Well now you have four rules. Again, I think

Re: regex require a period

2003-10-10 Thread perl
rules: starts with alphanumeric 3 chars long require ONLY one period require alpha after the period /^[a-zA-Z0-9][\w-].[a-zA-z]/ #but now working sub validate { local $_ = shift; return( length = 3 and tr/.// == 1 and /^[[:alpha:]]/ and

Re: Declaring sub at top or bottom matter?

2003-10-10 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Does declaring at the top or the bottom matter? Yes. But you probably meant defining a sub in which case ... maybe ... but usually no. Have you read the perlsub.pod document? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: how do I pass null arguement?

2003-10-10 Thread Thomas Bätzler
Hi, [EMAIL PROTECTED] wrote: How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname = $_[1]]; } Alternatively, you could write either my $fname = shift; my $lname = shift; or even my(

Re: regex require a period

2003-10-10 Thread Daniel Staal
--On Friday, October 10, 2003 16:43 -0700 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: rules: starts with alphanumeric 3 chars long Note, so we are not confused: you mean _at least_ 3 chars long. (Not _only_ 3 chars long.) require ONLY one period require alpha after the period Ok, what exactly

NET::FTP problem w/CHMOD

2003-10-10 Thread [EMAIL PROTECTED]
Hi I am trying to use the NET::FTP module to recursively chmod files. Either of these two ways of telling the server to chmod it seem to work: $ftp-command(SITE CHMOD 755 $file); or $ftp-quot(SITE CHMOD 755 $file); ...but once that runs once, even successfully, $ftp-pwd() returns an empty string

Re: regex require a period

2003-10-10 Thread perl
The regex below is working for after the period. The part in fron is not working. It is requiring atleast 2 chars before the period which is not my rule. the rule for the front part: start with [a-zA-Z0-9] chars following is [\w-] BUT IS OPTIONAL /^[a-zA-Z0-9][\w-]\.[a-zA-z]+$/ I think the

Re: regex require a period

2003-10-10 Thread perl
The regex below is working for after the period. The part in fron is not working. It is requiring atleast 2 chars before the period which is not my rule. the rule for the front part: start with [a-zA-Z0-9] chars following is [\w-] BUT IS OPTIONAL /^[a-zA-Z0-9][\w-]\.[a-zA-z]+$/ I think the

Re: regex require a period

2003-10-10 Thread Daniel Staal
--On Friday, October 10, 2003 17:45 -0700 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: start with [a-zA-Z0-9] chars following is [\w-] BUT IS OPTIONAL /^[a-zA-Z0-9][\w-]\.[a-zA-z]+$/ I think the regex is not doing the option \w part. Correct, it isn't. You haven't asked it to... To make it

Re: regex require a period

2003-10-10 Thread perl
So, would this be it for the optional? /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/ thanks --On Friday, October 10, 2003 17:45 -0700 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: start with [a-zA-Z0-9] chars following is [\w-] BUT IS OPTIONAL /^[a-zA-Z0-9][\w-]\.[a-zA-z]+$/ I think the regex is not

Re: regex require a period

2003-10-10 Thread Daniel Staal
--On Friday, October 10, 2003 18:21 -0700 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So, would this be it for the optional? /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/ thanks Yep, that should work for you. Daniel T. Staal (By the way: Don't reply to me *and* the list. I've set up my email client so

Re: regex require a period

2003-10-10 Thread perl
Great! Final verification question. Atleast for now :) Do I need to use delimiter for a hyphen? /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/ or /^[a-zA-Z0-9][\w\-]*\.[a-zA-z]+$/ thanks --On Friday, October 10, 2003 18:21 -0700 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So, would this be it for the

behavior of semicolon on return line

2003-10-10 Thread perl
Does the semicolon behave any differently for a return test statement? Example, sub validate { return shift =~ /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/ } or sub validate { return shift =~ /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/; } thanks - eMail solutions by

RE: behavior of semicolon on return line

2003-10-10 Thread Tim Johnson
I don't know, does it? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 7:02 PM To: [EMAIL PROTECTED] Subject: behavior of semicolon on return line Does the semicolon behave any differently for a return test statement? Example, sub

Re: behavior of semicolon on return line

2003-10-10 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Does the semicolon behave any differently for a return test statement? Example, sub validate { return shift =~ /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/ } or sub validate { return shift =~ /^[a-zA-Z0-9][\w-]*\.[a-zA-z]+$/; } Trailing commas and semicolons are