Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: substituting constants within regex?

by Ovid (Cardinal)
on Jul 09, 2007 at 08:31 UTC ( #625580=note: print w/ replies, xml ) Need Help??


in reply to substituting constants within regex?

I recommend the Readonly module:

#!/usr/bin/perl -w use strict; use warnings; use Readonly; Readonly my $NEWLINE => '^M'; while (<>) { s/\Q$NEWLINE$//; print; }

Cheers,
Ovid

New address of my CGI Course.


Comment on Re: substituting constants within regex?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-09-02 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (88 votes), past polls