I'm sure it must have been done before, but couldn't find it...
#!/usr/bin/perl sub imagine { &imagine(not exists $_{heaven}); not $us{below}{hell}; keys $us{above} == ($sky); for $p (@people) { &imagine($p) and $living{$p}{localtime}; } &imagine(not @countries); not $hard_to_do; not(@kill or @die_for) and not @religions; for $p (@people) { &imagine($p) and $peace{$living{$p}{life}}; } &imagine(not @posessions); $you_can = rand 1; not($need{greed} or $need{hunger}); $man{brotherhood} = map {$_=>@man} @man; for $p (@people) { &imagine($p) and $share{$p} = map {$_=>1} @world; } $dreamer{$self} and keys(%dreamer)>1; $dreamer{$you} and &live(@world) == &live($one); }
Any comments will be appreciated :)
Grimborg.

Replies are listed 'Best First'.
Re: &imagine...
by jcoxen (Deacon) on Sep 27, 2005 at 21:01 UTC
    I think that Moondog Johnny would find that extraordinarily cool.

    Well done.

    Jack

Re: &imagine...
by DrHyde (Prior) on Sep 28, 2005 at 08:58 UTC
    I have a minor and annoying nit to pick ...

    in not $#religions and all the other places where you use $#, $#foo evaluates to the index of the last element in the array @foo, or -1 if the array is empty. -1 is true. You probably wanted scalar(@foo) which evaluates to the number of elements in the array - that is, 0 (false) for an empty array of religions.

    It wouldn't scan so well though.

      not @religions would impose scalar context without the explicit call to scalar.

      Caution: Contents may have been coded under pressure.
        I stand corrected :) Thanks!
Re: &imagine...
by ciderpunx (Vicar) on Sep 27, 2005 at 21:01 UTC
Re: &imagine...
by Anonymous Monk on Sep 28, 2005 at 03:04 UTC
    This poem of yours was a really comprehensive way of digging into Pearl syntax; a trully educational application of the grammar structure is in evidence. กก Well Done !! in0w
      It's Perl. ;)