develooper Front page | perl.perl6.users | Postings from September 2017

Re: Need append help

Thread Previous | Thread Next
From:
Brandon Allbery
Date:
September 29, 2017 17:54
Subject:
Re: Need append help
Message ID:
CAKFCL4UoQAfBDTzvpNkKNvFbZwa5Fti-mqOzKa6cmovrKq1w9Q@mail.gmail.com
On Fri, Sep 29, 2017 at 1:49 PM, ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> I am trying to find a shorter way of doing
>      $x = $x ~ "def"
>
> But I can't seem to master "append"
>
> What am I doing wrong?
>

Again (as with last night in IRC) you are treating a string as a list. But
a string is a single thing; it doesn't make sense to list-append to it.

    $x ~= "def";

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About