I’m doing a SQL update statement but need to update the device names in order.
If the device names end in S01, then they get renamed first, then p01, etc.
@order = qw(s01 s02 p02 r02);
While select * from #get device_name, suffix, etc
Foreach $i (@order) {
If ($suffix eq $i) {
Update table
Problem with this is it skips the lines that don’t match the suffix. I tried tying the select output to a hash but I don’t think I’m doing it right. Hashes are hard for me to understand unless they’re simple.
This solution uses
grepto filter out the names that you want.