For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > November 2006 > OT syntax









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author OT syntax
Petr Vileta

2006-11-20, 3:59 am

Sorry for not Tk question.
I found in some perl script this syntax

$abc'def = 1;

Please what is the ' character? Why to use ' in variable name?

--

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)


John W. Krahn

2006-11-20, 7:58 am

Petr Vileta wrote:
> Sorry for not Tk question.
> I found in some perl script this syntax
>
> $abc'def = 1;
>
> Please what is the ' character? Why to use ' in variable name?


$abc'def is the Perl4 way to do $abc::def where 'abc' is the package name and
'def' is the scalar variable name.


John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
zentara

2006-11-20, 7:58 am

On Mon, 20 Nov 2006 06:09:52 +0100, "Petr Vileta" <stoupa@practisoft.cz>
wrote:

>Sorry for not Tk question.
>I found in some perl script this syntax
>
>$abc'def = 1;
>
>Please what is the ' character? Why to use ' in variable name?


It's legal to use the single ' in a varible name.

It sure screws up my perl syntax highlighting though. :-)



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com