Hi Stephen,
It works for me. Here is a simple
perl script. The first time it calls
the command "ls *" all as one string,
the next time as a list of strings:
==========================
#!/usr/local/bin/perl -w
print "As one string

n";
system ("ls *");
print "As a list

n";
system ("ls", "*");
=============================
When I run this, I get the following
output (edited):
==============================
As one string:
bar.pl cadence linker.java
baz.pl dat foo.pl refLink.java
As a list:
ls: *: No such file or directory
=================================
So you see, when you do the command as
one string, you get a listing, as if you
had typed it at the command line. If you
do it as a list, the command doesn't go
throught the shell so the * is not expanded
by the shell, and the ls command actually
sees the star. There is no file called "*".
Lincoln Stein is correct. Imagine that
you actually do the system call as
system ("ls $foo")
where $foo comes from the user. Then, if
the $foo is "; rm -rf *" you could be in
bigggggg trouble since you execute
system ("ls ; rm *");
DO NOT DO EXECUTE THAT! IT'S VERY BAD!
If you use a list, you will be executing
for example
system ("ls", ";", "rm", "*");
and everything is an argument to the ls
executable. No shell involved. Should be
a bit faster, too.
Chris