in reply to Remove field inside [ ] brackets
Don't forget to use strict; and -w.#!/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 ( <DPSLOTFILE> ) { if ( /$dpdrivloc:\s*(\d+)/ ) { print "Slot for $dpdrivloc: $1\n"; } } #system("c:\\ipbat.bat"); close DPSLOTFILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Remove field inside [ ] brackets
by Anonymous Monk on Mar 22, 2004 at 17:32 UTC | |
by graff (Chancellor) on Mar 23, 2004 at 03:30 UTC |