Usually, one would open a file and assign each line using <> as below:
open(DAT, $data_file) ¦¦ die("Could not open file!");
@raw_data=<DAT>;
close(DAT);
But for my case, I don't have a file which I'm opening, just a very long variable $source. So, I want to do something like:
@source = <$source>
But obviously, that is incorrect syntax.
@source=split(/\n/, $source);
That will give an array with one line of code per entry.
(NB that should work for pages stored in *nix format. For Windows files you might have to use a more complicated regex to deal with the \r carriage returns as well as the \n newlines...)