Re: Re: Comparing Directories

2004-06-24 Thread LRMK
there are commented print statements in two places which look like this :- #print "$key\n"; uncomment them and you will get what you want here is the full code for that... changes are marked by comments #

Regx for validating E-Mail addresses

2004-06-24 Thread LRMK
I am using following code to validate e-mail addresses if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ valid }else{ invalid } it will give valid results for all of the following e-mail address [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] ... but I

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Beau E. Cox
On Wednesday 23 June 2004 09:29 pm, LRMK wrote: > I am using following code to validate e-mail addresses > > if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ > valid > }else{ > invalid > } > > it will give valid results for all of the following e-mail address > > [EMAIL PROTECTED]

Re: Re: Comparing Directories

2004-06-24 Thread LRMK
Sorry I miss understood your requirement in my previous post this will compaire the content of the files too but it will only tell you whethr they are equal or not if you need a more detailed report you will need to change the logic of compreFiles method compare("c:","D:"); sub compare($$){

String File

2004-06-24 Thread LKTee
Dear All, I try command below in Unix $ ls -l file? -rw-r-r--1 root 125 May 27 11:11file1 -rwxr-x- 1 root 52125 May 27 19:11 file2 drwxr-xr-x 1

RE: String File

2004-06-24 Thread Hande, Akshatha
? Used for pattern matching where in it matches exactly one character after the pattern that you have provided. Similarly * will match zero or more characters. -Original Message- From: LKTee [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 9:13 AM To: '[EMAIL PROTECTED]' Subject:

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Owen
On Thu, 24 Jun 2004 13:29:12 +0600 "LRMK" <[EMAIL PROTECTED]> wrote: > I am using following code to validate e-mail addresses > > if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ > valid > }else{ > invalid > } A comprehensive regex for checking e-mail addresses may be found at;

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Owen
On Thu, 24 Jun 2004 18:17:41 +1000 Owen <[EMAIL PROTECTED]> wrote: > On Thu, 24 Jun 2004 13:29:12 +0600 > "LRMK" <[EMAIL PROTECTED]> wrote: > > > I am using following code to validate e-mail addresses > > > > if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ > > valid > > }else{ > >

different argv behavior in different machines

2004-06-24 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I am a new perl user and I am running into a problem. I am trying to use argv and it's not returning the correct response on my laptop, but it's working fine on another machine. The only difference between the two machines is that on my laptop, I first installed the perl AS package for windows ra

Re: different argv behavior in different machines

2004-06-24 Thread Beau E. Cox
On Wednesday 23 June 2004 10:22 am, PerlDiscuss - Perl Newsgroups and mailing lists wrote: > I am a new perl user and I am running into a problem. I am trying to use > argv and it's not returning the correct response on my laptop, but it's > working fine on another machine. The only difference b

Passing httpd auth details to cgi-script

2004-06-24 Thread mike
Is it possible to pass user/password from apache auth to cgi-scripts. To explain I have apache set to authenticate using htpasswd, checking a file in /etc/httpd When users access the site they get a user/password prompt This then leads to a bunch of cgi-scripts which access DBI::DBDpg Is it po

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Damon Allen Davison
Hi, Have a look at Abigail's Regexp::Common on CPAN. That wheel has been invented. ;) Best, Damon LRMK wrote: I am using following code to validate e-mail addresses if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ valid }else{ invalid } -- Damon Allen Davison http://www.allolex

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Wiggins d Anconia
> I am using following code to validate e-mail addresses > > if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ > valid > }else{ > invalid > } > > it will give valid results for all of the following e-mail address > > [EMAIL PROTECTED] > [EMAIL PROTECTED] > [EMAIL PROTECTED] > [EM

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Damon Allen Davison
Sorry, I was a little too glib. It was Wiggins' suggestion of Email::Valid I should have referred to. Regexp::Common does almost everything else. Damon Damon Allen Davison wrote: Have a look at Abigail's Regexp::Common on CPAN. That wheel has been invented. ;) -- To unsubscribe, e-mail: [EM

Re: Using MIME::Lite to send mail/or attachments

2004-06-24 Thread mike
On Wed, 2004-06-23 at 10:22 -0700, jason corbett wrote: > Can anyone tell me where I can find MIME::Lite or any other perl method to send > attachments/documents in mail format? If you have tips or scripts on using it to > send mail (documents attached), please let me know. > > Thanks, > JC >

Timer in Perl??

2004-06-24 Thread William Martell
Hello Group, Could anyone please tell me if there is a timer function in Perl. I am trying to get some perl code to run every morning, but I am unsure how to do it. Thanks Will -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Timer in Perl??

2004-06-24 Thread James Edward Gray II
On Jun 24, 2004, at 9:33 AM, William Martell wrote: Hello Group, Could anyone please tell me if there is a timer function in Perl. I am trying to get some perl code to run every morning, but I am unsure how to do it. You could always sleep() for a day between runs, but that seems far too clumsy

Re: Timer in Perl??

2004-06-24 Thread Wiggins d Anconia
> Hello Group, > > Could anyone please tell me if there is a timer function in Perl. I am trying to get some perl code to run every morning, but I am unsure how to do it. > > Thanks > Will > Generally this is provided by the underlying system's scheduler. cron on *nix, something else on windo

RE: Timer in Perl??

2004-06-24 Thread Bob Showalter
William Martell wrote: > Hello Group, > > Could anyone please tell me if there is a timer function in Perl. I > am trying to get some perl code to run every morning, but I am unsure > how to do it. What platform? On Unix, you typically use cron to run jobs at scheduled times. Windows has a sched

Re: open CONSOLE?

2004-06-24 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Perl.Org) writes: >Is there a way to explicitly open a handle to the "console", or wherever >STDOUT/STDERR are directed to by default? > >My process is running in an environment in which STDOUT and STDERR have >already been redirected. I want t

