[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Substitution loop



On Jul 31, 2007, at 3:11 PM, Dan Linder wrote:
You said "Anyone seen that error before?" Did you mean to include the
CommonShare.pm or a snippet of code?

My original post contained the line of code:

line 65 looks harmless enough:

  $d1=~s/[^\d]//g;

Additional context won't help since $d1 is passed into the subroutine which contains line 65. Hence my immediate debugger attempt.

I've used the s///g; many times before and never really had a problem with it.

Yup. s///g is one of many indispensable tools in the Perl 101 toolbox.

(Note, I don't optimize for execution speed, rather readability and future "3AM support".)

Indeed. The vast majority of time that is the way to go. Programmer time is orders of magnitude more expensive than a few extra CPU cycles nowadays. :)

j