Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Re: Re: Re: Re: Perl vs. Python: Looking at the Code

by mothra (Hermit)
on Apr 04, 2002 at 01:33 UTC ( #156524=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Perl vs. Python: Looking at the Code
in thread Perl vs. Python: Looking at the Code

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
(jeffa) 6Re: Perl vs. Python: Looking at the Code
by jeffa (Bishop) on Apr 04, 2002 at 04:41 UTC
    use strict; my $array = new list qw(foo bar); my $list = new list qw(baz qux); $array += $list; print "@$array\n"; package list; use overload "+=" => sub { push @{$_[0]},@{$_[1]};$_[0] }; sub new { my $class = shift; my $self = [@_]; return bless $self, $class; }

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: Re: Re: Re: Re: Re: Re: Perl vs. Python: Looking at the Code
by runrig (Abbot) on Apr 04, 2002 at 04:10 UTC
    array += foo

    I'm sure someday soon you will be able to say in perl:

    @array += @foo; # or even @array += $foo;
    But it won't have anything to do with pushing more elements on to the end of a list...(can anyone say APL?)
    ------------
    ooo  O\O  ooo tilly was here :,(
    
      I belive in Perl 6 it will be @array ^+= @foo;

      -Lee

      "To be civilized is to deny one's nature."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://156524]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2022-05-16 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (62 votes). Check out past polls.

    Notices?