[bcn-pm] fer còpia d'un objecte

Alex Muntada alexm at cpan.org
Thu Jul 17 21:19:51 CDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoting Anarion:

> La disponibilitat de clonar un objecte a destar implementada
> a la clase que utilitzes.

No soc cap expert en Bioperl, però fent un cop d'ull al manual
diria que el que tu busques és el següent:

  $a = new Bio::SeqFeature::Generic();

  $b = new Bio::SeqFeature::Generic(
    -gff_string => $a->gff_string
  );

Però et recomano que miris la web que apareix a la documentació
(bio.perl.org) perquè hi trobaràs de tot... jo he quedat ben
parat!

> Sino sempre pots fer algun truc com usar Data::Dumper i eval
> i ferte un clonatge manual.

Tractant-se de programació amb objectes, haver d'utilitzar el
Data::Dumper fa molt lleig, encara que funcioni. Per tant, us
desaconsello totalment aquest mètode en casos com aquest, o ja
em direu per a què serveix l'OOP sinó...
;-)

- --
Alex Muntada <alexm at cpan.org>
http://alexm.org/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/F1kULdxCGS3zaBERAu73AKCU/Iu9S9laCsmVagVnqTZk3UtbZgCfZRC4
5QJdkcio3/YjKAotfMPPObA=
=fPA0
-----END PGP SIGNATURE-----



More information about the Barcelona-pm mailing list