in reply to Re^12: Using a sting with a variable name
in thread Using a sting with a variable name
use strict 'vars'; let's the programmer know that a variable they used doesn't exist.Could you first define what you mean by exists in this context? Because:
package main; use strict 'vars'; say $var; # Error, ($var doesn't "exist"?)
But that's clearly nonsense as in both snippets, $var and $::var are the same, and a variable cannot both exist and not exist.package main; use strict 'vars'; say $::var; # No error ($::var does "exist"?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^14: Using a sting with a variable name
by ikegami (Patriarch) on May 11, 2009 at 20:25 UTC |