Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 examining the Monastery: (12)
As of 2014-11-25 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (160 votes), past polls