I’m really new to Perl and a first timer to XML::Simple.
I have a foreach loop (XML data already fed into $xmlHash)
foreach (@{$xmlHash->{$PROTEIN}->{$PEPTIDE}}) {}
That works 90 times when the $peptide key contains a multiple peptides. However, protein 91 (and many others after) have only a single peptide (a scalar value), which causes perl to throw
Not an ARRAY reference at C:\...
What is the best way to make the foreach loop also work with scalar $PEPTIDES?
See ForceArray in
XML::Simpledocumentation.