CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
subroutine not returning

 



rcunn87
New User

Jul 31, 2007, 10:57 AM

Post #1 of 4 (300 views)
subroutine not returning Can't Post

I have a subroutine that takes a list I made and adds them to an array. Some are entered as scalars and others Hashs get built and the reference to the Hash is placed in the array(so i guess they are all scalars but thats besides the point). After I make the array I try to return a reference to the array and I get nothing when I try and print the scalar I assigned it to. For example...

Code
$arrayRef=&subroutine(/@oldArray); 
print $arrayRef;

Nothing is printed at all. I have been playing with this all day and it is driving me nuts. Let me know what other information is needed.

Okay I fixed it somehow. I changed the var ($arrayRef) to something like $arrayRef2 and it started working...


(This post was edited by rcunn87 on Jul 31, 2007, 11:17 AM)


KevinR
Veteran


Jul 31, 2007, 12:01 PM

Post #2 of 4 (296 views)
Re: [rcunn87] subroutine not returning [In reply to] Can't Post

this:

/@oldArray

should be:

\@oldArray
-------------------------------------------------


rcunn87
New User

Jul 31, 2007, 12:10 PM

Post #3 of 4 (294 views)
Re: [KevinR] subroutine not returning [In reply to] Can't Post

Yea I know I was just giving an example of what I was doing


KevinR
Veteran


Jul 31, 2007, 12:34 PM

Post #4 of 4 (293 views)
Re: [rcunn87] subroutine not returning [In reply to] Can't Post


In Reply To
Yea I know I was just giving an example of what I was doing


OK.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives