Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How can I enter the data of different variables from a text file into a perl program?

by JavaFan (Canon)
on May 05, 2012 at 22:20 UTC ( #969093=note: print w/ replies, xml ) Need Help??


in reply to How can I enter the data of different variables from a text file into a perl program?

use 5.010; use strict; use warnings; $_ = `cat data.txt`; s/\b[a-z]/\$::$&/g; eval; no warnings 'once'; say $::x1 * $::y1; say $::x2 * $::y2; say $::x3 * $::y3; say +($::x1 * $::y1) / $::x2; __END__ 38.38 67.28 52.07 6.61724137931034483
I bet there will be people complaining about this working program. ;-)


Comment on Re: How can I enter the data of different variables from a text file into a perl program?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://969093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (16)
As of 2015-07-01 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (11 votes), past polls