Sigh, I have my tar module WO::Tar and when I require it into my script and read a tar it all works fine but as soon as I try to use the following:
{
BEGIN { $INC{"WO/Tar.pm"} = "WO/Tar.pm" }
my code here
}
.....(modelled after GT's install.cgi script) I get the folowing error:
substr outside of string at e:\apache\cgi-bin\install\file.cgi line 624.
That line is:
# Verify the checksum.
substr($head,148,8) = " ";
...I can't really see why that would cause an error using BEGIN...perldoc says:
If OFFSET and LENGTH specify a substring that is partly outside the string, only the part within the string is returned. If the substring is beyond either end of the string, substr() returns the undefined value and produces a warning. When used as an lvalue, specifying a substring that is entirely outside the string is a fatal error.
What can I do to fix that?....and why it it only happening with BEGIN?
{
BEGIN { $INC{"WO/Tar.pm"} = "WO/Tar.pm" }
my code here
}
.....(modelled after GT's install.cgi script) I get the folowing error:
substr outside of string at e:\apache\cgi-bin\install\file.cgi line 624.
That line is:
# Verify the checksum.
substr($head,148,8) = " ";
...I can't really see why that would cause an error using BEGIN...perldoc says:
If OFFSET and LENGTH specify a substring that is partly outside the string, only the part within the string is returned. If the substring is beyond either end of the string, substr() returns the undefined value and produces a warning. When used as an lvalue, specifying a substring that is entirely outside the string is a fatal error.
What can I do to fix that?....and why it it only happening with BEGIN?

