I am having real issues with passing a string to lc. I have a series of objects that I set up, these objects have various settings in them. They follow the OO methodology pre moose. I then read an XML file which contains changes to some of these values and load these new values onto selected variables in my objects.

If I pass a variable string that I modify to lc I get a panic message. check out the code below,

# I tried to print it as a new string, this still fails my $newOpMode = sprintf "%s", $self->setTheOpMode; print length($newOpMode) . " $newOpMode ---" . length ($self->setT +heOpMode) . " " . $self->setTheOpMode."\n"; $return = 1 if ( (lc( $newOpMode )) eq "mitigate" ); # panics here

This gives me the following message, but if you check both strings they are the same

8 mitigate ---8 mitigate Use of uninitialized value in pattern match (m//) at /usr/share/perl/5 +.8/utf8_heavy.pl line 211. Use of uninitialized value in scalar assignment at /usr/share/perl/5.8 +/utf8_heavy.pl line 227. Use of uninitialized value in pattern match (m//) at /usr/share/perl/5 +.8/utf8_heavy.pl line 228. Use of uninitialized value in scalar assignment at /usr/share/perl/5.8 +/utf8_heavy.pl line 288. Use of uninitialized value in pattern match (m//) at /usr/share/perl/5 +.8/utf8_heavy.pl line 291. Use of uninitialized value in scalar assignment at /usr/share/perl/5.8 +/utf8_heavy.pl line 346. Use of uninitialized value in pattern match (m//) at /usr/share/perl/5 +.8/utf8_heavy.pl line 347. panic: swash_fetch at /home/root/pambuoy/smruPb-swup-v10.21/pgmon/../m +odules/rtdcStateLogic/rtdcSystemController.pm line 112.

The version the code fails on is v5.8.8 compiled for an ARM based overo, my development system is ubuntu (5.10.1), on which this code operates fine.

what is going on inside PERL and is there anything I can do without having to start compiling sections of code?


In reply to panic: swash_fetch on passing a string to lc by irishBatman

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.