in reply to Re^2: My Second, first japh
in thread My Second, first japh
I set the $Perl variable to a whitespace, which makes it so you can fit the whole thing on just two lines. Then I played with the whitespace enough so that the words for "Just another Perl Hacker," are on spaces of multiple 5. Since now its a simple loop. Here's a shorter version:$Just = $0; open JAPH,$Just; @another = split /\s/, <JAPH>; $Perl = " +"; $hacker = ","; sub Just { substr shift , 1 }; $Perl = join $Perl, Just ($another[0]), Just ($another[5]), Just ($ano +ther[10]), Just ($another[15]); print $Perl . $hacker,
254 characters. not bad, right? I think thats in the canonical limits.$Just = $0; open JAPH,$Just; @another = split /\s/, <JAPH>; $Perl = " +"; $hacker =",";sub Just {substr shift,1}; for($hack = 15; $hack > -1 ; $hack -= 5){$hacker = Just($another[$hack +]) . $Perl . $hacker};$hacker =~ s/\s,/,/s; print Just $Perl.$hacker,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: My Second, first japh
by starbolin (Hermit) on Aug 11, 2006 at 19:39 UTC |