in reply to Re^2: tk option+value in variable?
in thread tk option+value in variable?
Maybe this should be a nother top-level question, but can you tell me know you knew to promote my string to an array? I was playing with subroutines and arguments, and I found that all these generated the same answer (5):
Another area my knowledge is lacking is the dash notation for the options (-font => 'courier', for example); is that common in other areas of perl or specific to Tk?my $a = 2; my $b = 3; print &add($a, $b) . "\n"; my $opt = "$a, $b"; print &add(eval($opt)) . "\n"; my @opt = ($a, $b); print &add(@opt) . "\n"; exit; sub add { my ($x, $y) = @_; return ($x +$y); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: tk option+value in variable?
by choroba (Cardinal) on Jan 25, 2019 at 22:15 UTC | |
Re^4: tk option+value in variable?
by AnomalousMonk (Archbishop) on Jan 26, 2019 at 01:28 UTC | |
by cniggeler (Sexton) on Jan 26, 2019 at 16:04 UTC | |
by AnomalousMonk (Archbishop) on Jan 26, 2019 at 22:23 UTC | |
by cniggeler (Sexton) on Jan 28, 2019 at 16:45 UTC | |
by haukex (Archbishop) on Jan 28, 2019 at 18:32 UTC | |
by AnomalousMonk (Archbishop) on Jan 28, 2019 at 20:05 UTC |