I have a problem with the following code snippet:
sub jil { my ($self) = @_; my $outstr = $self->_jilout('insert_job') . $self->_jilout('job_type'); $outstr .= $_ foreach (map $self->_jilout($_), @{%$self}{@{$self-> +{_fields_in_seq}}}); $outstr; } sub _jilout { my ($self,$attr) = @_; return '' if !exists($self->{$attr}) || !defined$self->{$attr}; "$attr: ".$self->{$attr}."\n"; }
When I use $foo->jil, I get the 'insert_job' and 'job_type' instructions, but nothing else, no warnings either. Using the Perl 5 debugger gives me a literally bizarre message:
DB<2> c Bizarre copy of HASH in leave at Autosys.pm line 88. ______________________________________________________________________ +________ Exit Code = 0 ______________________________________________________________________ +________ Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info. DB<2>
The horizontal rules and 'Exit code = 0' are from the application's END routine. $foo contains:
DB<2> x $_ 0 Autosys::command=HASH(0x4019d918) '_fields_in_seq' => ARRAY(0x4019d93c) 0 'command' 1 'machine' 2 'permission' 3 'alarm_if_fail' 4 'profile' 5 'condition' 6 'box_name' 'alarm_if_fail' => 1 'box_name' => 'OR_D_ID_ENR_RUL_BOX' 'command' => 'run_script.ksh ost_rules.ksh -s FDR -e Stan_Raw_Adjus +t -B100000' 'condition' => 'success(OR_D_ID_ADJUST_ENR)' 'insert_job' => 'OR_D_ID_ADJUST_RULE' 'job_type' => 'c' 'machine' => 'fpdbln99' 'permission' => 'gx' 'profile' => '.auto_profile' DB<3>
Any monks care to shed any light on what is happening. Maybe I need more coffee.

--rW


In reply to Bizarre copy of HASH in leave by rinceWind

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.