develooper Front page | perl.perl5.porters | Postings from April 2000

Re: [ID 20000427.005] perlref.pod does not mention ref in string or numeric context

Thread Previous
From:
Ronald J Kimball
Date:
April 27, 2000 12:47
Subject:
Re: [ID 20000427.005] perlref.pod does not mention ref in string or numeric context
Message ID:
20000427154734.C1017084@linguist.dartmouth.edu
On Thu, Apr 27, 2000 at 08:29:30PM +0100, Brian McCauley wrote:
> --- perlref.pod	Fri Aug  6 20:49:33 1999
> +++ -	Thu Apr 27 20:28:44 2000
> @@ -397,6 +397,16 @@
>  The ref() operator may be used to determine what type of thing the
>  reference is pointing to.  See L<perlfunc>.
>  

Good catch, I agree that this info should be in perlref:


> +If you try to use a reference like a string, you get strings like
> +
> +	ARRAY(0x80f5dec)   or    HASH(0x826afc0)
> +
> +If you try to use a reference like a number you get the pure address
> +which is not in itself much use unless you are into beep black magic.
> +

s/beep/deep/; # ?

I think this phrasing is better, because it is more explicit:

If you use a reference in a string context...
If you use a reference in a numeric context...

> +A side effect of these representations is that you can use C<eq> or
> +C<==> to see if two references refer to the same thing.
> +
>  The bless() operator may be used to associate the object a reference
>  points to with a package functioning as an object class.  See L<perlobj>.
>  
>  


Ronald

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About