Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Can't use string ("...") as an ARRAY ref while "strict refs" in use at x.pl line ...

by AnomalousMonk (Archbishop)
on Jun 09, 2014 at 18:49 UTC ( [id://1089305]=note: print w/replies, xml ) Need Help??


in reply to Re: Can't use string ("...") as an ARRAY ref while "strict refs" in use at x.pl line ...
in thread Can't use string ("...") as an ARRAY ref while "strict refs" in use at x.pl line ...

Why does each chunk appear to have 101 elements?

c:\@Work\Perl\monks>perl -wMstrict -le "use Data::Dumper; my @a = (1..1284); my $chunkedRef = chunky(@a); sub chunky { my %master; for(0..int @_/100) { push @{$master{$_+1 . ' key'}},@a[$_*100..$_*100+100]; } return \%master; } print 'elements per chunk: ', scalar @{ $chunkedRef->{'1 key'} }; " elements per chunk: 101
  • Comment on Re^2: Can't use string ("...") as an ARRAY ref while "strict refs" in use at x.pl line ...
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1089305]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-18 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found