in reply to Can't use string ("250") as an ARRAY ref while "strict
Dumper outputs
, which is obviously not what you expected $category to be. This is because my $cat = (<DATA>); read only 1 line from DATA (perldoc -f readline). You should try my $cat = join '', <DATA>;.$VAR1 = { 'name' => 'Coffee' };
update:
After making the above change I get Can't use string ("250") as an ARRAY ref while "strict refs" in use at foo.pl line 34.
and line 34 is foreach my $content (@{$conditionning->{'content'}}).
Basically,
$category->{'subcategory'}[0]{'product'}[0]{'conditionning'}[0]{'content'}
is '250' (just like <conditionning unit="gr">250</conditionning>) and not an array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't use string as an ARRAY
by Maxim (Sexton) on Oct 02, 2004 at 11:41 UTC | |
|
Re^2: Can't use string as an ARRAY
by Maxim (Sexton) on Oct 03, 2004 at 01:26 UTC | |
by PodMaster (Abbot) on Oct 03, 2004 at 10:38 UTC | |
by Maxim (Sexton) on Oct 04, 2004 at 07:22 UTC |