Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Fair enough, it's a string compare rather than a pattern match. It's a simple eq, which should compare the string contained in $oldString to the value in quotes. Still, I get that uninitialized value error. The reason that there's a big gap between line 84 and line 103 is that I have a chunk commented out with an =item =cut block. Perhaps this will help. I've removed that block to make sure it wasn't causing the problem.
80 my $oldString = $allChanges->[$k]->getOldString(); 81 my $newString = $allChanges->[$k]->getNewString(); 82 $logger->debug("oldString = (", $oldString, ")"); 83 $logger->debug("newString = (", $newString, ")"); 84 print Dumper($oldString); 85 sleep 1; 86 87 if ($oldString eq "Automated") { 88 $logger->debug("old string = ", $oldString); 89 $logger->debug("new string = ", $newString); 90 }
Output:
INFO main:::78: Change 2 was to the Automated field of testCase HIREX- +16845 on createdDate 2013-05-13 11:34:52 Old String = (Ready For Inte +gration) New String = Automated DEBUG main:::82: oldString = (Ready For Integration) DEBUG main:::83: newString = (Automated) $VAR1 = 'Ready For Integration'; Use of uninitialized value in pattern match (m//) at weeklyAutomationC +hanges.pl line 87. Use of uninitialized value in pattern match (m//) at weeklyAutomationC +hanges.pl line 87. DEBUG main:::352: old string = Ready For Integration DEBUG main:::353: new string = Automated DEBUG main:::355: New string = Automated

-Logan
"What do I want? I'm an American. I want more."


In reply to Re^2: The simplest possible pattern match defeats me by logan
in thread The simplest possible pattern match defeats me by logan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2021-10-25 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?