Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 browsing the Monastery: (12)
As of 2015-07-08 08:36 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 (98 votes), past polls