develooper Front page | perl.beginners | Postings from February 2011

encapsulate static data

Thread Next
From:
Jim Green
Date:
February 9, 2011 17:57
Subject:
encapsulate static data
Message ID:
d53b1b3e-ca5d-4ed3-a3f8-65b0d86d9689@u17g2000yqe.googlegroups.com
Hello:
I have some static data I want to wrap in a Data.pm, what is the best
way of doing this.

package data;
use strict;
use warnings;

my $data=1;
1;

I tried
use data;
print $data; but it doesn't work, also I tried print data::$data and
still doesn't work.

Thanks for helping!
Jim


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About