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

Re: Pearls (not really) of Perl programming

by kutsu (Priest)
on Nov 24, 2004 at 17:40 UTC ( #410191=note: print w/ replies, xml ) Need Help??


in reply to Pearls (not really) of Perl programming

We use custom tags (%B% = start bold, /B/ = end bold and others) for reports that are printed on both the internet and a high speed printer. The data for these reports is pulled from several (more then 7) files and at each of these I found:

s/\%B\%/<b>/g; s/\/B\//<\/b>/g;

seems the writter didn't know about subs and \Q\E or quotemeta() ;)

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce


Comment on Re: Pearls (not really) of Perl programming
Download Code
Re^2: Pearls (not really) of Perl programming
by ikegami (Pope) on Nov 24, 2004 at 19:39 UTC

    Seems kutsu doesn't know about using a seperator other than / ;) Neither \Q\E nor quotemeta() are needed here.

    s#%B%#<b>#g; s#/B/#</b>#g;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2015-07-05 05:47 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 (60 votes), past polls