POD2-ES
view release on metacpan or search on metacpan
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
=item Obtener información de usuarios y grupos
X<user> X<group> X<password> X<uid> X<gid> X<passwd> X</etc/passwd> X<usuario> X<grupo> X<contraseña>
=for Pod::Functions =User
L<C<endgrent>|/endgrent>, L<C<endhostent>|/endhostent>,
L<C<endnetent>|/endnetent>, L<C<endpwent>|/endpwent>, L<C<getgrent>|/getgrent>,
L<C<getgrgid>|/getgrgid GID>, L<C<getgrnam>|/getgrnam NOMBRE>,
L<C<getlogin>|/getlogin>, L<C<getpwent>|/getpwent>, L<C<getpwnam>|/getpwnam
NOMBRE>, L<C<getpwuid>|/getpwuid UID>, L<C<setgrent>|/setgrent>,
L<C<setpwent>|/setpwent>
=item Obtener información de la red
X<network> X<protocol> X<host> X<hostname> X<IP> X<address> X<service> X<red> X<protocolo> X<servidor> X<dirección> X<servicio>
=for Pod::Functions =Network
L<C<endprotoent>|/endprotoent>, L<C<endservent>|/endservent>,
L<C<gethostbyaddr>|/gethostbyaddr DIRECCIÃN,TIPODIR>,
L<C<gethostbyname>|/gethostbyname NOMBRE>, L<C<gethostent>|/gethostent>,
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
L<C<fcntl>|/fcntl IDENTIFICADOR_ARCHIVO,FUNCIÃN,ESCALAR>, L<C<flock>|/flock
IDENTIFICADOR_ARCHIVO,OPERACIÃN>, L<C<fork>|/fork>, L<C<getgrent>|/getgrent>,
L<C<getgrgid>|/getgrgid GID>, L<C<gethostbyname>|/gethostbyname NOMBRE>,
L<C<gethostent>|/gethostent>, L<C<getlogin>|/getlogin>,
L<C<getnetbyaddr>|/getnetbyaddr DIRECCIÃN,TIPODIR>,
L<C<getnetbyname>|/getnetbyname NOMBRE>, L<C<getnetent>|/getnetent>,
L<C<getppid>|/getppid>, L<C<getpgrp>|/getpgrp PID>,
L<C<getpriority>|/getpriority CUÃL,QUIÃN>,
L<C<getprotobynumber>|/getprotobynumber NÃMERO>,
L<C<getprotoent>|/getprotoent>, L<C<getpwent>|/getpwent>,
L<C<getpwnam>|/getpwnam NOMBRE>, L<C<getpwuid>|/getpwuid UID>,
L<C<getservbyport>|/getservbyport PUERTO,PROTOCOLO>,
L<C<getservent>|/getservent>, L<C<getsockopt>|/getsockopt
SOCKET,NIVEL,OPCIÃN>, L<C<glob>|/glob EXPR>, L<C<ioctl>|/ioctl
IDENTIFICADOR_ARCHIVO,FUNCIÃN,ESCALAR>, L<C<kill>|/kill SEÃAL, LISTA>,
L<C<link>|/link ARCHIVO_VIEJO,ARCHIVO_NUEVO>, L<C<lstat>|/lstat
IDENTIFICADOR_ARCHIVO>, L<C<msgctl>|/msgctl ID,CMD,ARG>, L<C<msgget>|/msgget
CLAVE,INDICADORES>, L<C<msgrcv>|/msgrcv ID,VAR,TAMAÃO,TIPO,INDICADORES>,
L<C<msgsnd>|/msgsnd ID,MSG,INDICADORES>, L<C<open>|/open
IDENTIFICADOR_ARCHIVO,EXPR>, L<C<pipe>|/pipe
IDENTIFICADOR_LECTURA,IDENTIFICADOR_ESCRITURA>, L<C<readlink>|/readlink EXPR>,
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
Cuando escoja un nuevo salto cree un string de dos caracteres elegidos
aleatoriamente del conjunto C<[./0-9A-Za-z]> (como por ejemplo C<join '', ('.',
'/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]>). Este conjunto de caracteres
es sólo una recomendación; los caracteres permitidos en el salto dependen
solamente de la función crypt del sistema y Perl no puede restringir el salto
que L<C<crypt>|/crypt TEXTOPLANO,SALTO> acepte.
Aquà hay un ejemplo que se asegura que quien corra el programa conoce su
contraseña:
my $pwd = (getpwuid($<))[1];
system "stty -echo";
print "Contraseña: ";
chomp(my $palabra = <STDIN>);
print "\n";
system "stty echo";
if (crypt($palabra, $pwd) ne $pwd) {
die "Lo siento...\n";
} else {
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
más portable en sistemas compatibles con POSIX. Vea también el módulo
L<C<Term::ReadKey>|Term::ReadKey> en CPAN.
=item getlogin
X<getlogin> X<login>
=for Pod::Functions return who logged in at this tty
Implementa la función de la biblioteca C del mismo nombre, que en la mayorÃa
de los sistemas devuelve el login actual desde F</etc/utmp>, si existe. Si
devuelve la cadena vacÃa, utilice L<C<getpwuid>|/getpwuid UID>.
my $login = getlogin || getpwuid($<) || "Kilroy";
No considere usar L<C<getlogin>|/getlogin> para autenticación: no es tan
seguro como L<C<getpwuid>|/getpwuid UID>.
Cuestiones de portabilidad: L<perlport/getlogin>.
=item getpeername SOCKET
X<getpeername> X<peer>
=for Pod::Functions find the other end of a socket connection
Devuelve la dirección socket empaquetada del otro extremo de la conexión
SOCKET.
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
=for Pod::Functions get current nice value
Devuelve la prioridad actual de un proceso, un grupo de procesos o un usuario.
(Vea L<getpriority(2)>). Lanzará una excepción fatal si se usa en una
máquina que no implemente L<getpriority(2)>.
Cuestiones de portabilidad: L<perlport/getpriority>.
=item getpwnam NOMBRE
X<getpwnam> X<getgrnam> X<gethostbyname> X<getnetbyname> X<getprotobyname>
X<getpwuid> X<getgrgid> X<getservbyname> X<gethostbyaddr> X<getnetbyaddr>
X<getprotobynumber> X<getservbyport> X<getpwent> X<getgrent> X<gethostent>
X<getnetent> X<getprotoent> X<getservent> X<setpwent> X<setgrent> X<sethostent>
X<setnetent> X<setprotoent> X<setservent> X<endpwent> X<endgrent> X<endhostent>
X<endnetent> X<endprotoent> X<endservent>
=for Pod::Functions get passwd record given user login name
=item getgrnam NOMBRE
=for Pod::Functions get group record given group name
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
=for Pod::Functions get host record given name
=item getnetbyname NOMBRE
=for Pod::Functions get networks record given name
=item getprotobyname NOMBRE
=for Pod::Functions get protocol record given name
=item getpwuid UID
=for Pod::Functions get passwd record given user ID
=item getgrgid GID
=for Pod::Functions get group record given group user ID
=item getservbyname NOMBRE,PROTOCOLO
=for Pod::Functions get services record given its name
lib/POD2/ES/perlfunc.pod view on Meta::CPAN
los usuarios son capaces de cambiar esta información y por eso no puede
confiarse y por eso el $gcos queda contaminado (ver L<perlsec>). La $contrasena
y el $shell, la contraseña codificada del usuario y el shell del login, están
también contaminados, por la misma razón.
En contexto escalar, obtiene el nombre, a menos que la función fuera localizar
por nombre, en cuyo caso obtendrá la otra cosa, cualquiera que sea. (Si la
entrada no existe obtendrá el valor indefinido). Por ejemplo:
my $uid = getpwnam($nombre);
my $nombre = getpwuid($numero);
my $nombre = getpwent();
my $gid = getgrnam($nombre);
my $nombre = getgrgid($numero);
my $nombre = getgrent();
# etc.
En I<getpw*()> los campos $cuota, $comentario y $expiracion son casos
especiales en el sentido que en muchos sistemas no están soportados. Si la
$cuota no está soportada, es un escalar vacÃo. Si está soportada, usualmente
codifica la cuota de disco. Si el campo $comentario no está soportado, es un
lib/POD2/ES/perlop.pod view on Meta::CPAN
variables. Si realmente desea probar si al menos uno de los dos, C<$x> o C<$y>,
están definidos, use S<C<defined($x // $y)>>.
Los operadores C<||>, C<//> y C<&&> devuelven el último valor evaluado (a
diferencia de los operadores del C C<||> y C<&&>, que devuelve 0 o 1). Por lo
tanto, un forma razonablemente portátil para averiguar nuestro directorio
principal podrÃa ser:
$home = $ENV{HOME}
// $ENV{LOGDIR}
// (getpwuid($<))[7]
// die "¡Eres un sintecho!\n";
En particular, esto significa que usted no deberÃa usar esto para seleccionar
entre dos agregados para hacer una asignación:
@a = @b || @c; # Esto no hace lo correcto
@a = scalar(@b) || @c; # porque realmente quiere decir esto.
@a = @b ? @b : @c; # Aunque esto también funciona.
Como alternativas a C<&&> y C<||> cuando se usan para control de flujo, Perl
( run in 0.353 second using v1.01-cache-2.11-cpan-8d75d55dd25 )