Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > strange syntax: $var'token

Reply
Thread Tools

strange syntax: $var'token

 
 
Michael Vilain
Guest
Posts: n/a
 
      09-14-2004
I have the O'Rielly Camel book and didn't find any reference to the
following syntax I saw in some code for a web store:

$cgi_lib'filepre = "cgi-lib";

Is this some sort of shorthand for

$cgi_lib['filepre'] = "cgi-lib";

I'm used to using perl 5.0 but don't know if this an addition in later
versions (5.[68]). Is it?

TIA...

--
DeeDee, don't press that button! DeeDee! NO! Dee...



 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      09-15-2004
"Michael Vilain <(E-Mail Removed)>" wrote:

> I have the O'Rielly Camel book and didn't find any reference to the
> following syntax I saw in some code for a web store:
>
> $cgi_lib'filepre = "cgi-lib";


That is perl4 syntax for setting the variable $filpre in package cgi_lib.
For perl version 5.x, use :: instead of ' after the package name.

$cgi_lib::filpre = 'cgi-lib';

I would not trust code like that as a web store or shopping cart.

If you have any other questions, post them to comp.lang.perl.misc
not here (comp.lang.perl).
-Joe
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AVG Email Scanner activating at strange times with strange IP addresses dennispublic@hotmail.com Computer Support 1 08-26-2006 04:27 AM
Strange Wireless Network problem Sarah Kingswell Wireless Networking 1 02-15-2005 06:24 PM
strange problem John Wireless Networking 4 02-14-2005 05:40 PM
Strange taskbar behaviour (notification area) Falcon Wireless Networking 0 08-17-2004 09:03 AM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM



Advertisments