in reply to Re^2: Reading individual bits
in thread Reading individual bits
Whilst I'm looking, this bit of code is very strange--and slow.
@$ItemListRef = (@$ItemListRef,$NumOut, "\t");
You
This action is the same as doing:
push @$ItemListRef, $NumOut, "\t";
Accept that it uses gob-loads (tech. term) of memory in building lots of intermediate lists in the process. No wonder your subroutine is slow.
Also, why are you interspersing your values with tabs?
If the intention is to print them as tab-delimited list to a file or the screen. Just build the array without the inspersed tabs and then use join to add teh tabs when you print.
print join "\t", @ItemList;
Not only will you save half the memory of your list, by not allocating it you'll save a bit more time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Reading individual bits
by Anonymous Monk on Jul 30, 2004 at 13:41 UTC |