On 27 Jun 2001 19:56:49 +0200, Jos I. Boumans wrote:
> the obvious proof i have too much time:
> 
> for(join'',map{$_.=$:}@{[qw(2000 05 08)]}){s/\s//g&&chop&&print}
> 
> Jos
<snip />

Okay, I think you win.  Please let me know if my attempt at an
explaination of your abomination (modified slightly to be closer to the
rest of the other answers already in thread) is incorrect in any way.

<code>
#!/usr/bin/perl -w

use strict;

my $var1 = '2001';
my $var2 = "06";
my $var3 = "27";

my $newvar;

# $: is (by default) " \n-"
for(                  #sets $_ to the value of the join below
join '',              #join every element of array created by map
                      #with nothing as seperator
map{$_ .= $:}         #take every element of array built below
                      #and append $: (" \n-")
@{                    #dereference the arrayref about to be created
[$var1, $var2, $var3] #create an array ref to an array containing vars
}) {                  #end of for loop declaration
       s/\s//g        #remove all whitespace from $_ (gets rid of the 
                      #" \n"s from the map)
       &&             #if substitute is successful then
       chop           #remove the last - from $_
       &&             #if chop is successful then
       ($newvar = $_) #assign date to $newvar
}                     #end of for

print "$newvar\n";
</code>

I feel dirty now.

--
Today is Pungenday, the 32nd day of Confusion in the YOLD 3167



Reply via email to