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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subs and variables

Status
Not open for further replies.

jamsman

Technical User
Jul 22, 2005
38
DE
I have a script that reads information from a database and returns some variables (acutally lots of variables).
There is threee different sets of variables that could be returnd so i thought i would use a sub to only initialise the required ones. The problem is that i later need to use these variables and the error i get is that they are unintialised i know this is because they are declared only in the sub. Is therre away around this????

thank you for any ideas



 
is this ok?:
($a, $b) = &dosomething;
print "$a $b";

sub dosomething
{
return ("hello", "world");
}

Ion Filipski
1c.bmp
 
ok thanks that seems to work ok for the moment

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top