I'm having problems returning from a batch file called by the system command. The batch file completes but never returns to the calling perl script. What am I missing here? Here's a snippet of my code:

newbug.bat:

@echo off echo this is some message echo another message echo yet another message goto fini :fini echo "Exiting..." exit /b

fascanner.pl:

... $Jira_command_line="newbug $Jira_bug_category $Jira_bug_number trunk $ +TRUNK $sernum"; print "Calling '$Jira_command_line'\n"; #$i = system("$Jira_command_line"); ### original line but doesn't wor +k $i = system("cmd /c $Jira_command_line"); ### this also doesn't work print "\n********** Initial FA of $sernum complete! **********\n";

I noticed that "Exiting..." is displayed so it should be exiting, but somewhere hangs between leaving the batch file and returning to my perl script. Any ideas why? Thanks for your help.

I'm running ActivePerl 5.12 on Win XP and I've also tried ActivePerl 5.14, but still have the same issue.


In reply to Not returning from batch file by alexanderp98

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.