Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2015-11-26 03:42 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls