Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

use Strict

Hi,

  What exactly does "use strict" do?

0
leoleo
Asked:
leoleo
  • 3
1 Solution
 
PC_User321Commented:
The most important thing that it does is force you to declare all variables before using them.
This makes writing bug-free code easier because without it you could accidentally use two different spelling of a variable, and perl would use them as two different variables.

You declare variables with the word 'my'. e.g.
   my $First;
   my $Second = "Number two";
0
 
PC_User321Commented:
Type "perdoc strict" at the unix prompt to find out all the details.
0
 
PC_User321Commented:
Sorry, "perldoc strict".

On a PC you can read
C:\Apps\Perl\html\lib\strict.html
(adjust the path to match your setup).
0
 
leoleoAuthor Commented:

Thanks a lot.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now