On 10/19/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote:
> print Dumper($workspace);
> print "$workspace->{TextHere}->{content}->[0]\n";
>
> The last print gives an error. The output from dumper is similar to this:
>
> $VAR1 = {
> 'TextHere' => [
> {
> 'content' => 'C:\\Data\\asd\\asd\\2008\\ghjk',
> 'xml:space' => 'text'
> }
> ]
> };
So, 'TextHere' is a hash key; the corresponding value seems to be an
anonymous array whose contents would be another hash. But the print
statement, after using 'TextHere' as a hash key, is trying to access a
hash and then an array.
That is to say, you're asking for
$workspace->{TextHere}->{content}->[0]
but
$workspace->{TextHere}
is a reference to an array, so you need to de-reference it as an
array. The next element should be an array index in square brackets,
but you've got a hash key in curly braces:
$workspace->{TextHere}->{content}
Do you see how to fix it now? Good luck with it!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/