Agradecimientos/Acknowledgments

I'd like to thank Tom Christiansen, Damian Conway, Simon Cozens, Francois Desarmenien, Richard Foley, Jeffrey E.F. Friedl, Joseph N. Hall, Tim Jennes, Andy Lester, Allison Randall, Randal L. Schwartz, Michael Schwern, Peter Scott, Sriram Srinivasan, Linconl Stein, Dan Sugalski, Leopold Tötsch, Nathan Torkington and Larry Wall for their books and/or their modules. To the Perl Community.







Special thanks to Larry Wall for giving us Perl.







A mis alumnos de Programación Paralelo II en el segundo curso de la Ingeniería Superior Informática en la Universidad de La Laguna

Casiano Rodríguez León
2010-03-22
program =~ s/<<\$dir>>/$dir/g; $program =~ s/<<\$ENV>>/$ENV/g; $program =~ s/<<\$exec>>/$exec/g; $program =~ s/<<\$scriptname>>/$scriptname/g; print $tmp $program; close($tmp); return $scriptname; }

Ejercicio 1.2.1  

En http://www.perlmonks.org/ apareció la siguiente pregunta (busque por el tópico calling Unix commands):

Hi, I'm trying write a script that will call a unix comand and either
post the results or parse the results then post them. I thought perhaps
I could accomplish this with exec or system. However, I haven't been
able to figure it out. Any insight would be much appreciated. Thanx
Comente las respuestas. Estudie el módulo Shell y discuta su implementación.

Explique la salida:

pp2@nereida:~/Lbook$ perl -wde 0
main::(-e:1):   0
  DB<1> use Shell qw(echo cat ps cp)
  DB<2> s $foo = echo("howdy", "funny", "world")
main::((eval 7)[/usr/share/perl/5.8/perl5db.pl:628]:3):
3:      $foo = echo("howdy", "funny", "world");
  DB<<3>> s
Shell::AUTOLOAD(/usr/share/perl/5.8/Shell.pm:132):
132:        shift if ref $_[0] && $_[0]->isa( 'Shell' );
  DB<<3>> n
Shell::AUTOLOAD(/usr/share/perl/5.8/Shell.pm:133):
133:        my $cmd = $AUTOLOAD;
  DB<<3>>
Shell::AUTOLOAD(/usr/share/perl/5.8/Shell.pm:134):
134:        $cmd =~ s/^.*:://;
  DB<<3>> p $cmd
Shell::echo
  DB<<4>> n
Shell::AUTOLOAD(/usr/share/perl/5.8/Shell.pm:136):
136:        *$AUTOLOAD = _make_cmd($cmd);
  DB<<4>> n
Shell::AUTOLOAD(/usr/share/perl/5.8/Shell.pm:137):
137:        goto &$AUTOLOAD;
  DB<<4>> x @_
0  'howdy'
1  'funny'
2  'world'
  DB<<5>> c
  DB<6> p $foo
howdy funny world



Subsecciones
Casiano Rodríguez León
2010-04-20