in reply to How to get the TOTAL length/size of an array?

Variety delights:

… my @l = ("abc", "cd", "e", "fg", "hi", "hello world"); say length pack("A*" x scalar @l, @l); __END__ karl@h3002993:~/src/perl$ ./pack.pl 21

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^2: How to get the TOTAL length/size of an array?
by AnomalousMonk (Archbishop) on Sep 21, 2023 at 20:25 UTC

    With slightly fewer manipulations:

    Win8 Strawberry 5.8.9.5 (32) Thu 09/21/2023 16:18:12 C:\@Work\Perl\monks >perl -wMstrict -le " my @l = ('abc', 'cd', 'e', 'fg', 'hi', 'hello world'); print length pack '(A*)*', @l;" 21


    Give a man a fish:  <%-{-{-{-<