Home  |  Linux  | Mysql  | PHP  | XML
From:Dermot Paikkos Date:Wed Apr 22 21:32:31 2009
Subject:RE: Global scope
Hi,

Hello,


package options;
use strict;

use warnings; ### This might have helped

use base qw(Exporter);
our @EXPORT = qw(@BenefitsOptions %BenefitsOptions);

#our @EXPORT_OK = qw(); # If your not going to export anything,
# you might as well leave this out.

our %BenefitsOptions = (
"Dental" => 1,
"Full" => 2,
"Base" => 3,
"Comm." => 4, # Do you really want a period (.) here?
"END" # What is this for?
);
# @BenefitsOptions = ();
# This causing errors.
my @BenefitsOptions = (); # Works with strict pragma.

1;
...
Vance


I can't see what the problem is apart from the points above. This works for me

#!/bin/perl
use strict;
use warnings;
use options;

print "Comm. is $BenefitsOptions{'Comm.'}\n";

>Comm. is 4


Perhaps you edited this for the email. Good luck,
Dp.






Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next


Your recent visits
RE: how to add support of Msql and CGI in Apache
CGI ap on NetworkSolutions host
Are there any free web hosting providers who also allow perl scripting?
Re: script working from shell, but not from browser.
Re: Need help to resove..... ExtUtils-Makemaker comilationS



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants