From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tamas Dober Sent: 06 February 2006 00:10 To: [email protected] Subject: IPC::Run
> Hello, > > I'm a beginner, please forgive me b/c of the simple questions. > > I'd like to test that that a batch file (starting a Java app) gives me > the expected output or not. > > What I have now: > > use strict; > use warnings; > use IPC::Run 'run'; > my $out; > my @ls = ( '\/perl\/Feb\/packager\/bin\/package.bat' ) ; Shouldn't those '\/' be '\\' ?? > run [EMAIL PROTECTED], \undef, \$out or die "bat returned $?" ; > like($out, qr/Usage/, 'Usage message' ); > is( $out =~ /config/, 'this is like that'); Those last two calls are to undefined subroutines. All of which leads me to suspect that this isn't really the code that you executed, as it couldn't possibly have produced the output that you claim. Its good to post a small example that illustrates what you are trying to do, but it must be code that we can run. Otherwise it makes it harder to help you. Unless you need to interact with the command that you are running, then IPC::Run might be a bit of overkill. If you need to collect the output from an external command, just use backticks. my $out = `\\perl\\Feb\\packager\\bin\\package.bat`; print "Usage message\n" if $out =~ /Usage/; For more info see 'perldoc perlop', search for backtick, or qx. HTH -- Brian Raven ================================= Atos Euronext Market Solutions Disclaimer ================================= The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions. L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions. _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
