By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,186 Members | 1,530 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,186 IT Pros & Developers. It's quick & easy.

Require a Perl Header file

100+
P: 158
I have a Perl Header file i need to include so i can call stuff out of it. Heres my code. The problem in on 8 and 9, when i try to print a variable out of the header file it does not work.

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. print "Content-type:text/html\n\n";
  3.  
  4.   require "Art-Net.ph";
  5.   use IO::Socket;
  6.   use warnings;
  7.  
  8. print $NETID0; 
  9. print $NETID1; 
  10.  
  11. my $header = 'Art-Net';
  12. my $space  =' ';
  13. my $Prover = chr(0x0e);
  14. my $filler = chr(0x00);
  15. my $ttm    = chr(0x02);
  16. my $ID     = $header.$filler;
My code to the header file is.
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. ############################
  4.  
  5. my $NETID0 = 2; #NetID when DIP Sw #4 =OFF DEFAULT
  6. my $NETID1= 10; # NetID when DIP Sw #4 =ON
  7. my $DefaultPort = 0x1936; 
  8. my $ProtocolVersion = 14; # DMX-Hub protocol version.
Jun 12 '07 #1
Share this Question
Share on Google+
1 Reply


KevinADC
Expert 2.5K+
P: 4,059
your variables are scoped to the script they are in because you're using "my". Look into using "our" for shared variables.
Jun 13 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.