open (OUTFILE,">dll.def"); print OUTFILE "EXPORTS\n"; open (INFILE,"dll.fil"); while() { if ($_ =~ /T _/) { $line = $_; $line =~ s/.* T _//; print OUTFILE $line; } } close (INFILE); close (OUTFILE); If you have a dll file named file.dll. At the command line, type: nm file.dll > dll.fil perl dll.pl