in reply to .bat and perl mystery
t-cmd.pl:
and 'hello world.bat':#!/usr/bin/perl use strict; use warnings; $|++; my $cmd = 'hello world.bat'; my @cmd_args = qw/ testing testing 1 2 3 /; my $exit_code = system( $cmd, @cmd_args ); print 'exit code from ', $cmd, ' is ', $exit_code, $/;
does this work? system returns the exit code from the command. use backticks or qx// to get the program's STDOUT into a scalar or array.echo hello world! echo %1 %2 %3 %4 %5
~Particle *accelerates*
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: .bat and perl mystery
by Anonymous Monk on Jun 12, 2002 at 16:54 UTC | |
by jsprat (Curate) on Jun 12, 2002 at 17:57 UTC | |
by Anonymous Monk on Jun 13, 2002 at 12:35 UTC | |
by jsprat (Curate) on Jun 13, 2002 at 16:57 UTC |
In Section
Seekers of Perl Wisdom