in reply to Re: Behavior of compile-time constants?
in thread Behavior of compile-time constants?

My recommendation to him was to use variables for his constants. (Yes, I know that sentence sounds bizarre.) Variables certainly behave differently in different contexts, but people are not as likely to make mistakes with them because they know they've got a variable rather than some mysterious constant thing.
  • Comment on Re: Re: Behavior of compile-time constants?

Replies are listed 'Best First'.
Re: Behavior of compile-time constants?
by Abigail-II (Bishop) on Jun 14, 2002 at 18:29 UTC
    Let's go crazy and use the worst of both worlds:
    #!/usr/bin/perl use strict; use warnings 'all'; use variable i => 0; use variable array => []; array = [2, 4, 5, 8]; for (i = 0; i < 4; i ++) { print array -> [i], "\n"; } __END__ 2 4 5 8

    Abigail