>>>>> "SB" == Steve Bertrand <st...@ibctech.ca> writes:
SB> I thought afterword that it had to do with precedence. I'll stick to SB> using brackets when I know I need the left side evaluated before moving SB> forward. you don't need parens (those aren't brackets, [] are brackets, {} are braces) for that, just use the proper op eq and you get a better test and the op is faster and binds better. SB> I don't want to change the object method's behaviour just for a test, so SB> can anyone point me in the right direction as to how I can override the SB> object method's needed die() statement on the test side, so the method SB> I'm testing doesn't die() the test? you need to wrap the call in block eval and check for die afterwards. see perldoc -f eval and perlvar for $...@. note that this is BLOCK eval which is fine to use anywhere you want to trap dies and not string eval which is evil unless absolutely necessary. SB> is ($user->add_plan(\%plan_info), 0, "Don't want to die()!"); eval { $user->add_plan(\%plan_info) } ; is( $@, .... ) ; uri -- Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Free Perl Training --- http://perlhunter.com/college.html --------- --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/