The code which i am using has the logic as since there as spaces between each comumn so i just divide it in number of words in one line as different such :
0 0 0 0 0 //so i have them in an arry and then store theses values in the new matrix the code for this is as...

open(TRAINER, '/perl/bin/test/training.txt');
@train = <TRAINER>;          
close(TRAINER);
[EMAIL PROTECTED];

for ($i = 0; $i < $length; ++$i)
{
  @char= split(/ /,$train[$i]);         
  [EMAIL PROTECTED];


  for ($x=1;$x<27;++$x)
    {
    $y=1;
        for ($j=0; $j < $s-1; ++$j)
          {

        $matrix_trained[$x][$y]=$char[$j];
            ++$y;
            }


    }
}

the lower module brings every number in the matrix...
but when i display it i only see zeros but the original conatains non zero values too.

And what about the module you are talking about i dont have any idea about them how do get them or use them.
Can you please help.

Thanks ,
Amit




On Wed, 08 Feb 2006 Brian Raven wrote :
>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



_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to