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

use variable in Tk::Photo?

Status
Not open for further replies.

AMiSM

Technical User
Jan 26, 2006
128
US
Hi, folks! Sean here!
I'm trying to assign some defined images to an array. It keeps telling me I can't call method Photo with an undefined value.

my @question;
for my $q (1..20) {
my $img = $mw -> Photo ( -file => "Q$q.bmp" );
push @question, $img;
}

What bonehead thing am I doing wrong?
 
Never mind, it's something else entirely
 
Aye, $mw is undefined.

Probably just an initialization issue. Be sure to error check construction of objects. A lot of cpan modules will set error codes if the object wasn't created. A simple or die works great for detecting that.

- Miller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top