SPUG: Regexp::Assemble question

Andrew Sweger andrew at sweger.net
Wed Feb 25 08:55:13 PST 2009


On Tue, 24 Feb 2009, John W. Krahn wrote:

> Emails do not have colours, they are just plain text.

Mine doesn't. But I know some do. Regardless, Amit's intent was still
understood. 

> Is this your actual code?  If so, you don't need the subroutines at all, 
> you just need the keys.  And why use a hash reference instead of a hash?

Your tone suggests that all Perl programmers should use it in the same way
(your's aparently). Where I come from, Perl is spoken by people of every
skill level; from baby-perl-talk to uber-l33t-golpher-perl. If the code
works, it works. Style and convention mostly become a matter of teamwork.
This list is about learning and sharing Perl. I suspect you might not have
realized this (considering your reply to Amit and your previous reply to
this list).

> Why all the duplicate code?
> 
>      my $mode = qx(file $filename) =~ /gzip/i ? '<:gzip' : '<';
>      open MYINPUTFILE, $mode, $filename or $Logger->logdie( "Error 
> opening file: $!" );

Again, TIMTOWTDI.

> No need for this variable as Perl provides the $. built-in variable that 
> keeps track of the current line number.

Maybe so, but $lines is a lot more obvious than $. when it comes time to
review or update the code. Perhaps $INPUT_LINE_NUMBER (via English.pm)
could be even more obvious (and mean *exactly* the same thing as $.,
whereas $lines could actually mean something slightly different!).

> Those people who think they know everything are a great
> annoyance to those of us who do.        -- Isaac Asimov

Wow. Again?

Let me put it simply: knock it off. If you want to bash people about how
they write Perl, go hang out on Usenet or some obscure IRC channel. It's
not welcome here.

-- 
Andrew B. Sweger -- The great thing about multitasking is that several
                                things can go wrong at once.







More information about the spug-list mailing list