in reply to Re: Warnings:
in thread Uninitialized value in string warnings (was: Warnings:)
Ok, understand about the potential clash of $a$b with the sort module, though it seems like bad design that I can clash with system vars that use common names. A problem with all languages that opt for implicitly global vars rather than implicitly local.
I still don't see how your reference to perlvar would help me? The only occurences of $a or $b that I could find in there are where they are used in an example!
I thought and tried inserting the bracketed ternary expressions into the compound expression as you suggested, but have so far been spectacularly unsucessful in preventing them from generating more and worse errors than I am trying to cure.
I realise that this is probably down to my inexperience rather than because it isn't a good idea...so thanks!
Re: Program design: Good, sage advice which in most any other situation I would totally agree with. Trouble in this case is that the variable ($b) in the original example, is actually generated within the compound statement and comes into existance and disappears automagically. I have successfully unwound the statement into a loop which allows me to preinitialise $b at an appropriate block level, but (so far) the syntatic salt needed to make it work within the compound statement eludes me. And as the unwound (looping) statement appears to be considerably less efficient that the compound one, disabling this individual warning for a block encompassing this one statement seems the appropriate way to go.
|
|---|