my $tiempo_inicio = 0; sub procesado { $tiempo_inicio = 120; } procesado(); if ($tiempo_inicio == 120) { print "Si\n"; }