in reply to Modify code help

Since you've been trying so often to get help on this task, and you're still not getting it, let's take a step back and look at the whole task, now that you've posted some code that seems to cover everything (or does it?)...

Maybe what you really want, then, is simply to run that last system call while you're reading "newreport.txt" -- this will save you a lot of trouble.

#!/usr/bin/perl -w use strict; system ("c:\\Perl\\DataPro\\convert.bat"); open(DPSLOTFILE, "< c:\\Perl\\DataPro\\newreport.txt") or die "Can't open file: $!"; while ( <DPSLOTFILE> ) { if ( /MSL6000\s+Trinity\s+(\d+)/ ) { my $tapeid = $1; print "Running omnimm to eject $tapeid\n"; system("c:\\Perl\\DataPro\\omnimm -eject \"MSL6000 Trinity\" $ta +peid -location \"blahblahblah\""); } }