Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Your @Variables is an array, each element of which is a line in the file. That's what the diamond operator gives you in list context.
So, $Variables[3] is the whole fourth line from the file called 'variables.dat'. That's not what you want. You're looking for the fourth *field* in whichever line. (I'm assuming those are tab-separated valued, BTW...) Without resorting to DBD::CSV or Text::CSV_XS (which may or may not be the best idea in your case), you can do it like this, after the code you posted in the root node:
In reply to Re: reading scalars from text file
by mrbbking
|
|