use 5.008004?
use strict?
use warnings y perl -w?
use Carp?
¿Que diferencia hay entre croak y die?
package nombredepaquete?
our?
¿En que ámbito es visible una variable declarada con our?
¿Cuál es el nombre completo de una variable de paquete?
local?
%h de clave k?
@a de índice 7?
¿Que lugar ocupa ese elemento en el array?
my ($input) = @_; |
my $input = @_; |
=>?.
@a = undef;
if (@a) { &tutu(); }
¿Se ejecuta &tutu? Explique su respuesta
eval {
my ($a, $b) = (10, 0);
my $c = $a / $b;
};
print "$@" if $@;
lhp@nereida:~/Lperl/src$ cat -n privacy.pl
1 #!/usr/bin/perl -w
2 use strict;
3 package tutu;
4 my $a = 10;
5
6 package titi;
7
8 if (defined($tutu::a)) { print "$tutu::a\n" }
9 else { print "No esta definida \$tutu::a\n"};
10 print "\$a = $a\n";
BEGIN?
perl -e 's/nereida\.deioc\.ull\.es/miranda.deioc.ull.es/gi' -p -i.bak *.html
Indique como saldrá formateada la salida del siguiente código:
my @items = qw(un dos tres);
my $format = "Los items son:\n".("%10s\n"x @items);
printf $format, @items;
@text?
DB<1> @text = (1, 2, 3, 4, 5) DB<2> @text[@text] = 0 DB<3> x 0+@text 0 6
Makefile.PL? ¿Cuál es su función?
¿Que secuencia de comandos conocida como
mantra de instalación es necesario ejecutar para
instalar un módulo?
¿Que significa la frase looks good?
MANIFEST?
¿Cuál es la función de MANIFEST.SKIP?
¿Que hace make manifest?
Makefile generado a partir de
Makefile.PL ¿Que debo hacer?
-I?
$/?
=head1 Texto =over número =item stuff =back =cut =pod
pod:
C<$a E<lt>=E<gt> $b>
use Modulo::Interesante qw(one two);
package Trivial::Tutu; our @EXPORT = qw(uno dos); our @EXPORT_OK = qw(tres cuatro cinco); use Exporter; our @ISA = qw(Exporter);
Indique que es importado y que no cuando se usan las siguientes declaraciones: la exportación:
use Trivial::Tutu;
use Trivial::Tutu qw(uno dos)
use Trivial::Tutu qw(tres cinco)
use Trivial::Tutu();
use Trivial::Tutu(siete);
use Este::Modulo;¿Donde busca el fichero
Modulo.pm?
Tutu.pm?
MANIFEST?
Makefile para trabajar en la plataforma
actual?
use y require?
our @ISA = qw(Exporter)?.
our @EXPORT = qw( compile compile_from_file)?
EXPORT Y EXPORT_OK?.
BEGIN?
o conf de cpan?
makepl_arg?
h, a, d, i, r, !,
de cpan?
upgrade, ls, look de cpan?
use_ok
,
diag
,
ok
,
is
,
isnt
,
like
,
unlike
,
can_ok
,
isa_ok
e
is_deeply
Test::More el número de pruebas a realizar?
¿Cómo se le indica a Test::More que no conocemos el número de pruebas a realizar?
Test::Exception, Test::Pod, etc.
que no forman parte de la distribución núcleo de Perl. ¿Como deben ser diseñadas dichas pruebas de cara a
no entorpecer la correcta distribución de su módulo?
if?
$N > 0 and $R > 0 and $N == int $N and $R == int $R
ok?
is?
$@?
like?
use_ok es llamada dentro de un BEGIN?
SKIP?
TODO?
pod_file_ok?
¿A que módulo pertenece?
use Test::More qw(no_plan);?
can_ok? ¿Qué argumentos tiene?
is_deeply e is?
throws_ok?
¿En que módulo se encuentra?
HARNESS_PERL_SWITCHES=-MDevel::Cover make test?
lives_ok? ¿En que módulo está?
trunk, branches y tags?
svn commit?
¿Que hace svn update?
¿Que hace svn log?
svn -vu satus? ¿Que significan las opciones usadas?
-p1 en
$ patch -p1 < ../newknap.patch
svn update?
svn commit -m 'changed this and that'?
gvim -d file1 file2?
diffupdate?
]c?
[c?
8]c?
do?
dp?
:diffg?
:12,20diffg?
:buffers?
:buffer 2?
:diffg 3?
:diffg batch.mine?
:diffput?
:12,20diffput?
zo?
zO?
zc?
zO?
:vnew?
CTRL-W v?
:set foldmethod=manual?
zf}?
:diffthis?
:diffsplit filename?
:windo ?
vim:
:1,5yank a :6,10yank b :tabedit | put a | vnew | put b :windo diffthis
vimdiff?
patch? ¿Cómo se crea un patch?
:diffpatch filename?
:vert diffpatch filename?
$ svn diff modulos.tex -r PREV:HEAD > patch
$ vi
:.!svn cat modulos.tex -r PREV
:vert diffpatch patch
~/.ssh/authorized_keys
¿Cómo se pinene comentarios en dicho fichero?
¿que ocurre con las líneas en blanco?
from="!enemy.my_isp.net,*.my_isp.net,home.example.com"
svnserve?
svn+ssh si no tenemos privilegios de administrador?
--tunnel-user=user de svnserve?
command="/usr/bin/svnserve -t -r /home/casiano/repository --tunnel-user=lgforte",no-port-forwarding ssh-dss ....
system con uno o con varios argumentos?
system con o sin redirección, pipes, background, etc.?
system y exec?
I require some assistance. I am writing a CGI script in Perl on Solaris that needs to run external commands using the 'system' operator. These commands are part of a larger package that needs the system initialized (via a command) properly before execution, or else each individual command cannot interact with the other, like the following. 1: system "/PATH/initialize_system"; # init the environment 2: system "/PATH/skew.k ARG_FOR_FRAME_NUMBER"; # create image 3: system "/PATH/savegif.k FRAME_NUMBER"; # save image off 4: system "exit"; # exit the environment created with initialize_system When running a command using 'system', the environment appears to only lasts until the next line of Perl code, so line 2 can't talk to line 3 because the environment required for them to communicate isn't there which is initialized by line 1. The above code snippet would the way it is run from a command line. Any help would be appreciated. Thanks.
¿Cuál es su respuesta?
$ set | grep "^[A-Z]" |wc
$ perl -e 'print "$_ = $ENV{$_}\n" for sort keys %ENV;' | wc
¿A que se debe la diferencia?.
Consulte el módulo
Env::Bash
.
Discuta su funcionalidad.
system 'echo $PATH'y
system "echo $PATH"
system('echo','hola','>','juan.txt');
*a = *b?
*a = \$b?
*a = \&Paquete::Con::Un::Largo::Nombre::resuelve?
*a = \*STDOUT?
DB<1> *a = \*STDOUT DB<2> print a "hola"
%ENV?
qx?
tee?
$? == -1?
$? & 127?
$? & 128?
$? >> 8?
bc implementa una calculadora).
Explique la secuencia
de eventos:
pp2@nereida:~/alu$ perl -wde 0 main::(-e:1): 0 DB<1> open $F, "|bc" DB<2> print $F "4*3\n" DB<3> print $F "5*2\n" DB<4> close($F) 12 10 DB<5>
DB<6> $F->autoflush(1) DB<7> open $F, "|bc" DB<8> print $F "4*3\n" 12 DB<9> print $F "5*2\n" 10
bc y alimente la calculadora usando syswrite.
¿Que diferencias observa?
$/?
lhp@nereida:~/Lperl/src/perl_networking/ch2$ cat -n pipe2none 1 #!/usr/bin/perl -w 2 use strict; 3 4 open(FH, "|doesnotexist") or die "Can't open pipe: $!\n"; 5 print FH "Hi!\n" or die "Can't write to doesnotexist!: $!\n"; 6 close(FH) or die "Can't close doesnotexist!: $!\n. Status: $?";Al ejecutar este programa tenemos la salida:
lhp@nereida:~/Lperl/src/perl_networking/ch2$ perl -v This is perl, v5.8.7 built for i486-linux-gnu-thread-multi ... lhp@nereida:~/Lperl/src/perl_networking/ch2$ ./pipe2none Can't exec "doesnotexist": No existe el fichero o el directorio at ./pipe2none line 4. Can't open pipe: No existe el fichero o el directorio
lhp@nereida:~/Lperl/src/perl_networking/ch2$ cat -n pipe2none2 1 #!/usr/bin/perl -w 2 use strict; 3 4 my $pid = open(FH, "| doesnotexist > tutu") or die "Can't open pipe: $!\n"; 5 print "PID: $pid\n"; 6 print FH "Hi!\n" or die "Can't write to doesnotexist!: $!\n"; 7 close(FH) or die "Can't close doesnotexist!: $!\n. Status: $?";Al ejecutar produce la salida:
lhp@nereida:~/Lperl/src/perl_networking/ch2$ pipe2none2 PID: 18909 sh: doesnotexist: command not found Can't close doesnotexist!: . Status: 32512 at ./pipe2none2 line 7.
STDOUT sean redirigidas a un determinado fichero?
%SIG?
PIPE? ¿Cuándo se genera una señal PIPE?
