dusk has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

I have a new quandary, here it is:

.... loop .... @array = ($refnum, $scalar); push @chunk, @array; print "@array\n"; $refnum++; next; } warn "\ndebugging: @chunk\n"; print "delete?: "; chomp (my $number = <STDIN>); delete ($chunk[$number]); open (TO_WRITE, ">$ARGV[0]"); while (<TO_WRITE>) { print TO_WRITE @chunk; }

The basic idea is, the script should open a file, extract certain fragments of data (lets pretend these 'certain fragments' are $scalar), then the user can choose which $scalar to delete from the file; then delete it.
The problem in this script, is that it is (I think) deleting all the elements of the array, and then writing to the file.
Please help :)