Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Something is wrong with this pattern

by samarzone (Pilgrim)
on Dec 24, 2010 at 06:55 UTC ( #878978=note: print w/ replies, xml ) Need Help??


in reply to Something is wrong with this pattern

The value inside $operator (supposed to "." in case of "11.5") is interpreted as special character inside regular expression. Escape its special meaning as following

$celldata=~m{(.+?)\Q$operator\E(.*)}

You can better use split for this if you have only one "$operator" in a string

($left_str, $right_str) = split(/\Q$operator\E/, $celldata);

-- Regards - Samar


Comment on Re: Something is wrong with this pattern
Select or Download Code
Re^2: Something is wrong with this pattern
by tej (Scribe) on Dec 24, 2010 at 07:30 UTC

    Thank you samarzone

    It is working fine now...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://878978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2014-09-21 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls