On 02/03/2013 14:37, Chris Stinemetz wrote:
On Fri, Mar 1, 2013 at 3:37 PM, Chris Stinemetz wrote:
On Fri, Mar 1, 2013 at 11:00 AM, Shlomi Fish wrote:
Hi Jim,
On Thu, 28 Feb 2013 11:21:59 -0800
Jim Gibson wrote:
On Feb 28, 2013, at 10:31 AM, Chris Stinemetz wrote:
I want to put a has
On Mar 2, 2013, at 6:37 AM, Chris Stinemetz wrote:
> With Shlomi's approach how would I access each element in the %global_hash
> within the main script calling the function?
>
> Below is what I have attempted.
>
> **Containers.pm**
>
> ## This is the file Containers.pm
> package Containers;
On Fri, Mar 1, 2013 at 3:37 PM, Chris Stinemetz wrote:
>
>
> On Fri, Mar 1, 2013 at 11:00 AM, Shlomi Fish wrote:
>
>> Hi Jim,
>>
>> On Thu, 28 Feb 2013 11:21:59 -0800
>> Jim Gibson wrote:
>>
>> >
>> > On Feb 28, 2013, at 10:31 AM, Chris Stinemetz wrote:
>> >
>> > > I want to put a hash declaratio
On Fri, Mar 1, 2013 at 11:00 AM, Shlomi Fish wrote:
> Hi Jim,
>
> On Thu, 28 Feb 2013 11:21:59 -0800
> Jim Gibson wrote:
>
> >
> > On Feb 28, 2013, at 10:31 AM, Chris Stinemetz wrote:
> >
> > > I want to put a hash declaration in a separate file from the main
> script.
> > > How do I do this cor
Hi Jim,
On Thu, 28 Feb 2013 11:21:59 -0800
Jim Gibson wrote:
>
> On Feb 28, 2013, at 10:31 AM, Chris Stinemetz wrote:
>
> > I want to put a hash declaration in a separate file from the main script.
> > How do I do this correctly?
> >
> > perl.pl ( main script )
> >
> > #!/usr/bin/perl
> > us
>
>
>
> Put the following line in the main script:
>
> our %hash;
>
> Change the "my %hash = ( ... );" declaration in lib.pl to "our %hash =
> (...);".
>
> In your original versions, %hash was a lexical variable in lib.pl, and
> thus not in scope within perl.pl. Using 'our' instead of 'my' makes %h
On Feb 28, 2013, at 10:31 AM, Chris Stinemetz wrote:
> I want to put a hash declaration in a separate file from the main script.
> How do I do this correctly?
>
> perl.pl ( main script )
>
> #!/usr/bin/perl
> use warnings;
> use strict;
> use Data::Dumper;
>
> require "lib.pl";
>
> print Dump
I want to put a hash declaration in a separate file from the main script.
How do I do this correctly?
perl.pl ( main script )
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
require "lib.pl";
print Dumper \%hash;
lib.pl ( library script )
#!/usr/bin/perl
use warnings;
use strict;