#!/usr/bin/perl -w use strict; #$slotnumber=0; my $dpdrivloc = "Trinity"; open( DPSLOTFILE, "< c:\\perlen\\perlmonks\\test.txt") or die "Can't open file: $!"; while ( ) { if ( /$dpdrivloc:\s*(\d+)/ ) { print "Slot for $dpdrivloc: $1\n"; } } #system("c:\\ipbat.bat"); close DPSLOTFILE;