Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/09/2008, 09:13
jferrero
Colaborador
 
Fecha de Ingreso: mayo-2006
Ubicación: Valladolid
Mensajes: 525
Antigüedad: 18 años, 9 meses
Puntos: 11
Respuesta: usar variable fuera de una funcion

Código:
my $tiempo_inicio = 0;

sub procesado {
    $tiempo_inicio = 120;
}

procesado();
if ($tiempo_inicio == 120) {
    print "Si\n";
}
La declaras fuera, por lo que se convierte en global a todo el programa.