Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

RFC: object-oriented two-dimensional ragged array tutorial

by paulymer (Novice)
on Sep 10, 2013 at 00:00 UTC ( #1053126=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
            package Row;
    ...
                    },
            );
    }
    
  2. or download this
    sub addCell {
            my ($self, $index, @cells) = @_;
            $self->pushRow( [] ) if !defined $self->getRow($index);
            $self->getRow($index)->pushCell(@cells);
    }
    
  3. or download this
    {
            package Grid;;
    ...
                    },
            );
    }
    
  4. or download this
    my $grid = Grid->new( grid => [ 
                    [$cellA0, $cellB0, $cellC0], 
                    [$cellA1, $cellB1, $cellC1],
                    [$cellA2],
            ] );
    
  5. or download this
    #!/usr/bin/perl -w
    
    ...
    $grid4->addCell(5, $mycell4B);
    print $grid4->toString . "\n";
    print "END grid4 test\n\n";
    
  6. or download this
    BEGIN row1 test
    A0      B0      C0      D0      E0
    ...
    A5
    END grid4 test
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://1053126]
Approved by kcott
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (19)
As of 2015-07-01 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls