20140221: updated perl code for Lab_6