eval { use Image::Magick };

I'm guessing the purpose of this line is to defer the overhead of loading Image::Magick until you actually need it. I don't think this line of code successfully achieves that though.

One of the differences between 'use' and 'require' is that use happens at compile-time while require happens at run-time. So Image::Magick will be loaded as soon as that line is compiled - regardless of the fact that it's in an eval block. You could change it to:

eval "use Image::Magick";

Which would work because the compiler wouldn't even see it. Or you could simply say:

require Image::Magick

The fact that you're using eval but not checking $@ was a bit of a red flag.


In reply to Re: Image2HTML by grantm
in thread Image2HTML by Chady

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.