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
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
>
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
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);
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
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
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
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__