>>>>> "SHC" == Shawn H Corey <shawnhco...@ncf.ca> writes:


  SHC> #!/usr/bin/env perl

that is not a good trick to run perl. also it forks off an extra process
which slows things down.

  SHC> use strict;
  SHC> use warnings;

  SHC> my @whatever = qw(a b c d e);
  SHC> my @test = qw(1 2 3 4 5 6 7);

  SHC> sub testing {
  SHC>   my @data1 = @{ $_[0] };
  SHC>   my @data2 = @{ $_[1] };

why do you need to copy the arrays over? keep them as refs and
dereference them as needed.

        my( $data1, $data2 ) = @_ ;

  SHC>   print "\@data1 = @data1\n";
  SHC>   print "\@data2 = @data2\n";
  SHC> }

        print "data1 = @{$data1}\n";
        print "data2 = @{$data2}\n";

  SHC> See:
  SHC> perldoc perlreftut
  SHC> perldoc perlref

those should be mentioned more prominently and earlier. obviously the OP
doesn't know about refs so they need to learn the basics.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to