Re: Help with passing arrays to a Perl subroutine

2007-11-02 Thread Charles
On Nov 1, 1:37 pm, [EMAIL PROTECTED] (Jl Post) wrote: > On Nov 1, 9:35 am, [EMAIL PROTECTED] (Charles) wrote: > > > > > 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, @Yval

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread Paul Lalli
On Nov 1, 6:35 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: > Paul Lalli schreef: > > You need @{$xValues} and @{$yValues}. > > Thanks for the correction of my stupid typoes. In the line that came > after what you quote, and in the code that followed it, it is OK. > BTW, the {} are not needed. Not in t

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread Dr.Ruud
Paul Lalli schreef: > Dr.Ruud: >> [EMAIL PROTECTED]: >>> sub graph >>> { >>> my @Xvalues = @{ $_[0] }; # remember to use "my"! >>> my @Yvalues = @{ $_[1] }; # remember to use "my"! >> >> A graph subroutine is not likely to change the input data, so there >> is no re

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread Paul Lalli
On Nov 1, 4:53 pm, [EMAIL PROTECTED] (Dr.Ruud) wrote: > [EMAIL PROTECTED] schreef: > > > sub graph > > { > > my @Xvalues = @{ $_[0] }; # remember to use "my"! > > my @Yvalues = @{ $_[1] }; # remember to use "my"! > > A graph subroutine is not likely to change the inp

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > sub graph > { > my @Xvalues = @{ $_[0] }; # remember to use "my"! > my @Yvalues = @{ $_[1] }; # remember to use "my"! A graph subroutine is not likely to change the input data, so there is no reason to copy the input data. m

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread jl_post
On Nov 1, 9:35 am, [EMAIL PROTECTED] (Charles) wrote: > > 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

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread Paul Lalli
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

Re: Help with passing arrays to a Perl subroutine

2007-11-01 Thread Gunnar Hjalmarsson
Charles wrote: Three days of head-banging Unnecessary, since this is a FAQ. 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(