in reply to bubble sort in perl

Perl has a built in search function, that you might want to take a look at; conveniently enough it's called sort.
@raw_data = sort @raw_data;
That will sort it in numerical order.
@raw_data = sort {$b <=> $a} @raw_data
will do so backwards. Full documentation is available at perldoc's sort documentation.

Hope that is enough to get you started.     --jb