Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

RE: Dark Theme for /. through Perl

by chromatic (Archbishop)
on May 04, 2000 at 23:51 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 21:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found