Re: [Boston.pm] boost::format to sprintf, or how do I get a substitution with a substitution in it?

2015-04-04 Thread Mike Small
"Greg London" writes: > Cool! 15 years of perl and I never used /e > > I got the regexp to convert the first file > and discovered that sprintf is way more inconvenient > than I remember. It doesn't return the string, > it returns pass/fail. And it operates on char* ? > > This may have been why

Re: [Boston.pm] boost::format to sprintf, or how do I get a substitution with a substitution in it?

2015-04-04 Thread Gyepi SAM
On Fri, Apr 03, 2015 at 09:48:22PM -0500, Greg London wrote: > Cool! 15 years of perl and I never used /e > > I got the regexp to convert the first file > and discovered that sprintf is way more inconvenient > than I remember. It doesn't return the string, > it returns pass/fail. And it operates

Re: [Boston.pm] boost::format to sprintf, or how do I get a substitution with a substitution in it?

2015-04-03 Thread Bill Ricker
> . It doesn't return the string, > it returns pass/fail. And it operates on char* ? > > This may have been why I used boost::format. > > Anyone know of a c++ self contained function that takes > a format string and returns the result string > rather than using char*'s and returning the value in >

Re: [Boston.pm] boost::format to sprintf, or how do I get a substitution with a substitution in it?

2015-04-03 Thread Greg London
Cool! 15 years of perl and I never used /e I got the regexp to convert the first file and discovered that sprintf is way more inconvenient than I remember. It doesn't return the string, it returns pass/fail. And it operates on char* ? This may have been why I used boost::format. Anyone know of

Re: [Boston.pm] boost::format to sprintf, or how do I get a substitution with a substitution in it?

2015-04-03 Thread Uri Guttman
On 04/03/2015 08:59 PM, Greg London wrote: s/format\((.*?)\)(.*?)\.str\(\)/something/g The problem is I need $1 and $2 to put into sprintf but I before I do that, I also need to take the '%' operators in $2 and replace them with ',' and THEN put it back in. Things started to get hairy, and I wa

[Boston.pm] boost::format to sprintf, or how do I get a substitution with a substitution in it?

2015-04-03 Thread Greg London
I've got a rather largish pile of c++ code that makes a lot of calls to boost::format. I'm having trouble compiling the code on my FPGA platform (can't figure out how to install boost::format into the tool flow). So, I thought maybe I'd try to do a perl script to convert all the files to use sprint