>>>>> "BD" == Brent Dax <[EMAIL PROTECTED]> writes:
BD> I think qn counts as weird syntax. I ask again, what's wrong with one
BD> of:
BD> sprintf("%hash\%s", $string);
BD> sprintf(%hash.'%s', $string);
BD> sprintf('%s%s', _%hash, $string);
what if you want to use %hash{width} as a field precision? i don't like
the idea that all format specifiers would be the noisy \%s. they are
much more common than using hashes in format strings. now as i said in
another post, you can use the * method but i never liked it. in c it was
the only decent solution to dynamic precisions (other than doing a
sprint of the format string itself which loses). in perl, interpolation
makes that easier but i have rarely seen hashes used in that way. a temp
variable is as good a solution for that too.
$prec = %hash{width} ;
sprintf( qf"%${prec}s", $string);
sprintf( "\%${prec}s", $string);
is one of your alternatives. :-/
uri
--
Uri Guttman ------ [EMAIL PROTECTED] -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org