Hosen1989 has asked for the wisdom of the Perl Monks concerning the following question:
Dear ALL,
Here I have faced feature 'I think' I do not understand.
I was going to use constant module, and the three line below demonstrate it:
use constant WEEKDAYS => qw(Sunday Monday Tuesday Wednesday Thursday F +riday Saturday); print "".(WEEKDAYS)[1]; #case 1 print (WEEKDAYS)[1]; #case 2
@case 1: it work just fine and print the day of week!!!
@case 2: it crash with next error:
syntax error at time.pl line 3, near ")[" Execution of time.pl aborted due to compilation errors.
So can you help me here.
BR
Hosen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use constant moudle
by Anonymous Monk on Feb 24, 2016 at 10:30 UTC | |
by kcott (Archbishop) on Feb 24, 2016 at 11:40 UTC | |
by Anonymous Monk on Feb 24, 2016 at 11:51 UTC | |
by kcott (Archbishop) on Feb 24, 2016 at 12:42 UTC |