Vladimir D Belousov <mailto:[EMAIL PROTECTED]> wrote:

: I want to give to print_array() function a reference to a part of
: array. Array and that part of array may be very big and I wish to
: avoid excessive copying of data. Therefore I don't want use splice
: function.

#!/usr/bin/perl

use strict;
use warnings;

my @array = 1 .. 1_00_000;

print_array( [ @array[ 10_000 .. 10_050 ] ] );


sub print_array {
        print "$_\n" foreach @{ $_[0] };
}

__END__


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


-- 
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