akrrs7 has asked for the wisdom of the Perl Monks concerning the following question:
This is the shell script
#!/usr/bin/sh export LIBDIR=$MY_XALANHOME/bin export LOCALCLASSPATH=${LIBDIR}/xalan.jar export LOCALCLASSPATH=${LOCALCLASSPATH}:${LIBDIR}/xml-apis.jar export LOCALCLASSPATH=${LOCALCLASSPATH}:${LIBDIR}/xercesImpl.jar JAVACMD=$JAVA_HOME/bin/java $JAVACMD -cp $LOCALCLASSPATH org.apache.xalan.xslt.Process "$@"
This is the perl equivalent script
#!/usr/bin/perl use strict; use warnings; $ENV {'LIBDIR'}='$MY_XALANHOME/bin'; $ENV {'LOCALCLASSPATH'}='$LIBDIR/xalan.jar'; $ENV {'LOCALCLASSPATH'}='$LOCALCLASSPATH:$LIBDIR/xml-apis.jar'; $ENV {'LOCALCLASSPATH'}='$LOCALCLASSPATH:$LIBDIR/xercesImpl.jar'; JAVACMD=$JAVA_HOME/bin/java; $JAVACMD -cp $LOCALCLASSPATH org.apache.xalan.xslt.Process "$@";
Please review and advise where I could be off on the perl script. I need this to work in Windows as well as Unix.
Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Convert Shell script to Perl
by Corion (Patriarch) on Oct 10, 2011 at 13:28 UTC | |
by akrrs7 (Acolyte) on Oct 10, 2011 at 13:51 UTC | |
by Corion (Patriarch) on Oct 10, 2011 at 13:56 UTC | |
Re: Convert Shell script to Perl
by Utilitarian (Vicar) on Oct 10, 2011 at 14:02 UTC | |
by cdarke (Prior) on Oct 10, 2011 at 14:41 UTC | |
by akrrs7 (Acolyte) on Oct 10, 2011 at 15:26 UTC | |
by Utilitarian (Vicar) on Oct 10, 2011 at 15:43 UTC | |
by akrrs7 (Acolyte) on Oct 10, 2011 at 14:15 UTC | |
by Anonymous Monk on Oct 10, 2011 at 14:20 UTC | |
by akrrs7 (Acolyte) on Oct 10, 2011 at 15:11 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 10, 2011 at 19:28 UTC | |
by akrrs7 (Acolyte) on Oct 10, 2011 at 15:46 UTC | |
by FreeBeerReekingMonk (Deacon) on Mar 01, 2016 at 20:10 UTC |
Back to
Seekers of Perl Wisdom