kkurnala has asked for the wisdom of the Perl Monks concerning the following question:
Dear Perl Monks, I am a novice in perl and currently stuck with a problem. please help. My code has lines like:
}elsif ($branchurl =~ /sites/) { $outfile_merge = 'STARTING MERGE FOR sites\n================== +================\n'; $branchurl =~ /sites\/(.+)\/branches/i; print "$1"; $outfile_merge = `cd trunk/sites/$1; svn merge --dry-run $bran +churl .`; print " 5 - $outfile_merge\n"; }
In the above snippet, I want to know if there is an error with the cd command or svn merge command and come out of the loop with a error message Can one of you recommend what best I can do please? Thanks a tonne !!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to know the exit status of sub-commands running with backticks in Perl.
by ikegami (Patriarch) on Apr 05, 2012 at 21:55 UTC | |
by kkurnala (Initiate) on Apr 05, 2012 at 22:03 UTC | |
by GrandFather (Saint) on Apr 05, 2012 at 22:15 UTC | |
by ikegami (Patriarch) on Apr 06, 2012 at 21:22 UTC |