Hi list.

I tapeworm a disordered file which I repair it and produces this exit to me in 
my shell:

UNIDAD                                                                  |       
 TOTAL
----------------------------------------------------------------------------------------------------|----------
UNIDAD PARA LA PROMOCION Y DEFENSA DE LOS DERECHOS HUMANOS              |       
  1
UNIDAD PARA LA ATENCION DE LAS ORGANIZACIONES SOCIALES                  |       
  1
UNIDAD DE ENLACE LEGISLATIVO                                            |       
  2
UNIDAD DE CONTRALORIA INTERNA                                           |       
  1
SUBSECRETARIA DE POBLACION,MIGRACION Y ASUNTOS RELIGIOSOS               |       
  1
SUBSECRETARIA DE NORMATIVIDAD DE MEDIOS                                 |       
  3
SUBSECRETARIA DE ENLACE LEGISLATIVO                                     |       
  1
SECRETARIA                                                              |       
  4
DIRECCIÓN GENERAL DE DESARROLLO POLÍTICO                                |       
  1
DIRECCION GENERAL DE TECNOLOGIAS DE LA INFORMACION                      |       
  3
DIRECCION GENERAL DE MEDIOS IMPRESOS                                    |       
  1
DIRECCION GENERAL DE COMUNICACION SOCIAL                                |       
  1
COORDINACION GENERAL DE LA COMISION MEXICANA DE AYUDA A REFUGIADOS      |       
  4
-- UNIDAD SIN DEFINICION --                                             |       
  1

14 rows selected.

But when I send it by email the exit is disordered. How could I send this file 
and receive it ordered in the inbox ????

This my code:

#!/usr/bin/perl
use strict;

  my $rmorales = "[EMAIL PROTECTED]";  #- Correo de Rafael Morales
  my $alertas  = "alertaMail.log";          #- Archivo que contiene la 
informacion de alertas

  open MAIL,"|mail $rmorales" || warn "No se ha encontrado la direccion de 
correo\n$!";
  open (ALERTAS, "<$alertas") || die "No se ha encontrado el archivo 
$alertas\n$!"; 
  open (TOTAL, ">total.txt") || die "No se puede escribir en el archivo 
total.txt\n$!"; 

  foreach (<ALERTAS>)
  {
      $_=~ s/(\w)\s\t/$1/;
      $_=~ s/(--)\t\t/$1/;
      print TOTAL "$_";
      print MAIL "$_\n";
  }
  close (ALERTAS);


Regards.
-- 
_______________________________________________
Get your free email from http://mymail.bsdmail.com

Powered by Outblaze

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to