DS has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks , I am converting an old shell script to perl , I came through this for loop but don't know how to exactlly do it in perl ..
not sure how to change the for loop.don't seem to work when I try :for DIR in `ls -d [a-k]* lts mon [n-z]*` do if [ -d $DIR/bld ]; then cd $DIR/bld cbsfpfg.exe `echo "cbs"$DIR$RELEASE $DIR` cd ../.. fi done
my $DIR; for $DIR in `ls -d [a-k]* lts mon [n-z]*` do if (-d $DIR/bld){ system (qq(cd $DIR/bld)); system(qq(cbsfpfg.exe `echo "cbs"$DIR$RELEASE $DIR`)); system (qq(cd ../..)); } done
edited: Mon Aug 5 22:14:09 2002 by jeffa - title change (was: shell problem)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Trying to convert shell script to Perl
by DamnDirtyApe (Curate) on Aug 05, 2002 at 22:33 UTC | |
Re: shell problem
by I0 (Priest) on Aug 05, 2002 at 20:31 UTC | |
by graff (Chancellor) on Aug 06, 2002 at 03:01 UTC |
Back to
Seekers of Perl Wisdom