void has asked for the wisdom of the Perl Monks concerning the following question:
#!/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 = <IN_FILE>; 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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: A Splice of life
by jeffa (Bishop) on Nov 30, 2001 at 22:43 UTC | |
|
Re: A Splice of life
by dragonchild (Archbishop) on Nov 30, 2001 at 22:45 UTC | |
|
Re: A Splice of life
by seanbo (Chaplain) on Nov 30, 2001 at 23:01 UTC | |
|
Re: A Splice of life
by void (Scribe) on Nov 30, 2001 at 22:55 UTC | |
by maverick (Curate) on Nov 30, 2001 at 23:02 UTC | |
by void (Scribe) on Dec 01, 2001 at 01:27 UTC |