How to get some data from TXT file and run it in Perl code?

M

max

How to get some data from TXT file and run it in Perl code?

Eg. In Txt file named "data.txt" I have
 
J

John Bokma

max said:
How to get some data from TXT file and run it in Perl code?

Eg. In Txt file named "data.txt" I have

------------------------------------

$name="Piter";
$phone="095445566-555";
$a=$b+$c;

perldoc -f require

(BTW, I recommend to use strict; and use warnings; etc.)
 
C

ced

max said:
How to get some data from TXT file and run it in Perl code?

Eg. In Txt file named "data.txt" I have

------------------------------------

$name="Piter";
$phone="095445566-555";
$a=$b+$c;
An alternative to the suggesed 'require' is 'do' if you're just
reading in a configuration file.

perldoc -f do

hth,
 
H

hemis

Had rexx this property or what, where you could load a module or just any
piece of code from text file onto memory and run it?
It would be cool. Can I do that in perl?!
 
A

Anno Siegel

hemis said:
Had rexx this property or what, where you could load a module or just any
piece of code from text file onto memory and run it?
It would be cool. Can I do that in perl?!

perldoc -f eval

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top