Updates more-or-less every 5 minutes (except when there is no activity). Extracted from Tanktalus' CB Stats' database. Feedback
Shows the last hour or so, but never more than will fit in 64k, nor over two hours. Other sources of cb history
Last update: Oct 01, 2014 at 21:45 UTC

Previous message (not shown): Oct 01, 2014 at 20:05 UTC
[pedrosantos]Hi, is there anybody who can teach me how to assign an array as an element of another array?
[tye]$b[$i] = \@a;
[tye]or $b[$i] = [@a];
[pedrosantos]Thanks tye, let me try.
[pedrosantos]but, wait,
[pedrosantos]can I "push" the information?
[pedrosantos]example push @b,\@a?
[tye]sure
[yitzchak]if @b is (1,2,3) and @a is (4,5), do you want (1,2,3,4,5) or (1,2,3,4,5) (four elements, the last of which is a reference to an array with two elements
[yitzchak]if @b is (1,2,3) and @a is (4,5), do you want (1,2,3,4,5) or (1,2,3,[4,5]) (four elements, the last of which is a reference to an array with two elements
[pedrosantos]I want the last option
[pedrosantos]the last element to be an array.
[yitzchak]what you said does that
[pedrosantos]using the reference: push @b,\@a the reference is stored, but on the next cycle, of my program I change the contents of the array and... the values in @b are also changed...
[choroba]if you don't declare my @a in the loop, you have to use [@a] instead
[yitzchak]then do push @b, [@a];
[pedrosantos]I mean, the contents of @a are changed, which translates into the element in @b also being changed, which is what I want to avoid.
[yitzchak]though if @a itself has any references *they* will still be shared
[yitzchak]yes, we understood.
[pedrosantos]I
[pedrosantos]I tried push @b, @a'
[pedrosantos];
[pedrosantos]but the second loop errs as follows:
[GotToBTru]push @b, @a makes a copy of @a to put into @b
[pedrosantos]Can't use string ("2") as an ARRAY ref while "strict refs" in use at collectvm.pl line 116, <stdin> line 11.
[GotToBTru]makes a copy and puts a reference to it in @b, that should be
[GotToBTru]push @b, \@a puts a reference to @a in @b
[pedrosantos]number 2 was a run time value in the first @a array.
[GotToBTru]changes to @a will show up in @b in the 2nd case, but not in the first
[pedrosantos]but push @b,@a; wil consolidate the list, i will not have an array as the last element of @b.
[choroba]push @b, [@a]
[pedrosantos]If I define my @c within the loop, then @c=@a; push @b,\@a; will @b be affected?
[pedrosantos]Got it: you're right about making a local copy of the array in a "my" variable (I still don't understand how does this work): code as follows:
[pedrosantos]for (...) {
[pedrosantos]○○my @wakawaka=@NICdetails; ○○push @values,\@wakawaka;
[pedrosantos]...
[pedrosantos]my @wakawaka=@NICdetails;
[pedrosantos]push @values,\@wakawaka;
[pedrosantos]... }
[pedrosantos]Thanks A LOT for your help!.