תמים, על דרך אומרם ז"ל בחולין דף ו' (זבחים קטז. ע"ז י.) וזה לשונם צדיק במעשיו תמים בדרכיו, ופירש"י וז"ל, בדרכיו, עניו ושפל רוח, ע"כ. זה יגיד עוצם אישורו שאפי' בדורותיו הרעים את כולם היה עניו וכו', והוא לפנים משורת הדין כי שורת הדין נותנת עם חסיד וגו' ועם עקש וגו', והוא לא כן עשה. ועוד שאפילו בעיני דורותיו הוכר היותו עניו והוא אומרו תמים בדורותיו. ואמר לשון רבים להגיד מעלתו, והנה כל אדם ישיג הכרת ג' דורות הא' דור אביו וב' דורו וג' דור בניו והגיד הכתוב כי בכלם היה הוא מסוים. והגם שהיה מתושלח זה הוא לבדו נשאר מיתר הראשונים שלפני פניו. ה',
The word חמים should be understood in the same vein as the Talmud Avodah Zarah 10 explains it. The Talmud understands the word צדיק as a reference to Noach's deeds, whereas the word תמים is a reference to Noach's lifestyle, his attitudes [as opposed to understanding the word as an adjective describing his righteousness. Ed.] All of this is additional praise for Noach who was able to perfect his personality in the face of such wicked contemporaries. Noach did far more than could have been expected of him. Our sages call such conduct לפנים משורת הדין. According to Samuel II, 22,27 G'd acts loyally with the loyal, whereas He uses wile in dealing with the perverse. According to this yardstick Noach would have been free to do likewise, but he chose to be more considerate than required by law. When the Torah describes Noach's perfection as בדורותיו this means that his goodness was recognised even by the people of his time. The plural in the expression בדורותיו reminds us that the average person's lifespan involves three generations. He lives during part of his father's generation, his contemporaries, and during part of his children's generation. Noach was unique during all these three generations; the only righteous member of a former generation that he shared time on earth with was his grandfather Methuselah.
Perhaps this is the meaning - not to be influenced by those people who are around you, like Noah.
(א) וַיְהִ֣י אַבְרָ֔ם בֶּן־תִּשְׁעִ֥ים שָׁנָ֖ה וְתֵ֣שַׁע שָׁנִ֑ים וַיֵּרָ֨א יְהֹוָ֜ה אֶל־אַבְרָ֗ם וַיֹּ֤אמֶר אֵלָיו֙ אֲנִי־אֵ֣ל שַׁדַּ֔י הִתְהַלֵּ֥ךְ לְפָנַ֖י וֶהְיֵ֥ה תָמִֽים׃
(1) When Abram was ninety-nine years old, the LORD appeared to Abram and said to him, “I am El Shaddai. Walk in My ways and be perfect.
(ג) והיה תמים. אַף זֶה צִוּוּי אַחַר צִוּוּי, הֱיֵה שָׁלֵם בְּכָל נִסְיוֹנוֹתַי; וּלְפִי מִדְרָשׁוֹ הִתְהַלֵּךְ לְפָנַי בְּמִצְוַת מִילָה, וּבַדָּבָר הַזֶּה תִהְיֶה תָּמִים, שֶׁכָּל זְמַן שֶׁהָעָרְלָה בְךָ אַתָּה בַּעַל מוּם לְפָנַי. דָּבָר אַחֵר וֶהְיֵה תָמִים, (עַכְשָׁו אַתָּה חָסֵר ה' אֵבָרִים, ב' עֵינַיִם, ב' אָזְנַיִם, וְרֹאשׁ הַגְּוִיָּה) שֶׁאוֹסִיף לְךָ אוֹת עַל שִׁמְךָ, וְיִהְיוּ מִנְיַן אוֹתִיּוֹתֶיךָ רמ"ח כְּמִנְיַן אֵבָרֶיךָ:
