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;
In reply to Re: Remove field inside [ ] brackets
by neniro
in thread Remove field inside [ ] brackets
by jamen_98
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |