#!/usr/bin/mythryl include package string_map; m = (empty: Map( String )); m $= ("Key1", "Value1"); m $= ("Key2", "Value2"); m $= ("Key3", "Value3"); case (get (m, "Key2")) THE value => printf "Key2 -> %s\n" value; NULL => printf "Key2 not in tree\n"; esac; case (get (m, "Key4")) THE value => printf "Key4 -> %s\n" value; NULL => printf "Key4 not in tree\n"; esac;
The run:
linux$ ./my-script Key2 -> Value2 Key4 not in tree