sub my_string_index($\@) {
my ($symkey, $symkeys)=@_;
my $index=-1;
for ($index=0;$index<=$#$symkeys; ++$index) {
if ($symkeys->[$index] eq $symkey) { return $index; }
}
return -1;
}
####
@cursor_keys = qw( );
$keyname_to_find='';
my_string_index $keyname_to_find, @cursor_keys;
####
# skeleton file read & write functions...
sub readfile { my ($array_p)=@_; @$array_p=<>;}
sub save_file {
my ($array_p)=@_; foreach (@$array_p) { print $_; }
}
# (above dummy routines will be changed later)
### main program ###
# first open file
readfile(\@cur_file); #will put file into specified array
#update code
#delete blank comment lines and blank lines
@mynewfile=grep ( !/^#?\s*$/, @cur_file);
#save results back in file
save_file(\@mynewfile); #will save array back to file