#!/usr/bin/perl
use warnings;
use strict;
sub agent_generator{
#generates agents with template data
my $stringset = shift; #arrayreference
my @newstringset;
foreach (@{$stringset}){
push @newstringset, 0;
}
my $looped = join "", @newstringset;
while (1){
my $pos = 0;
$newstringset[$pos]++;
while (($pos <= $#{$stringset}) && ($newstringset[$pos] > $stringset->[$pos])) {
$newstringset[$pos] = 0;
$pos++;
$newstringset[$pos]++;
}
print @newstringset,"\n";
((pop @newstringset)&&(return @newstringset)) if ((join "", @newstringset)=~/$looped/);#if reached 0s again.
}
#count lowest digit up one. if digit is to high,
#reset and go up one digit and count it up one. if that one
#is to high go up one digit and count it up else return
#to lowest digit.
}
my @array = qw(4 4 4 1 6 2 1 1 2 1 1 9);
my @a2 = qw(3 3);
my @new = agent_generator(\@a2);
print @new,"\n";
####
$rref->{FOO}->[5] = "bar";
$rref->{BAR}->[5] = "cat";
print "$rref->[5]";#gives the values "cat" & "bar"
#also lists the sub-structures that contain
#a [5] in an array (or some such)
##
##
Relational Referencing.
* general ideas..
o
how to keep it simple and let a data structure either be turned inside out
or be looked at inside out.
need a visual way to work with this...
could be visually disturbing.
* Examples..
o
$ref->[0]->[0] = 1;
$ref->[0]->[4] = 23;
$ref->[3]->[2] = 771;
$ref->[2]->[3] = 1;
#bring all values of '1' to the top
$ref->{1}->[0] = $ref->[0];
$ref->{1}->[1] = $ref->[2];
* Execution?