opendir mydir/??/??/??

Discussion in 'Perl Misc' started by avilella@gmail.com, Nov 25, 2007.

  1. Guest

    Hi all,

    I have a group of dirs and subdirs that look like mydir/00/00/00,
    mydir/00/00/01 ... mydir 11/55/99.

    In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
    that I can do an opendir like:

    opendir(DIR, "mydir/??/??/??")

    Cheers,

    Albert.
    , Nov 25, 2007
    #1
    1. Advertising

  2. On Nov 25, 8:11 pm, "" <> wrote:
    > Hi all,
    >
    > I have a group of dirs and subdirs that look like mydir/00/00/00,
    > mydir/00/00/01 ... mydir 11/55/99.
    >
    > In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
    > that I can do an opendir like:
    >
    > opendir(DIR, "mydir/??/??/??")
    >
    > Cheers,
    >
    > Albert.


    Hi Albert,

    use the File::Find module. I think it will give you the flexibility to
    do what you want.

    http://search.cpan.org/~nwclark/perl-5.8.8/lib/File/Find.pm

    Good luck,
    Spiros
    Spiros Denaxas, Nov 25, 2007
    #2
    1. Advertising

  3. "" wrote:
    >
    > I have a group of dirs and subdirs that look like mydir/00/00/00,
    > mydir/00/00/01 ... mydir 11/55/99.
    >
    > In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
    > that I can do an opendir like:
    >
    > opendir(DIR, "mydir/??/??/??")


    my @files = glob "mydir/??/??/??/*.ext";

    perldoc -f glob
    perldoc File::Glob



    John
    --
    use Perl;
    program
    fulfillment
    John W. Krahn, Nov 25, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew

    opendir()

    Andrew, Sep 3, 2003, in forum: Perl
    Replies:
    2
    Views:
    9,452
    John Bokma
    Sep 3, 2003
  2. PHPBABY3
    Replies:
    16
    Views:
    716
    freemont
    May 9, 2008
  3. Replies:
    4
    Views:
    208
    Gabriel Genellina
    May 25, 2008
  4. W. eWatson
    Replies:
    3
    Views:
    280
    W. eWatson
    Jan 17, 2010
  5. \A_Michigan_User\
    Replies:
    6
    Views:
    149
    Bob Barrows [MVP]
    Jan 29, 2005
Loading...

Share This Page