Link to home
Start Free TrialLog in
Avatar of haast
haast

asked on

Beginners question

I am a beginner and this probably an extremely simple question, please excuse me.

How do I reverse a flatfiles contents, what I mean by reverse is this:

Existing flatfile contents.

1\n
2\n
3\n

What I want to convert it to is:

3\n
2\n
1\n

This is how I currently read the file:

open(FILE,"$dbase")
@all=<FILE>;
close(FILE);

ASKER CERTIFIED SOLUTION
Avatar of bebonham
bebonham

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rag2000
rag2000

reverse the array
@reverseAll = reverse @all
Avatar of haast

ASKER

Thank you, it works fine.