I was wondering if anyone has a good explanation for the following strange behaviour:

I have the following module.

#REMEBERED TO CHANGE THE MODULE NAME HERE use Module::With::New::PackageName; sub generate{ #open a temp file. my $workbook = Spreadsheet::WriteExcel->new( $filehandle ); #PROGRAM DOES NOT REACH THIS POINT! write_form( ... ); #close the sheet. #open the temp file and return the content as a string. } sub write_form{ #do something #FORGOT TO REPLACE NAME HERE Module::With::Old::PackageName::perform_action(); #do some more }

The code above worked fine before I changed the package name of a package that was used in the function write_form. After I changed the name of the module from Module::With::Old::PackageName to Module::With::New::PackageName, the program never managed to finish the execution of Spreadsheet::WriteExcel->new. Perl did not produce any error messages or warnings, it just stopped executing.

Correcting the package name in write_form fixed the problem, but I can't see the connection between the wrong package name and the error that it caused. Shouldn't Perl give me an error message when the execution reaches the wrong package name and not in some unrelated function?

By the way the application where this code is located is a web application that is created using CGI::Application, running on an IIS server with ActiveState Perl 5.8.7.

2006-10-17 Retitled by GrandFather, as per Monastery guidelines
Original title: 'Any explanations for this bug?'


In reply to silent failure with non-existant module by Anonymous Monk

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.