Re: reference to array of hashes in OOP

2007-07-11 Thread Paul Lalli
On Jul 11, 3:33 pm, [EMAIL PROTECTED] (Inventor) wrote: > the program gets a run-time error, and I don't know which error > message it is because the module is used in a CGI program and I don't > know how to get at the error messages. If you have access to the server logs, check them. If not, ad

Re: reference to array of hashes in OOP

2007-07-11 Thread Inventor
On Jul 11, 5:09 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote: > Inventor wrote: > > Hi, > > > I would like to make a perl module with an array of hashes as the data > > structure, but I am having trouble with the references. I have > > declared the data structure in the constructor as follows:

Re: Search and Replace

2007-07-11 Thread Mr. Shawn H. Corey
Joseph L. Casale wrote: Paul, Reading the perlre doc I am starting to understand this line: $line =~ s/(\S+)\s+(\S+)\s+(\S+)/X$1 Y$2 Z$3/; I have a few questions. 1. What is the tilde for? From `perldoc perlop`: Binding Operators Binary "=~" binds a scalar expression to a patte

RE: Search and Replace

2007-07-11 Thread Joseph L. Casale
Paul, Reading the perlre doc I am starting to understand this line: $line =~ s/(\S+)\s+(\S+)\s+(\S+)/X$1 Y$2 Z$3/; I have a few questions. 1. What is the tilde for? 2. I see you built a pattern to search for consisting of a non-whitespace followed by a whitespace followed by a non etc. I see the

Re: Search and Replace

2007-07-11 Thread Rob Dixon
Joseph L. Casale wrote: Hi, Know that I am learning perl, I am expected to use it at work :) Problem is I am still to green for the current problem I have. The data is always left justified and has a space between each value. I have a text file of about ~500 lines like this: -11.67326 23.95923

Re: read file

2007-07-11 Thread Rob Dixon
jeniffer wrote: I have a file of the format action arg1 \ arg2 \ arg3 \ action2 arg1 \ arg2 \ arg3 \ I read this by :- foreach $line (@lines) { ($action , @argument_list) = split(/\s+/,$line); This would work fine if the file is of the format ac

Re: reference to array of hashes in OOP

2007-07-11 Thread Mr. Shawn H. Corey
Inventor wrote: Hi, I would like to make a perl module with an array of hashes as the data structure, but I am having trouble with the references. I have declared the data structure in the constructor as follows: my $self = ({}); my $self = []; and blessed it with: bless ($self

reference to array of hashes in OOP

2007-07-11 Thread Inventor
Hi, I would like to make a perl module with an array of hashes as the data structure, but I am having trouble with the references. I have declared the data structure in the constructor as follows: my $self = ({}); and blessed it with: bless ($self, $class_name); but when I try to acce

RE: Search and Replace

2007-07-11 Thread Joseph L. Casale
Wow, both examples from both posters were great! Paul, thanks for the explanation!! I'll start playing :) I suppose the fileIO part will be easy? I am just at perldoc right now! Jlc -Original Message- From: Paul Lalli [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 12:30 PM To:

Re: Search and Replace

2007-07-11 Thread Paul Lalli
On Jul 11, 1:50 pm, [EMAIL PROTECTED] (Joseph L. Casale) wrote: > Hi, > Know that I am learning perl, I am expected to use it at work :) > Problem is I am still to green for the current problem I have. The data is > always left justified and has a space between each value. > > I have a text file o

RE: Search and Replace

2007-07-11 Thread Moon, John
From: Joseph L. Casale [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 1:51 PM To: beginners@perl.org Subject: Search and Replace Hi, Know that I am learning perl, I am expected to use it at work :) Problem is I am still to green for the current problem I have. The data is always left ju

Search and Replace

2007-07-11 Thread Joseph L. Casale
Hi, Know that I am learning perl, I am expected to use it at work :) Problem is I am still to green for the current problem I have. The data is always left justified and has a space between each value. I have a text file of about ~500 lines like this: -11.67326 23.95923 0.4617566 5.075023 24.2793

Re: read file

2007-07-11 Thread Chas Owens
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote: > On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote: > snip > > my $rec = ''; > > while (<>) { > > if (/\\$/) { #if line is a continuation > > chop; #remove the continuation character >

Re: read file

2007-07-11 Thread Chas Owens
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip > my $rec = ''; > while (<>) { > if (/\\$/) { #if line is a continuation > chop; #remove the continuation character > $rec .= $_; > next; > } > my @rec = sp

Re: read file

2007-07-11 Thread Chas Owens
On 7/11/07, Chas Owens <[EMAIL PROTECTED]> wrote: snip my $rec = ''; while (<>) { if (/\\$/) { #if line is a continuation chop; #remove the continuation character $rec .= $_; next; } my @rec = split ' ', $rec; $rec = ''; #do stuff with @rec } snip Who

Re: read file

2007-07-11 Thread Chas Owens
On 7/11/07, jeniffer <[EMAIL PROTECTED]> wrote: I have a file of the format action arg1 \ arg2 \ arg3 \ action2 arg1 \ arg2 \ arg3 \ I read this by :- foreach $line (@lines) { ($action , @argument_list) = split(/\s+/,$line); This would work fine

Re: read file

2007-07-11 Thread Tom Phoenix
On 7/11/07, jeniffer <[EMAIL PROTECTED]> wrote: I have a file of the format action arg1 \ arg2 \ arg3 \ action2 arg1 \ arg2 \ arg3 \ In other words, some of the file's "lines" are more than a single line each; a continued line ends with a backslash. Per

read file

2007-07-11 Thread jeniffer
I have a file of the format action arg1 \ arg2 \ arg3 \ action2 arg1 \ arg2 \ arg3 \ I read this by :- foreach $line (@lines) { ($action , @argument_list) = split(/\s+/,$line); This would work fine if the file is of the format action arg1

Re: How to get a list of child processes (Unix systems only)

2007-07-11 Thread Paul Lalli
On Jul 11, 2:47 am, [EMAIL PROTECTED] wrote: > I am looking for an efficient way to get list of child (forked) processes of > a given processes id. > Has anyone idea how to do it in "pure perl style" ? This information is stored in Process Table for the system. You can access this table using th

installing DBD::mysql

2007-07-11 Thread Octavian Rasnita
Hi, I am trying to install DBD::mysql and I see that it tries to connect to the server using the socket /var/lib/mysql/mysql.sock This is because another version of MySQL was installed on the server, and I have installed another one that uses the socket /tmp/mysql.sock. What should I change

Re: How to get a list of child processes (Unix systems only)

2007-07-11 Thread yaron
Hi Jeff, Thanks for the answer. This module gives only partial answer. My wish is to traverse the system processes tree from parent to childes, and start it with a given process id. As far as I understand this module gives you only the direct born childs that was forked by a given Proc::Forkin

Re: How to get a list of child processes (Unix systems only)

2007-07-11 Thread Jeff Pang
--- [EMAIL PROTECTED] wrote: > Hi, > > I am looking for an efficient way to get list of > child (forked) processes of a given processes id. > Has anyone idea how to do it in "pure perl style" ? > > Is this process created by you?otherwise you may not have the priviledge to access it,unless yo