Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    perl initalization? hows it done in case of (.=) operator

    $|=1;
    srand(time());
    $p = "";
    for ($k=0;$k<1300;$k++) {
    $p .= ",5-$k";

    I want to know esp in regard to this initialization
    $p .= ",5-$k";

    What does (.) means is p not replaced every-time the for loop is incremented.

    Thanks

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,874
    Thanks
    2
    Thanked 164 Times in 159 Posts
    That's the concatenation operator. Each iteration of the loop ",5-$k" will be appended to the current value of $p.


  •  

    Posting Permissions

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