Re: basic perl question

Discussion in 'Perl Misc' started by Jürgen Exner, Oct 30, 2012.

  1. vis29 <> wrote:
    >I am going through a perl program, i have following lines which I dont understand, please explain what those lines does and why.
    >
    >if (/^$hash{server}/) {
    > $name="not accessible";
    > }


    It tests if the value in $_ (which is the default if no other value is
    specified) matches the regular expression between the /.../, which in
    turn specifies that the string should begin with whatever value the
    element "server" in the hash %hash currently has.
    If a match is found, then it assigns the text "not accessible" to the
    variable $name.

    jue
    Jürgen Exner, Oct 30, 2012
    #1
    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. dpackwood
    Replies:
    3
    Views:
    1,791
  2. Engineer
    Replies:
    6
    Views:
    612
    Jeremy Bowers
    May 1, 2005
  3. Replies:
    0
    Views:
    428
  4. Tarscher

    basic perl array question

    Tarscher, Mar 22, 2006, in forum: Perl Misc
    Replies:
    4
    Views:
    105
    Tad McClellan
    Mar 22, 2006
  5. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Jan 23, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    297
    PerlFAQ Server
    Jan 23, 2011
Loading...

Share This Page