in reply to Re: referencing list
in thread referencing list

As Data::Alias is not standard in the version of PERL I am using, this may not be what I am looking for. Perhaps I could give another example:
my @shape = ("round", "square", "polygon"); my @colour = ("red", "salmon", "purple" ); my @tag ; for my $j ( 0..2 ) { if ( ($shape[$j] eq "round") && ($colour[$j] eq "red") ) {$tag[$j]=1;} else {$tag[$j]=0;} print "$shape[$j] $colour[$j] $tag[$j]\n"; }
There must be a more elegant way of doing ths eg by using: my @x = ($shape, $colour. $tag) ; rather than having a separate list for each attribute.

Replies are listed 'Best First'.
Re^3: referencing list
by tobyink (Canon) on Jun 06, 2012 at 06:29 UTC
    Data::Alias is a module. To use it you need to install it. That's the point of modules: they are modular; you only install the ones you need. Not sure what you're trying to say with your second example; it appears to have little in common with the first.
    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'