Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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.

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 about the Monastery: (15)
As of 2016-09-29 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (554 votes). Check out past polls.