> "RC" == Rob Coops writes:
RC> my $arrayref = [ [ [ 'user1', 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[
RC> 'user2', 'd' ],[ 'user3', 'a' ],[ 'user2', 'f' ] ] ];
this comment is for both you and the OP. you should format complex data
so you can read it. it makes it much easier to edit an
On 13/05/2011 11:11, Agnello George wrote:
Hi All
I have a small issue in arranging data with a array ref .
$arrayref = [ [ [ 'user1, 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[
'user2', 'd' ],[ 'user3', 'a' ],[ 'user2', 'f' ] ] ];
i tried the following
my %sh ;
foreach my $i ( @$arrayref) {
On Fri, May 13, 2011 at 01:00:57PM +0200, Rob Coops wrote:
> It might not look nice but I would do the following:
But it can be cleaned up quite a lot:
> #!/usr/local/bin/perl
>
> use strict;
> use warnings;
>
> my $arrayref = [ [ [ 'user1', 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[
> 'user2',
On Fri, May 13, 2011 at 4:30 PM, Rob Coops wrote:
> It might not look nice but I would do the following:
> #!/usr/local/bin/perl
> use strict;
> use warnings;
> my $arrayref = [ [ [ 'user1', 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[
> 'user2', 'd' ],[ 'user3', 'a' ],[ 'user2', 'f' ] ] ];
> my %has
It might not look nice but I would do the following:
#!/usr/local/bin/perl
use strict;
use warnings;
my $arrayref = [ [ [ 'user1', 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[
'user2', 'd' ],[ 'user3', 'a' ],[ 'user2', 'f' ] ] ];
my %hash;
foreach my $arrayreference ( @{${$arrayref}[0]} ) {
if (
Hi All
I have a small issue in arranging data with a array ref .
$arrayref = [ [ [ 'user1, 'c'], [ 'user2', 'a'], [ 'user2', 'b' ],[
'user2', 'd' ],[ 'user3', 'a' ],[ 'user2', 'f' ] ] ];
i tried the following
my %sh ;
foreach my $i ( @$arrayref) {
push (@{$sh{$i->[0]}},{group => [$i->[1] } )