> -----Original Message-----
> From: Moon, John [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 18, 2001 7:36 PM
> To: Tillema, Glenn; 'Curtis Poe'; [EMAIL PROTECTED]
> Subject: RE: How to generate a table ?
>
>
> Glenn & Curtis;
>
> Thanks for the suggestions ... but more thanks to both you
> and Curtis for helping me to start "thinking out of my box"...
> and this is why I'm replying ...
Thanks! I'm certainly no Perl-god but I saw you doing something
that I knew the answer to so I replied.
> I don't know if it's my version of cgi but the only thing I
> don't like about the shortcuts is it doesn't generate "\n" so
> when you are working on the html - the generated code - it's
> hard to read when you look at the source if
> you didn't do something correct.
If you follow the 'use CGI qw/:standard *table/;' with a
'use CGI::Pretty;' it will add most of the '\n's for you. Curtis
suggested this to me in a previous email (thanks, Curtis). I hate
the indenting that CGI::Pretty does but thankfully it's modifiable by
following with a
$CGI::Pretty::INDENT = " ";
which gives me a three-space indent (what I like).
> Thanks again to both you & Curtis ... I hope others get some
> use out of this also ....
You're welcome! I'm glad to help when I can! When I was first learning
Perl it was a steep learning curve (despite my years as a programmer) and
I really wish I would have had this group then!
> PS...
> Oh, thanks for reminding me about $_ ... I forget that Perl
> will help me if I'll let it ...
Just remember that if you are using '$temp' values as place-holders you
most likely adding extraneous code and giving yourself more work! There
is an excellent series on the O'Reilly Network by Mark-Jason Dominus called,
"Perl Program Repair Shop" that's been breaking me of bad habits.
http://www.oreillynet.com/pub/a/network/2001/05/18/perl_redflags.html
His examples look SO MUCH like what I was writing twelve and 18 months ago
it's frightening! The best thing, In my eyes, about his article is that he
doesn't just show you some over-written code and then show you the cleaned-up
result; he works through the process step-by-step and explains what he's
changing and why he's changing it.
I highly recommend his articles to any Perl coder interested in increasing
their skills!
> it gets old thinking of names for the foreach when you really don't
> care what it returned ... again just needed to "get out of my box"
> ... bad habits are hard to break !
>
> John W Moon
I really think we all do it. When I first started writing Perl my code looked
an awful lot like Pascal; I wrote everything out. As I've learned Perl my
code as become more efficient (and I'd like to think more effective). I'm still
learning, though, and I think twelve-months from now I'll look back on the
scripts I'm writing today and ask myself why I was doing everything the
hard way. :)
cheers,
Glenn
Glenn Tillema [EMAIL PROTECTED]
ADC Telecommunications, Inc.
PO Box 1101, MS 508
Minneapolis, MN 55440-1101
Learn about ADC - The Broadband Company - www.adc.com