Find the answer to your Linux question:
Results 1 to 3 of 3
What is the meaning of $line.='0' in perl ??...
  1. #1
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114

    What is the meaning of $line.='0' in perl ??

    What is the meaning of $line.='0' in perl ??

  2. #2
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    If it's the same as PHP it means add 0 to the end of $line. For instance:

    $line="1"
    $line.=0
    echo $line

    Will print "10"
    Linux User #453176

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Indeed. More specifically, '.' is the string concatenation operator. So just like
    Code:
    $n += 3
    translates to:
    Code:
    $n = $n + 3
    We see that
    Code:
    $n .= '0'
    translates to
    Code:
    $n = $n . '0'
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...