in reply to constant name in variable
Update From your followup I see I interpreted your question the wrong way.#!/usr/bin/perl -w use strict; use constant B => 5; my $name = B; my $value = $name; print "B gives: ", B, "\n\$name is: $name\n\$value is: $value\n"; __DATA_ B gives: 5 $name is: 5 $value is: 5
With your code there is no benefit to avoiding no strict; for a small scope. You merely hide the issues.
Dispatch tables might suit your problem.
|
|---|