Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Format's output to a variable

Status
Not open for further replies.

Jiggerman

Programmer
Sep 5, 2002
62
GB
Can any of you fine folks out there think of a way to send the output of a "format" section to a variable, rather than out to a filehandle. I want to re-use it in a Tk Entry box you see.

Thanks for all or any help.
 
Well, in a way yes it is, but I was hopeing to be able to use all of Format's useful setup arguments. I assumed it would be pretty simple to use a variable instead of a Filehandle, or a filehandle pointing at a variable, I didn't know how to do this, but thought it would be a pretty simple problem to solve.

I suppose I could use sprintf, but I'm sure format would be just as simple.
 
I'm just after glancing at "Programming Perl" (Riley), and it says that its just another symbol in the symbol table, that defaults to STDOUT, but you could open a pipe to another handle and work it that way. and i quote "Not very convenient, but doable"

I'm just after looking at it for the first time.

What you're talking about seems to have been on the TO-DO-LIST for Perl 5 (subversion unknown), but it may have been addressed in later versions

HTH
Paul
 
Thanks Very much Paul,

I think the long and very memory, and processor in-efficient way of doing it, would be to use format out to a file, then read in the file again, It's a "loopy" way of doing it, but it's probably what I will use.

Thanks again for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top