Ver Mensaje Individual
  #6 (permalink)  
Antiguo 29/06/2010, 08:06
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 1 mes
Puntos: 20
Respuesta: Problema al ejecutar un comando del sistema (system)

Buenas,

Lo intento de la primera forma pero no me compila

syntax error at ./perl_first_webstats.pl line 90, near "print"
syntax error at ./perl_first_webstats.pl line 104, near "}"
Execution of ./perl_first_webstats.pl aborted due to compilation errors.


Código PERL:
Ver original
  1. 81 sub Mostrar_Config_Actual {
  2.  82     local $SITE_DOMAIN;
  3.  83
  4.  84     print "\n--------------------------------------------------------------------------------\n";
  5.  85     print colored(" CONFIGURACION ACTUAL",'cyan'),"\n";
  6.  86     print "--------------------------------------------------------------------------------\n";
  7.  87     open my $FICHERO, "</etc/awstats/web/$file"
  8.  88         or {
  9.  89             print colored(" [ERROR] >>> No existe el fichero introducido ",'bold red');
  10.  90             print color 'reset';
  11.  91             print "$file", colored(" en /etc/awstats/web/",'bold red'),"\n\n";
  12.  92             exit 1;
  13.  93         }
  14.  94
  15.  95     while (<$FICHERO>) {
  16.  96         next if /^\s*#/;    # obviamos los comentarios
  17.  97         next if /^\s*$/;    # obviamos las lÃ*as vacÃ* o en blancoi
  18.  98         print $_;
  19.  99         }
  20. 100     close $FICHERO;
  21. 101
  22. 102     $SITE_DOMAIN=qx(grep -v '#' /etc/awstats/web/$file | grep -i SiteDomain | cut -d'=' -f2 | sed 's/"//g');
  23. 103     print "\n--------------------------------------------------------------------------------\n";
  24. 104 }

Muchas gracias de antemano!