strange syntax: $var'token

Discussion in 'Perl' started by Michael Vilain, Sep 14, 2004.

  1. 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...
     
    Michael Vilain, Sep 14, 2004
    #1
    1. Advertising

  2. Michael Vilain

    Joe Smith Guest

    "Michael Vilain <>" 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
     
    Joe Smith, Sep 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alvin Bruney

    Threads.. Session var lost, App var ok

    Alvin Bruney, Dec 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    377
    rooster575
    Dec 2, 2003
  2. Cronus
    Replies:
    1
    Views:
    698
    Paul Mensonides
    Jul 15, 2004
  3. G Fernandes
    Replies:
    1
    Views:
    544
  4. Wessi
    Replies:
    3
    Views:
    891
    Lawrence Kirby
    Aug 11, 2005
  5. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    This is an unexpected token. The expected token is 'NAME'

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Jul 13, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    810
    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=
    Jul 13, 2007
Loading...

Share This Page