in reply to Re^4: How to right align outputs of stored data in a variable?
in thread How to right align outputs of stored data in a variable?

my $fmt = "%-$textlength".'s '."%$numlength"."d\n";
I don't see the point of all the dots.

I did that to avoid the {} syntax which can confuse beginners.

Your wrote: I think I would have used a straight double-quote interpolation:  my $fmt = "%-${textlength}s %${numlength}d\n"; It seems clearer to my eye IMHO. Yes, I agree IF the OP understands the curly bracket context here.

Replies are listed 'Best First'.
Re^6: How to right align outputs of stored data in a variable?
by AnomalousMonk (Archbishop) on Feb 07, 2017 at 22:35 UTC
    ... IF the OP understands the curly bracket context here.

    It's unfortunate that it's not generally made more clear that the curly bracket representation is the "canonical" form of representation for all variables and works with everything: identifiers, hard/soft references, expressions, what have you. The common, non-curly form is used as a convenience; the canonical form is a PIA in most cases.


    Give a man a fish:  <%-{-{-{-<