Newbie programmer here, still learing Perl and programming in general. I am having some trouble with programming styles. There are certain things I am doing that, although the program is working as expected, seem to be a little unconventional. As I have no programming experience at all I am unsure if I am going about things the right way. For example:
I have been working on my first real application and have 2 pm file which contain things like connection information, functions and variable message strings. In one of these files I have a function &ParseString. In here I pass a string from another Perl script and parse it. But then, depending on what results are in the string I am setting global variables e.g:
if(substr($string64[$count],0,2) eq "MY") {our $message_64 = substr($s
+tring64[$count],2);
Then, when &ParseString returns the result (back in the original Perl sctipt) I use the $message_64 string in an if clause etc.
I suppose what I am wondering about is: is it correct to assign a global variable like that, in a funtion, and then use it elsewhere? Or is it better practise to define it first somewhere, then change it later etc.?
Sorry for the newbie question, but like I said, I am new to the whole programming game!