in reply to Changing to input

Your code is right, you just don't check for errors after try to open the directory:
Print "Enter directory : "; chomp($dir = <STDIN>); opendir DIR, $dir or die "Unable to open directory $dir : $!\n"; @files = grep { !/\.\.?/ } readdir DIR; print "$dir contains " . join(',', @files);

HTH


--
zejames

Replies are listed 'Best First'.
Re: Re: Changing to input
by Anonymous Monk on Jul 03, 2002 at 13:40 UTC
    I understand all except this part?? What is "join" doing here?? print "$dir contains " . join(',', @files);

      It produces a string that contains all of its arguments, separated by the first one. In this case, it takes all the @files, puts commata between them, and makes that one large string.

      If you don't know what something does, you can look it up in the extensive perldoc. Try perldoc -f join on the commandline and see what it tells you. If you're using ActiveState Perl on Windows, you will probably want to find the HTML version of the documentation it ships with and installs. There is hardly any trivial question you cannot answer straight off the docs within a minute.

      Makeshifts last the longest.

        Thanks.