Re: Curly braces and the logic of PERL
- From: chas.owens@xxxxxxxxx ("Chas. Owens")
- Date: Mon, 27 Oct 2008 23:02:11 -0400
On Mon, Oct 27, 2008 at 20:28, Rob Dixon <rob.dixon@xxxxxxx> wrote:
John W. Krahn wrote:
The fewer lines of code to read and/or write, the easier it is to spot
mistakes, the less chance for "action at a distance."
Not at all.
Is this
sub wanted { return unless -f; open my $FH, '<', $_ or die "Cannot open '$_'
$!"; while ( <$FH> ) { /\Q$string/ && print $REPORT "$File::Find::name\n" and
return; } } find \&wanted, '/test';
easier to debug?
No, it is not, but it also isn't fewer lines of code; it is many lines
of code compressed into fewer lines. Fewer lines of code means using
higher level constructs (such as anonymous subroutines) to eliminate
redundant code.
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
.
- Follow-Ups:
- Re: Curly braces and the logic of PERL
- From: Rob Dixon
- Re: Curly braces and the logic of PERL
- References:
- Curly braces and the logic of PERL
- From: Brian
- Re: Curly braces and the logic of PERL
- From: Mr. Shawn H. Corey
- Re: Curly braces and the logic of PERL
- From: Brian
- Re: Curly braces and the logic of PERL
- From: John W. Krahn
- Re: Curly braces and the logic of PERL
- From: Rob Dixon
- Curly braces and the logic of PERL
- Prev by Date: Re: ignore directories with File::Find?
- Next by Date: Re: match and putting in a variable with a single statement
- Previous by thread: Re: Curly braces and the logic of PERL
- Next by thread: Re: Curly braces and the logic of PERL
- Index(es):
Relevant Pages
|