Consider the following Perl code fragment for the next two questions. $line = \"
ID: 3813053 • Letter: C
Question
Consider the following Perl code fragment for the next two questions. $line = "128.78.12.9"; ($p1, $p2) = split('.', $line); What does the variable $p1 contain after the code fragment completes execution?
1) 128 2) 78 3) 12 4) 9
What does the variable $p2 contain after the code fragment completes execution?
1) 128 2) 78 3) 12 4) 9
Perl statements must be terminated by 1) . 2) : 3) $ 4) ;
The Perl statement open(FILE, $line): 1) opens a file for appending 2) opens a file for writing 3) opens a file for reading 4) opens a file for reading and writing
A while loop in Perl
1) always executes a fixed number of times
2) continues to iterate while the condition specified in the while statement remains false.
3) continues to iterate while the condition specified in the while statement remains true.
4) continues to iterate while there is a line in some file to read.
Explanation / Answer
1) answer is 128
2) answer is 78
3) answer is ;
4) opens a file for reading and writing
5) continues to iterate while the condition specified in the while statement remains true.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.