#!/usr/bin/perl -w # # this is a test of the splice command # # # use strict; my $x = "how about this"; my $y = "this is the new line"; open (IN_FILE, "test.dat") or die "test.dat will not open: $!\n"; my @ary = ; close (IN_FILE) or die "test.dat will not close: $!\n"; # print "Print the array before the change:\n @ary\n"; my $z = splice (@ary,$x,2); print "Printing the array:\n @ary\n\n\n"; print $z;