in reply to Re: Dereferenced Arrays
in thread Dereferenced Arrays
this is by far the UGLIEST function i have seen. the flow control is wretched.... but its a beautiful fault in its own "crack in the liberty bell" sorta way
poo ( [1..4], ["goo", "doo", "moo"], [6..9] ); sub poo { my($first, $second, $third) = @_; my @array = @{$second}; my $second = shift(@array); my $length = length($second); print("@array" , " $second", " $length\n"); @array = @{$first}; my $first = shift(@array); my $length1 = length($first); print("@array", " $first", " $length1\n"); @array = @{$third}; my $third = shift(@array); my $length2 = length($third); print("@array", " $third", " $length2\n"); my $result = $length + $length1 + $length2; print("$result\n"); }
no indents..... no comments... completely unmaintainable... but complete. only thing i have to ask now, is what suggestion would someone make to incorporate a loop to go thru. would it call for @_ [ $index ] and then increasing it throughout the loop until it returns undef?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Dereferenced Arrays
by Marshall (Canon) on Aug 19, 2009 at 02:01 UTC | |
by ikegami (Patriarch) on Aug 19, 2009 at 02:40 UTC | |
by Marshall (Canon) on Aug 19, 2009 at 04:03 UTC | |
|
Re^3: Dereferenced Arrays
by ig (Vicar) on Aug 19, 2009 at 07:13 UTC |