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!

Tk headache: passing arguments to a subroutine 1

Status
Not open for further replies.

darkreaper00

Technical User
Aug 5, 2002
23
US
I have a command bound to objects on a canvas like so:

$canvas->bind($id, '<ButtonRelease-2>' => [\&netscape, $org, $call_subject, $B_hits[$m]{qstart}, $B_hits[$m]{qend}]);

It calls the function netscape() correctly, but my arguments are passed as things like:

Tk::Canvas=HASH(0x14059da90), SCALAR(0x1401285a0), SCALAR(0x140128720), SCALAR(0x140530490)

This happens whether or not I make them references (\$org, etc.)

any ideas? thanks!
 
You can always try and use the sub as a "normal" one using this syntax;

$canvas->bind($id, '<ButtonRelease-2>' => sub {netscape($org,$call_subject,$B_hits[$m]{qstart}, etc.)});

Course the other problem maybe that you're not dereferencing your arguments within the netscape function perhaps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top