Hi, Experts,
I have been using Readonly.pm for quite some time on various platforms, such Solaris, AIX, Redhat, SUSE 9 & 10 with perl 5.8.8 or lower and never had any problems until I started running my codes (CLI) on SUSE 11 with perl 5.10.0.
The error I got:
String found where operator expected at XS.pm line 36, near "Carp::croak "Readonly::XS is not a standalone module. You should not use it directly.""
(Do you need to predeclare Carp::croak?)
For your convenience, below is the part of XS.pm:
BTW, I got this error only on SUSE 11 (perl 5.10.0). Could someone kindly explain to me how the variable $MAGIC_COOKIE is set and why this error is only seen on SUSE 11? How to fix this problem?
Many thanks.
I have been using Readonly.pm for quite some time on various platforms, such Solaris, AIX, Redhat, SUSE 9 & 10 with perl 5.8.8 or lower and never had any problems until I started running my codes (CLI) on SUSE 11 with perl 5.10.0.
The error I got:
String found where operator expected at XS.pm line 36, near "Carp::croak "Readonly::XS is not a standalone module. You should not use it directly.""
(Do you need to predeclare Carp::croak?)
For your convenience, below is the part of XS.pm:
Code:
package Readonly::XS;
use strict;
use warnings;
use vars qw($VERSION $MAGIC_COOKIE %PL_COMPAT);
$VERSION = '1.04';
require XSLoader;
XSLoader::load('Readonly::XS', $VERSION);
# It is an error to use this from any module but Readonly.
# But sooner or later, someone will.
BEGIN
{
no warnings 'uninitialized';
if ($MAGIC_COOKIE ne "Do NOT use or require Readonly::XS unless you're me.")
{
require Carp;
Carp::croak "Readonly::XS is not a standalone module. You should not use it directly."; [b]# Line 36!![/b]
}
}
BTW, I got this error only on SUSE 11 (perl 5.10.0). Could someone kindly explain to me how the variable $MAGIC_COOKIE is set and why this error is only seen on SUSE 11? How to fix this problem?
Many thanks.