Loading ...
Sorry, an error occurred while loading the content.
 

[PBML] Perl: perl -w and use strict

Expand Messages
  • Frank Hale
    Okay this is what I want to do. I have a configuration file: - test_config.pl for global variables - #!/usr/bin/perl -w use strict; require test.pl ; my $test
    Message 1 of 1 , Nov 12, 1999
      Okay this is what I want to do. I have a configuration file:

      - test_config.pl for global variables -

      #!/usr/bin/perl -w

      use strict;
      require "test.pl";

      my $test = "Hello,World!";

      ---------------------------

      and I have another perl script which I want to put all my code in:

      #!/usr/bin/perl -w

      use strict;

      print $test;

      1;

      Except I get the following error when I execute test_config.pl

      frank@Andromeda:~/httpd/cgi-bin > ./test_config.pl
      Global symbol "$test" requires explicit package name at test.pl line 5.
      Compilation failed in require at ./test_config.pl line 5.

      How can I make it so I can have a configuration file with all my global
      variables and an implementation file? Kinda like the .c and .h combo in
      C.

      --
      From: Frank Hale
      Email: frankhale@...
      ICQ: 7205161
      Website: franksstuff.com (Dynamic IP, Online when I am online)
    Your message has been successfully submitted and would be delivered to recipients shortly.