in reply to WARNING!! Possible Brainbench spoilers (do NOT read unless you've taken and passed the cert)
a) Perl Idioms Explained - @ary = $str =~ m/(stuff)/g covers this but in essence you are assigning the return value of m// (yes /.../ == m/.../ ) to a scalar. What is the return value? See perlre but it is 1 (true) if there is a match and false (null string) if there is no match. $data *is not altered* - it was never set to 'Hello World' due to precedence ie the expression parses as $data = ( 'string' =~ m/stuff/ );
b) BEGIN executes at the begining ie compile time before CHECK, INIT and of course END. These four block types run in this order:
Congrats on the payrise. Who says these sorts of tests are pointless!
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: WARNING!! Possible Brainbench spoilers (do NOT read unless you've taken and passed the cert)
by dragonchild (Archbishop) on Jul 02, 2004 at 11:49 UTC | |
by tachyon (Chancellor) on Jul 02, 2004 at 22:55 UTC |