
April 11th, 2000, 01:32 PM
|
|
Contributing User
|
|
Join Date: Jul 1999
Posts: 33
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
just a quick and probably dodgy example:
@array = (1 .. 10);
&mysub(@array);
exit;
sub mysub
{
@temp = @_;
foreach (@temp)
{
print "sub got this number $_n";
}
}
----
You might want to get the return values of the array so maybe you could have return(@temp), but then you'd want to call it with @somearay = &mysub(@array); Or something like that.
as for scopes in perl, a good book is learning perl by O'Reilly, it'll explain that and more. Maybe even check the perl homepage.
My perl is a tad rusty. :-/
Imo
|