
Jasmine
Administrator
Feb 1, 2000, 9:09 AM
Post #3 of 3
(1312 views)
|
|
Re: problems with the texarea html tag
[In reply to]
|
Can't Post
|
|
That's because the input record delimeter (held in $/) is a newline by default. Perl, by default, considers each line in a file a record. So to slurp the entire contents of the file into a scalar (that is, to define the record as the complete multiline file), you'll first need to clear the default record delimeter. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> open (FILE, "temp.txt"); undef $/; $txt = <FILE>; </pre><HR></BLOCKQUOTE> $txt will now hold the entire contents of <FILE>
|