I'm running on unix (5.6) and that is a cutnpaste of my working script. 
'course it wrapped along the way ... what system are you useing?  Did you 
'unwrap' the array assignment line?  What failure did you get?

I didn't ask the question, the spaces should be okay, but it also works 
w/o them:
my @CmdList = ('/tmp/hello.pl', '-p', '"this is my parm"', '-m', '"this is 
my message"', '-o', '"this is my option"', "data1 data2 data3 data4 
data5");

That's one line.  I didn't ask the original question and I, er, lost, the 
original post and user email.

a

Andy Bach, Sys. Mangler
Internet: [EMAIL PROTECTED] 
VOICE: (608) 261-5738  FAX 264-5030

" ... even if you're mediocre/decent at perl [the cmecf] code is pretty 
confusing in certain areas ..." CB



 
> This works:
> #!/usr/bin/perl -w
> use strict;
> my @CmdList = ('/tmp/hello.pl', ' -p ', '"this is my parm"', ' -m ', 
> '"this is my message"', ' -o ', '"this is my option"', " data1 data2 
data3 
> data4 data5");
> print "cmd: ", @CmdList, "\n";
> exec "@CmdList";

    I would be surprised if this works. I certainly fails on my system.
Splitting things up is the right way to go but the first argument you
are passing to the hello.pl program is " -p ". This starts with a space
rather than a dash so it will not to seen as an option. 

    If you want it to print pretty, try using:

                 print "cmd: ", (join " ", @CmdList), "\n";

    You also need to split up the arguments so there are five rather
than one with imbedded spaces.

--
Bruce A. Hudson                                                          | 
[EMAIL PROTECTED]
UCIS, Networks and Systems                               |
Dalhousie University                                             |
Halifax, Nova Scotia, Canada                             | (902) 494-3405



_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to