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

Hi all, I'm looking for the best approach to create an index in an already indexed text file (DVDbackups) to do the following: Validate the command line argument passed by user so the index number, for example 572, is not used again and the user gets prompted to use the next number in the queue (obviously 573). My approach would be to search through the DVDbackups file for the latest (if there is a way of checking for a date the index had been written to file) or last index added to the file (maybe by looking for the bottom index of the file) and do a string search for the last index number used and then finally suggest the number to the user or just make sure the user doesn't use that number or previous numbers again (like an error trap). Any help is much appreciated. Thanks
  • Comment on Best approach to validate a command line argument against an index in a file

Replies are listed 'Best First'.
Re: Best approach to validate a command line argument against an index in a file
by roboticus (Chancellor) on Apr 08, 2010 at 17:48 UTC