in reply to Adding Strings to an Array Permanently

Quick and dirty, but not necessarily correct and elegant solution would be:

  1. to store some special string like "THE_END" as the last one in the array
  2. if the array changes, to open up the Perl script itself, read it line by line, and when you come across "THE_END" (your array end), substitute that with $new_string.", "THE_END" (or basically, concatenate "THE_END" to the new string and then append the whole string to the array
  3. save the file

I know, I know, inefficient and quite dirty, but if you need it real fast (besides - of you need it really fast with no downbloadable modules available, like your computer is not online at the moment), that should work.

  • Comment on Re: Adding Strings to an Array Permanently