for ($i = 0;$i < @ARGV; ++$i){ if ($ARGV[$i] eq "-rut") { $e = $i; $e++; $rut = $ARGV[$e]; } print "el rut es $rut\n"; }