Problem in this "while".

GatoLinux gatolinux en gmail.com
Jue Mayo 15 20:05:48 PDT 2008


You are right! I am going to take care about "chomp".

This is the modified code:

*while ( "$directory" ne "$end" )
{
        print "Directory: ";
  $directory = <STDIN>;
  chomp $directory;*

Thanks!

On Thu, May 15, 2008 at 3:14 PM, Marcelo <marcelo.magallon en gmail.com> wrote:

> On Thu, May 15, 2008 at 2:46 PM, GatoLinux <gatolinux en gmail.com> wrote:
>
>
> >     $directory = <STDIN>;
>
> > Why do it happens?
>
> When the user inputs "end!", $directory will contain "end!\n",
> including the "enter" used by the user to let your program continue
> after getting the data from STDIN.
>
> You can do this after that line:
>
> chomp $directory;
>
> Marcelo
>



-- 
Solutions from the root.
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://mail.pm.org/pipermail/costarica-pm/attachments/20080515/b6f491ce/attachment.html 


Más información sobre la lista de distribución Costarica-pm