develooper Front page | perl.perl5.porters | Postings from January 2001

Re: More lvalue tomfoolery

Thread Previous
From:
Casey R. Tweten
Date:
January 15, 2001 14:33
Subject:
Re: More lvalue tomfoolery
Message ID:
Pine.OSF.4.21.0101151730390.3434-100000@home.kiski.net
Today around 10:23pm, Simon Cozens hammered out this masterpiece:

: On Mon, Jan 15, 2001 at 11:19:29PM +0100, abigail@foad.org wrote:
: > On Mon, Jan 15, 2001 at 09:46:21PM +0000, Simon Cozens wrote:
: > > Should this be legal?
: > >     (($a) x 4) = 1;
: > 
: > Yeah, that would be neat.
: > 
: >     sub TIESCALAR {bless []} sub STORE {shift; print shift} tie $a => 'main';
: >     (($a) x 4) = split /(?<=\s)/ => "Just another Perl Hacker\n";
: 
: ./~ What shall we do, what shall we do, with all this useless beauty?

Archive it, of course :)  http://www.perl.com/CPAN-local/misc/japh

While the example looks useless, it gives me a good idea of what this
syntax provides, and I like it.


-- 
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'crt@kiski.net',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>


Thread Previous


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