Re: same variable defined twice
[email protected] ("R. Hicks")
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
Octavian Rasnita wrote: > 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 > I just ran into this: my $limit = ''; $limit = ' LIMIT 10'; In development it takes the second one...and it can be commented out so the first hit gets taken. Other ways to do it, of course, but this is a one-time script. I wouldn't do that in a larger program. R