Search Header Logo

Minimal Perl Quiz

Authored by Michal Grygierzec

Computers

Professional Development

Used 1+ times

Minimal Perl Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which program behaves differently

perl -w -e 'while (<>) { print; }' file file2

perl -wnl -e '' file file2

perl -wnl -e 'print;' file file2

perl -wpl -e '' file file2

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which special variable counts records as they are processed?

$"

$!

$.

$&

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

One of the variables is named incorrectly during declaration:

$happyScalar

%sadHash

$quietArray

@grumpyArray

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which variable represents file handle?

ARGV

$ARGV

@GVAR

@ARGV

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output of the program given arguments: A B C

$,='/';

print @ARGV;

A B C

A,B,C

ABC

A/B/C

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Fiil in the _____ to accesses the input record’s third colon-separated field:

perl –wnlaF':' –e 'print _____;' fileX

$F[-2]

$F[2]

$F[3]

$F[$.]

7.

MULTIPLE SELECT QUESTION

30 sec • 2 pts

Select valid match operator usage examples:

$data =~ m%perl # PeRl too! %xi

$F[-1] =~ /^carrot$|garlic|^potato/

/\Q** $9.99 Sale! **\E/

$data =~ m%perl # PeRl% too! %gi

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?