in reply to Re: Checking Input using reg exp.
in thread Checking Input using reg exp.
#!/usr/local/bin/perl $cnip = $ENV{'QUERY_STRING'}; print "\n Look Up NPANXX Info"; print "\n =============================="; print "\n Please enter NPANXX:_______\b\b\b\b\b\b\b +"; chomp($cnip=<STDIN>); if($cnip =~ /\d{6}/){ &npa1 } else{ print "\n Valid NPANXX not entered!\n"; }; sub npa1 { @datb = `cat tech3 | grep $cnip`; @cnip = $cnip; #printing the info foreach $datb (@datb){ @cnip = split (/\:/, $datb); print "\n ========================================\n"; print " NPANXX Line Switch MSR&CUSTGP VMX"; print " $cnip $cnip[1] $cnip[2] $cnip[3] $cnip[4] $cnip +[5]"; print " ========================================\n\n"; }; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(shockme) Re: Re: Re: Checking Input using reg exp.
by shockme (Chaplain) on Dec 28, 2001 at 09:30 UTC | |
|
Re: Re: Re: Checking Input using reg exp.
by gav^ (Curate) on Dec 28, 2001 at 19:55 UTC |