in reply to Getting the Behavior of the "file open or die" Pragma but with a Program Pause

If you don't like having to have the user take action, you could always just do something like sleep 5;. That'll display the error for five seconds, then exit.

  • Comment on Re: Getting the Behavior of the "file open or die" Pragma but with a Program Pause
  • Download Code

Replies are listed 'Best First'.
Re^2: Getting the Behavior of the "file open or die" Pragma but with a Program Pause
by perldigious (Priest) on Oct 10, 2016 at 16:19 UTC

    I don't mind the user interaction, in fact I prefer it because it all but forces them to look at the error message. My main cringe is that I took something as clean and tidy as the one line "open or die" and use this kludge just to get the program pause behavior. I'm picking nits I'm sure, but I was hoping there was a way to keep that one line cleanliness (with the post-fix notation), get the pause, and not have to resort to a subroutine call as I do. I'm probably asking to have my cake and eat it too. :-)

    I love it when things get difficult; after all, difficult pays the mortgage. - Dr. Keith Whites
    I hate it when things get difficult, so I'll just sell my house and rent cheap instead. - perldigious