in reply to Filehandle opened only for output error

This is because you open the file only for output (i.e., the  '>' parameter of the  open statement) and then you try to read from it (the  my @lineas = <$ARCHIVO>; statement).