On Jul 15, Connie Chan said:
>> >## params.pl in /lib/ ##
>> >my $lib{root} = 'C:/myLib/'; my $rt = $lib{root};
>> >my $lib{char_maps} = $rt."chinese/gbb5.map";
>> >my $lib{gb_map} = $rt."chinese/gb.map";
>> >
>> >my $lib{temp} = $rt."temp/";
>>
>> Warning: you cannot my() a subscript.
>>
> >## params.pl in /lib/ ##
> >my $lib{root} = 'C:/myLib/'; my $rt = $lib{root};
> >my $lib{char_maps} = $rt."chinese/gbb5.map";
> >my $lib{gb_map} = $rt."chinese/gb.map";
> >
> >my $lib{temp} = $rt."temp/";
>
> Warning: you cannot my() a subscript.
>
> my $foo[$i]; # is a syntax error
> -Original Message-
> From: Connie Chan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 10:30 AM
> To: Bob Showalter; [EMAIL PROTECTED]
> Subject: Re: our %hash problem when require
>
>
> > The "our" declaration is for the current file on
On Jul 15, Connie Chan said:
>>1
>Hehe... I forgot the 1; again , but I do have this in my code. =)
>
>> my $ref = \%lib1::abc;
>How about if I don't package it ? and hopefully just make it looks
>like %ENV ? For my case in real , that's something like this :
>
>## params.pl in /lib/ ##
>my $lib{
> The "our" declaration is for the current file only, so you need
> "our" in Script 1.
O seems I am hopeness...
> $a is a "special" variable (used in sort blocks), so it gets a
> "free pass" from use strict, just like all the other special
> variables ($_, $/, etc.).
Was you the guy tol
On Jul 15, Connie Chan said:
>### Lib 1 ###
>use strict;
>our %abc;
>$abc{a} = 1;
>$abc{b} = 2;
>### EOF Lib 1 ###
>
>### Lib 2 ###
>use strict;
>our $a = "ME";
>### EOF Lib 2 ###
You've made the mistake of using $a (or $b) as a variable name. These two
variables are protected from use strict '
>1
Hehe... I forgot the 1; again , but I do have this in my code. =)
> my $ref = \%lib1::abc;
How about if I don't package it ? and hopefully just make it looks
like %ENV ? For my case in real , that's something like this :
## params.pl in /lib/ ##
my $lib{root} = 'C:/myLib/'; my $rt = $lib{ro
> -Original Message-
> From: Connie Chan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 15, 2002 9:28 AM
> To: [EMAIL PROTECTED]
> Subject: our %hash problem when require
>
>
> Some days ago, I've interested in the using of 'our' var,
> how
On Monday, July 15, 2002, at 06:27 , Connie Chan wrote:
> Some days ago, I've interested in the using of 'our' var,
> however, I do have some problem on using this with require.
part of what is going on here, is essentially the transition
model from how things were 'possible' in perl4 - before
Some days ago, I've interested in the using of 'our' var,
however, I do have some problem on using this with require.
### Lib 1 ###
use strict;
our %abc;
$abc{a} = 1;
$abc{b} = 2;
### EOF Lib 1 ###
### Lib 2 ###
use strict;
our $a = "ME";
### EOF Lib 2 ###
### Script 1 ###
use strict;
eval
10 matches
Mail list logo