Perl_Padawan has asked for the wisdom of the Perl Monks concerning the following question:
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 (Prior) 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 |