Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Surviving 'Illegal division by zero'

by zakzebrowski (Curate)
on Jun 23, 2004 at 20:58 UTC ( #369176=note: print w/replies, xml ) Need Help??

in reply to Surviving 'Illegal division by zero'

I ran into a similar situation at work today actually, however, I wasn't trying to do a mathimatical situation. Since I'm bored, I'll share. What I was trying to do is load a file into memory, and then perform a subsistuion, similar to $line =~ s/\n//g; , and then I was going to perform additional string subsitutions on the line. This didn't work and resulted in a "illegal division by zero" error, so I needed a different work around. I thought of subsituting a different character for \n, but that character could exist in the file, so I backed off from that approach. I never really did find out a good way to do it, so instead I made a seperate regular expression which would catch the cases where a \n was embeded in the the other regular expression I wanted to extract from the file. I think this is the more elegent and robust solution, since I later found additional special cases that I wasn't taken into effect...

Zak - the office

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://369176]
[Discipulus]: yes, I immediately try to adapt some of your precedent examples.. but with no success and I'm not able to debug/modify them ;=(
[Discipulus]: all is well with you? new job? new cello?
[marioroy]: There were no annoucement, but MCE::Shared 1.831 is completed and released. It contains the new MCE::Hobo, providing ->init.
[marioroy]: ... including MCE 1.830. Finally, reached the finish line. All is well.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-09-22 09:40 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (260 votes). Check out past polls.