Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: using constants in regex/search

by f00li5h (Chaplain)
on Dec 02, 2008 at 04:52 UTC ( #727302=note: print w/ replies, xml ) Need Help??


in reply to using constants in regex/search

use constant'ed constants are really subs that just return the same thing each time... there's no un-nasty way to interpolate them. TheDamian's perl best practices recommends using Readonly for constants for this reason.

Also  $input =~ /@{[ NAME ]}/ ... but if you do that, the maintenence programmer after you will hunt you down with a hatchet and do unspeakable things to you.

Enjoy ^_^

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;


Comment on Re: using constants in regex/search
Select or Download Code
Replies are listed 'Best First'.
Re^2: using constants in regex/search
by geniezlife (Initiate) on Dec 02, 2008 at 08:51 UTC
    Thanks! :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2015-07-30 02:36 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 (269 votes), past polls