in reply to how can i load the files and search for match?
Which probably means there was some warning and it "went away" with strict commented out... First, remove that, and we get:package Load; #use strict;
To fix that, make it read foreach my $files (@SEARCH_STRING){ in the display() method.Global symbol "$files" requires explicit package name at Load.pm line +44. Global symbol "$files" requires explicit package name at Load.pm line +45.
Line 22 is in listNames() and is:Can't use string ("Load") as a HASH ref while "strict refs" in use at +Load.pm line 22.
The calling code is:$self->{_listNames}= $listNames if defined ($listNames);
That needs to be something along the lines of:$dir=Load->new(); $dir=Load->listNames($list);
Since listNames() accesses values of the object (blessed hashref), you can only invoke it on an object, and not directly on the class name. You should similarily modifiy the ->search() and ->display calls as well.my $load = Load->new(); my $dir = $load->listNames($list);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how can i load the files and search for match?
by rianne809 (Novice) on Oct 13, 2005 at 18:03 UTC |