Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7428715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:50:54+00:00 2026-05-29T08:50:54+00:00

Hey I thought about writing a function that prompts me in certain situations (perl

  • 0

Hey I thought about writing a function that prompts me in certain situations (perl had a bad exit status and the warning it prints starts with “Could not find * in @INC) with maybe re-running the command.

Do you think this is feasable?

I have found that TRAPZERR function. but i don’t even get the name of the last command in there, only the last argument, so one concrete point would be: how can I get the command-name out of it? !!:0 doesn’t work.

Next thing is: i think i might have to do some tricks with preexec to catch the first line of the stderr (if that doesn’t work that’s not a big problem, but it would be interesting anyway), I thought about appending an 2> to a pipe or something but I’m not sure how to get that pipe constructed in the first place. But as stated above, this is a minor issue.

But really, if you think: No this task is impossible! Please tell me so (although I would be interested why).

From the one answer i got until now I think i can narrow down the problem a little:

Is it possible to wrap a MULTIOS redirection around a perl script? ( I thought about some special kind of exec, but came up with none that worked)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:50:55+00:00Added an answer on May 29, 2026 at 8:50 am

    Here’s a start.

    preexec() {
      lastcommand=$1
      exec 3>&1 4>&2                   
      exec 2> >(tee /tmp/output 1>&4)
    }
    precmd() {
      read line </tmp/output
      case "$line" in
      "Can't locate"*)
        echo "Perl module missing running $lastcommand"
        ;;
      esac
    }
    

    But maybe you want to do something at the language level like How can I hook into Perl's use/require so I can throw an exception?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all. Quick question on Fluent syntax. I had thought I had this down,
Hey, I just started wondering about this as I came upon a code that
So I was going about my Moosey business and I thought hey might be
Hey all i am trying to figure out how to go about calculating this
I'm using Play 1.2.1. I want to hash my users password. I thought that
Hey, I'm talking about profiles within pom.xml of a project. Could please anybody explain
hey all im trying to get my head around calling this c++ function in
Hey all -- this question is specifically about a gender validation, but I'm interested
Hey have method called voted? that sees if someone voted. Where would I put
Hey guys! I have a dijit.form.ComboBox that needs have value checking applied against it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.