It looks like someone (you?) is sensibly using use strictures; or use warnings FATAL => 'all'; somewhere.

Where is $text coming from? My gut reaction is that you are unexpectedly assigning a value of undef to it somewhere, possibly thinking you have an empty string instead. If you are in fact making the assignment in your code you might try this: my $text = $some_str || ''; to ensure a defined value if an empty string is acceptable.

If it is not, then you need to find out why the data is coming in as undef to begin with.

Thinking about it further, I suspect you are passing $some_str as a parameter to a method. You could still use the $some_str || '' construct, but it feels more like you should track down why that is undef to begin with.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

In reply to Re: XML::RSS save crashing by boftx
in thread XML::RSS save crashing by cormanaz

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.