NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
I found two without answers (Score:1)
$p = [ { a => 1, b => 2, c => 3 }, “ant”, “bat”, “cat” ];Which of the following expression gives the value cat ?
$p[3]
$p->{c}
$p->[4]
$p->{bat}
$p->[3] would be correct, and
%x = qw(C Ritchie Perl wall C++ Stroustrup); print @x{C, C++}Error : should use % instead of @ in print function
Displays Stroustrup
Displays Ritchie
Displays Ritchie Stroustrup
This doesn't compile, but of course, they didn't use " in a bunch of the other questions either.
Reminded me of the brainbench test - mostly using obscure perl4-isms, which is only relevant today if you get the unenviable task of maintaining some nasty code.
Reply to This
You forgot pseudo-hashes (Score:1)
$p->{c}is correct.Re:I found two without answers (Score:2)
I think you're forgetting about pseudo-hashes (but, of course, everyone should be forgetting about pseudo-hashes!)
Re:I found two without answers (Score:1)
Re:I found two without answers (Score:1)
The great thing about multitasking is that several things can go wrong at once.
Re:I found two without answers (Score:2)
I presume they've updated the quiz by now, but I haven't had time to go back to check.