Re: Newbie: Perl reg. expression

2004-05-18 Thread lohit
Durai wrote: Hi, It gives the output: (0.0.0.0) 12.34.56.78:80 204.62.129.132 I need Only IP address. I need like: 204.62.129.132 127.0.0.1 if you want to exclude only 0.0.0.0 , how about print if /(\d+\.\d+\.\d+\.\d)/ and $1 != "0.0.0.0"; Not like 12.34.56.78:80,(0.0.0.0),..etc. Thanks, Durai.

Fw: Newbie: Perl reg. expression - Correction

2004-05-18 Thread LRMK
sorry about that typing mistake Rakhitha Karunarathne Web Master www.Ad-Man.tk - Free Unlimited Banner Rotators > - Original Message - > From: "Durai" <[EMAIL PROTECTED]> > To: "LRMK" <[EMAIL PROTE

Re: Broke My @INC

2004-05-18 Thread Ramprasad A Padmanabhan
set environment var PERLLIB on linux like systems with perl 5.8.3 you will do something like export PERLLIB=/usr/lib/perl5/5.8.3/i386-linux-thread-multi:/usr/lib/perl5/5.8.3:/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi:/usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi:/usr/lib/perl

RE: combining data from more than one file...

2004-05-18 Thread Traeder, Philipp
> Well this is the best I could do thinking through what you said. This > is actually my first time working with hashes. Also, I am > still a PERL > newbie. So, I guess a little helpful code would go a long way. I just > can't figure out how to link the regular expressions to the hash when > s

RE: Image editing/Creating modules

2004-05-18 Thread Charles K. Clarkson
[EMAIL PROTECTED] wrote: : can someone give a name of any image (JPG or GIF) editing / : creating module, which allow to create images to display on : web pages on the fly by CGI scripts. There are a bunch of those. Have you tried CPAN? http://search.cpan.org/modl

Re: Broke My @INC

2004-05-18 Thread Randy W. Sims
Jason Dusek wrote: Hi List, My @INC is messed up - Perl can't find any modules. If I know the path to a module, is there some kind of quick work around? For those who are curious, I seem to have broken my @INC by installing the ports (I'm on FreeBSD) for Perl 5.6.1 and Perl 5.8.2. You installed

Re: Query

2004-05-18 Thread Jose Alves de Castro
On Tue, 2004-05-18 at 07:36, Sudhindra Bhat wrote: > Hi > > Thanks. But there is a small issue. Considering the same example, the piece > of code sent by you prints 123456 which is not on the same line as "Test:" > But it doesn't print the characters 123456 ABCDEF which is on the same line > as "T

RE: Query

2004-05-18 Thread Sudhindra Bhat
Hi This doesn't seem to work. I get a blank output. But yes the output that is want is 123456 ABCDEF 123456 Regards, Sudhindra -Original Message- From: Jose Alves de Castro [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 18, 2004 3:55 PM To: Sudhindra Bhat Cc: Perl Beginners Subject: Re:

RE: Query

2004-05-18 Thread Jose Alves de Castro
In that case, with this: #!/usr/bin/perl -w use strict; while (<>) { if ( /Test:/ .. /Results:/ and !/Results:/ ) { if ( /Test:\s*/ ) { print $' } else { print if /./ } } } you can get that output ( run the script with the input file). HTH, jac On Tue, 2004-05-

RE: Query

