[Perl] Como hacer justificaciones a impresion en archivo

Ricardo Cumberbatch L. (PANNet - URC) rcumber@utp.ac.pa
Fri, 20 Dec 2002 12:26:30 -0500 (GMT)


Disculpa pero no te entendi, dispensa mi turres ;-P

On Fri, 20 Dec 2002, Jose Antonio Galicia wrote:

> On Fri, 20 Dec 2002, Ricardo Cumberbatch L. (PANNet - URC) wrote:
>=20
> > format PRINTER =3D
> > @<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<< @<<<<<<<<<<< @<<<<<<<<< @<<<<<<=
<<<
> > $linea1[0],$linea1[1],     $linea1[2],  $linea1[3],  $login,    $passwd
> > .
>=20
> > =09#write (PRINTER);
>=20
>  Antes de esto, supongo, asigna el filehandle "PRINTER"
> con un open. =BFVerdad?
>=20
> > =09#system("useradd -c '$linea1[0] $linea1[1]' -d /dev/null $login");
> > =09#system("passwd --stdin $login < $datainfo/password");
> > =09open (IMPRIMIR, ">>$datainfo/Students_creados");
> > =09write (PRINTER);
>=20
>  Aqu=ED imprimes nuevamente al mismo filehandle, =BFo estas
> cerrando y abriendo? Si este fuera el caso tal vez sea m=E1s
> r=E1pido usar "select" y STDUOT pero con la penalizaci=F3n que
> tendrias siempre conectados los filehandles.
>=20
> > Format not terminated at generaruser.pl line 222, at end of line
> > Missing right curly or square bracket at generaruser.pl line 222, at en=
d
> > of line
> > syntax error at generaruser.pl line 222, at EOF
> > Execution of generaruser.pl aborted due to compilation errors.
>=20
>  Ve:
>=20
> =09$ perl -e 'format =3D
> =09@<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> =09$L[0],$L[4]
> =09.
> =09open F, "/etc/passwd"; while (<F>){@L=3Dsplit ":"; write}'
>=20
>=20
> =09$ perl -e 'format SALE =3D
> =09@<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> =09$L[0],$L[4]
> =09.
> =09open F, "/etc/passwd"; open SALE, ">/tmp/salida"; while (<F>){@L=3Dspl=
it ":"; write SALE}'
> =09$ cat /tmp/salida
>=20
>=20
> =09perl -e 'format =3D
> =09@>>>>>>>>>>>> @>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> =09$L[0],$L[4]
> =09.
> =09format SALE =3D
> =09@<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> =09$L[0],$L[4]
> =09.
> =09open F, "/etc/passwd";open SALE, ">/tmp/salida";
> =09while (<F>) {
> =09  @L=3Dsplit ":";
> =09  $of =3D select (SALE); write;
> =09  select ($of); write;
> =09}'
> =09$ cat /tmp/salida
>=20
>  Espero que estos ejemplo te aclaren el panorama.
>=20
>  Saludos,
>  To=F1o
> ---
> FORTUNE REMEMBERS THE GREAT MOTHERS: #5
>=20
> =09"And, and, and, and, but, but, but, but!"
> =09=09-- Mrs. Janice Markowsky, April 8, 1965
>=20
> _______________________________________________
> Perl mailing list
> Perl@tlali.iztacala.unam.mx
> http://tlali.iztacala.unam.mx/mailman/listinfo/perl
>=20