Perl Access Global arrays -
Perl Access Global arrays -
i have classa , define global array in classa
our @myarray = {"1","2","3","4"}
i have classb in have object of classa. tried accessing myarray follows.
$my_obj_of_classa->{'myarray'} $my_obj_of_classa->{'\@myarray'} $my_obj_of_classa->{\@myarray}
none of these work. error saying:
global symbol "@my_array" requires explicit bundle name
this question contains deep misunderstanding of how global variables , objects work in perl. looks you're expecting @myarray
deed class variable in ruby in can access on given object of class. not how globals in perl work @ all.
i reply question, you'll run afoul of misunderstanding. think best if backed , @ to the lowest degree skimmed perl start. reviewing modern perl idea.
perl
Comments
Post a Comment