untitled
206 10 Transforming with Traditional Programming Languages print("Health Study Data\n\n"); while (<>) { $month = substr($_ ...
10.1 Text Transformations 207 but rather indicate that the variables arescalars, that is, numbers or strings (ordinary text). Th ...
208 10 Transforming with Traditional Programming Languages print "Health Study Data\n\n"; while (<>) { $month = 0 + substr ...
10.1 Text Transformations 209 print("Health Study Data\n\n"); $count = 0; $bmisum = 0; $bmisumsq = 0; while (<>) { $month ...
210 10 Transforming with Traditional Programming Languages program, and modified for each record in the health study file. The m ...
10.1 Text Transformations 211 print "Health Study Data\n\n"; while (<>) { chomp; @record = split(" ", $_); @date = split(" ...
212 10 Transforming with Traditional Programming Languages 1/15/2000 18.66 normal 62 cm 46.27 kg 102 lb 1/15/2000 26.93 overweig ...
10.1 Text Transformations 213 @record = split; This is actually better than the previous form because it will treat all forms of ...
214 10 Transforming with Traditional Programming Languages while (<>) { chomp; @record = split(" ", $_); @date = split("/" ...
10.1 Text Transformations 215 In the main body of the program, the hashes are used at the end to compute the three statistics: c ...
216 10 Transforming with Traditional Programming Languages Number of records: 2 Average BMI: 25.665 BMI Variance: 137.28245 BMI ...
10.1 Text Transformations 217 Summary Programs are commonly organized into three parts: introduction, body, and conclusion. Whi ...
218 10 Transforming with Traditional Programming Languages @lines = <>; $size = scalar(@lines); print("The input file has ...
10.1 Text Transformations 219 while (<>) { chomp; push(@table, [split]); } $size = @table; print("Table size is $size\n"); ...
220 10 Transforming with Traditional Programming Languages number and legal obligations, almost as if it were a person. There ar ...
10.1 Text Transformations 221 print "Health Study Statistics\n\n"; while (<>) { chomp; push(@table, [split]); $bmi = $reco ...
222 10 Transforming with Traditional Programming Languages Brackets enclosing an array variable or braces enclosing a hash vari ...
10.1 Text Transformations 223 } my $mean = $sum / $count; my $var = ($sumsq - $count * $mean ** 2) / ($count - 1); return ($mean ...
224 10 Transforming with Traditional Programming Languages use this list like any other. For example, the following program will ...
10.1 Text Transformations 225 while (<>) { chomp; push(@table, [split]); } printstats(1); printstats(4); sub stats { my $c ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf