in reply to put file content into a string
First, you don't seem to check to see if the open works. This seems a critical flaw. Try something like this:
open IN, "<myFile" or die "Could not open myFile: $!";
Second, you will only get the first line of the file, unless you muck with the record separator. You may want to append to your $str variable inside a while loop.
Hope that helps. :)
|
|---|