[bcn-pm] Perl profilers

Alex Muntada alexm at ac.upc.es
Fri Apr 30 09:38:42 CDT 2004


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

* avilella:  [2004-04-30/15:39:00 +0200]

> BUGS
> 
> Another problem is that if a subroutine exits using goto(LABEL),
> last(LABEL) or next(LABEL) then perl may crash
>        or Devel::DProf will die with the error:
>  
>           panic: Devel::DProf inconsistent subroutine return

Si llegeixes amb atenció la frase veuràs que el que diu no és que
no puguis posar cap next enlloc, sinó que no pots sortir d'una
subrutina amb un salt incondicional (goto, last o next), com en
l'exemple següent:

  sub foo {
    print "foo\n";
    goto BAR;
  }

  foo();

  BAR:
  print "bar\n";


Que jo sàpiga, aquesta no és una pràctica gaire normal (i encara
menys en Perl) i del tot desaconsellable atès que sempre hi ha
mecanismes que permeten evitar-ho (potser amb un petit cost en
eficiència però segur que sense tants maldecaps).

use Perl;
no Patents;

- --
Alex Muntada <alexm at ac.upc.es>
http://people.ac.upc.es/alexm/

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

iD8DBQFAkmTtLdxCGS3zaBERAtqBAJ9r1LJiorssDxZ3ncjaDdHjQPliPgCfR6Xz
hVemdLOU8rWAjQ9JqgWBxJs=
=LXph
-----END PGP SIGNATURE-----



More information about the Barcelona-pm mailing list