#!/usr/bin/perl package Image::Magick; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() # XS function. If a constant is not found then control is passed # to the AUTOLOAD in AutoLoader. my $constname; ($constname = $AUTOLOAD) =~ s/.*:://; print STDERR "$constname "; # DEBUG my $val = constant($constname, @_ ? $_[0] : 0); # the following code from the original sub is irrelevant (never reached) #if ($! != 0) { # if ($! =~ /Invalid/) { # $AutoLoader::AUTOLOAD = $AUTOLOAD; # goto &AutoLoader::AUTOLOAD; # } # else { # my($pack,$file,$line) = caller; # die "Your vendor has not defined PerlMagick macro $pack\:\:$constname, used at $file line $line.\n"; # } #} #eval "sub $AUTOLOAD { $val }"; #goto &$AUTOLOAD; } package main; Image::Magick::not_there(); # starts endless recursion