Hi Ryan,

first of all the subroutine defination is Ok but how u will call the subroutine???Through the name right?
so
sub ([EMAIL PROTECTED], [EMAIL PROTECTED]); is wrong
instead u should call the function through it's name like
& collect([EMAIL PROTECTED], [EMAIL PROTECTED]);  or
simply
collect ([EMAIL PROTECTED], [EMAIL PROTECTED]);
2nd thing u are passing references means the address location so if u will print $value then it will print the memory location.instead u r program should be like this
@array1 = (a, b, c,);
@array2 = (1, 2, 3,);

sub collect {
 ($value1, $value2) = @_;
    print @$value1;
    print @$value2;
return @value1, @value2;
}
collect ([EMAIL PROTECTED], [EMAIL PROTECTED]);

Thanks



----- Original Message ----- From: "Ryan Dillinger" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Tuesday, June 13, 2006 3:45 AM
Subject: subroutine?


Hello;
I have a script here, that for some reason I cannot get to
print out. Can someone please point out what I may be doing
wrong? I know I am going to feel like a Dummy!
            Thanks so much for your help!!

@array1 = (a, b, c,);
@array2 = (1, 2, 3,);

sub collect {
 ($value1, $value2) = @_;
    print $value1;
    print $value2;
return @value1, @value2;
}

sub ([EMAIL PROTECTED], [EMAIL PROTECTED]);

Thanks Again!



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>






--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to