473,549 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checking return values of a perl program in a batch file

I am new to perl and would like to know how to check the return values
of a perl program in a batch file. how can I save the return value of
the perl program and use it to make decisions as to what I should do
next in the batch file?
Jul 19 '05 #1
2 9908
brad wrote:
I am new to perl and would like to know how to check the return values
of a perl program in a batch file. how can I save the return value of
the perl program and use it to make decisions as to what I should do
next in the batch file?


As for the Perl part: you define the return value of the Perl script in the
exit() command, e.g.
exit 123 ;

I personally don't know of any programming language that is called batch. If
you are using the term in the usual generic meaning of "a simple program
that automatically process a whole bunch of jobs", then your question is
impossible to answer because there are dozens and dozens of programming
languages out there that are commonly used to write batch files. You may
want to ask in a newsgroup that deals with whatever language you are using
to implement your batch process.

jue
Jul 19 '05 #2
brad wrote:
I am new to perl and would like to know how to check the return values
of a perl program in a batch file.


I know of at least three types of batch files.
The answer when using COMMAND.COM or CMD.EXE is vastly different that
what would be used for /bin/bash or /bin/tcsh and has absolutely
nothing to do with the answer for MultiProgrammin g Batch running on
a 36-bit computer.

Check the manual for the command-line interpreter for your specific
Operating System for 'batch' error detection.
-Joe
--
I love my TiVo - http://www.inwap.com/u/joe/tivo/
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4458
by: Marc S. Gibian | last post by:
I am putting together a Perl tool to manage a large set of tasks related to building a rather complex set of software. One of the goals for moving to Perl is to provide very rigorous error checking and handling. One area that has me puzzled is error checking some of the file system operations. Just simple things such as open, rename, unlink,...
3
2736
by: Myron Turner | last post by:
I'm not sure whether this question belongs entirely here or in a perl group--but probably it requires knowledge of both. I've written a perl module, currently in use, which does asynchronous searches of library databases anywhere in the world. It forks off a separate process for each database which it contacts. In the past I've had it...
1
2927
by: Tom | last post by:
How do i run a batch file from a perl script? thanks in advance Tom
8
1409
by: gremlinbass | last post by:
I was wondering if I can check to see if a file is open? Specifically, is there any way I can code Access to check to see if a text file (datasource.txt to be specific) is open, returning a true value and creating a loop? Then, once the file closes, return a false value and closing the loop? I need to run a batch file using Shell() and...
6
2386
by: RoSsIaCrIiLoIA | last post by:
Do you know how to write a self-checking program in standard C? Do I can think that if I write in a file.c static g="1234567"; in the file.exe (or file) there is in some place 1234567'\0''\0''\0''\0''\0''\0''\0'...'\0' This is my first attempt: /* file.c -> file.exe */ #include <stdio.h>
66
3572
by: Johan Tibell | last post by:
I've written a piece of code that uses sockets a lot (I know that sockets aren't portable C, this is not a question about sockets per se). Much of my code ended up looking like this: if (function(socket, args) == -1) { perror("function"); exit(EXIT_FAILURE); } I feel that the ifs destroy the readability of my code. Would it be
0
2214
by: sunrt | last post by:
We have an As400 system that has program which executes batch files which resides on the SQL server 7.0 computer . Those batch files run SQL server jobs using isql. The whole idea about this is when ever some jobs will run on As400 to populate some files the program will be called to execute the batch files which will run the sql jobs to...
1
1904
by: halcyon943 | last post by:
have 4 folders that I watch and need to move files from to another location. Three constraints: -Finish time. Make sure the program stops transferring files at a specific time -Number of files transferred. Can only move a certain amount of files per time period. -Folders have a priority. The files have to be moved based on the folder...
1
6517
by: deepikabg | last post by:
Hi, Im v.new to postgres. I needed some help writing batch files. I wanted to run psql commands in a batch file. I give 2 inputs to the batch file -- Username and Database name I want my batch file to do the following things. - check if a database created by that user exists if true return 1 else return 0 Anyone who knows how to do...
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7450
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
6043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.