Perl, download URL

2010-05-26 Thread Andros Zuna
Hi again, have a new script her, I want to create a code that will read a data file of the following format The first column describes how many times the script should download a URL, and the second column describes how many seconds the tool should sleep before going on... This is what i got

Re: Return value = 0

2010-05-26 Thread Andros Zuna
Ok, I see, so the code should look somehow like this: #! /usr/bin/perl use warnings; use strict; $command = "ls -l"; while (system($command) != 0) { my $c++ } But how could I test if the command executes if the return value changes? ...is there a unix command or other way that generates

Re: Return value = 0

2010-05-26 Thread Andros Zuna
Hi, I did some few changes: #! /usr/bin/perl # use warnings; # use strict; $command = `ls -l`; if (system($command) == 0) { } elsif(system($command) != 0) { print "Failed to execute: $?\n"; my $c++ } But I'm still not getting it right, this is my error output: root@/user$ ./script.

Re: Return value = 0

2010-05-26 Thread Andros Zuna
gt; [image: ic_mob.gif] me if u need any thing > [image: preview_document.jpg] > > > > On Wed, May 26, 2010 at 6:19 PM, Andros Zuna wrote: > >> Hi! >> I am trying to write a perl code that will retry the same command over >> and over again until the return val

Return value = 0

2010-05-26 Thread Andros Zuna
Hi! I am trying to write a perl code that will retry the same command over and over again until the return value is 0. This is what I got for now: #! /usr/bin/perl use warnings; use strict; $command = 'ls -l'; if (system($command) == 0) { } elsif(system($command != 0)) { print "Failed to execu