NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
You'll never stop learning Perl... (Score:2)
As if that wasn't enough, Perl is constantly growing. The community, the coding standards, the code on CPAN. What was considered good style five years ago is now looked on as a bit amatuerish. We learn, we grow, we change. Such is the stuff of life. In the other direction lies COBOL, FORTRAN, even LISP. Good languages that didn't or couldn't adapt.
So don't despair, we're all in the same boat.
Should you try Ruby? Yes. Its a wonderful language borrowing elements from Perl 5 and Smalltalk and even preempting chunks of Perl 6.
Could your code be simpler? Sure. Apply a few idioms you might not know:
name => 'copy_'.$item.'_'.$parent_id,
using the less ambiguous ${foo} syntax, this can become:
name => "copy_${item}_$parent_id",
Honestly, I've never understood why popup_menu() requires you to put in *both* the values and the labels since the value entry is then redundant. So write a wrapper:
sub my_popup_menu {
my $args = shift;
$args->{values} = [ keys $self->{labels} ]
if $self->{labels} && !$self->{values};
popup_menu($args);
}
and then use it:
my_popup_menu({
name => 'source',
labels => { map {$_->[0], $_->[1] } @$items }
})
On a more grand scale, if you're doing a lot of database work it would behoove you to look at modules like Ima::DBI, Class::DBI. Alazbo, etc... which abstracts away a lot of this work. Modules like Template::Toolkit mean you won't have to stick HTML formatting code in your program. More stuff to learn, but it makes coding easier.
Jarkko Hietaniemi, 5.8 pumpking, puts at the end of every email: "There is this special biologist word we use for 'stable'. It is 'dead'." If you ever learned the entirety of Perl, or any language, it would be dead.
Reply to This
Re:You'll never stop learning Perl... (Score:1)