I am using Active State Perl and only have the version of File-Util that "works", 4.132140. I did verify that your code works with this version.
#!/usr/bin/perl use strict; use warnings; # Using Active State Perl 5.20.2 use File::Util; #version 4.132140 my $f = File::Util->new(); my @d = $f->list_dir("C:/test"); print join " ", @d, "\n"; __END__ . .. anothertestdir bar bar2
From test code and docs, this code does what is supposed to do (with no actual "simple file", returns the dot directories + others). If a later version of Util::File is throwing an internal error as your post indicates, then I would consider that a bug. Forcing installation of a "non-approved" AS repository module version is a mess that I really don't want to attempt.

Update: From looking at next responses, it does appear that this is a legit bug report and I would recommend proceeding with that.


In reply to Re: Bug in latest File::Util? by Marshall
in thread Bug in latest File::Util? by martell

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.