Re: Perl Scalars

2007-10-11 Thread Matthew Whipple
Perl references (like the Perl language itself) are higher level than their C counterparts. Pointers expose the memory address wheres references (to my knowledge and at least not normally) do not. This opens the door to pointer arithmetic and some of the black magic possible with pointers (includ

Re: Perl Scalars

2007-10-11 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > > > From: yitzle <[EMAIL PROTECTED]> > > > The purpose of my message was to clarify the part of the documentation > > that > > > Kaushal asked about. > > > > I think you failed on that. > > > I would t

Re: Perl Scalars

2007-10-11 Thread Rob Dixon
Jenda Krynicky wrote: From: yitzle <[EMAIL PROTECTED]> The purpose of my message was to clarify the part of the documentation that Kaushal asked about. I think you failed on that. I am aware that Perl has pointers/references, as I mentioned, but the question is not /about/ pointers, but

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > And BTW ... you are aware of the fact that if you do > > int *b; > *b = 5; > > you cause the program to crash, right? > You did not start by assigning a variable to a reference to > something, you assigned to the thing already referenced by

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > From: yitzle <[EMAIL PROTECTED]> > > On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > > > Anyhow, the point is that Perl doesn't have those confusing weird > > > "pointer" > > > > stuff. $a and $c do not "point" to the same plac

Re: Perl Scalars

2007-10-10 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > > Anyhow, the point is that Perl doesn't have those confusing weird > > "pointer" > > > stuff. $a and $c do not "point" to the same place, the just got the same > > > value. (Well, Perl /does/ have point

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > From: yitzle <[EMAIL PROTECTED]> > > On 10/10/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > > > > Can you please explain me with a sample code. If I understand it > correctly > > > does the below code holds true for your explanation

Re: Perl Scalars

2007-10-10 Thread Matthew Whipple
It may be easier to understand outside of computer context and delving into pointers/references/memory addresses. I'm sure there are some good tried and true analogies that I can't think of so I'll try to come of up with one that fits well into computers without getting too far from reality or too

Re: Perl Scalars

2007-10-10 Thread Jenda Krynicky
From: yitzle <[EMAIL PROTECTED]> > On 10/10/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > > > Can you please explain me with a sample code. If I understand it correctly > > does the below code holds true for your explanation > > Lets put it this way. > I the world of C/C++, there's something

Re: Perl Scalars

2007-10-10 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Kaushal Shriyan wrote: > > Hi, > > > > I am referring to http://www.gnulamp.com/perlscalars.html > > > > $a = $b; # Assign $b to $a > > > > Note that when Perl assigns a value with *$a = $b* it makes a copy of $b and > > then assigns that to $a. Therefore th

Re: Perl Scalars

2007-10-10 Thread yitzle
On 10/10/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > Can you please explain me with a sample code. If I understand it correctly > does the below code holds true for your explanation > Lets put it this way. I the world of C/C++, there's something called a pointer. The syntax of Perl and C/

Re: Perl Scalars

2007-10-10 Thread Rob Dixon
Kaushal Shriyan wrote: Thanks Rob All they're saying is that $a = $b doesn't tie $a and $b together in any way, it just copies the value of $b to $a. If you change $b after that it won't alter $a again. Can you please explain me with a sample code. If I understand it correctly does the bel

Re: Perl Scalars

2007-10-10 Thread Kaushal Shriyan
On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Kaushal Shriyan wrote: > > Hi, > > > > I am referring to http://www.gnulamp.com/perlscalars.html > > > > $a = $b; # Assign $b to $a > > > > Note that when Perl assigns a value with *$a = $b* it makes a copy of $b > and > > then assigns that to $

Re: Perl Scalars

2007-10-10 Thread Rob Dixon
Kaushal Shriyan wrote: Hi, I am referring to http://www.gnulamp.com/perlscalars.html $a = $b; # Assign $b to $a Note that when Perl assigns a value with *$a = $b* it makes a copy of $b and then assigns that to $a. Therefore the next time you change $b it will not alter $a. I did not understan