Re: Combining Code, Newbie Issues.



usenet@xxxxxxxxxxxxxxx wrote:
> usenet@xxxxxxxxxxxxxxx wrote:
>> [snipped code]
>
> I just noticed from your original post that your message includes a
> status (based on return code). I'm assuming that (because you don't
> include the actual numeric value of the code in the message) that
> "warnings" will always be rc==2 (so that the return code can only be
> 0, 1, or 2). If this assumption is correct, you can save some typing
> with a nifty trick like this:
>
> my $msg = "The Production Scheduler has completed " .
> ("Successfully", "With Errors", "With
> Warnings")[$returncode];

Or:

my $msg = "The Production Scheduler has completed with ".
qw/Success Errors Warnings/[$returncode];

:-)

--
Stan


.



Relevant Pages

  • Re: Combining Code, Newbie Issues.
    ... I just noticed from your original post that your message includes a ... you can save some typing with ... a nifty trick like this: ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Stan Continues In His Mental Confusion!
    ... And if you don't do that, you haven't got a leg to stand on to refute anything or everything that was stated in that original post! ... you're just TOTAL GASBAG BULLSHITTERS. ... why are you so dense in the head? ... Actually, Stan, YOU ARE THE GASBAG since you keep ...
    (rec.outdoors.rv-travel)
  • Re: vcs files
    ... > the range of features that may be implemented - per original post, ... > on whether a changed appointment can be updated or deleted via the data ... > in .vcs file? ... Prev by Date: ...
    (microsoft.public.outlook)
  • Re: Impossible SQL query?
    ... extra Ends are not determined by what's leftover once you traverse the ... but any Ends you encounter along the way that exceed the ... but End #10 is not in his original post. ... Prev by Date: ...
    (comp.databases.oracle.misc)
  • Re: Duplicate folder tree
    ... > first attempt at something like this, I highly recommend using a mature ... Oops, I didn't read the original post and got this thread confused with ... Prev by Date: ...
    (microsoft.public.scripting.wsh)