Re: looking for a better way...

2003-08-14 Thread Pinku Bhatnagar
Hey Jerry, I have a one quick solution for you. str = "\"q4171\",\"(08/11/03 23:30:48)\",\"\""; @array = split(/,/,$str); foreach (@array) { s/\"//g ; } HTH Pinku Jerry Preston wrote: Hi!, I am trying to breakdown this line: "q4171","(08/11/03 23:30:48)","" with ( @data ) = split /[,|\"]/

Re: looking for a better way...

2003-08-14 Thread Pinku Bhatnagar
hi Jerry, On second thought, I have a better solution for you. $str = "\"q4171\",\"(08/11/03 23:30:48)\",\"\""; @array = $str =~ /"([^"]*)"/g; HTH Pinku Jerry Preston wrote: Hi!, I am trying to breakdown this line: "q4171","(08/11/03 23:30:48)","" with ( @data ) = split /[,|\"]/;#" but I ge

RE: looking for a better way...

2003-08-14 Thread NYIMI Jose (BMB)
"q4171","(08/11/03 23:30:48)","" Makes me thing of CSV (comma separated value). You may need to check CPAN for CSV module if You have to parse a lot of such string from a given file. José. -Original Message- From: Jerry Preston [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 10:

Re: looking for a better way...

2003-08-14 Thread Jeff 'japhy' Pinyan
On Aug 12, Jerry Preston said: >I am trying to breakdown this line: > >"q4171","(08/11/03 23:30:48)","" > >with ( @data ) = split /[,|\"]/;#" Either use the Text::CSV module from CPAN (or perhaps Text::CSV_XS), or else use a regex like the following: @fields = $str =~ m{ " [^"]* " | [^,]+ }xg

Re: looking for a better way, a perl way

2003-03-06 Thread John W. Krahn
Jerry Preston wrote: > > Hi! Hello, > I am looking for way to reduce the following code, a better way, a perl > way. Any ideas? > > while ( my ( $Site, $Description, $Part_Number, $Part_Serial_Number, $Qty, > $RMA_Number, $Customer_Contac, $RMA_Date, $Part_Rec ) = $sth->fetchrow()) { > # w

RE: looking for a better way, a perl way

2003-03-06 Thread Bakken, Luke
Look at the sprintf function. Please! > # while ( $data ) = $sth->fetchrow()) { > $l = length( $Site ); > if( $l != 5 ) { > $s = substr( "", 0, 5 - $l ); > $Site .= $s; > } Does this do what you want? $Site = sprintf '%-5s', $Site; One liner: C:\>perl -e"$S

Re: looking for a better way, a perl way

2003-03-06 Thread Rob Dixon
Hi Jerry. "Jerry Preston" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi! > > I am looking for way to reduce the following code, a better way, a perl > way. Any ideas? I think you've been overlooked a little because your post looks very much like a 'please do my work for me' p