in reply to html into an array

Other Monks have given you advice to help with your problem. I would just like to point out what seems to be some slightly topsy-turvy logic in your code and give some advice regarding opening files. Your code

$append = 0; if ($append) { open(MYOUTFILE, ">clean_text"); #open for write, overwrite } else { open(MYOUTFILE, ">>clean_text"); #open for write, append }

looks like you are overwriting if $append is true and appending if it is false. Perhaps a little misleading?

The use of the three argument form of open is to be encouraged as is the use of lexically scoped filehandles. You should also test that the open succeeded. Most importantly, putting the lines use strict; and use warnings; at the top of your scripts will save you a lot of wasted time in the long run as it will help you spot typos like

$append = 1; ... if ( $apped ) { # Append to my file } else { # Trample all over my irreplaceable data }

Using strictures, three argument open and lexical handles your piece of code might look like

my $append = 0; my $cleanedFile = q{clean_text}; if ( $append ) { open my $cleanedFH, q{>>}, $cleanedFile or die qq{open: $cleanedFile for append: $!\n}; } else { open my $cleanedFH, q{>}, $cleanedFile or die qq{open: $cleanedFile for overwrite: $!\n}; }

I hope these thoughts are of use.

Cheers,

JohnGG