Multiple choice questions: perl

Oct 27, 2013 • Naupaka Zimmerman

For all you python people out there, remember that there is more than one way to do it :)

(although of course these questions only have one right answer each)

 

Distinguishing novice and competent

In perl, which sigil is used for a hash?

a) $
b) @
c) %
d) #

 
Distinguishing competent and expert

In the following line of perl, what ends up stored in $1?

“testing the code” =~ m/c(w{2})/;

a) true
b) 1
c) od
d) the