considering how many Perl scripts that are out in the wild that use neither 'strict' nor 'warnings,' I think this is a fair question.
Oh, it's fair, I just question whether you're going
to get honest answers.
It's also tricky b/c coming first one psychologically expects it to be the easiest question.
Hmmm... then maybe what it's testing is test-taking
skills. (Mine are pretty good, but that's not what
you probably want to test in most cases.) Would it
be less "tricky" if it were pushed back to question
3 or 4? I still think it's an easy question. All
you have to know is that "If it looks like a function
call, Perl treats it like a function call" (i.e.,
when you call a function, parentheses after the name
of the function define the extent of the arglist).
That's pretty fundamental. I'd think you'd have a
fairly hard time trying to actually program in Perl
without understanding that. All sorts of things
would get messed up if you thought foo(blah)+6
would pass (blah)+6 as an argument to foo. Ack.
The confusion that would result from such a
misunderstanding could be profound.
{my$c;$ x=sub{++$c}}map{$ \.=$_->()}map{my$a=$_->[1];
sub{$a++ }}sort{_($a->[0 ])<=>_( $b->[0])}map{my@x=(&
$x( ),$ _) ;\ @x} split //, "rPcr t lhuJnhea eretk.as
o";print;sub _{ord(shift)*($=-++$^H)%(42-ord("\r"))};
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|