Steve Dawson <> wrote:
> amit hetawal wrote:
>
>>
>> ?
>> Hello all,
>> I am writing a matrix to a file as :
>>
>> open(WRITE, ">training.txt");
>> for ($x = 1; $x<27; ++$x)
>> {
>> for($y=1; $y<27;++$y)
>> {
>> print WRITE "$matrix[$x][$y] ";
>> }
>> print WRITE "\n";
>>
>> }
>>
>> this code is working fine and writing the file in format as ; 0 0 0
>> 0 0 0 0 1 1 1 2 3 4 5 0 0 0 0 0 0
>> .
>> .
>> .
>>
>> but when i want to retrieve this matrix in a new prog. and that too
>> same as a matrix as above.. i am not able to get the same matrix
>> again. How can i achieve this..
>> Any ideas....
>> Thanks,
>> Amit
Amit, you have shown us the code that seems to work, but in general you
are more likely to get help if you also show us the code that you are
having problems with. However, in this case ...
>>
> You could look at the Storable module which will allow you to store
> and retrieve complex data structures from a file.
>
> Steve
Good advice from Steve. Storable bas the benefit of being fast, but the
downside of not being human readable, if that is a requirement. Other
modules, such as Data::Dumper, Data::Dump or even XML::Simple would be
more human readable if not as fast. There are not doubt other modules
that can be used to good effect. It looks like your problem has been
solved a number of times, and in different ways. You could be spoiled
for choice.
HTH
--
Brian Raven
=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs