<div>trying to grep out some info from my /etc/hosts file...just to get more practice with Perl and well for my personal pleasure, too.</div>
<div>&nbsp;</div>
<div>
<p>#!/usr/bin/perl</p>
<p>open (FILE, &quot;/etc/hosts&quot;);<br>@lines = &lt;FILE&gt;;<br>close (FILE);</p>
<p>foreach $line (@lines){<br>&nbsp;&nbsp; if ($line =~ /pm1/){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print $line;<br>&nbsp;&nbsp; }<br>}<br></p>
<p>the problem with this is that it&#39;s printing out some hosts that i don&#39;t want that also have pm1 at the end.</p>
<p>somehostpm1 but it also gets my dr hosts (dr-somehostpm1)</p>
<p>thoughts?</p>
<p>by the way, i had to jump the wifes car so i ended up missing out on the meeting. gonna try to make the next one for sure, though.</p></div>