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 :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: writing blank array to file?
by wog (Curate) on Jun 18, 2001 at 20:13 UTC | |
Re: writing blank array to file?
by dimmesdale (Friar) on Jun 18, 2001 at 20:08 UTC | |
Re: writing blank array to file?
by bikeNomad (Priest) on Jun 18, 2001 at 20:09 UTC | |
Re: writing blank array to file?
by malloc (Pilgrim) on Jun 18, 2001 at 20:10 UTC |
Back to
Seekers of Perl Wisdom