in reply to Re: My perl interpreter won't even look at it. It's that bad.
in thread My perl interpreter won't even look at it. It's that bad.

Just an expansion of Ovid's last comment: refactoring this code would (for example) turn this:
sub generate_extension { my $self = shift; return( &generate_line_form_element( "text", "extension" , $self- +>{extension}, $self->{extension} , "4" , "4" ); } sub generate_email_address { my $self = shift; return( &generate_line_form_element( "text", "email_address" , $s +elf->{email_address}, $self->{email_address} , "30 +" , "50" ); }

... into this:
sub generate_stuff { my $self = shift; my $what = shift; my @numbers = @_; return( &generate_line_form_element( "text", $stuff , $self->{$st +uff}, $self->{$stuff} , @numbers ) +; }

... and calling it would look like this:
generate_stuff( 'extension', 4, 4 ); # this is what a generate_stuff( 'email_address', 30, 50 ); # call would look like

If you see a lot of code that looks the same structurally, it's usually better to consolidate it into something smaller and less repetetive. That way, if you have an error (or just a change you want to make), you only have to fix it in one place, and you can be certain that all of your similar functions will work the same way. In a situation of significant redundancy, consolidation can save a lot of space.
--
Love justice; desire mercy.