Re: Help! Strings -> Numbers
[email protected] ("Tanton Gibbs") Wed, 20 Nov 2002 16:45:46 -0500
| Newsgroups | perl.perl6.documentation |
|---|---|
| Message-ID | <02fe01c290de$2f590da0$3bd02143@brooklyn> |
> > my int $i is formatted('%4x');
> > $i = 255;
> > print $i; # prints '00ff';
> >
> > Anyone care to comment?
>
> I too don't see much use in the former. The latter puts distance between
> the formatting and the thing being formatted and that can't be good.
In situations such as these where you want a variable printed in a special
way, wouldn't it be better to use printf? Isn't that what it was designed
for?
Tanton