[openid-test commit] r37 - trunk/perl

1 view
Skip to first unread message

codesite...@google.com

unread,
Jan 21, 2008, 5:27:55 AM1/21/08
to openi...@googlegroups.com
Author: br...@danga.com
Date: Mon Jan 21 02:27:09 2008
New Revision: 37

Modified:
trunk/perl/perl-test.cgi

Log:
Hey Tatsuhiko, you broke my tests. :)

Need the BEGIN {} block, or $flags doesn't get set. This is a CGI, so
execution starts at the top, and finishes, before getting down to the
non-BEGIN $flags assignment.

Modified: trunk/perl/perl-test.cgi
==============================================================================
--- trunk/perl/perl-test.cgi (original)
+++ trunk/perl/perl-test.cgi Mon Jan 21 02:27:09 2008
@@ -432,8 +432,11 @@
use AnyDBM_File;
use POSIX;

-eval { require GDBM_File; GDBM_File->import };
-my $flag = $@ ? (O_CREAT | O_RDWR) : &GDBM_WRCREAT;
+my $flag;
+BEGIN {
+ eval { require GDBM_File; GDBM_File->import };
+ $flag = $@ ? (O_CREAT | O_RDWR) : &GDBM_WRCREAT;
+}

sub new {
my ($class, $file) = @_;

Reply all
Reply to author
Forward
0 new messages