<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18852">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>To expand a little on what Abram
suggested:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I think you have to put the subroutine definitions
inside an eval.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Another way to do it would be to say:</FONT></DIV>
<DIV><FONT size=2 face=Arial>if (something) {</FONT></DIV>
<DIV><FONT size=2 face=Arial> require 'x.pm';</FONT></DIV>
<DIV><FONT size=2 face=Arial>}</FONT></DIV>
<DIV><FONT size=2 face=Arial>else {</FONT></DIV>
<DIV><FONT size=2 face=Arial> require y.pm';</FONT></DIV>
<DIV><FONT size=2 face=Arial>}</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Where files x.pm and y.pm contain your two versions
of the code.</FONT></DIV>
<DIV><BR>Indy Singh<BR>IndigoSTAR Software -- <A
href="http://www.indigostar.com">www.indigostar.com</A></DIV>
<DIV> </DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=fulko.hew@gmail.com href="mailto:fulko.hew@gmail.com">Fulko Hew</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=tpm@to.pm.org
href="mailto:tpm@to.pm.org">TPM</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, November 27, 2009 2:00
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [tpm] how to conditional
compile</DIV>
<DIV><BR></DIV><SPAN style="FONT-FAMILY: courier new,monospace">I thought I
was doing the right thing, but I can't get there from here.</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">What I'd like to do is 'conditional
compile'. ie. define this set of</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">subroutines if something, and a
different set if something else.</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">For example:</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">BEGIN {</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace"> if (eval 'use AMODULE; 1")
{<BR> sub mysub1 { print "do something";
}<BR> sub mysub2 { print "something else"; }<BR> }
else {<BR> sub mysub1 { print "mysub1() is unsupported";
}<BR> sub mysub2 { print "mysub2() is unsupported";
}<BR> }<BR>}</SPAN><BR style="FONT-FAMILY: courier new,monospace"><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">Or in otherwords... if the module
isn't found, I'd like to stub out some routines.</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">Ideas anyone?</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">TIA</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><SPAN
style="FONT-FAMILY: courier new,monospace">Fulko</SPAN><BR
style="FONT-FAMILY: courier new,monospace"><BR
style="FONT-FAMILY: courier new,monospace">
<P>
<HR>
<P></P>_______________________________________________<BR>toronto-pm mailing
list<BR>toronto-pm@pm.org<BR>http://mail.pm.org/mailman/listinfo/toronto-pm<BR></BLOCKQUOTE></BODY></HTML>