Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Whats its bad here?

by Sombrerero_loco (Beadle)
on Sep 25, 2009 at 12:44 UTC ( [id://797490]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Whats its bad here?
in thread Whats its bad here?

YUp, if i disable use strict it works, and if i print the var $vTemp2 its shows me the correct info.... Its a weird thing.

Replies are listed 'Best First'.
Re^5: Whats its bad here?
by Corion (Patriarch) on Sep 25, 2009 at 13:07 UTC

    That's what use strict; is for. It forces you to predeclare your variable names, so it can catch mistyped variable names. If you predeclare $vTemp2 like this:

    use strict; my $vTemp2; ...

    your program will work and you get the benefit of Perl alerting you when you mistype the name.

Re^5: Whats its bad here?
by toolic (Bishop) on Sep 25, 2009 at 13:05 UTC
    if i disable use strict it works
    But, that is the wrong thing to do. You should use strict, then fix the errors. Read use strict and warnings.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://797490]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found