Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^6: Have you netted a Perl Monk or Perl Pretender in 5 minutes or less?

by Anonymous Monk
on Sep 15, 2005 at 21:52 UTC ( [id://492442]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Have you netted a Perl Monk or Perl Pretender in 5 minutes or less?
in thread Have you netted a Perl Monk or Perl Pretender in 5 minutes or less?

So are we admitting that this is a poor interview question? And bad design on the part of Perl in regards to statement modifiers? Compare...
#!/usr/bin/perl -w use strict; our $c = 2; print "Before: c=$c\n"; unless($c){my $c = 1} print "After: c=$c\n";
  • Comment on Re^6: Have you netted a Perl Monk or Perl Pretender in 5 minutes or less?
  • Download Code

Replies are listed 'Best First'.
Re^7: Have you netted a Perl Monk or Perl Pretender in 5 minutes or less?
by QM (Parson) on Sep 15, 2005 at 23:39 UTC
    So are we admitting that this is a poor interview question?
    This behavior of my is a fact. Precisely because of this fact, it's a good interview question. Knowing where the cracks in the armor lie is just as important as wearing the armor in the first place.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      Combining my with if/unless often leads to buggy behavior and is definitely not a "best practice". Things like the strange behavior of my $x if 0 (which is often used for "tricks") have been deprecated since 5.9.1 and will be removed eventually.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://492442]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2024-04-23 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found