On Fri, Nov 15, 2002 at 12:02:02PM -0800, Dave Whipp wrote:

> $b = 4294967296:1.2.3.4  # base 2**32


Hmm, interesting. Just as an aside, this gives me an idea: would it be
feasible to allow the base to be specified as an expression instead of
a constant? (I'm pretty sure it would be useful.)  For example:



4294967296:1.2.3.4      # working with a really big base, hard to grok
2**32:1.2.3.4           # ahhhhh, much better

24*60*60:10             # one day in seconds, easy representation


Or how about run-time evaluated versions?

# Set a timer to run for either a day or an hour, depending 
$timer = 60*60*($use_days ? 24 : 1):10   


Or a REALLY sick one:

fetch_base():7.9        # great for Obfuscated Perl.  also good for 
                        #     concisely (though not partiuclarly readably) 
                        #     determining multiple values for the index 
                        #     into a dispatch table.

--Dks

Reply via email to