garbage777 has asked for the wisdom of the Perl Monks concerning the following question:
Update: I just realized I accidentally posted the whole code.#!/usr/bin/perl use strict; use warnings; package main; #my $testObj = Disk::Collection->new(); #$testObj->read(Disk::FileInput->new("inputtextfile")); #$testObj->print_dk_push_back; my $testObj = Disk->new("inputtextfile"); package Disk; sub new { my ($class, $fname) = @_; my $self = { lib => undef }; bless $self, $class; my $lib = Disk::Collection->new(); my $libfile = Disk::FileInput->new($fname); $lib->read($libfile); ($self->{lib}) = ($lib->get_list("JUNK")); return $self; } package Disk::Collection; sub new { my $class = shift; my $self = { line => shift, items => undef, close => undef, }; $self->{line} = "" unless $self->{line}; bless $self, $class; } sub read { my ($self, $libfile) = @_; ... ... my $item = Disk::Collection->new($line); if ($line =~ /{/) { die "syntax error:$lino: $line\n" if $line !~ /{\s*$/; $item->read($libfile); ----> If I remove this line, the file p +rocessing does not happen. print $line, "\n"; } ... ... } ... ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Processing file for reading
by bv (Friar) on Sep 14, 2009 at 17:18 UTC |