Path: news.umbc.edu!mabzug1
From: mabzug1@umbc.edu (Mordechai T. Abzug)
Newsgroups: comp.lang.perl.misc
Subject: Perl bug/feature: vec and references
Date: 29 Aug 1995 21:33:56 GMT
Organization: the Courts of Chaos
Lines: 25
Message-ID: <420144$ig3@news.umbc.edu>
NNTP-Posting-Host: ela02.gl.umbc.edu
NNTP-Posting-User: mabzug1
X-Newsreader: TIN [version 1.2 PL2]
Xref: news.umbc.edu comp.lang.perl.misc:5045
#good:
vec ($a, 0, 32) = 65; # works well;
#bad:
$foo = {};
vec ($foo->{'bar'}, 0, 32)=65; #dies miserably
#OK:
$foo = {};
$foo->{'bar'}='blatz';
vec ($foo->{'bar'}, 0, 32)=65; #proceeds normally.
In other words, although normal vectors don't require prior initialization,
referenced ones do.
Didn't see anything in perlref to explain this, but then, I'm no Perl hacker
(yet! ;> ) so I could've missed something subtle. Or even something
explicit.
(note: this happened on an SGI Indigo, running IRIX 5.3, under Perl5.001, if
that makes any difference).
--
-Mordechai T. Abzug
Homepage: http://www.gl.umbc.edu/~mabzug1 send email to: mabzug1@umbc.edu
--
-Mordechai T. Abzug
Homepage: http://www.gl.umbc.edu/~mabzug1 send email to: mabzug1@umbc.edu
Recursive, adj.; see Recursive
From: mabzug1@umbc.edu (Mordechai T. Abzug)
Newsgroups: comp.lang.perl.misc
Subject: Perl bug/feature: vec and references
Date: 29 Aug 1995 21:33:56 GMT
Organization: the Courts of Chaos
Lines: 25
Message-ID: <420144$ig3@news.umbc.edu>
NNTP-Posting-Host: ela02.gl.umbc.edu
NNTP-Posting-User: mabzug1
X-Newsreader: TIN [version 1.2 PL2]
Xref: news.umbc.edu comp.lang.perl.misc:5045
#good:
vec ($a, 0, 32) = 65; # works well;
#bad:
$foo = {};
vec ($foo->{'bar'}, 0, 32)=65; #dies miserably
#OK:
$foo = {};
$foo->{'bar'}='blatz';
vec ($foo->{'bar'}, 0, 32)=65; #proceeds normally.
In other words, although normal vectors don't require prior initialization,
referenced ones do.
Didn't see anything in perlref to explain this, but then, I'm no Perl hacker
(yet! ;> ) so I could've missed something subtle. Or even something
explicit.
(note: this happened on an SGI Indigo, running IRIX 5.3, under Perl5.001, if
that makes any difference).
--
-Mordechai T. Abzug
Homepage: http://www.gl.umbc.edu/~mabzug1 send email to: mabzug1@umbc.edu
--
-Mordechai T. Abzug
Homepage: http://www.gl.umbc.edu/~mabzug1 send email to: mabzug1@umbc.edu
Recursive, adj.; see Recursive