in reply to Re: Using "my" suppresses "Name used only once" warning?
in thread Using "my" suppresses "Name used only once" warning?
I tend to want to pre-declare variables, as it's how I learnt in BASIC, C and COBOL. I also got into the habit of defining them before doing anything else.
Obviously in large programs this can lead to some being declared but never used, or left behind when the code that uses them is removed.
The using a string as a number thing was because I was testing what warnings were given and set a variable to 1 (numeric), concanated it with "1" with the . operand and then added a numeric number 1 to it, without getting any warnings about it.
I know a "make your mind up about the context of $such_and_such" warning is too much to ask, but I'd have expected some sort of non-fatal complaint.
I guess what I'm really after is a psuedo strong type casting option for variables. In other words, if I used a scalar in string context, I want to be warned if I later use it as a number (even if it looks like a number).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using "my" suppresses "Name used only once" warning?
by Abigail-II (Bishop) on Feb 03, 2003 at 01:18 UTC | |
by Wysardry (Pilgrim) on Feb 03, 2003 at 02:14 UTC | |
by Abigail-II (Bishop) on Feb 03, 2003 at 08:18 UTC | |
by Wysardry (Pilgrim) on Feb 03, 2003 at 18:53 UTC | |
by Abigail-II (Bishop) on Feb 03, 2003 at 23:05 UTC | |
| |
by Biker (Priest) on Feb 03, 2003 at 13:17 UTC | |
|
Re: Re: Re: Using "my" suppresses "Name used only once" warning?
by demerphq (Chancellor) on Feb 03, 2003 at 13:56 UTC |