So it sounds like you just need some "lightweight" persistent storage for these failed jobs, where you can find some failed job name in the failed job list easily (and I guess probably containing some small amount of other info). Sounds like a hash structure.

One idea is to just implement this with Config::Tiny. This is a module to fiddle with .ini files. This is a simple critter with no installation dependencies. So no fancy install is required, you could just put it in same directory as your new improved script.

Anyway this thing implements HOH, for you to use as you see fit. Some very simple app code is attached.

Update: OOps for posting at wrong level (the tidied up version instead of the original node..Ooops). Using a hash table may be overkill for just keeping track of "name => date/time", the idea BrowserUk would serve that purpose fine. I think there are other tied hash modules, but this was the simplest one that I could think of and avoids any potential installation hassles.

#!/usr/bin/perl -w use strict; use Config::Tiny; use Data::Dumper; # Open the config my $Config = Config::Tiny->read( 'status.ini' ) or die "could not open config.ini file"; #just to see what this looks like internally: print Dumper $Config; ##add new parameter (or would modify) $Config->{_}->{'newJOB'} = 'failed some stuff X'; #to discover and print the root names and their values: print "\nDiscover and print all rootnames (like Dumper does)\n"; my @jobs; foreach my $root_name (keys %{$Config->{_}}) { push (@jobs, $root_name); print " $root_name => $Config->{_}->{$root_name}\n"; } my $job2del = shift @jobs; print "deleting $job2del\n"; delete $Config->{_}->{$job2del}; $Config->write( 'status.ini' ); __END__ ***status.ini initial state: job4=fail date/time stampB newJOB=failed some stuff X job3=fail some time stuff AAAA ***program output: $VAR1 = bless( { '_' => { 'job3' => 'fail some time stuff AAAA', 'job4' => 'fail date/time stampB', 'newJOB' => 'failed some stuff X' } }, 'Config::Tiny' ); Discover and print all rootnames (like Dumper does) job3 => fail some time stuff AAAA job4 => fail date/time stampB newJOB => failed some stuff X deleting job3 ***status.ini final state job4=fail date/time stampB newJOB=failed some stuff X

In reply to Re^2: Fast Recall by Marshall
in thread Fast Recall by sans-clue

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.