Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

RE: Dark Theme for /. through Perl

by chromatic (Archbishop)
on May 04, 2000 at 23:51 UTC ( #10262=note: print w/ replies, xml ) Need Help??


in reply to Dark Theme for /. through Perl

One thing that might make this more clear (as well as more generally customizable) is to separate the theme changes from the main script.

Build a configuration file, then read it into the hash. The key will be the string-to-find and the value will be the replacement. Then you can do something as simple as this:

foreach my $find (keys %chunks) { $data =~ s/$find/$chunks{$find}/g; }
You don't have anything complicated like backtracking or grouping, so it works. It's a bit slower than the other way, but the added convenience (and code beautification) might be worth it.


Comment on RE: Dark Theme for /. through Perl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2014-08-01 17:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (33 votes), past polls