Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

[SOLVED] Get element count of CONSTANT list (aref))

by stevieb (Canon)
on Mar 12, 2018 at 21:29 UTC ( [id://1210767]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $array = [qw(1 2 3)];
    my $array_len = @$array;
    
    # $array_len == 3
    
  2. or download this
    use constant STEPPER_SEQUENCE => [
        [qw(1 0 0 1)],
    ...
        [qw(0 0 1 1)],
        [qw(0 0 0 1)],
    ];
    
  3. or download this
    use warnings;
    use strict;
    ...
    my $aref = [qw(1 2 3)];
    
    say "aref ok" if @$aref == 3;
    
  4. or download this
    @{ STEPPER_SEQUENCE }
    @( STEPPER_SEQUENCE )
    (STEPPER_SEQUENCE)
    @STEPPER_SEQUENCE
    etc, etc, etdc
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1210767]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found