Walt Mankowski on 15 Oct 2003 18:14:03 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Solution to Quick easy question


On Wed, Oct 15, 2003 at 06:05:22PM -0400, Hans Dieter Pearcey wrote:
> On Wed, Oct 15, 2003 at 03:01:20PM -0700, James wrote:
> > 
> > > real printf code:
> > > 
> > > printf ("%-15s          %-15s          %-30s\n",
> > > $DCS_DB{"$i"}, $DB{"$i"}_NM, $DB{"$i"}_DIR);
> > > 
> > 
> > Thanks Doug, your email put me in the right direction.
> >  Here is the *new* and improved printf:
> > 
> > printf ("%-15s          %-15s          %-30s\n",
> > ${"DCS\_DB$i"}, ${"DB$i\_NM"}, ${"DB$i\_DIR"});
> > 
> > Now it works.  I am still a little confused on when to
> > use double quotes, single quotes and the curley
> > braces.  
> 
> Someone has to say it, so I'll let it be Mr. Dominus:
> 
> Why it's stupid to `use a variable as a variable name'
> http://perl.plover.com/varvarname.html

Someone else has to ask, and it might as well be me, why do you have
those large chunks of whitespace in your printf statement when you're
already spacing things out with the %-15 and %-30?

Walt

Attachment: pgpWZdmqt2JgK.pgp
Description: PGP signature