Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 ( [id://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. ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-03-28 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found