Re: while reading 'mastering perl' @+ and @-, not too clear on this

2008-03-18 Thread John W. Krahn
Richard Lee wrote: Thanks John for detailed explanation!! I just dont' understand why \ (also didn't know that within [ ], \ has to be escaped.) needs to be watch out for within " " .. \ use can be tricky, for example: $ perl -le"print 'hello'" hello $ perl -le"print 'he\llo'" he\llo $ perl

Re: context?

2008-03-18 Thread Gunnar Hjalmarsson
John W. Krahn wrote: In the case of: my_function "foo", "bar"; my_function is a list operator which has a very low precedence so the parentheses are not required. Sometimes, i.e. if the sub is not predeclared, they are required. C:\home>type test.pl my_function "foo", "bar"; sub my_function

Re: context?

2008-03-18 Thread John W. Krahn
Joel wrote: when calling functions, we need not include parantheses, and we're still able to pass a list.. like for eg: my_function "foo", "bar"; #this copies foo and bar into @_ of my_function. but alternately the same assignment like @_ = "foo", "bar"; will omit "bar" from the list.. why is

Re: Using Perl to parse comma diliminated fields ---

2008-03-18 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: I have a regular'ol ASCII file which I'll need to read only the first line, and parse the three numbers that are seperated by commas and print the results. How do I go about opening this file, reading the first line, parsing the three numbers into variables, This

Re: Using Perl to parse comma diliminated fields ---

2008-03-18 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hey Perl Guru's:) I'm hoping that someone can help me out... I have a regular'ol ASCII file which I'll need to read only the first line, and parse the three numbers that are seperated by commas and print the results. This file will always consist of the same lines, but t

Re: Loop within Loop

2008-03-18 Thread hridyesh pant
you can use hash,where key is the column and value is the refrence to an array,and this array can contain multiple data. --Hridyesh Gunnar Hjalmarsson wrote: Bobby wrote: I have a text file with five colums of data (ColumA-E). Within each column there could be multiple data with a comma seper

Using Perl to parse comma diliminated fields ---

2008-03-18 Thread google
Hey Perl Guru's:) I'm hoping that someone can help me out... I have a regular'ol ASCII file which I'll need to read only the first line, and parse the three numbers that are seperated by commas and print the results. This file will always consist of the same lines, but the numbers will be differen

context?

2008-03-18 Thread Joel
when calling functions, we need not include parantheses, and we're still able to pass a list.. like for eg: my_function "foo", "bar"; #this copies foo and bar into @_ of my_function. but alternately the same assignment like @_ = "foo", "bar"; will omit "bar" from the list.. why is this? Thanks,

Re: xml::twig help

2008-03-18 Thread Rob Dixon
Ken Foskey wrote: > For the record on a more complex script than the address one... xml:simple 7 hours plus on very quick machine, still running and absolutely hammering the system, 1.3 Gig of memory used. xml::twig 1 hour on laptop (underpowered and not much memory), Linux still usable whil

Re: Loop within Loop

2008-03-18 Thread John W. Krahn
Bobby wrote: I have a text file with five colums of data (ColumA-E). Within each column there could be multiple data with a comma seperating each piece of data. How do i white a loop to parse through the data set and assign each column a variable and each piece of data within that column a differ

Re: Loop within Loop

2008-03-18 Thread Gunnar Hjalmarsson
Bobby wrote: I have a text file with five colums of data (ColumA-E). Within each column there could be multiple data with a comma seperating each piece of data. How do i white a loop to parse through the data set and assign each column a variable and each piece of data within that column a differ

Loop within Loop

2008-03-18 Thread Bobby
I have a text file with five colums of data (ColumA-E). Within each column there could be multiple data with a comma seperating each piece of data. How do i white a loop to parse through the data set and assign each column a variable and each piece of data within that column a different variable?

Re: flock - exclusive file locking

