O
OttawaTrade
here is the default form tie::file
use Tie::File;
tie @array, 'Tie::File', 'data.txt' or die ...;
my data.txt looks like this
ID|number|name|address|
a|a.number|a.name|a.address|
b|b.number|b.name|b.address|
this is basically a read only table.
i hope to be able to sort by name, number or address etc.
so i want to sort
$array[1][2]
$array[2][2]
$array[3][2]
etc
i have done the sort part in a 1D array. so the only problem i have is how
to tie a 2D arry to file.
how do i define @array 2D? how does Tie:File know what the seperator is?
use Tie::File;
tie @array, 'Tie::File', 'data.txt' or die ...;
my data.txt looks like this
ID|number|name|address|
a|a.number|a.name|a.address|
b|b.number|b.name|b.address|
this is basically a read only table.
i hope to be able to sort by name, number or address etc.
so i want to sort
$array[1][2]
$array[2][2]
$array[3][2]
etc
i have done the sort part in a 1D array. so the only problem i have is how
to tie a 2D arry to file.
how do i define @array 2D? how does Tie:File know what the seperator is?