|XP is just a number|
How to get 0 to initialize a valueby Lady_Aleena (Curate)
|on Apr 30, 2019 at 00:27 UTC||Need Help??|
Lady_Aleena has asked for the wisdom of the Perl Monks concerning the following question:
I haven't written perl in a while, so I've forgotten how to tell perl that 0 is valid to initialize a value.
The warning Use of uninitialized value is bugging me a lot. I don't like having any warnings.
I have a list of characters who have appeared in one or more books. There is one character whose first book notation is the number 0. The split on line 10 is said to be uninitialized. On line 12, $first_book in the $first_type is also uninitialized. On line 13, the removal of the non-digit characters in the $first_book, also says $first_book is an uninitialized value. That value is in fact initialized. Because the first book can contain alphabetical characters, I can't simply add a +0 to it.
Any suggestions on how to tell perl that 0 initializes the string?
I did not come up with this notation system, but I can't think of anything to replace it that won't make the data too long. I feel silly asking this, but I can't think of anything right now. Also, if you know who Bink is or recognize the titles of the novels and want to ask me what I am doing; please use PMs. Thanks! 8)
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!