If
my $serpath="D:\\eproof\\htdocs\\*\\work";
use
my @xmlfile = File::Find::Rule->file() ->name( '*.xml') ->in( glob $serpath );
Here is a self-contained example (you need write permission in current directory)
#!/usr/bin/perl -- use strict; use warnings; use Shell::Command qw( rm_rf touch mkpath ); use File::Find::Rule; use File::Spec::Functions; my $serpath = './temptest1'; # no trailing slash my $work = 'work'; my $time = int rand 20; mkpath( catfile( $serpath, $time, $work ) ); touch( map { catfile( $serpath, $time, $work, "$_.xml" ) } 1 .. 2 ); #touch(catfile( $serpath, $time, $work, "$_.xml" )) for 1 .. 2; { my @dirs = File::Find::Rule->directory->name($work)->in($serpath); print "dir $_\n" for @dirs; my @xmlfile = File::Find::Rule->file->name('*.xml')->in(@dirs); print "file $_\n" for @xmlfile; } print "wow $_\n" for File::Find::Rule->file->name('*.xml') ->in( glob catfile( $serpath, '*', $work ) ); mkpath("$serpath/$time/$work"); rm_rf('temptest1'); __END__ C:\>perl file.find.rule.pl dir temptest1/3/work file temptest1/3/work/1.xml file temptest1/3/work/2.xml wow temptest1\3\work/1.xml wow temptest1\3\work/2.xml C:\>perl file.find.rule.pl dir temptest1/15/work file temptest1/15/work/1.xml file temptest1/15/work/2.xml wow temptest1\15\work/1.xml wow temptest1\15\work/2.xml

In reply to Re^3: How to find the path by Anonymous Monk
in thread How to find the path by amexmythili

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.