Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Using a string within a qw construct
I am attempting to build a Tk:Optionmenu pull down from a string that
is passed to a sub-routine from one of my menu items. The string may
look like this:
2 3 8 10 14

The string WILL change, which is why I want to pass the string to my
menu pulldown as such:

my @slt_opt = qw/\$slt/;

$frame3->Label(-text => "Slot ID: ")->pack(-side => 'left',
-anchor => 's',
-expand => 1);

$frame3->Optionmenu(-variable => \$slots,
-options  => [@slt_opt],
-command  => [sub {print "args=@_\n"}, 'First']);

======================================
Am I reaching with what qw can do here?

Thanks in advance,

Joe


Report this thread to moderator Post Follow-up to this message
Old Post
joe.cipale@radisys.com
01-12-05 08:59 PM


Re: Using a string within a qw construct
joe.cipale@radisys.com wrote:
> I am attempting to build a Tk:Optionmenu pull down from a string that
> is passed to a sub-routine from one of my menu items. The string may
> look like this:
> 2 3 8 10 14
>
> The string WILL change, which is why I want to pass the string to my
> menu pulldown as such:
>
> my @slt_opt = qw/\$slt/;

qw() is not what you want. It will split it's argument on whitespace and
quote each element. Checkout 'perldoc perlop' for more details.
You simply want this:

my @slt_opt = (\$slt);

--Ala

Report this thread to moderator Post Follow-up to this message
Old Post
Ala Qumsieh
01-12-05 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:44 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.