Perl_Padawan has asked for the wisdom of the Perl Monks concerning the following question:
I am an intermediate perl user and I am trying to create an web site management interface for my church website that other people will be able to use. I want to have a txt file that I can read and write to that will have editable content. Then I want the cgi to read the variable strings in the txt file and spit out html.
I want to have a txt file like this:
$box_1="random content...";
$box_2="random content...";
$box_3="random content...";
Then use it like this:...
print $box_1;
print $box_2;
print $box_3;
Is there a way to use the raw data in the txt file as the string variables instead of opening the file, reading the contents, splitting them and assigning each one to a variable?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Reading variables from a txt file
by davido (Cardinal) on Jul 07, 2012 at 20:52 UTC | |
Re: Reading variables from a txt file
by jethro (Monsignor) on Jul 07, 2012 at 22:09 UTC | |
Re: Reading variables from a txt file
by cavac (Parson) on Jul 08, 2012 at 12:17 UTC | |
Re: Reading variables from a txt file
by BillKSmith (Monsignor) on Jul 07, 2012 at 23:07 UTC | |
Re: Reading variables from a txt file
by cheekuperl (Monk) on Jul 08, 2012 at 03:23 UTC | |
Re: Reading variables from a txt file
by aitap (Curate) on Jul 08, 2012 at 10:48 UTC | |
Re: Reading variables from a txt file
by flexvault (Monsignor) on Jul 08, 2012 at 12:36 UTC |
Back to
Seekers of Perl Wisdom