Another REALLY basic question!

Discussion in 'Perl Misc' started by fred@fredthomas.co.uk, May 30, 2006.

  1. Guest

    Hi All

    What does -> mean in perl scripting.

    eg.

    my $f_username=$query->param('req_username');
    my $f_password=$query->param('req_password');

    Thanks

    Fred
    , May 30, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi All
    >
    > What does -> mean in perl scripting.


    the arrow operator either dereferences a reference, or is a method
    invocation.

    > eg.
    >
    > my $f_username=$query->param('req_username');
    > my $f_password=$query->param('req_password');
    >
    > Thanks
    >
    > Fred
    it_says_BALLS_on_your forehead, May 30, 2006
    #2
    1. Advertising

  3. Guest

    in lamens terms for the example reference it means

    "in" query "is" param('req_username')
    , May 30, 2006
    #3
  4. QB Guest

    wrote:
    > in lamens terms for the example reference it means
    >
    > "in" query "is" param('req_username')
    >


    In lamentable terms, maybe.

    As the previous responder said, it is either a dereference, or a method
    call.

    In lay-man's terms, $query->param('req_username') asks the object $query
    (of class CGI, no doubt) to return the value of its 'req_username'
    parameter, by calling the method param.

    Since CGI::param returns undef (in scalar context) if its argument was
    not present in the query string, it can also be used as an existence
    tester in a Boolean expression.

    QB

    PS. Please quote context and include attribution(s) when replying to a post.
    QB, May 30, 2006
    #4
    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. AMT2K5
    Replies:
    16
    Views:
    653
    Martin Gregorie
    Mar 9, 2006
  2. =?Utf-8?B?TFc=?=
    Replies:
    8
    Views:
    416
    =?Utf-8?B?TFc=?=
    Apr 25, 2007
  3. LW
    Replies:
    1
    Views:
    174
    Alexey Smirnov
    May 2, 2007
  4. Rob R. Ainscough
    Replies:
    3
    Views:
    322
    Rob R. Ainscough
    Jun 14, 2005
  5. Replies:
    0
    Views:
    104
Loading...

Share This Page