Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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

Replies are listed 'Best First'.
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 romping around the Monastery: (3)
As of 2016-06-25 05:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (323 votes). Check out past polls.