Help for this page

Select Code to Download


  1. or download this
    opendir(my $dh, '.')
      or die("Unable to list directory: $!\n");
    
    my @searchlist = readdir($dh);
    
  2. or download this
    opendir(my $dh, '.')
      or die("Unable to list directory: $!\n");
    ...
    while (defined(my $file = readdir($dh))) {
       ...
    }
    
  3. or download this
    opendir(my $dh, '.')
      or die("Unable to list directory: $!\n");
    ...
          print("Match found\n") if $line =~ $pattern;
       }
    }
    
  4. or download this
    opendir(my $dh, '.')
      or die("Unable to list directory: $!\n");
    ...
       chomp $line;
       print("Match found\n") if $searchlist{$line};
    }