Re: Read only variabls

2003-08-15 Thread Rob Dixon
Jenda Krynicky wrote: > > Well at least it would not be using 'local' the way it does > use it now. 'temporary' or something would make more sense. > Local versus lexical variables are a big source of confusion :-( Agreed. I'd vote for 'our local'. /R -- To unsubscribe, e-mail: [EMAIL PROTECT

RE: Read only variabls

2003-08-14 Thread Dan Muey
> > Not sure this is what you are after but ... > > *x = \15; > print "\$x=$x\n"; > $x = 16; # => Modification of a read-only value attempted at ... > print "\$x=$x\n"; > > Jenda You're a genius! I'd love to understand further: - why using a glob like that make

Re: Read only variabls

2003-08-14 Thread david
Dan Muey wrote: > > Howdy, > > I read in an earlier email that some people put _ in front of > variables/function/etc to show that they are "important and should be > handled by the program only" and it said that some "modules enforce this" > > I guess what I'm getting at is: > > If my module

Re: Read only variabls

2003-08-14 Thread Rob Dixon
Dan Muey wrote: > > I read in an earlier email that some people put _ in front > of variables/function/etc to show that they are "important > and should be handled by the program only" and it > said that some "modules enforce this" Hi Dan. This is historical stuff, and ugly too. When there was no

Re: Read only variabls

2003-08-14 Thread Casey West
It was Wednesday, August 13, 2003 when Dan Muey took the soap box, saying: : : If my module exports variables can I make it so they can't be changed? Yes, but it's very complicated. You can see my example module ex::constant::vars for a way to do it, but read all the documentation first. :-)

Re: Read only variabls

2003-08-14 Thread Jenda Krynicky
From: "Rob Dixon" <[EMAIL PROTECTED]> > David Wall wrote: > > Rob Dixon wrote: > > > > > Lexical variables are another matter, as they don't belong to a > > > given package but exist globally as long as there is a reference > > > to them. In my opinion this is a bit of a hack, but access can be > >

RE: Read only variabls

2003-08-14 Thread Dan Muey
> > I guess what I'm getting at is: > > > > If my module exports variables can I make it so they can't > be changed? > > > > IE > > > > use MyStuff qw($_joe $_mama); # now they should have $_joe > > and $_mama exported from the module. > > > > print "$_joe $_mama\n"; # ok > > my $joe = $_jo

Re: Read only variabls

2003-08-14 Thread Rob Dixon
David Wall wrote: > Rob Dixon wrote: > > > Lexical variables are another matter, as they don't belong to a > > given package but exist globally as long as there is a reference > > to them. In my opinion this is a bit of a hack, but access can > > be limited by creating data that is accessible only

RE: Read only variabls

2003-08-14 Thread Dan Muey
> From: "Dan Muey" <[EMAIL PROTECTED]> > > > Not sure this is what you are after but ... > > > > > > *x = \15; > > > print "\$x=$x\n"; > > > $x = 16; # => Modification of a read-only value attempted at ... > > > print "\$x=$x\n"; > > > > > > Jenda > > > > You're a genius! > > No I'm n

RE: Read only variabls

2003-08-14 Thread Kipp, James
> I guess what I'm getting at is: > > If my module exports variables can I make it so they can't be changed? > > IE > > use MyStuff qw($_joe $_mama); # now they should have $_joe > and $_mama exported from the module. > > print "$_joe $_mama\n"; # ok > my $joe = $_joe;# ok >

Re: Read only variabls

2003-08-14 Thread David Wall
--On Wednesday, August 13, 2003 9:16 PM +0100 Rob Dixon <[EMAIL PROTECTED]> wrote: Lexical variables are another matter, as they don't belong to a given package but exist globally as long as there is a reference to them. In my opinion this is a bit of a hack, but access can be limited by creating

Re: Read only variabls

2003-08-14 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > If my module exports variables can I make it so they can't be changed? Not sure this is what you are after but ... *x = \15; print "\$x=$x\n"; $x = 16; # => Modification of a read-only value attempted at ... print "\$x=$x\n";

Re: Read only variabls

2003-08-14 Thread Rob Dixon
Thanks Jenda. Jenda Krynicky wrote: > > David Wall wrote: > > > Rob Dixon wrote: > > > > > > > Lexical variables are another matter, as they don't belong to a > > > > given package but exist globally as long as there is a reference > > > > to them. In my opinion this is a bit of a hack, but access

RE: Read only variabls

2003-08-14 Thread Dan Muey
> Dan Muey wrote: > > > > I read in an earlier email that some people put _ in front > > of variables/function/etc to show that they are "important > and should > > be handled by the program only" and it said that some > "modules enforce > > this" > > Hi Dan. > > This is historical stuff, an

RE: Read only variabls

2003-08-14 Thread wiggins
On Wed, 13 Aug 2003 14:13:28 -0500, "Dan Muey" <[EMAIL PROTECTED]> wrote: > > Don't have that one, I'll visit the library thoguh, Thanks > Closures are covered in a number of places, including: perldoc perlref http://perldoc.com/perl5.8.0/pod/

RE: Read only variabls

2003-08-14 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > > Not sure this is what you are after but ... > > > > *x = \15; > > print "\$x=$x\n"; > > $x = 16; # => Modification of a read-only value attempted at ... > > print "\$x=$x\n"; > > > > Jenda > > You're a genius! No I'm not. I saw this some

Read only variabls

2003-08-14 Thread Dan Muey
Howdy, I read in an earlier email that some people put _ in front of variables/function/etc to show that they are "important and should be handled by the program only" and it said that some "modules enforce this" I guess what I'm getting at is: If my module exports variables can I make it so

RE: Read only variabls

2003-08-14 Thread Dan Muey
> It was Wednesday, August 13, 2003 when Dan Muey took the soap > box, saying: > : > : If my module exports variables can I make it so they can't > be changed? > > Yes, but it's very complicated. You can see my example > module ex::constant::vars for a way to do it, but read all > the docum

Re: Read only variabls

2003-08-14 Thread Jenda Krynicky
From: "Rob Dixon" <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > I don't think Perl4 is a valid reason to call anything in Perl5 an > > afterthought. Unless you call the whole of Perl5 an afterthought. > > Not in that sense, but I don't believe Perl would have been designed > that way from scratc