read multiple csv files into array, do some math

2008-11-19 Thread Graham Saathoff
Hey all, I'll start by saying that I'm a complete beginner with perl, and while I've done some shell scripting, my experience doing programming / scripting work is pretty limited. I have several hundred csv files containing a mix of comma separated strings and numbers. Fortunately, they're all u

Re: perl compilation issue - using global variable

2008-11-19 Thread Mr. Shawn H. Corey
On Thu, 2008-11-20 at 10:23 +0530, ashish nainwal wrote: > I want to compile a perl script because I want to run it on systems > which > dont have perl installed. > Does creating an executable solve this purpose? If yes, then how can I > do > that? All versions of Linux, BSD and UNIX come with Per

Re: what was the name of the new perl site which had link to all perl journal published.. in pdf format somebody posted that before here

2008-11-19 Thread Richard Lee
Chas. Owens wrote: On Wed, Nov 19, 2008 at 22:48, Richard Lee <[EMAIL PROTECTED]> wrote: please help.. Is this what you are looking for? http://www.perlmonks.org/index.pl?node_id=711609 exactly!! thank you -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: what was the name of the new perl site which had link to all perl journal published.. in pdf format somebody posted that before here

2008-11-19 Thread Chas. Owens
On Wed, Nov 19, 2008 at 22:48, Richard Lee <[EMAIL PROTECTED]> wrote: > please help.. Is this what you are looking for? http://www.perlmonks.org/index.pl?node_id=711609 -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail

what was the name of the new perl site which had link to all perl journal published.. in pdf format somebody posted that before here

2008-11-19 Thread Richard Lee
please help.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Regular expression problem

2008-11-19 Thread Rob Dixon
Rob Coops wrote: > On Tue, Nov 18, 2008 at 9:52 AM, howa <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I have two strings: >> >> 1. abc >> 2. abc& >> >> >> The line of string might end with "&" or not, so I use the expression: >> >> (.*)[$&] >> >> Why it didn't work out? > > This does not work bec

Re: Million hash comparisons

2008-11-19 Thread Rob Dixon
Jenda Krynicky wrote: > From: Nitin Kalra <[EMAIL PROTECTED]> >> >> In a Perl script of mine I have to compare 2 8M-10M >> files(each). Which mean 80-90M searches. As a normal >> procedure (upto 1 M)I use hashes, but going beyond 1M >> system performance degrades drastically. > > You mean you comp

Re: Million hash comparisons

