while (system($command) != 0) {
                } 

Bob McConnell

-----Original Message-----
From: Andros Zuna [mailto:andros.z...@gmail.com] 
Sent: Wednesday, May 26, 2010 8:57 AM
To: Chaitanya Yanamadala
Cc: beginners@perl.org
Subject: Re: Return value = 0

Hi,
Thank you for the tip Chaitanya, but I still don't thik my script is
working correct!?



2010/5/26 Chaitanya Yanamadala <dr.virus.in...@gmail.com>


        u should give it as 
        $command=`ls -la`;
        
        
        use the key on the top of TAB button with shift..
        
        Chaitanya
        
        "A man can get discouraged many times but he is not a failure
until he stops trying..."
        
        "The difference between 'involvement' and 'commitment' is like
an eggs-and-ham breakfast: the chicken was 'involved' - the pig was
'committed'."
        ic_mob.gif me if u need any thing
        preview_document.jpg



        On Wed, May 26, 2010 at 6:19 PM, Andros Zuna
<andros.z...@gmail.com> wrote:
        

                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 execute: $command\n";
                 my $c++
                }
                
                I'm not shure to test it, because I don't know any unix
commands that
                gives other than 0 in return
                (I'm a n00b, but willing and trying to learn), could
anyone please
                take a look and see if this is correct, and if not, help
me??
                
                Tnx :)
                




--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to