chomp($ll[0] = `ls -lto $path/*B1006* |head -n 1`); chomp($ll[1] = `ls -lto $path/*B1106-* |head -n 1`); chomp($ll[2] = `ls -lto $path/*B11062* |head -n 1`); $next = 0; foreach (@ll) { if (m#([A-Z][a-z][a-z]\s[0-9][0-9]\s[0-9][0-9]:[0-9][0-9])\s(/.+\.Z)#) { $stamp[$next] = $1; $name[$next] = $2; } print "\$name[\$next]: $name[$next]\n"; print "\$stamp[\$next]: $stamp[$next]\n"; $next++; }