2008-11-19 Thread Jenda Krynicky
From: Nitin Kalra <[EMAIL PROTECTED]> > Hi Community, > > In a Perl script of mine I have to compare 2 8M-10M > files(each). Which mean 80-90M searches. As a normal > procedure (upto 1 M)I use hashes, but going beyond 1M > system performance degrades drastically. You mean you compute MD5 (or some

Re: Unexpected Behavior in try/catch

2008-11-19 Thread Chas. Owens
On Wed, Nov 19, 2008 at 18:04, Dr.Ruud <[EMAIL PROTECTED]> wrote: > "Chas. Owens" schreef: > >> eval { snip >> } >> if ($@) { snip >> }; snip Of course it would also be a good idea to move the useless semi-colon from the if up to the eval. That is what I get for not testing the code outside the b

Re: Unexpected Behavior in try/catch

2008-11-19 Thread Dr.Ruud
"Chas. Owens" schreef: > eval { >$sql = qq { >INSERT INTO table ( >field1, >field2, >field3, >field4, >field5 >) >VALUES (

Re: Million hash comparisons

2008-11-19 Thread Dr.Ruud
Nitin Kalra schreef: > In a Perl script of mine I have to compare 2 8M-10M > files(each). Which mean 80-90M searches. As a normal > procedure (upto 1 M)I use hashes, but going beyond 1M > system performance degrades drastically. > > If anybody has faced something like this then plz > share the sa

no output Net::SSH2

2008-11-19 Thread monnappa appaiah
Hi All, I have written 2 codes using "Net::SSH2" module which will connect to remote machine (linux), execute commands and give me the output...i'm running the script on my windows machine (win xp)..The problem is when i run this script i don't get any ouput and i also don't get any

Re: Million hash comparisons

2008-11-19 Thread Rob Dixon
Nitin Kalra wrote: > > In a Perl script of mine I have to compare 2 8M-10M > files(each). Which mean 80-90M searches. As a normal > procedure (upto 1 M)I use hashes, but going beyond 1M > system performance degrades drastically. > > If anybody has faced something like this then plz > share the sa

Re: Million hash comparisons

2008-11-19 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > On Wed, 2008-11-19 at 18:30 +, Nitin Kalra wrote: >> >> In a Perl script of mine I have to compare 2 8M-10M >> files(each). Which mean 80-90M searches. As a normal >> procedure (upto 1 M)I use hashes, but going beyond 1M >> system performance degrades drastically. >>

Re: Million hash comparisons

2008-11-19 Thread Mr. Shawn H. Corey
On Wed, 2008-11-19 at 18:30 +, Nitin Kalra wrote: > Hi Community, > > In a Perl script of mine I have to compare 2 8M-10M > files(each). Which mean 80-90M searches. As a normal > procedure (upto 1 M)I use hashes, but going beyond 1M > system performance degrades drastically. > > If anybody ha

Million hash comparisons

2008-11-19 Thread Nitin Kalra
Hi Community, In a Perl script of mine I have to compare 2 8M-10M files(each). Which mean 80-90M searches. As a normal procedure (upto 1 M)I use hashes, but going beyond 1M system performance degrades drastically. If anybody has faced something like this then plz share the same. BR/Nitin

Re: Unexpected Behavior in try/catch

2008-11-19 Thread Chas. Owens
On Wed, Nov 19, 2008 at 06:06, Rob Wilkerson <[EMAIL PROTECTED]> wrote: > The truth is that I know enough Perl to get by when I absolutely have > to use it, so maybe this is the correct behavior, but having never > seen it in any other language, I thought I'd post the question to the > group and ma

error when using net::SSH::perl

2008-11-19 Thread monnappa appaiah
Hi All, I wanted to write a script which could login to a remote machine and execute commands and give me the output, so i used Net::SSH::Perl module on my windows xp machine after running the script i get the this error "mkdir C:/: Invalid argument; The filename, directory name, or

Re: Need Help

2008-11-19 Thread Chas. Owens
On Wed, Nov 19, 2008 at 10:08, Rob Dixon <[EMAIL PROTECTED]> wrote: > Chas. Owens wrote: >> On Sun, Nov 16, 2008 at 09:11, a b <[EMAIL PROTECTED]> wrote: >>> Hi , >>> Can any body tells me what do we mean by below code >>> >>> $ROUTE::COMM{NEWROUTE}{OS()} >>> >>> >>> Thanks in Advance >>> a b . >

Re: removing files in unix or linux using glob?

2008-11-19 Thread Richard Lee
Mr. Shawn H. Corey wrote: for my $file ( glob( '/tmp/yahoo.*' ) ){ unlink $file if -f $file; } See: * perldoc -f unlink * perldoc -f glob * perldoc perlfunc and search for -f under "Alphabetical Listing of Perl Functions" thanks, I tried if ( -f q#/tmp/# ) {

Re: removing files in unix or linux using glob?

2008-11-19 Thread Mr. Shawn H. Corey
On Wed, 2008-11-19 at 12:12 -0500, Richard Lee wrote: > I thought I could do this, > > if ( -f q#/tmp/yahoo.* ) { > system("rm -rf /tmp/yahoo.*"); > } > > what am i missing? > for my $file ( glob( '/tmp/yahoo.*' ) ){ unlink $file if -f $file; } See: * perldoc -f unlink *

Re: removing files in unix or linux using glob?

2008-11-19 Thread Paul Johnson
On Wed, Nov 19, 2008 at 12:12:50PM -0500, Richard Lee wrote: > I thought I could do this, > > if ( -f q#/tmp/yahoo.* ) { >system("rm -rf /tmp/yahoo.*"); > } > > what am i missing? A hash, the glob() function, or perhaps just that the test is superfluous. -- Paul Johnson - [EMAIL PROTECTE

removing files in unix or linux using glob?

2008-11-19 Thread Richard Lee
I thought I could do this, if ( -f q#/tmp/yahoo.* ) { system("rm -rf /tmp/yahoo.*"); } what am i missing? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: perl compilation issue - using global variable

2008-11-19 Thread Mr. Shawn H. Corey
On Wed, 2008-11-19 at 04:03 -0800, ashish wrote: > Can someone please tell me how to compile a perl script which is > calling global variables and then how should the executable be used? > There is no need to compile a Perl script. To run it, call it with perl: perl ftp.pl Or you can make it

Re: printing element from a 'split' file

2008-11-19 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi, Hello, I am trying to split a file (where there are one or more spaces) that I am getting through a file handle that is fed into an array and then printing each element of the array on a seperate line. Here's what I have: As you can probably figure out I only ge

perl compilation issue - using global variable

2008-11-19 Thread ashish
Hi Can someone please tell me how to compile a perl script which is calling global variables and then how should the executable be used? I have created a AIX shell script (tool.sh) that parses a couple of files to export few global variables and then shows the end result. Now i call these variabl

Re: Regular expression problem

2008-11-19 Thread howa
Hello On Nov 18, 8:18 pm, [EMAIL PROTECTED] (Rob Coops) wrote: > If you want to capture both lines you end up doing > somehting like this: (.*)&{0,1}$ Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: xml question for xml::twig

2008-11-19 Thread Rob Dixon
Richard Lee wrote: > Richard Lee wrote: >>> I think I made a mistake .. this is now working... >>> >>> >> V="baz">1000yes50no>> >>> value="disabled"/>>> country="Russia" id="kingtony">>> value="none"/>>> value="ohio_usa">>> >>> active="true" country="japan" id="queensarah">>> type="dictator"/>>

RE: CPAN question

2008-11-19 Thread Stewart Anderson
> -Original Message- > From: Kevin Murphy [mailto:[EMAIL PROTECTED] > Sent: 18 November 2008 19:14 > To: beginners@perl.org > Subject: CPAN question > > Hi, > > I'm a system administrator, not a programmer, and my only experience > with Perl is setting up and maintaining a Bugzilla instal

Re: HTML Stipper with an option for directories and multiple files

2008-11-19 Thread cc96ai
Use: - HTML::Parser to parse - File::Find to loop the directory and file -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Unexpected Behavior in try/catch

2008-11-19 Thread Rob Wilkerson
The truth is that I know enough Perl to get by when I absolutely have to use it, so maybe this is the correct behavior, but having never seen it in any other language, I thought I'd post the question to the group and maybe learn something. I have a scenario where I need to try to insert a record i

Re: Need Help

2008-11-19 Thread Rob Dixon
Chas. Owens wrote: > On Sun, Nov 16, 2008 at 09:11, a b <[EMAIL PROTECTED]> wrote: >> Hi , >> Can any body tells me what do we mean by below code >> >> $ROUTE::COMM{NEWROUTE}{OS()} >> >> >> Thanks in Advance >> a b . >> > > No, there is not enough context for me to know why this code is being >

Re:printing element from a 'split' file

2008-11-19 Thread Jeff Pang
> Message du 19/11/08 15:37 > De : "[EMAIL PROTECTED]" > A : beginners@perl.org > Copie à : > Objet : printing element from a 'split' file > > while () { > chomp; > split /\s+/, @_; > print "$_\n"; > } > That probably should be: while() {     chomp;     my @elements = split;     pr

CPAN question

2008-11-19 Thread Kevin Murphy
Hi, I'm a system administrator, not a programmer, and my only experience with Perl is setting up and maintaining a Bugzilla installation on an Ubuntu LAMP server. I am now attempting to integrate our Active Directory with Request-Tracker to give it a test run but have gotten stuck in the mud wit

printing element from a 'split' file

2008-11-19 Thread mark.baumeist...@gmail.com
Hi, I am trying to split a file (where there are one or more spaces) that I am getting through a file handle that is fed into an array and then printing each element of the array on a seperate line. Here's what I have: As you can probably figure out I only get each element outputed in a single li

Re: Quoting hash keys changes things sometimes

2008-11-19 Thread Rob Dixon
Dr.Ruud wrote: > Rob Dixon schreef: >> Kelly Jones: >>> >>> Consider: >>> >>> perl -le '$hash{"foo-bar"} = 1; print $hash{foo-bar}' >>> [no result] >>> >>> perl -le '$hash{"foobar"} = 1; print $hash{foobar}' >>> 1 >>> >>> I sort of understand this: in the first script, Perl treats foo-bar >>> as a