Any witness whose evidence is admitted or any person who makes an affirmation instead of taking an oath is liable to prosecution and punishment for perjury in all respects as if he or she had been sworn, and every affirmation is considered to have been duly administered.