same variable defined twice

[email protected] ("Octavian Rasnita")
Newsgroups perl.beginners
Message-ID <002f01c8bc0b$797e94a0$9200a8c0@octavian>
Hi,

I've tried the following script and it works fine:

use strict;
my $text = 1;
my $text = 2;
print $text;

Shouldn't perl disallow defining the $text variable a second time in the same script if using "use strict"?

Thank you.

Octavian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.