Hi Chaddi,
Thanks for your posting.
I am wanting to translate my batch file into PERL, as a first step to making
it run on Linux.
Thanks,
Richard.
You must put those command in a "something.bat" in the PATH and use
"system( "something" );". But that doesn't translate the ".bat" script
in Perl, it just execute it. Why do you want to translate it anyway :
multiplatform ? easier to read and enhance ?
_ ___
|_) |
| \ICHARD |HOMAS.
[EMAIL PROTECTED]
rdthomas.welcome.to
From: Chaddai <[EMAIL PROTECTED]>
To: [email protected]
Subject: Re: .bat to .pl
Date: Sun, 04 Sep 2005 22:44:06 +0200
MIME-Version: 1.0
Received: from listserv.activestate.com ([209.17.183.249]) by
mc9-f25.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sun, 4 Sep 2005
14:51:53 -0700
Received: from listserv.activestate.com (localhost.localdomain
[127.0.0.1])by listserv.activestate.com (8.12.10/8.12.10) with ESMTP id
j84KrJfj004141;Sun, 4 Sep 2005 13:54:10 -0700(envelope-from
[EMAIL PROTECTED])
Received: from smtp5.ActiveState.com (sack.ActiveState.com
[192.168.2.149](may be forged))by listserv.activestate.com
(8.12.10/8.12.10) with ESMTP idj84KiCXE003484 for
<[email protected]>;Sun, 4 Sep 2005 13:44:12 -0700
(envelope-from [EMAIL PROTECTED])
Received: from smtp8.activestate.com (darkroast.activestate.com
[192.168.2.82])by smtp5.ActiveState.com (8.12.11/8.12.11) with ESMTP id
j84Ki7se014475for <[email protected]>;Sun, 4 Sep 2005
13:44:07 -0700 (envelope-from [EMAIL PROTECTED])
Received: from smtp1.wanadoo.fr (smtp1.wanadoo.fr [193.252.22.30])by
smtp8.activestate.com (8.13.4/8.13.4) with ESMTP id j84Khu9C050893for
<[email protected]>;Sun, 4 Sep 2005 13:43:57 -0700
(PDT)(envelope-from [EMAIL PROTECTED])
Received: from me-wanadoo.net (localhost [127.0.0.1])by
mwinf0104.wanadoo.fr (SMTP Server) with ESMTP id 0B2BA1FFFFCEfor
<[email protected]>;Sun, 4 Sep 2005 22:44:06 +0200
(CEST)
Received: from [192.168.0.240]
(ARouen-251-1-80-1.w83-202.abo.wanadoo.fr[83.202.251.1])by
mwinf0104.wanadoo.fr (SMTP Server) with ESMTP id C9E141FFFFD1for
<[email protected]>;Sun, 4 Sep 2005 22:44:05 +0200
(CEST)
X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
X-ME-UUID: [EMAIL PROTECTED]
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: fr, en
References: <[EMAIL PROTECTED]>
X-PerlMx-Spam: CA, All, Gauge=IIIIIII, Probability=7%, Report='__CT 0,
__CTE 0,__CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0,__MIME_VERSION
0, __SANE_MSGID 0, __USER_AGENT 0'
X-SpamReport: No antispam rules were triggered by this message
X-PMX-Version: CA 4.7.1.128075, Antispam-Engine: 2.1.0.0,Antispam-Data:
2005.9.4.25
X-BeenThere: [email protected]
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: Discussions relating to
ActivePerl<activeperl.listserv.ActiveState.com>
List-Unsubscribe:
<http://listserv.ActiveState.com/mailman/listinfo/activeperl>,
<mailto:[EMAIL PROTECTED]>
List-Archive:
<http://ASPN.ActiveState.com/ASPN/Mail/Browse/Threaded/activeperl>
List-Post: <mailto:[email protected]>
List-Help:
<mailto:[EMAIL PROTECTED]>
List-Subscribe:
<http://listserv.ActiveState.com/mailman/listinfo/activeperl>,
<mailto:[EMAIL PROTECTED]>
Errors-To: [EMAIL PROTECTED]
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 04 Sep 2005 21:51:53.0955 (UTC)
FILETIME=[DCED5B30:01C5B19A]
Richard Thomas a écrit :
Hi,
Thanks for all your replies.
A few points about the batch file I would like to convert is that it has
the following:
1) labels and goto's
2) if statements
3) variables
I tried the first suggestion on the following batch file that uses labels
and gotos:
goto.bat
======
:begin
echo hello world
goto begin
goto.pl
=====
use strict;
use warnings;
my $command;
$command=':begin';
system ($command);
$command='echo hello world';
system ($command);
$command='goto begin';
system ($command);
This shows that it's not just about transferring the commands from .bat to
.pl.
You must put those command in a "something.bat" in the PATH and use
"system( "something" );". But that doesn't translate the ".bat" script
in Perl, it just execute it. Why do you want to translate it anyway :
multiplatform ? easier to read and enhance ?
--
Jedaï
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs