#!/usr/bin/perl # # Bad code - will not work # use strict; use warnings; if ($^O eq 'MSWin32') { use autouse 'MyMod_W32' => qw( bar ); } else { use autouse 'MyMod' => qw( bar ); } bar();
update: Well that's what happens when you post untested code! This will not work. Duh. The 'use' happens at compile time. The last bar defined is the first one used.
-derby
In reply to Re: Runtime module use and sub definitions
by derby
in thread Runtime module use and sub definitions
by RhetTbull
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |