file lines into array

in the follwing code i open a file and print it to screen
but i also want to place the contents of the file into the
array 'originalone'
but it just puts a load of "_" in there
this is obviously the wrong way to put the file lines into the array
anyone know the correct way?
thanks
paul


open FILE,'<correct.txt' or die "can't open correct.txt because $!";
     $value = 0;
                        while( <FILE> ){
print;
@originalone[$value] = _;
$value = $value +1;
}
close FILE;    
paulwhelanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

binkzzCommented:
First of all, you don't want to say
@originalone[$value] = _;

But you want to say
$originalone[$value] = $_;


To get it all in an array, the best way really is to do:

open FILE, "<correct.txt";
  @originalone = <FILE>;
close FILE;

print @originalone;

Hope this helps,

McB
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
binkzzCommented:
Very weak to withdraw the question to save points, Paul.
0
paulwhelanAuthor Commented:
what are u talking about?
i accepted your answer!
0
binkzzCommented:
You put a $variable question up which you withdrew seconds after I gave you the chop $variable comment... !
0
paulwhelanAuthor Commented:
i never got that answer!
i worked it out myself
i wasnt sure if it was chop or splice and i found it on the web

i can assure u that i didnt see your answer
i have plenty of points and dont need to save them
i dont appreciate being dissed on this site

if points mean that much to you...here...take another 25 for an answer i never saw
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.