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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl/Tk and Filehandles

Status
Not open for further replies.

mgeurts

Programmer
Apr 30, 2002
13
US
I am writing a Perl/Tk program that involves getting a string of data from a text box widget, and then writing that string to a file. Unfortunately, all that gets written to the desired file is "HASH{aa345....}", instead of the actual text stored in the string. How can I get it to where someone could type in a sentence in a text widget, and that sentence be copied to a file?

Thanks in advance for any input...
Mark Geurts
 
show us some concise code 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Mark, hi.

Use TextUndo instead and you get these extra methods.

$text->Load($filename);

Loads the contents of the $filename into the text widget. Load() delete the previous contents of the text widget as well as it's undo history of the previous file.

$text->Save(?$otherfilename?)

Save contents of the text widget to a file. If the $otherfilename is not specified, the text widget contents writes the file of $filename used in the last Load() call. If no file was previously Load()'ed an error message pops up. The default filename of the last Load() call is not overwriten by $otherfilename. Mike
______________________________________________________________________
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Thanks Mike, your suggestion did work. I might come up with some more questions, and you seem to really know what your doin'.

Mark
 
Hmmm, don't know about that goBoating's done more tk work than me...

Glad you're sorted with this issue - come back anytime, they won't all be as easy to fix though <wry smile> Mike
______________________________________________________________________
&quot;Experience is the comb that Nature gives us after we are bald.&quot;

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top