carterniall has asked for the wisdom of the Perl Monks concerning the following question:
I am getting a 'can't call method 'toString' on unblessed reference'
Am I correct in saying that this perhaps is because the object I m trying to print to string is not the correct type?
I am looping through an array to print the contents to the screen
This array is compiled by adding the returned array to an array which is then looped through and printed.
The code to do this is:
foreach my $root (@docs){ foreach my $object (@$root) { print $object->toString(); } }
The <Folder> elements are printed out although the <Placemark> elements are not. I am not sure why the <Placemark> elements are not a blessed reference and am happy to expand/include more code if required.if ($size eq "1"){ my @placemark = $doc->getElementsByTagName('Placemark'); if(@placemark){ @placemark = convertCoords(@placemark); } return [@folder]; } else { my @placemark = $doc->getElementsByTagName('Placemark'); @placemark = convertCoords(@placemark); return [@placemark]; }
Any help would be so much appreciated.
Niall
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unblessed reference
by moritz (Cardinal) on Sep 17, 2008 at 12:21 UTC | |
|
Re: unblessed reference
by BrowserUk (Patriarch) on Sep 17, 2008 at 12:24 UTC | |
|
Re: unblessed reference
by kyle (Abbot) on Sep 17, 2008 at 12:25 UTC | |
|
Re: unblessed reference
by Anonymous Monk on Sep 17, 2008 at 12:26 UTC | |
by Todd Chester (Scribe) on Oct 17, 2015 at 06:02 UTC | |
by Todd Chester (Scribe) on Oct 17, 2015 at 06:24 UTC |