Greetings!

I am seriously confoogled about how to get my array back from a
reference.  This is the train scheduling program you've been hearing a
lot about from me.  The array holds the names of the crew members on
the train.  The train object is created with the following routine:

sub new
{
        my $class = shift;
        my $self = {};
        $self->{'crew'} = [];
        bless $self, $class;
        return $self;
}

Each job on a train has a position in an array.  Engineer might be
position 0, conductor 1, brakeman 2, and so on.  Crew members are
recorded by the following routine:

sub AddCrewMemberByIndex
{
        my $self = shift;
        my $volunteer = shift;
        my $index = shift;

        if (!defined($self->{'crew'}[$index]))
        {
                $self->{'crew'}[$index] = $volunteer;
                my @crewMembers = $self->{'crew'};
                my $crewCount = @crewMembers;
        }
}       

Once a crew member signs up, a comma-separated value file is generated
that has all of the information about the train.  Here's a sample:

2.14.2003,Wine Train BX,17:00,Allan,,Crim,,Sharon Fain,,,,,A Miller,,,,
2.15.2003,Scenic,8:00,Green,Jon Knight,Larry Blanchard,,Cliff
Stadler,,I Pallaise,,,Karen Stadler,Ron Barb Lewis,D Conrad,Joe
Dorsey,Pete Pilkey
2.19.2003,School Train,9:00,,,,,,,,,,Pete Pilkey,F Williamson,,,

(Note:  Each date in this sample has its own line.  There are no line
breaks within trains.

These lines are generated by the following routine:

sub FileString
{
        my $self = shift;
        my $result;
        my @data = ($self->GetDate(),
                                $self->GetName(),
                                $self->GetCrewCall(),
                                @{$self->GetCrewList()});
        $result = join(',', @data);
        return $result;
}

If the GetCrewList() is removed, everything works.  If GetCrewList() is
included, the program stops.  It's a web page generation program, and
Internet Explorer just waits and waits and waits for something to
display, and never gets it.  Here's GetCrewList():

sub GetCrewList
{
        my $self = shift;
        return $self->{'crew'};
}

There aren't any syntax errors in any of this, or at least none are
reported by perl -c.  Does anyone have any idea why my program may be
hanging?

Thanks very much!

Rob










__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to