[EMAIL PROTECTED] wrote: > I keep running into this problem and don't know the "proper way" to solve > it: > > I have an external program that I want to run within another perl version: > > my $timingexe = "v:\\utilities\\logging\\logtime.plx "; > my $opts = "\"$start\" " > ."\"$endtime\" " > ."\"$batchname\" " > ."\"$env\" " > ."\"$subbatch\" " > ."\"$title\" " > ."\"$ExeName\" " > ."\"$Params\" " > ."\"$version\" " > ."\"$returncode\" " > .$tries; > > print "\n\n$opts\n\n"; > > system("$timingexe.$opts"); > > This is what the contents of $opts is: > > "20050407 17:00:56" "20050407 17:00:56" "Numerix" "Dev" > "N:\Development\Trades\" "112136_112136.xls" "0.00 Range Accrual > Pricing" "N:\Development\MarketData\MarketData.xls" "3.1.1965.0" "0" 1 > > Which is fine. > > However, from the called application, this is what it gets: > > Args > > 20050407 17:00:56 20050407 17:00:56 Numerix Dev N:\Development\Trades" > 112136_112136.xls 0.00 Range Accrual Pricing > N:\Development\MarketData\MarketData.xls 3.1.1965.0 0 1 > > Quotes are missing and therefore the args don't get passed properly. > > Is there a better way to do this? I am stuck with the calling method as I > have a lot of legacy scripts and it needs to cover them all. > > Any hints? FROM BILL: ############################################################ Why is it that people can't post complete snippets ?
use strict; use warnings; foreach (@ARGV) { print "$_\n"; } print "\n"; my $timingexe = "v:\\utilities\\logging\\logtime.plx "; $timingexe = 'perl test.pl'; # calling myself for testing my $start = '20050407 17:00:56'; my $endtime = '20050407 17:00:56'; my $batchname = 'Numerix'; my $env = 'Dev'; my $subbatch = 'N:\Development\Trades'; # bad habit to end with a \ my $title = '112136_112136.xls'; my $ExeName = '0.00 Range Accrual Pricing'; my $Params = 'N:\Development\MarketData\MarketData.xls'; my $version = '3.1.1965.0'; my $returncode = '0'; my $tries = 1; my $opts = qq{"$start" "$endtime" "$batchname" "$env" "$subbatch" "$title"} . qq{ "$ExeName" "$Params" "$version" "$returncode" $tries}; print "$opts\n"; print "\n"; system "$timingexe $opts" if not @ARGV; # recurse just once __END__ "20050407 17:00:56" "20050407 17:00:56" "Numerix" "Dev" "N:\Development\Trades" "112136_112136.xls" "0.00 Range Accrual Pricing" "N:\Development\MarketData\Mar ketData.xls" "3.1.1965.0" "0" 1 20050407 17:00:56 20050407 17:00:56 Numerix Dev N:\Development\Trades 112136_112136.xls 0.00 Range Accrual Pricing N:\Development\MarketData\MarketData.xls 3.1.1965.0 0 1 ############################################################ Thanks to all for your help - the trailing \ on the tradedir was the real problem. Apologies for not sending full code snippet and for my email programs lack of skill putting the correct > in the reply. ______________________________________________________________ This message may contain privileged information. If you have received this message by mistake, please keep it confidential and return it to the sender. Although we have taken steps to minimise the risk of transmitting software viruses, the EBRD accepts no liability for any loss or damage caused by computer viruses and would advise you to carry out your own virus checks. The contents of this e-mail do not necessarily represent the views of the EBRD. _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs