splatohara has asked for the wisdom of the Perl Monks concerning the following question:
the results looks like the following;#!/perl/bin open (In,"tascomod.log") or die ("can not open file at the moment"); open (Out, "tasmodtypfinrpt.txt") or die ("cannot open output file may +be you should create one"); #print Out " TXSpeed Rx Speed"; while ($line=) { @temp = split(/[=]/,$line); #if ($temp[1] >100) # { # print "Session id is $temp[1] with "; # } if ($temp[1]>=1&&($temp[1]<=45)) { $modtyp = $temp[1]; print "\n$modtyp\n"; #the above line prints out ok but does not seem to then print out the +statement which corresponds with the value instead #it prints out all the statements, even the ones that do not correspon +d to the value! if ($modtyp = 20) { print "V34\n"; } if ($modtype = 9) { print "no connection\n"; } elsif ($modtype = 34) { print "V90\n"; } } }
9 V34 no connection 34 V34 no connection 9 V34 no connection 45 V34 no connection 45 V34 no connection 7 V34 no connection
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing options with elsif statement
by jmcnamara (Monsignor) on Feb 18, 2002 at 17:05 UTC | |
|
Re: printing options with elsif statement
by MZSanford (Curate) on Feb 18, 2002 at 17:08 UTC | |
|
Re: printing options with elsif statement
by dash2 (Hermit) on Feb 18, 2002 at 17:16 UTC | |
by splatohara (Novice) on Feb 18, 2002 at 17:34 UTC | |
by dash2 (Hermit) on Feb 18, 2002 at 18:20 UTC | |
|
Re: printing options with elsif statement
by lordsuess (Scribe) on Feb 21, 2002 at 18:01 UTC |