Yes, the warning is right; if you're assigning a single scalar value to a hash you probably don't want to be using hash slice semantics. If your code was failing when you did it "the right way", there's a bug elsewhere in the code. I couldn't run the code you provided because I don't know what your initial data set looks like, nor do I know what $hash{Airline}'s initial state is before the code you showed.
Perhaps you could follow up with a post in this same thread that demonstrates the problem in a self-contained script that we can actually run to see the behavior. Chances are good that as you attempt to boil it all down to a small test script of under 20 lines, you'll discover the bug yourself and be able to fix it.
But yes... the warning is accurate. You shouldn't have to assign a single value to a hash slice like that.
Dave
In reply to Re: Warning is right or not ?
by davido
in thread Warning is right or not ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |