On Sat, Oct 26, 2013 at 10:54:12AM -0400, Shawn H Corey wrote:
> On Sat, 26 Oct 2013 16:06:56 +0530
> Mayuresh Kathe <[email protected]> wrote:
>
> > i've been searching for books on learning and mastering perl and found
> > the series by o'reilly to be quite well recommended.
>
> Another O'Reilly book is "Perl Best Practice" by Damian Conway. Much of
> this book has been incorporated into Perl::Tidy and Perl::Critic.
>
> BTW, you should perltidy (downloaded with Perl::Tidy) and perlcritic
> (downloaded with Perl::Critic) on all your code.
Shawn, thanks for that Perl::Tidy tip, it's *very* impressive.
I wrote a small-ish Perl script with no indentation (since my Vim wasn't
configured), and then after running Perl::Tidy over it, the output was;
----------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
use warnings;
my $exponent = $ARGV[0];
my $number = 2;
my $result = $number;
if ( not defined $exponent ) {
die "Usage: $0 <exponent>\n";
}
else {
for ( my $count = 1 ; $count < $exponent ; $count++ ) {
$result = $result * $number;
}
print "$result\n";
}
exit(0);
----------------------------------------------------------------------
The entire code snippet is so beautifully layed out, cool.
Thanks again. :)
~Mayuresh
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/