Re: Regex Help

2007-11-10 Thread Jonathan Lang
Omega -1911 wrote: > @liners = split /(\s\[0-9],\s)Powerball:\s[0-9]/,$data_string; Instead of split, just do a pattern match: ($a[0], $a[1], $a[2], $a[3], $a[4], $b) = /(\d+), (\d+), (\d+), (\d+), (\d+), Powerball: (\d+)/; This puts the first five numbers into the array @a, and puts the power

Re: How to reinvent grep in perl?

2007-10-04 Thread Jonathan Lang
siegfried wrote: > Thanks, but if I am piping from stdin to stdout I see two problems: > > (1) how do I implement the -n flags that tell me the line number and > file name where the matches are Well, as long as you're only piping one file at a time, the line number part isn't a problem; but I see

Re: How to reinvent grep in perl?

2007-10-03 Thread Jonathan Lang
siegfried wrote: > I need to search large amounts of source code and grep is not doing the job. > The problem is that I keep matching stuff in the comments of the > C++/Java/Perl/Groovy/Javascript source code. > > Can someone give me some hints on where I might start on rewriting grep in > perl so

Re: regex help

2007-09-25 Thread Jonathan Lang
Rob Dixon wrote: > Jonathan Lang wrote: > > I'm trying to devise a regex that matches from the first double-quote > > character found to the next double-quote character that isn't part of > > a pair; but for some reason, I'm

regex help

2007-09-25 Thread Jonathan Lang
I'm trying to devise a regex that matches from the first double-quote character found to the next double-quote character that isn't part of a pair; but for some reason, I'm having no luck. Here's what I tried: /"(.*?)"(?!")/ Sample text: author: "Jonathan ""Dataweaver"" Lang" key=val What

Re: CSV file

2007-09-21 Thread Jonathan Lang
On 9/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > There is a report that is generated from a script as a plain text file. I > need to take this output file as input for my script and join them and create > a CSV file and mail to me daily. How can I create CSV file with out using > modul

Re: parsing csv-file for inserting in database

2007-09-17 Thread Jonathan Lang
Ruprecht Helms wrote: > Hi, > > how can I parse a csv-file where the entries are seperated with | . > The scripts later should put them into a mysql-database using dbi. > > Especially for me is interessting how to parse the content of the file > and store them into different variables for later pr

Re: Error:Can't locate object method "prepare" via package "abc" at xyz.pm

2007-05-31 Thread Jonathan Lang
Chas Owens wrote: Well, there is a prototype problem, but it isn't that $ will force new to only accept one value, but rather that prototypes and OO Perl don't mix. Perl simply ignores prototypes on methods. Also prototypes are broken*, don't use them. -snip- * http://library.n0i.net/programm

Re: Error:Can't locate object method "prepare" via package "abc" at xyz.pm

2007-05-31 Thread Jonathan Lang
Alma wrote: Hi , Urgent help. I have written 2 modules one abc.pm & xyz.pm (admin modules). abc.pm -- my $databasehandle; Note that this establishes a single $databasehandle for every object of type 'abc' that you create; it does not create a separate one

Re: Passing arguments to subroutine

2007-05-31 Thread Jonathan Lang
Alma wrote: Hi All, I need to pass the result of prepare statement as an argument to the subroutine. -snip- abc is calling delete_file() . where it need to delete the file stored at the location mentioned in file_path. Its not giving me an error but its not deleting the files from the locatio