Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 lurking in the Monastery: (12)
As of 2014-11-25 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (158 votes), past polls