in reply to Using constants. What am I doing wrong?
and your code does not.#!/usr/bin/perl -w use strict; use constant BASE => 'mybase'; print "BASE: ", BASE, "\n";
Update: If you want to set a 'symbolic constant' to a variable, you could use a variable and stick to the convetion that all caps means constant:
This also has the advantage of allowing variable interpolation.!/usr/bin/perl -w use strict; my $BASE = 'mybase'; print "BASE: $BASE\n";
-Mark
|
|---|