2004-05-18 Thread Sudhindra Bhat
Thanks a million. It works perfectly. Regards, Sudhindra -Original Message- From: Jose Alves de Castro [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 18, 2004 5:01 PM To: Sudhindra Bhat Cc: Perl Beginners Subject: RE: Query In that case, with this: #!/usr/bin/perl -w use strict; while (

working directory with exec command

2004-05-18 Thread Peterson, Darren - Contractor.Westar
I'm trying to use fork and exec to kick-start other processes on a Linux box. As with Win32::Process::Create, I'd like to somehow specify or point towards a working directory for the new process since some data files are expected via relative path. I actually tried passing a compound command such

RE: working directory with exec command

2004-05-18 Thread Bob Showalter
Peterson, Darren - Contractor.Westar wrote: > I'm trying to use fork and exec to kick-start other processes on a > Linux box. As with Win32::Process::Create, I'd like to somehow > specify or point towards a working directory for the new process > since some data files are expected via relative pat

RE: working directory with exec command

2004-05-18 Thread Peterson, Darren - Contractor.Westar
To myself I'll offer a resounding "Duh!" Sometimes the simplest things are the hardest to see. Thanks very much! -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 18, 2004 7:02 AM To: 'Peterson, Darren - Contractor.Westar'; '[EMAIL PROTECTED]' Subject:

Re: Regular Expresssion - Matching over multiple lines

2004-05-18 Thread James Edward Gray II
On May 17, 2004, at 11:16 PM, Andrew Gaffney wrote: Roman Hanousek wrote: Hi All I have bunch of files that contain code like this: What I am trying to do is match then check that this piece of code contains a alt= tag. width="9" height="6" alt="${string

Re: coding sampling techniques in perl

2004-05-18 Thread JupiterHost.Net
N, Guruguhan (GEAE, Foreign National, EACOE) wrote: Hi All, Howdy :) I am trying to code Latin Hypercube Sampling and Sobol Sampling Sequences in Perl as a part of a tool we are developing here. I would like to know is there any references (standard codes developed) in Perl for the same

Re: h2xs newbie

2004-05-18 Thread JupiterHost.Net
Randy W. Sims wrote: JupiterHost.Net wrote: Jeff 'japhy' Pinyan wrote: On May 16, JupiterHost.Net said: So the first question is: To create the tar.gz file needed for upload to cpan I simply tar/gz ify the NewModule/ directory, correct? No. h2xs ... Foo::Bar cd Foo/Bar # make the module

Re: Regular Expresssion - Matching over multiple lines

2004-05-18 Thread Andrew Gaffney
James Edward Gray II wrote: On May 17, 2004, at 11:16 PM, Andrew Gaffney wrote: Roman Hanousek wrote: Hi All I have bunch of files that contain code like this: What I am trying to do is match then check that this piece of code contains a alt= tag. And if it doen't print the lines where it's m

DBD::Oracle and 64bit libraries

2004-05-18 Thread Michael . O'Neil
Hi, How can I get DBD::Oracle to compile and work with Oracle's 64bit libraries? The solution to the ELF error I received was to change all references to the 64bit libraries to 32bit. It worked but the developers would like to use 64bit libraries with DBD::Oracle. Tnx, Mike -- To unsubscribe

using Sleep instead of Cron

2004-05-18 Thread Motherofperls
Hi all, I'm writing a script which fetches data every hour. I thought instead of using cron which is platform dependent, to use sleep and a goto statement. Is there any downfalls to this? At the start of the script I check to see if it was ran in the previous hour. BEGINNING: if(open(TIMECHEC

Re: Regular Expresssion - Matching over multiple lines

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 9:30 AM, Andrew Gaffney wrote: Doesn't the 'gc' modified make the whole think not as greedy? As a side effect of continuation, doesn't it try to match as many times as possible? I'm not familiar with this, but my gut reaction is no. Perhaps on of the Regex experts can clear

Re: using Sleep instead of Cron

2004-05-18 Thread Jose Alves de Castro
On Tue, 2004-05-18 at 16:02, [EMAIL PROTECTED] wrote: > Hi all, > > I'm writing a script which fetches data every hour. I thought instead of > using cron which is platform dependent, to use sleep and a goto statement. Is > there any downfalls to this? Yes. With sleep, once the machine is res

Re: using Sleep instead of Cron

2004-05-18 Thread Jose Alves de Castro
On Tue, 2004-05-18 at 16:02, [EMAIL PROTECTED] wrote: > Hi all, > > I'm writing a script which fetches data every hour. I thought instead of > using cron which is platform dependent, to use sleep and a goto statement. Is > there any downfalls to this? Other downfalls: - Cron has automatic e-

Re: using Sleep instead of Cron

2004-05-18 Thread Wiggins d Anconia
> > Hi all, > > I'm writing a script which fetches data every hour. I thought instead of > using cron which is platform dependent, to use sleep and a goto statement. Is > there any downfalls to this? Sure, all of the differences between a one-off script and a constantly running program. cro

Re: using Sleep instead of Cron

2004-05-18 Thread Motherofperls
My main concern was that the script would die from SIGALARM. I'm testing on and XP box and using the script on a FreeBSD box. How can I get the cron function on my XP box? Also I have to get admin permission for cron jobs. Which I don't think will be a problem. It's not important that th

