ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
why doesn't this work?
by John Deighan other posts by this author
Sep 27 2004 6:03PM messages near this date
view in the new Beta List Site
Re: why doesn't this work? | RE: why doesn't this work?
I'm trying to develop a Perl module that will work a bit differently 
depending on which kind of database is installed. The idea is to define an 
environment variable named 'Oracle' that, if set to 1, installs a different 
version of a function. In the following test code, I'm trying to define one 
or the other version of a function named 'callme', but it's not working. 
The environment variable named 'Oracle' is set to 1 (the main script prints 
out its value), but the test library still installs the second version of 
callme when it should be installing the first.

================
test script:
================
use strict;
use testlib;

print("Env Var 'Oracle' is set to '$ENV{Oracle}'\n");
callme();

================
test library (testlib.pm):
================
use strict;

if ($ENV{Oracle}) {
	sub callme {print("Version 1\n");}
	}
else {
	sub callme {print("Version 2\n");}
	}

1;

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved