#!/usr/bin/perl
$pattern="*.dat";
@file=glob($pattern);
@file=sort @file;
foreach $file (@file){
  $file=~s/p\.dat//;;
  $file=~s/pm\.dat/m/;;
  print "$file\n";
}

open (IN,"<list_mata");
@line=<IN>;
@line=sort(@line);
foreach $line (@line){
  print "$line";
}