Re: using Sleep instead of Cron

2004-05-18 Thread Wiggins d Anconia
> > My main concern was that the script would die from SIGALARM. I'm testing on > and XP box and using the script on a FreeBSD box. How can I get the cron > function on my XP box? > In general this is a bad idea, aka developing/testing on a different platform than where it will run eventuall

RE: using Sleep instead of Cron

2004-05-18 Thread Bob Showalter
Wiggins d Anconia wrote: > cron can be installed as part of the Cygwin distro, not sure about > other ways. The M$ products come with a scheduler as well, but you > have now exhausted my knowledge of it ;-) The MS "at" service blows huge chunks. There is a cron for Windows at http://cronw.so

Re: Regular Expresssion - Matching over multiple lines

2004-05-18 Thread Jeff 'japhy' Pinyan
On May 18, James Edward Gray II said: >On May 18, 2004, at 9:30 AM, Andrew Gaffney wrote: > >> Doesn't the 'gc' modified make the whole think not as greedy? As a >> side effect of continuation, doesn't it try to match as many times as >> possible? > >I'm not familiar with this, but my gut reaction

Re: combining data from more than one file...

2004-05-18 Thread Michael Robeson
Ok great. Most of what you show does make sense. However, there are some bits of code that I need further clarification with. Some bits I am able to tell what they are doing but I do not quite know how or why they work they way they do. I'll state these areas in the code we've got together at t

Perl Newbie Question

2004-05-18 Thread Perl Mail User
Hello All, I have a question, I am looking to read the name of the file that I am passing as an argument to the perl script through the while (<>) part of the script. Example: perl script.pl 1.txt 2.txt 3.txt Each file has information that I am parsing to put into a report but I need to get th

Re: Perl Newbie Question

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 1:10 PM, Perl Mail User wrote: Hello All, I have a question, I am looking to read the name of the file that I am passing as an argument to the perl script through the while (<>) part of the script. You're looking for the $ARGV variable. It contains the filename you need. Hop

RE: Perl Newbie Question

2004-05-18 Thread Bob Showalter
Perl Mail User wrote: > Hello All, Hi. Providing a real name would be considered polite. Also, please choose a meaningful subject. > > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part > of > the script

Re: Perl Newbie Question

2004-05-18 Thread Paul Johnson
On Tue, May 18, 2004 at 01:10:27PM -0500, Perl Mail User wrote: > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part of > the script. $ARGV perldoc perlvar -- Paul Johnson - [EMAIL PROTECTED] http://

CGI radio group help

2004-05-18 Thread John Pretti
All, I have been viewing the documentation for CGI.pm in hopes to use the radio_group function. According to the docs my code appears to be correct. Here is a sample and the error, can someone please help? I am sure this is a simple fix. Note - I am an absolute perl n00b with no programming exper

RE : Perl Newbie Question

2004-05-18 Thread Jose Nyimi
> -Message d'origine- > De : Perl Mail User [mailto:[EMAIL PROTECTED] > Envoyé : mardi 18 mai 2004 20:10 > À : [EMAIL PROTECTED] > Objet : Perl Newbie Question > > Hello All, > > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl

Re: combining data from more than one file...

