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

Doesn't work if the strings contain a backslash.
@a = ('a\\b'); print length(Dumper @a)-2*@a; # 4

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^3: How to get the TOTAL length/size of an array?
by LanX (Saint) on Sep 22, 2023 at 09:01 UTC
    well I've said approximation and did put "work" in quotes.

    But granted I had other problems in mind than backslashes...

    edit

    also single quotes;

    DB<27> @a=("'"); DB<28> p length(Dumper @a)-2*@a 2

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery