stas 01/12/10 00:28:22
Modified: lib/Apache compat.pm
Log:
- because of open()'s prototype problems we cannot forward @_ to open.
(tested with 5.6.1 and bleadperl)
Revision Changes Path
1.30 +14 -1 modperl-2.0/lib/Apache/compat.pm
Index: compat.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- compat.pm 2001/12/05 19:18:08 1.29
+++ compat.pm 2001/12/10 08:28:22 1.30
@@ -267,6 +267,7 @@
use Fcntl ();
use Symbol ();
+use Carp ();
sub new {
my($class) = shift;
@@ -282,7 +283,19 @@
sub open {
my($self) = shift;
- open $self, shift, @_; # because of open's prototype
+
+ Carp::croak("no Apache::File object passed")
+ unless $self && ref($self);
+
+ # cannot forward @_ to open() because of its prototype
+ if (@_ > 1) {
+ my ($mode, $file) = @_;
+ open $self, $mode, $file;
+ }
+ else {
+ my $file = shift;
+ open $self, $file;
+ }
}
sub close {