binurajkr has asked for the wisdom of the Perl Monks concerning the following question:
If I run a.pl, it prints the latest SVN Version. However, if I copy a.pl to cgi-bin directory and run it under cgi, I do not see the svn version gettting displayed. If I make a slight modification to find_latest_svn_version.sh removing the "--revision HEAD", I can see that it display the version number(though it is not the one from the HEAD of the tree). I could not figure out why adding this argument causes the script to behave differently. I am wondering whether there are tricks to in passing arguments correctly under cgi, as the same perl script works fine from command line. Any help is greatly appreciated and thanks in advance.----------------------------------------------------------- find_latest_svn_version.sh #!/bin/sh -v SVNINFO="/home/buildmaster/bin/svn info" #find the latest SVN Version SVNVERSION=`${SVNINFO} --revision HEAD $1 | grep "Revision" | sed -e ' +s/Revision: \(.*\)/\1/'` echo $SVNVERSION ---------------------------------------------------------- a.pl #! /usr/bin/perl -w print "Content-type: text/html\n\n"; print <<END_SEC1; <html> <head> <title> Build DashBoard</title> </head> <body> starting </body> </html> END_SEC1 $findversion = "find-latest-svn-version.sh"; $srcdir = "/home/buildmaster/build/releases/sources/MPP_SW_BASE"; $scriptDir = "/home/buildmaster/build/scripts"; if( system( "$scriptDir/$findversion $srcdir") ) { print "<br>failed<br>\n"; } else { print "<br>succeeded<br>\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why does the same perl routine behave differently under cgi?
by moritz (Cardinal) on Mar 23, 2009 at 23:29 UTC | |
|
Re: Why does the same perl routine behave differently under cgi?
by fzellinger (Acolyte) on Mar 23, 2009 at 23:52 UTC | |
by binurajkr (Initiate) on Mar 24, 2009 at 01:00 UTC | |
|
Re: Why does the same perl routine behave differently under cgi?
by ikegami (Patriarch) on Mar 23, 2009 at 23:09 UTC | |
by binurajkr (Initiate) on Mar 24, 2009 at 00:42 UTC |