Re: [MacPerl-AnyPerl] symbolic references <-> no strict refs

2002-03-17 Thread allan
Keary Suska wrote: > IMHO, symbolic refs are syntactic sugar that make code difficult to read, > follow, and debug. I recommend using hashes or objects instead. They are > easier to read, follow, and debug, and are more extensible. hi keary, thanks for the suggestions. but i dont see how you c

Re: [MacPerl-AnyPerl] symbolic references <-> no strict refs

2002-03-17 Thread Keary Suska
on 3/17/02 6:35 AM, [EMAIL PROTECTED] purportedly said: > that works, but since i want to build those symbolic > references dynamically (the reason for the symbolic refs are > because the camel book suggests those in favour of eval on a > string) how can i then pre-declare my variables (since i >

Re: [MacPerl-AnyPerl] import hash

2002-03-17 Thread allan
good enough for me, thanks! ../allan Adam Witney wrote: > > Don't know if this is the best way, but here is one way... > > ## hash.pl # > > #! /usr/bin/perl -w > > %bar = ( > 'A' => 1, > 'B' => 2 >); > > 1; # as hash.pl must return a true value when req

Re: [MacPerl-AnyPerl] import hash

2002-03-17 Thread Adam Witney
Don't know if this is the best way, but here is one way... ## hash.pl # #! /usr/bin/perl -w %bar = ( 'A' => 1, 'B' => 2 ); 1; # as hash.pl must return a true value when require'd ## myscript.pl # #! /usr/bin/perl -w use strict; use vars qw(%bar);

[MacPerl-AnyPerl] import hash

2002-03-17 Thread allan
hi i have a few large hashes that i would like to store in a seperate file for readability reasons instead of in my main file. i need those hashes to be available/visible to any other files that my main script might 'require'. is it possible to have a seperate file and possibly do something lik

Re: [MacPerl-AnyPerl] symbolic references <-> no strict refs

2002-03-17 Thread allan
thanks bart, that works, but since i want to build those symbolic references dynamically (the reason for the symbolic refs are because the camel book suggests those in favour of eval on a string) how can i then pre-declare my variables (since i don't know their names before the script runs)? is t

Re: [MacPerl-AnyPerl] symbolic references <-> no strict refs

2002-03-17 Thread Bart Lateur
On Sun, 17 Mar 2002 17:36:03 +0800, allan wrote: >can someone please explain why the below script doesn't work >on v5.6.0/mac osX? >it _will_ work if i outcomment "use strict"; >#!perl >use strict; >no strict 'refs'; >my $test = "variable_name"; >$$test = "a string"; >print $variable_name; "no

[MacPerl-AnyPerl] symbolic references <-> no strict refs

2002-03-17 Thread allan
hi can someone please explain why the below script doesn't work on v5.6.0/mac osX? it _will_ work if i outcomment "use strict"; thanks ../allan #!perl use strict; no strict 'refs'; my $test = "variable_name"; $$test = "a string"; print $variable_name; __END__