Jan Eden wrote: > Hi, > > I try to call wget using system like this: > > system("wget -O /dev/null", "http://janeden.org/test/file.txt"); > > This does not work: > > Can't exec "wget -O /dev/null": No such file or directory at > ./wgetrec.pl line 6. > > Ok, so how about this: > > system("wget", "-O /dev/null http://janeden.org/test/file.txt"); > > No go: > > wget: missing URL > > Without additional options, > > system("wget", "http://janeden.org/test/file.txt"); > > works fine. > > How can I pass an option to system's first argument in a setting like > this?
This is explained in 'perldoc -f system' You either need to separate all the args yourself, or pass a single string to system so the shell can split the args. You're trying to do both. either: system("wget -O /dev/null http://janeden.org/test/file.txt") or: system('wget', '-O', '/dev/null', 'http://janeden.org/test/file.txt') -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>