in reply to Re: parse_dir doesn't seem to work
in thread parse_dir doesn't seem to work

using data dumper, $listing is the directory listing. dumping @directories produces nothing.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
$nysus = $PM . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re^3: parse_dir doesn't seem to work
by Cubes (Pilgrim) on Jan 03, 2008 at 17:49 UTC
    I get the correct list returned (using 5.8.5) from parse_dir. Perhaps there's something it doesn't like about your brand of ls -l? Looks like there's a parameter to parse_dir to make it speak up on unparseable lines... does that help?
      Yeah, that's it. Getting "Can't parse" errors. Weird. Here's a typical line:
      Can't parse: -rw-r--r-- 1 root root 15264 2008- +01-03 12:46 out
      Thanks, man.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
      $nysus = $PM . $MCF;
      Click here if you love Perl Monks

        On my linux box, I can get such a listing via ls -l --time-style=long-iso, which in particular produces the 2008-01-03 date formatting. Do you have an alias for ls that includes a --time-style option?
        That date format looks odd... Without digging into the File::Listing code, I'd guess that's where it's choking.
      Here's what worked for me:
      $listing = `ls -l --time-style=locale`;
      Thanks to everyone who chipped in to help me. I'm grateful.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
      $nysus = $PM . $MCF;
      Click here if you love Perl Monks