regex nth match of string, perl 5.8.5

2006-01-23 Thread Chris Cosner
minated <> operator at program.pl line 48. Line 48 is }{ So I have the syntax wrong, at the very least. Should I be thinking more in terms of some sort of lookahead? Any hints as to how to approach this will be appreciated. -Chris Cosner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: regex nth match of string, perl 5.8.5

2006-01-23 Thread Chris Cosner
Bingo! Thanks for the replies. Just use the "non-greedy" form of "*": s{(\)(.*?)(\)}{$1$2\<\/I\>}g should do what you want. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Convert utf-8 XML Document to ISO format

2006-08-14 Thread Chris Cosner
d put it into the proper encoding for your database. $string = encode("iso-8859-1", $string); #Probably a good idea to use a bound parameter, i.e., ? in the query and provide the $string as a parameter in the execute command. At least in my case, this solves the problem. -Chris C

packing an array of hashes

2007-08-07 Thread Chris Cosner
I've re-read perlref and have been trying to tease an answer out of the Perl Cookbook. If you put a hash reference into an array push @array, \%hash; you do not store any actual hash data in the array. So if you change the hash, then later pull the hash reference from the array and access i

Re: packing an array of hashes

2007-08-07 Thread Chris Cosner
Aha. Many thanks. Now I'm on the right track (see Anonymous Data in the Perl Cookbook, ch. 11). Mr. Shawn H. Corey wrote: Chris Cosner wrote: If you put a hash reference into an array push @array, \%hash; you do not store any actual hash data in the array. So if you change the hash,

xml::xslt and regexes

2008-12-09 Thread Chris Cosner
Question: What is the speediest tool to pull data from an xml feed that will only be a few hundred lines at most? Some regexes will be necessary. Context: I am playing with the google books data api. They provide a feed, which you can see an example of here: http://code.google.com/apis/books/d

msql + cgi form parse error

2003-11-21 Thread Chris Cosner
If someone could point me in the right direction... I have a form on a system I am maintaining that works fine most of the time, but sporadically spits out an error. Users hit the back button, only to find that the data they had filled in is no longer in the form (but sometimes it stays). The sy

Re: msql + cgi form parse error

2004-01-16 Thread Chris Cosner
This is a follow-up that I have been meaning to post for a month or so. The situation was a misbehaving form on a system I am maintaining. Further investigation of the code for the form revealed other problems, such as improper use of eval. The problem boiled down to -- rewrite or do spot fixes.