Re: Regx for validating E-Mail addresses

2004-06-24 Thread Randal L. Schwartz
> "Lrmk" == Lrmk <[EMAIL PROTECTED]> writes: Lrmk> if ($mail =~ m/^(\w+(\.|-))*\w+\@(\w+(\.|-)*)+\w+$/){ Lrmk> but I am not sure about the illegal chars for an e-mail address Yup, fails on about 99% of the *legal* addresses, and permits *illegal* addresses. Two very important clues:

Printing hash of hashes

2004-06-24 Thread Daniel Falkenberg
Hello All, I need to print my hash of hashes. For example... %HoH = ( flintstones => { lead => "fred", pal => "barney", }, jetsons => { lead => "george", wife => "jane",

Re: String File

2004-06-24 Thread John W. Krahn
Lktee wrote: > > Dear All, Hello, > I try command below in Unix > > $ ls -l file? > -rw-r-r--1 root 125 May 27 11:11file1 > -rwxr-x- 1 root 52125 May 27 19:11 file2 > drwxr-xr-x 1 root 442 May 27 20:11

RE: Printing hash of hashes

2004-06-24 Thread Bob Showalter
Daniel Falkenberg wrote: > Hello All, > > I need to print my hash of hashes. For example... > > %HoH = ( > flintstones => { > lead => "fred", > pal => "barney", > }, > jetsons => { > lead => "george", >

Re: Printing hash of hashes

2004-06-24 Thread Gunnar Hjalmarsson
Daniel Falkenberg wrote: I need to print my hash of hashes. For example... How can I print that in a readable format. Then I would like to be able to print for example... Simpsons, Lead, homer. Any ideas? http://www.perldoc.com/perl5.8.4/pod/perldsc.html -- Gunnar Hjalmarsson Email: http://www.gu

pattern

2004-06-24 Thread Mandar Rahurkar
Hi All, I need to searh through a text file and lookfor a keyword and print the immediate word following it and before it. for eg., $_="bird was eating fish"; output for keyword eating shd be: was eating fish this is what i am doing, $key="dog"; @sspace=`cat file.txt`; foreach(@sspace)

Re: Passing httpd auth details to cgi-script

2004-06-24 Thread JupiterHost.Net
Is it possible to get the authentication details and pass them to the scripts so they can be passed to postgres so PG can then authenticate without further user input (pg is using md5 auth) $ENV{REMOTE_USER} has the username. The password is a bit trickier since its not usually automatically sent

Re: pattern

2004-06-24 Thread Gunnar Hjalmarsson
Mandar Rahurkar wrote: I need to searh through a text file and lookfor a keyword and print the immediate word following it and before it. for eg., $_="bird was eating fish"; output for keyword eating shd be: was eating fish this is what i am doing, $key="dog"; @sspace=`cat file.txt`; foreach(@sspac

RegExp help

2004-06-24 Thread Price, Jason (TLR Corp)
I'm trying to write a regular expression to divide up a line of text into a hash, but am having a hard time with it. I'm hoping you all can help me. Here's an example line of text: "( uiwgAttribute-OID NAME 'uiwgAttribute' DESC 'Contains meta data about an attribute' SUP top MUST cn MAY ( uiwgAD

Sending email via SMTP

2004-06-24 Thread Mike Blezien
Hello, I'm looking at using the Net::SMTP module to send email as opposed to the standard method of "sendmail". Been reading through the docs on the module, but not real clear on how to setup the "To:", "From:", "Reply-to:", "Subject:". and other headers, and actual body of the email to be sent

Re: RegExp help

2004-06-24 Thread Gunnar Hjalmarsson
Jason Price wrote: I'm trying to write a regular expression to divide up a line of text into a hash, but am having a hard time with it. I'm hoping you all can help me. Here's an example line of text: Not every line will have the same keys, or the same number of keys. In that case the example you

Re: RegExp help

2004-06-24 Thread JupiterHost.Net
Price, Jason (TLR Corp) wrote: I'm trying to write a regular expression to divide up a line of text into a hash, but am having a hard time with it. I'm hoping you all can help me. Here's an example line of text: "( uiwgAttribute-OID NAME 'uiwgAttribute' DESC 'Contains meta data about an attribute

RE: RegExp help

2004-06-24 Thread Price, Jason (TLR Corp)
Original Message From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 3:46 PM To: [EMAIL PROTECTED] Subject: Re: RegExp help > Jason Price wrote: >> I'm trying to write a regular expression to divide up a line of text >> into a hash, but am having a hard time wi

Class to select/insert/delete/update

2004-06-24 Thread Rod Za
Hello, i'm trying to make a class to do select/insert/delete/update on a MySQL table (via DBI). this is a snip of code: sub query{ my $self = shift; my($sql) = @_; my @result; my $sth = $self->{dbh}->prepare($sql) or return undef; if($sql =~ /delete|insert

Re: Sending email via SMTP

2004-06-24 Thread Wiggins d Anconia
> Hello, > > I'm looking at using the Net::SMTP module to send email as opposed to the > standard method of "sendmail". > > Been reading through the docs on the module, but not real clear on how to setup > the "To:", "From:", "Reply-to:", "Subject:". and other headers, and actual body > of the

Re: RegExp help

2004-06-24 Thread Jeff 'japhy' Pinyan
On Jun 24, Price, Jason (TLR Corp) said: >"( uiwgAttribute-OID NAME 'uiwgAttribute' DESC 'Contains meta data about >an attribute' SUP top MUST cn MAY ( uiwgADsType $ uiwgDescription $ >uiwgDisplayName $ uiwgIsMultiValued ) )" > NAME -> 'uiwgAttribute', > DESC -> 'Contains meta data ab

Re: Class to select/insert/delete/update

2004-06-24 Thread Wiggins d Anconia
> Hello, > > i'm trying to make a class to do select/insert/delete/update on a MySQL table (via DBI). > this is a snip of code: > You haven't really shown us a class, just a method... > sub query{ > my $self = shift; > my($sql) = @_; > my @result; Why scope @result here

Re: Sending email via SMTP

2004-06-24 Thread Mike Blezien
Wiggins d Anconia wrote: Hello, I'm looking at using the Net::SMTP module to send email as opposed to the standard method of "sendmail". Been reading through the docs on the module, but not real clear on how to setup the "To:", "From:", "Reply-to:", "Subject:". and other headers, and actual bod

Re: Sending email via SMTP

2004-06-24 Thread Wiggins d Anconia
> Wiggins d Anconia wrote: > >>Hello, > >> > >>I'm looking at using the Net::SMTP module to send email as opposed to the > >>standard method of "sendmail". > >> > >>Been reading through the docs on the module, but not real clear on how > > > > to setup > > > >>the "To:", "From:", "Reply-to:", "

Re: Sending email via SMTP

2004-06-24 Thread Mike Blezien
MIME::Lite was the one I was trying to remember! thx's Wiggins d Anconia wrote: Wiggins d Anconia wrote: Hello, I'm looking at using the Net::SMTP module to send email as opposed to the standard method of "sendmail". Been reading through the docs on the module, but not real clear on how to setup

Re: RegExp help

2004-06-24 Thread Randy W. Sims
On 6/24/2004 4:58 PM, Price, Jason (TLR Corp) wrote: Original Message From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 3:46 PM To: [EMAIL PROTECTED] Subject: Re: RegExp help Jason Price wrote: I'm trying to write a regular expression to divide up a line of t

Re: RegExp help

2004-06-24 Thread Gunnar Hjalmarsson
Jason Price wrote: Gunnar Hjalmarsson wrote: Jason Price wrote: Not every line will have the same keys, or the same number of keys. In that case the example you posted is obviously not sufficient as a problem description. Basically, every line will follow a similar pattern: "junk KEY1 value1 KEY2

calculating http download speed

2004-06-24 Thread Radhika Sambamurti
Hi folks, My task is to calculate the download speed taken by a program, that can download images either by ftp, http or smbclient. One way I am thinking of doing this is by calculating the total download size by time taken. getting the size is easier than calculating the time taken for the downl

Re: Printing hash of hashes

2004-06-24 Thread LRMK
I used this code In a ASP code to display the entire content of hashes I did some changes to neke it pure perl it should be good for your job ex:- printIt("", %hashToPrint); sub printIt($%){ my ($myfix, %hash)[EMAIL PROTECTED]; foreach my $k(sort keys %hash){ print "$myfix $k\t=\t$hash{$

Re: Class to select/insert/delete/update

2004-06-24 Thread LRMK
I think it will be nice if you write more hgher level methods for each InsertSelect, Update, Create, And Delete commends. Ex:- An Insert method which take the table name and a Hash as args and cunstruct the query and execute it sub Insert($%){ $self = shift; my ($table,%data) = @_; m

Re: calculating http download speed

2004-06-24 Thread Beau E. Cox
On Thursday 24 June 2004 02:07 pm, Radhika Sambamurti wrote: > Hi folks, > My task is to calculate the download speed taken by a program, that can > download images either by ftp, http or smbclient. One way I am thinking of > doing this is by calculating the total download size by time taken. getti

Execute a sub: $sub

2004-06-24 Thread Daniel Kasak
Hi all. I have an object that I want to have execute some code that it gets told about when it's constructed. How do I go about that? ie: $self->{some_code_to_execute} will either have the name of a sub, or a reference to a sub, or something. Dan -- Daniel Kasak IT Developer NUS Consulting Group

How to call a perl script....

2004-06-24 Thread Charlene Gentle
Hi How do you call 'n perl script from within a perl script and return to the scripts again. Thanx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to call a perl script....

2004-06-24 Thread Beau E. Cox
On Thursday 24 June 2004 08:32 pm, Charlene Gentle wrote: > Hi > > How do you call 'n perl script from within a perl script and return to > the scripts again. > > > > Thanx You can use the 'system' command: ##--master-- ... my $rc = system "perl slave.pl"; ... or backtics if you want to capture