2008-03-18 Thread Chas. Owens
On Mon, Mar 17, 2008 at 4:47 PM, Dermot <[EMAIL PROTECTED]> wrote: snip > print $fh $status."\n"; > print STDERR "$0: $! $?\n"; snip $? holds the status returned by the last external call (call to system() function, pipes, qx// operator, call to wait() or waitpid(),

Re: xml::twig help

2008-03-18 Thread ken Foskey
For the record on a more complex script than the address one... xml:simple 7 hours plus on very quick machine, still running and absolutely hammering the system, 1.3 Gig of memory used. xml::twig 1 hour on laptop (underpowered and not much memory), Linux still usable while running. Definitely

RE: FW: How to install Date::Manip on cygwin perl?

2008-03-18 Thread Bob McConnell
I have always avoided the "Program Files" default directory when installing anything with a Unix flavor to it. For Perl, everything gets installed at "D:\perl", just to avoid this problem. Even Microsoft applications don't all know how to handle paths with spaces. It was not one of their better inn

Re: FW: How to install Date::Manip on cygwin perl?

2008-03-18 Thread Gunnar Hjalmarsson
Siegfried Heintze (Aditi) wrote: It looks like the CPAN program does not anticipate paths with spaces in them. So it seems. You may want to try other methods to install the module. http://search.cpan.org/src/SBECK/Date-Manip-5.48/INSTALL -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-b

problem running Devel::ptkdb

2008-03-18 Thread ANJAN PURKAYASTHA
i installed Tk and Devel::ptkdb on my mac. a test run of ptkdb gave me the following error: couldn't connect to display ":0" at /Library/Perl/5.8.6/darwin-thread-multi-2level/Tk/MainWindow.pm line 55. MainWindow->new() at /System/Library/Perl/5.8.6/Devel/ptkdb.pm line 1147 Can't call method "setup_

RE: How to install Date::Manip on cygwin perl?

2008-03-18 Thread Siegfried Heintze (Aditi)
Can someone advise me as to where I should put the quotes? All I did was type perl -MCPAN -e 'install Date::Manip' Somewhere the is a perl script that needs to be edited. Can someone tell me what script this is? Thanks, Siegfried -Original Message- From: Mike Wohlrab [mailto:[EMAIL PROT

Re: Client-Server Architecture script

2008-03-18 Thread Anirban Adhikary
Dear List I have a question regarding this client - server script. I am using two modules in my script . One is IO::Socket and another is IO::Select. Now my question is if I want to implement an architecture so that client script will send a command to the server* [*which doesn't require root priv

Re: xml::twig help

2008-03-18 Thread Rob Dixon
Ken Foskey wrote: On Tue, 2008-03-18 at 00:55 +1100, Ken Foskey wrote: I am extracting addresses from an XML file to process through other programs using pipe delimiter the following code works but this is going to get 130,000 records through it it must be very efficient and I cannot follow the

Re: Hash & CSV

2008-03-18 Thread Rob Dixon
JBallinger wrote: > On Mar 14, 3:26 pm, [EMAIL PROTECTED] (Manoj) wrote: >> When using Data: Dumper is taking more time for my 1 lines of CSV file. This solved a few queries...and the benchmark was a new value addition for me. Thanks 2) Is there any optimal method for reading a CSV fi

Re: while reading 'mastering perl' @+ and @-, not too clear on this

2008-03-18 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: Took your advice and start to read 'Mastering regular expression' by Jeffrey E.F.Friedl, Can you explain below further? on page, 205 push(@fields, $+) while $text =~ m{ "([^\"\\]*(?:\\.[^\"\\]*)*)",? #standard quoted string(with possible co

Re: Hash & CSV

2008-03-18 Thread Prabu Ayyappan
- Original Message From: JBallinger <[EMAIL PROTECTED]> To: beginners@perl.org Sent: Monday, March 17, 2008 9:18:12 PM Subject: Re: Hash & CSV On Mar 14, 3:26 pm, [EMAIL PROTECTED] (Manoj) wrote: > When using Data: Dumper is taking more time for my 1 lines of CSV file. > This solved a

Re: while reading 'mastering perl' @+ and @-, not too clear on this

2008-03-18 Thread John W. Krahn
Richard Lee wrote: Took your advice and start to read 'Mastering regular expression' by Jeffrey E.F.Friedl, Can you explain below further? on page, 205 push(@fields, $+) while $text =~ m{ "([^\"\\]*(?:\\.[^\"\\]*)*)",? #standard quoted string(with possible comma) | ([^,]+),?