
Cure
User
May 14, 2000, 8:46 AM
Post #9 of 13
(1301 views)
|
|
Re: inserting a text file into a perl script.
[In reply to]
|
Can't Post
|
|
Hi One way to do it:--> { local $/; open(DATA,"database.txt") or die $!; $cure=<DATA>; close(DATA); } ($header, $footer) = split(/__SPLIT__/, $cure,2); print $header; print $footer; heres another way to do it--> { local $/; open(DATA,"database.txt") or die $!; $cure=<DATA>; close(DATA); } $header = substr($cure,0,index($cure,"_")); $footer = substr($cure,index($cure,"__",)),$footer=~s/__SPLIT__//; print $header; print $footer; Cure
|