Trying to pull a list of C++ files from a fixed project directory. The system command shows a list of files verifying that the directory is correct. Find::File::Rule returns an empty list. I've tried many versions of the command block and I'm out of ideas at this point. This has to be a duh moment. What have I missed?

File::Find::Rule is up to date on my install.

I will add a grep section later to pull #include statements out of the files.

Thanks!

#! /usr/bin/perl use strict; use warnings; use File::Find::Rule; use Data::Dumper; my $dir = ('~/Hamradio/Keithsdr/KEITHSDR-main/SDR_RA8875/'); system "ls $dir"; # This works and verifies the search # path - $dir my @files = File::Find::Rule->file() ->name('*.cpp') ->in($dir); print Dumper $dir; # Good directory string # $VAR1 = '~/Hamradio/Keithsdr/ # KEITHSDR-main/SDR_RA8875/'; print Dumper(\@files); # Empty list $VAR1 = []

James

There's never enough time to do it right, but always enough time to do it over...


In reply to File::Find::Rule Help Needed by jmlynesjr

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.