Help for this page

Select Code to Download


  1. or download this
    my $txt = "txt";
    my @files = `ls *$txt`;
    
  2. or download this
    my $txt='txt';
    my @files=glob "*$txt";
    
  3. or download this
    my $txt='txt';
    opendir my $d,'.' or die "Can't opendir .: $!";
    my @files=grep /\Q$txt\E$/,readdir $d;
    closedir $d;