Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Syntactic Confectionery Delight
 
PerlMonks  

Re: RFC(Tutorial):Text::Table Enable

by toolic (Chancellor)
on Jun 14, 2010 at 14:27 UTC ( #844608=note: print w/ replies, xml ) Need Help??


in reply to RFC(Tutorial):Text::Table Enable

I am also a fan of Text::Table, and I agree that any attempt to supplement existing POD and example code are worthwhile endeavors.

My suggestions are all in the spirit of refinement, and as such, are mostly nitpicky style opinions.

A more direct node title would be "Text::Table Tutorial".

Since your code snippets do not employ consistent usage of whitespace, I recommend running them through perltidy.

Be consistent with your constructor: prefer Text::Table->new() over new Text::Table

open (FH,'<',"$file") or die ("ERROR! Opening file $!");
These days, I think lexical filehandles are preferred to bareword filehandles:
open my $fh, '<', $file or die ("ERROR! Opening file $file $!");

You have done a great job of using code tags for keywords, variables, etc. I think surrounding them with single quotes just adds clutter. For example, use print instead of 'print'.

You should add some output examples to clearly demonstrate what the reader should expect to see when running your code.

for(my $i = 0;$i<=$#Dlines; $i++){
is more Perlish as:
for my $i (0 .. $#Dlines) {
perlcritic can automatically advise on such style issue.


Comment on Re: RFC(Tutorial):Text::Table Enable
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://844608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2014-04-17 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (441 votes), past polls