2004-05-18 Thread Ramprasad A Padmanabhan
Quite a unique case. If your data is no very huge I would suggest, you just first keep on reading all data into a huge has ( key as the animal value as the data) and then just print out the hash into files like ( writing pseudo code is easier if written in perl :-) ) my @files = qw(file1 file2 fi

Module to validate credit cards

2004-05-18 Thread Mike Blezien
Hello, can someone recommend a decent perl module or a reliabe routine to check credit cards and expiration dates formats... not to actual check if the card is valid, stolen,... etc, but just the format for the common cards used today. TIA -- MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= T

RE: Module to validate credit cards

2004-05-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Mike Blezien wrote: > Hello, > > can someone recommend a decent perl module or a reliabe routine to > check credit cards and expiration dates formats... not to actual > check if the card is valid, stolen,... etc, but just the format for > the common cards used today. Go to CPAN Search and

RE : Module to validate credit cards

2004-05-18 Thread Jose Nyimi
> -Message d'origine- > De : Mike Blezien [mailto:[EMAIL PROTECTED] > Envoyé : mardi 18 mai 2004 21:32 > À : Perl List > Objet : Module to validate credit cards > > Hello, > > can someone recommend a decent perl module or a reliabe routine to check > credit > cards and expiration dates

Re: RE : Module to validate credit cards

2004-05-18 Thread Mike Blezien
Thx's, I'll check it out. Mike Jose Nyimi wrote: -Message d'origine- De : Mike Blezien [mailto:[EMAIL PROTECTED] Envoyé : mardi 18 mai 2004 21:32 À : Perl List Objet : Module to validate credit cards Hello, can someone recommend a decent perl module or a reliabe routine to check credit car

bytes to array speed problems

2004-05-18 Thread Niels Larsen
Greetings, Three small questions, 1. I fetch a byte string from file with, sysread $bin_fh, $bytstr, $length; The byte string contains a run of integers that I would like to have access to. I get that access with @array = unpack "n*", $bytstr; But this last operation, all in memory,

Re: CGI radio group help

2004-05-18 Thread Jeff 'japhy' Pinyan
On May 18, John Pretti said: ># Create New CGI Object >my $q = new CGI; > ># print form >print $q->header, >$q->start_html, >$q->br, >$q->start_multipart_form, >$q->p("Select a promotion directory:"), Here's your first problem: > %label = ('hw'=>'..su

Re: Query

2004-05-18 Thread John W. Krahn
Sudhindra Bhat wrote: > > Hi Hello, > This doesn't seem to work. I get a blank output. But yes the output that is > want is > > 123456 ABCDEF > 123456 while ( ) { next unless /\S/; if ( s/^.*?Test:\s*// .. /Results:/ and !/Results:/ ) { print } } John -- use Pe

Re: Newbie: Perl reg. expression

2004-05-18 Thread John W. Krahn
Durai wrote: > > Hello All, Hello, > open FILE, "test.txt" or die "Can't open file!: $!"; > while( ) > { > print if /(\d+\.\d+\.\d+\.\d)/; > } > close FILE; > > It gives the following output: > > # prevent Apache from glomming onto all bound IP addresses (0.0.0.0) > #Listen 12.3

Re: RE : Module to validate credit cards

2004-05-18 Thread Owen
On Tue, 18 May 2004 22:07:16 +0200 "Jose Nyimi" <[EMAIL PROTECTED]> wrote: > I discovered Business::CreditCard > http://search.cpan.org/~ivan/Business-CreditCard-0.27/CreditCard.pm That's a fine module, but you might want to have a separate list of dummy numbers that are valid but used for test

Re: Image editing/Creating modules

2004-05-18 Thread Ramprasad A Padmanabhan
use GD; Hope you are able to install on your machine Ram On Tue, 2004-05-18 at 10:37, [EMAIL PROTECTED] wrote: > can someone give a name of any image (JPG or GIF) editing / creating module, which > allow to create images to display on web pages on the fly by CGI scripts. > > > Rakhitha M. Karu

@UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Jason Dusek
Hi, Is there an easy way to get all the unique elements of an array? i.e. is there some module or function that does that sort of thing? -- -- Jason Dusek ("`-''-/").___..--''"`-._ -- | `6_ 6 ) `-. ( ).`-.__.`) -- | (_Y_.)' ._ ) `._ `. ``-..-' -- |

Re: Image editing/Creating modules

2004-05-18 Thread LRMK
Nope - It gave a error when I try to make it some sort of a fatel error. Thankx .. Any way I installed PERLMagick with ImageMagick so I am going to use it. Ithink there is a bug in ImageMagick when I try to load a image from a perl file handle Windows says that perl.exe performed an ilegal opera

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 9:14 PM, Jason Dusek wrote: Hi, Is there an easy way to get all the unique elements of an array? i.e. is there some module or function that does that sort of thing? There are excellent modules to handle this, but it's also pretty simple to roll your own in most cases: sub uni

Possible OT: Site Spiders?

2004-05-18 Thread Lone Wolf
I need a site spider to stay in the same domain, but follow all links (saving all files encountered) for saving an entire business site. I have been looking around but have not found the one I am looking for, can anyone help? It can be PERL or Windows or PHP, it just needs to be locked to the sam

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Randy W. Sims
On 5/18/2004 10:46 PM, James Edward Gray II wrote: On May 18, 2004, at 9:14 PM, Jason Dusek wrote: Hi, Is there an easy way to get all the unique elements of an array? i.e. is there some module or function that does that sort of thing? There are excellent modules to handle this, but it's also pre

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Randy W. Sims
On 5/18/2004 11:00 PM, Randy W. Sims wrote: sub uniq { return keys %{{ map { $_, 1 } @_ }} } Sorry for the nice formatting, that should have been: sub uniq{keys%{{map{$_,[EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Possible OT: Site Spiders?

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 9:54 PM, Lone Wolf wrote: I need a site spider to stay in the same domain, but follow all links (saving all files encountered) for saving an entire business site. I have been looking around but have not found the one I am looking for, can anyone help? It can be PERL or Windows

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Jason Dusek
What modules handle this? I have been digging around in CPAN all day... -- -- Jason Dusek ("`-''-/").___..--''"`-._ -- | `6_ 6 ) `-. ( ).`-.__.`) -- | (_Y_.)' ._ ) `._ `. ``-..-' -- | _..`--'_..-_/ /--'_.' ,' -- | (il),-''

Re: Possible OT: Site Spiders?

2004-05-18 Thread Gabino Travassos
> I need a site spider to stay in the same domain, but follow all links > (saving all files encountered) for saving an entire business site. I > have been looking around but have not found the one I am looking for, > can anyone help? It can be PERL or Windows or PHP, it just needs to be > locked

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 10:12 PM, Jason Dusek wrote: What modules handle this? I have been digging around in CPAN all day... Searching the CPAN for "array unique", the first match is the super cool Tie::Array::Unique. http://search.cpan.org/~pinyan/Tie-Array-Unique-0.01/Unique.pm Hope that helps. Jam

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Jeff 'japhy' Pinyan
On May 18, James Edward Gray II said: >On May 18, 2004, at 10:12 PM, Jason Dusek wrote: > >> What modules handle this? I have been digging around in CPAN all day... > >Searching the CPAN for "array unique", the first match is the super >cool Tie::Array::Unique. > >http://search.cpan.org/~pinyan/Ti

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Ramprasad A Padmanabhan
On Wed, 2004-05-19 at 08:35, Randy W. Sims wrote: > On 5/18/2004 11:00 PM, Randy W. Sims wrote: > > sub uniq { return keys %{{ map { $_, 1 } @_ }} } > > Sorry for the nice formatting, that should have been: > > sub uniq{keys%{{map{$_,[EMAIL PROTECTED] > > Are u sure that works ? I just wrote

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Jeff 'japhy' Pinyan
On May 19, Ramprasad A Padmanabhan said: >#!/usr/bin/perl > >my @arr = qw(a b c d a b e f ); >print join(" " , sort @arr) . "\n" . '#' x 50 . "\n"; >print join(" " , sort (uniq (@arr))) . "\n"; >exit 0; >sub uniq{keys%{{map{$_,[EMAIL PROTECTED] Perl is not sorting the return values of the uniq()

Re: @UNIQUE=unique(@REDUNDANT);

2004-05-18 Thread Randy W. Sims
On 5/19/2004 12:30 AM, Ramprasad A Padmanabhan wrote: On Wed, 2004-05-19 at 08:35, Randy W. Sims wrote: On 5/18/2004 11:00 PM, Randy W. Sims wrote: sub uniq { return keys %{{ map { $_, 1 } @_ }} } Sorry for the nice formatting, that should have been: sub uniq{keys%{{map{$_,[EMAIL PROTECTED] Are u

Query

2004-05-18 Thread Sujana_Setty
I am using the below command awk -F: ' $3 ~/bharghav/ { print $0 } ' data.file but this command produces both Vijayb:12345:Vijay B bharghav vijaya:12347:vijaya bharghavi what to if I want only record containing exactly the word "bharghav" that is Vijayb:12345:Vijay B bharghav -Original Me

Perl Coding Standarts

2004-05-18 Thread Marcos . Rebelo
I'm looking for Perl coding standards. I found some in the net but seems they are just web pages not really in use. I was looking for really in use perl coding standards and some opinions about them. I would also like to know if there is tools checking for this standards. For know I'm using 'per