I'm having a hard time tracking down an error:

Undefined subroutine &main:: called
returned when I try uploading an image in Movable Type 5. Using Carp::Always and the debugger I fixed a few undefined variables. I'm still getting an error from the BEGIN block in MT5's Bootstrap.pm file and an eval which I still haven't tracked down (possibly from CMS.pm).

Having done several searches, the closest issue I found that resembled what's happening was this on Movable Type's Forums which suggests it could have something to do with the version of Image::Size and/or Image::Magick. However, when I checked Movable Type's FogBugz report that very similar issue couldn't be recreated and was closed.

Below is the BEGIN block from MT5's Bootstrap.pm. Any direction is appreciated.

sub BEGIN { my ( $dir, $orig_dir ); require File::Spec; if ( !( $dir = $ENV{MT_HOME} ) ) { if ( $0 =~ m!(.*([/\\]))! ) { $orig_dir = $dir = $1; my $slash = $2; $dir =~ s!(?:[/\\]|^)(?:plugins[/\\].*|tools[/\\])$!$slash +!; $dir = '' if ( $dir =~ m!^\.?[\\/]$! ); } elsif ( $] >= 5.006 ) { # MT_DIR/lib/MT/Bootstrap.pm -> MT_DIR/lib/MT -> MT_DIR/lib - +> MT_DIR require File::Basename; $dir = File::Basename::dirname( File::Basename::dirname( File::Basename::dirname( File::Spec->rel2abs(__FIL +E__) ) ) ); } unless ($dir) { $orig_dir = $dir = $ENV{PWD} || '.'; $dir =~ s!(?:[/\\]|^)(?:plugins[/\\].*|tools[/\\]?)$!!; } $ENV{MT_HOME} = $dir; } unshift @INC, File::Spec->catdir( $dir, 'extlib' ); unshift @INC, File::Spec->catdir( $orig_dir, 'lib' ) if $orig_dir && ( $orig_dir ne $dir ); }


"...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote

In reply to MT5: Undefined Subroutine Called Uploading Image by luis.roca

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.