Wizards & Wise Ones,

Is there a way to have a constant take on different values?  I've tried the code below, and all I get as a value for DATA_COLS is seven. Always seven.

        use Getopt::Std;

        my %opts;

        getopts( 'o:', \%opts );

        my $os = $opts{'o'};

        use constant (DATA_COLS => (($os eq 'X') ? 6 : 7));

Okay, this is apparently wrong.  Is there a right way, some way I can set DATA_COLS to different values based on input?  I can't use the Readonly module to create a "non-changeable variable," it's not installed in the target systems, just development (beats me, too, but that's how it is). Or must I give up the idea of having a constant and just let DATA_COLS become the (vanilla) variable $DATA_COLS?

Many thanks,

Deane
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to