in reply to Re^3: Read Directory and getlines in .csv
in thread Read Directory and getlines in .csv

Works beautifully. I think I need to look up a few things to see how/why/what of them like using "glob" and "unless. Whew! Most of the components you have in your code are what I had in mine. I was close, but, alas...no cigar. (sad face) BUT->I'm learning!! Thank you so much for your assistance. I kinda like Perl, its very powerful.

  • Comment on Re^4: Read Directory and getlines in .csv

Replies are listed 'Best First'.
Re^5: Read Directory and getlines in .csv
by Laurent_R (Canon) on Apr 27, 2016 at 20:13 UTC
    glob does more or less the same thing as opendir /readdir, except that it is more practical: first, it's one line instead or two, second it removes pseudo-directories such as "." and ".." which you usually don't want to explore, and finally it returns a list of files with their path, so that you can open them without having to add the path.

    unless does exactly what the English meaning of the word implies. It is essentially equivalent to if not. For example:

    my $q = $c / $d unless $d == 0; # avoid division by zero error