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];


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