Hi , I have an array @plf_files which contains a list of .plf names,now I have a file "@file" which contains .plfs as shown below,now for every .plf found in @file,I want to open each .plf ,search recursively until no .plf is found in it and save them in an array,how do I make sure the process of opening and searching recursively happens?
#!/usr/bin/perl -w use strict; use warnings; my (@recursive_plfs,plf_files) =(); @plf_files = {files.plf,orphans.plf,bases.plf}; @file = {//source/perl/scripts/modem/final/rel/sw/bases.plf#30,//sourc +e/perl/scripts/modem/final/rel/sw/files.plf#3}; foreach my $plf (@plf_files) { if (grep @file) { push @recursive_plfs=$plf; #the below loop needs to be repeated until no .plf's are found,how do +I do this? { open my $match, '<',"$plf" or die "could not open '$plf' $!"; push @recursive_plfs = /\/(\w+\.plf)/ = grep (/\*\.plf$/,$match) #get +only the plf name from the match } } }

In reply to Recursive search by perl_mystery

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.