#!/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 ( ) { if ( /MSL6000\s+Trinity\s+(\d+)/ ) { my $tapeid = $1; print "Running omnimm to eject $tapeid\n"; system("c:\\Perl\\DataPro\\omnimm -eject \"MSL6000 Trinity\" $tapeid -location \"blahblahblah\""); } }