sub enter_father {
$student = $name_ent -> get;
open studentfile, ">>", $student;
$file_array[6] = $father_ent;
print studentfile ($file_array[6]);
close studentfile;
}
although there are more entris and all the end file ends up having content like this,
SampleNameTk::Entry=HASH(0x84a8644)Tk::Entry=HASH(0x84a8a4c)Tk::En try=HASH(0x84a8bcc)Tk::Entry=HASH(0x84a8dc4)Tk::Entry=HASH(0x84a 8fbc)Tk::Entry=HASH(0x84a91b4)Tk::Entry=HASH(0x84a93ac)Tk::Entry =HASH(0x8499b58)Tk::Entry=HASH(0x8499d50)Tk::Entry=HASH(0x8499f4 8)Tk::Entry=HASH(0x849a140)Tk::Entry=HASH(0x849a338)Tk::Entry=HA SH(0x849a530)Tk::Entry=HASH(0x849a728)Tk::Entry=HASHThe name shows up, but nothing else
You may view the original node and the consideration vote tally.
It's not clear to me from your code, but I think you need to call $father_end->get() to retrieve the contents of the father entry box.
Style-wise, I also recommend not using global variables -- instead passing variables to your subroutines:
sub save_from_entry_widget
{
my ($widget, $filename) = @_;
my $text = $widget->get();
open my $fh, '>>', $filename or die "Cannot append to '$filename': $!\n";
print $fh $text;
}
Then call this with:
save_from_entry_widget( $father_ent, $name_ent->get() );perlmonks.org content © perlmonks.org and chromatic, HeyYou, NodeReaper
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03