On Nov 1, 11:35 am, [EMAIL PROTECTED] (Charles) wrote: > Three days of head-banging....
An hour of FAQ and Documentation reading would have been more productive... > the Boss has my walking papers if I don't "get'er done"! > > I have module from CPAN named Graph. I have created a subroutine for > this to pass in two arrays; x-axis and y-axis into my Graph subroutine > i.e. ; &graph( @Xvalues, @Yvalues ); > > My confusions is: in my subroutine, I cannot treat the two parameters > (arrays) as separate parameters. Therefore both arrays @Xvalues > @Yvalues are seen as one big string of numbers when I pass them..... > everything is one one axis, the x-axis. perldoc -q "How can I pass" perldoc perlsub In short, pass references to the arrays, and derfeference them in the subroutine. sub take_two { my ($x_ref, $y_ref) = @_; my @x = @{$x_ref}; my @y = @{$y_ref}; # . . . } #.... take_two([EMAIL PROTECTED], [EMAIL PROTECTED]); Paul Lalli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/