<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - Running Perl in a WinXP Command Line Batch File - Comments</title>
 <link>http://community.activestate.com/forum-topic/running-perl-winxp-command-line-batch-file</link>
 <description>Comments for &quot;Running Perl in a WinXP Command Line Batch File&quot;</description>
 <language>en</language>
<item>
 <title>in your batch file you need</title>
 <link>http://community.activestate.com/forum-topic/running-perl-winxp-command-line-batch-file#comment-4201</link>
 <description>&lt;p&gt;in your batch file you need to check for the return value passed back from the script.&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;REM check for return value from script:
if errorlevel 0 ECHO script ran OK
if errorlevel 1 ECHO error occured in script1&lt;/pre&gt;&lt;p&gt;in your perl script, exit(0) means ok, exit(1) means error.&lt;br /&gt;
die results in exit(1).&lt;/p&gt;
</description>
 <pubDate>Fri, 15 Feb 2008 14:24:26 +0000</pubDate>
 <dc:creator>MarcZ</dc:creator>
 <guid isPermaLink="false">comment 4201 at http://community.activestate.com</guid>
</item>
<item>
 <title>Running Perl in a WinXP Command Line Batch File</title>
 <link>http://community.activestate.com/forum-topic/running-perl-winxp-command-line-batch-file</link>
 <description>&lt;p&gt;Hi, I wrote a perl script and want to run it in a WinXP command line batch file. The reason why I am doing this is that I have to call a program immediately in order to accomplish some tasks.&lt;/p&gt;
&lt;p&gt;My problem is that I want to conditionally run the program after the perl script, i.e.: if the perl script generates error, the program should not be run. &lt;/p&gt;
&lt;p&gt;My batch file is really as simple as this.&lt;/p&gt;
&lt;p&gt;@echo off&lt;br /&gt;
perl -x -S script.pl %1&lt;br /&gt;
program.exe %1&lt;/p&gt;
&lt;p&gt;As you can see, I want to cover the error case. If a user does not input one argument, my perl script will print usage information, no problem for this. However, the program.exe should not run in this case, I don&#039;t know how to do this.&lt;/p&gt;
&lt;p&gt;It is probably not a program about perl. Is there any way that a perl program can return its complete code back to the system? Or is there a standard way for doing this?&lt;/p&gt;
&lt;p&gt;Many thanks.&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/running-perl-winxp-command-line-batch-file#comments</comments>
 <category domain="http://community.activestate.com/forums/perl-discussion-0">Perl discussion</category>
 <category domain="http://community.activestate.com/os/windows-xp-pro">Windows XP Pro</category>
 <pubDate>Wed, 13 Feb 2008 01:33:00 +0000</pubDate>
 <dc:creator>noahsark</dc:creator>
 <guid isPermaLink="false">1922 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
