Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 browsing the Monastery: (6)
As of 2015-07-05 18:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls