Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Uninitialized value in substr commandby lmtaylor (Novice) |
on Aug 20, 2014 at 21:09 UTC ( [id://1098163]=perlquestion: print w/replies, xml ) | Need Help?? |
lmtaylor has asked for the wisdom of the Perl Monks concerning the following question: Hello. I'm trying to take a very large array and re-format it. The initial array looks something like this: >123 ABD CEF GHI >456 JKL MNO >789 That's obviously simplified, but that's the idea. I want to join the elements between the two lines that begin with '>' and then get rid of the lines that begin with the '>', so my final array looks something like this: ABDCEFGHI JKLMNO Here is the code I've written to do it. My problem is, every time I run it, I get a million errors that all say "Use of uninitialized value in substr at line 19." But I can't figure out what value it's talking about.
I wrote this code to test my method before implementing it in my real program, which will take the array in from an input file. Only I can't figure out what this error is talking about. The commented out print commands work just fine. Does anyone see something that I'm missing? Thank you so much for your help! - Lisa
Back to
Seekers of Perl Wisdom
|
|