http://qs1969.pair.com?node_id=584361

It's sparse, short, cryptic, and perhaps not very unique,

but someone might find this useful. I like to think it

taps into the unlimited chaotic potential of Perl. Here's

the code.


#!/usr/bin/perl use strict; use warnings; my @words = ("copy ","study ","meditate ","write from scratch "); my @words2 = ("and ","or "); my @words3 = ("scalars ","arrays ","hashes ","regexes ","subroutines " +,"cpan ","perlmonk archives ","cgi "); print $words[rand @words], $words2[rand @words2], $words[rand @words], + $words3[rand @words3], "\n";

Replies are listed 'Best First'.
Re: My random project generator
by b10m (Vicar) on Nov 16, 2006 at 09:09 UTC

    IMHO, it'd be better to take out the elements you've used, for now I get things as:

    write from scratch or write from scratch perlmonk archives
    study or study hashes
    write from scratch or write from scratch arrays

    Something like this would fix it (/me ducks for TIMTOWTDI attacks...)

    print splice(@words, int rand @words, 1), $words2[int rand @words2], splice(@words, int rand @words, 1), $words3[int rand @words3],"\n";
    --
    b10m

    All code is usually tested, but rarely trusted.
      Alright, I know how I'm going to be populating my ~/.plan from now on... (:


      strfry( $vegetables )
Re: My random project generator
by dewey (Pilgrim) on Nov 16, 2006 at 07:07 UTC
    This is a very simple bit of code but I like the effect. It's sort of quiet and unassuming. I may post a 'remix' later... in a little snippet like this I like to play a lot with syntactical and formatting possibilities. Thanks for posting!
    ~dewey