I've had, over the years, several such perplexing instances where a newly written (or written, rewritten and rewritten...) script, especially when attempting to do something new and unusual, and where the code might be interpreted somewhat ambiguously, refused to work. No way no how...

Then after being up half the night (or several) and giving up and going to bed would find that upon returning to work in the morning the script would just work.

My conclusion, after experiencing this several times over the years is that Perl, at first, couldn't quite understand what I wanted. There was some kind of communication block due to the fact that I was asking for something that hadn't been done before.

Then - during the night, something clicked and Perl said "a hah!" realized what I wanted... picking this up from my subconscious mind while I was sleeping and wanting to please me... surprised me by working "correctly" in the morning.

In other words, there seems to be something sentient (intangible/mystical/spiritual) at the heart of Perl. Or perhaps it was simply force of will. At any rate, I was never able to figure out anything that I could have done materially or physically to cause the program(s) to suddenly start running differently (as intended rather than some other way or not at all) after "sleeping on it".


In reply to Is Perl Sentient? by PerlGuy(Tom)
in thread Duplicate Images with Image::Magick Resize by graq

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.