in reply to Re: Trying to connect to MSSQL and return result. Script hangs indefinitely.
in thread Trying to connect to MSSQL and return result. Script hangs indefinitely.

Maybe I'm missing something: How would incorrect quoting cause Perl to hang? Trying bad quoting on qx I get "sh: Syntax error: Unterminated quoted string". Are there shells that hang on bad quoting?
  • Comment on Re^2: Trying to connect to MSSQL and return result. Script hangs indefinitely.
  • Download Code

Replies are listed 'Best First'.
Re^3: Trying to connect to MSSQL and return result. Script hangs indefinitely.
by NetWallah (Canon) on Aug 06, 2014 at 21:33 UTC
    My bash shell on SLES( 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux) hangs on the first code sample, waiting for the close single quote.

    After one is provided, it complains (and perl does too .. the intent was to show code that appears to hang in the shell). Here is the session:

    />: perl -e 'print qx|printf "%b" "this is a q\'uot\'ed test|' > > .. Hanging here > .. until quote.. > ' -bash: .. Hanging here .. until quote.. : command not found Can't find string terminator "|" anywhere before EOF at -e line 1. />:

            Profanity is the one language all programmers know best.

      Hm, same here, although it's bash that's hanging waiting for input, not Perl or the backticks, as in the OP.

      $ perl -wMstrict print qx|printf "%b" "this is a q\'uot\'ed test"|, "\n"; print qx|printf "%b" "this is a q\'uot\'ed test|; print qx|printf "%b" "this is a q\'uot'ed test|; __END__ this is a q'uot'ed test sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string
        Ok - agreed - I cannot get bash to hang with a perl script that has backticks.

                Profanity is the one language all programmers know best.