Hi,

I am looking for a nice solution for the following problem :

I have a directory stored in $header. I need to seek each directory for a specific
file, but I have to start in the deepest dir and than go upwards. Using the split
@header first value is always empty as it is splitting on " */*". As /user does not
contain any data in front of the / I have a "problem".
Of course I can do the "if (!($head)) { next; } ", but I hope there is a more
beautifull solution. Any ideas ??

Also ones I found the file I need to find, I would like to exit out of the 
foreach loop only. How do I do ??
The example is below. Thanks for your help in advance !!

Regs David
#----------------

$header = "/someone/I/know";

sub pre {

@header = split(/\//, $header);
chomp @header;
$dm = "/user/IPlib";

  foreach $head(@header) {
    #if (!($head)) { next; }   ??
    $dm = "$dm" . "/$head";
    push @dv, $dm;
    @rdv = reverse(@dv);
  } # End foreach 
  
  foreach $rdv(@rdv) {
    if ( -f "${rdv}/feature.tmpl" ) {
      open (FH "< ${rdv}/feature.tmpl");
      @template = <FH>;
      close FH;
      ## ?? Exit out of this foreach loop only ??
    } # End-if
    else { next; }
    
} # End sub pre

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to