Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: TMTOWTDI Puzzle: Generating a range of numbers

by atcroft (Monsignor)
on Dec 19, 2001 at 10:58 UTC ( #133036=note: print w/replies, xml ) Need Help??

in reply to TMTOWTDI Puzzle: Generating a range of numbers

My first attempt at one of the puzzles on here (I think someone had a suggestion similar to this). Thought it might be appropriate, though.

#!/usr/bin/perl -- -l -w my $msg = "happy b-day perl"; $msg =~ s/\s*|perl//g; &gen($msg); sub gen { my ($st) = @_; if (length($st)) { my @temp = split('', $st); shift(@temp); &gen(join('', @temp)); print(length($st), ' '); } }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://133036]
[Corion]: Hmmm. I feel a Meditation coming on. I wrote a module, DBIx::PivotQuery, which returns a table-like set of rows (AoA) but some columns are generated from column values, like in an (Excel) pivot table or a ROLLUP command
[Corion]: My current approach for subtotals involves rerunning the given query, with the hint to the user that they should use a temporary table if they want better performance.
[Corion]: But I could create that temporary table in the module and use it for the improved perfomance directly instead.
[Corion]: And the question is, what would be better/preferred ;-)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-02-23 15:22 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (347 votes). Check out past polls.