I guess what I'm trying to say is that you have to be able
to break a problem down. I guess I'm biased, already knowing
HOW to do this, but I'll use your "print a number padded with
0's" comment. How would I find a way to do this?
- well, decimal numbers don't start with 0's, unless it's
just the number 0
- decimal numbers CAN start with a "0." followed by 0's,
so I could divide the number by some power of ten, and then
remove the leading "0."
- I'm really trying to turn a number into a string with
some leading 0's to make it a string of a certain length
- is there some function that will allow me to format a
string to my demands?
At that point, I might not know about sprintf and printf. So
I would ask: "I want to pad a number with zeroes. Is there
a function I can use to format a number like that?" I might
be scolded for not checking the documentation and the FAQs,
but at least I was able to think through my problem.
But again, I'm biased. Maybe I was just ranting out against
all the times something has been so very obvious to me and
not to someone else. Perl has given me very clear vision,
and I have trouble not expecting everyone else to have such
clarity of mind.
$_="goto+F.print+chop;\n=yhpaj";F1:eval