Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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