Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Perl/TK : Passing arguments to the function while clicking submit button

by kiruthika.bkite (Scribe)
on Apr 06, 2010 at 09:48 UTC ( #833005=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl/TK : Passing arguments to the function while clicking submit button
in thread Perl/TK : Passing arguments to the function while clicking submit button

Thanks a lot..
But I want to know why it is working when I called the function without argument and not working with argument.

It will be better if you explain this.

Thanks.


Comment on Re^2: Perl/TK : Passing arguments to the function while clicking submit button
Replies are listed 'Best First'.
Re^3: Perl/TK : Passing arguments to the function while clicking submit button
by almut (Canon) on Apr 06, 2010 at 10:02 UTC
    why it is working when I called the function without argument

    Presumably because \&function (without parentheses) is a reference to the function, while \&function(...) is a reference to whatever the called function returned.

    #!/usr/bin/perl -l sub function { return "foo"; } $command = \&function; print $command; $command = \&function(); print "$command -> $$command"; __END__ $ ./833005.pl CODE(0x604fd0) SCALAR(0x604290) -> foo
      Thank you..I understand it.
Re^3: Perl/TK : Passing arguments to the function while clicking submit button
by choroba (Canon) on Apr 06, 2010 at 10:04 UTC
    Could you please be more specific? (A piece of code with both expected and real output would be helpful.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://833005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-07-31 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls