Variable size/Get: Difference between revisions
m
→{{header|Perl}}: revised to match current module usage
SqrtNegInf (talk | contribs) m (removed stray text in 'omit from' list) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: revised to match current module usage) |
||
Line 880:
=={{header|Perl}}==
{{works with|Perl|5.
{{libheader|Devel::Size}}
<lang perl>use Devel::Size qw(size total_size);
my $var = 9384752;
my @arr = (1, 2, 3, 4, 5, 6);
print size($var); # 24
print total_size(\@arr); # 256</lang>
=={{header|Perl 6}}==
Perl 6 tries to avoid generic terms such as "size" and "length", instead providing methods that are expressed in terms of the units appropriate to the abstraction level.
|