Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Problems? Is your data what you think it is?
 
PerlMonks  

Re: can i get the value outputed from my subroutine into my program as a value

by physi (Friar)
on Aug 15, 2001 at 17:07 UTC ( [id://105102]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to can i get the value outputed from my subroutine into my program as a value

First: that what subs are for (to return a value to the main process)

Serveral things went wrong here:

&getPassword = my $Password;
must be :
my $Password = &getPassword;
and your password subroutine has to return a value, which then is assigned to $Password in your main program part
my $password = &getPassword; print "$password\n"; sub getPassword { my $pass = 'willi'; return $pass; }
This will give you an willi as output.
Hope this will help.
----------------------------------- --the good, the bad and the physi-- -----------------------------------

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://105102]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.