<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:10pt"><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 10pt;">Everyone begins as a beginner!<br><br>No matter you are a beginner or an expert, you'd better to know how to use perldoc (There are a lot to learn)<br><br>-&gt; perldoc -f readdir<br>&nbsp;&nbsp;&nbsp;&nbsp; readdir DIRHANDLE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Returns the next directory entry for a directory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; opened by "opendir".&nbsp; If used in list context,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returns all the rest of the entries in the<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directory.&nbsp; If there are no more entries, returns
 an<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; undefined value in scalar context or a null list in<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list context.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If you're planning to filetest the return values out<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; of a "readdir", you'd better prepend the directory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in question.&nbsp; Otherwise, because we didn't "chdir"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; there, it would have been testing the wrong file.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; opendir(DIR, $some_dir) || die "can't opendir $some_dir:
 $!";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @dots = grep { /^\./ &amp;&amp; -f "$some_dir/$_" } readdir(DIR);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; closedir DIR;<br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: truncatei &lt;truncatei@gmail.com&gt;<br>To: china-pm@pm.org<br>Sent: Tuesday, January 29, 2008 6:05:08 AM<br>Subject: Re: [PerlChina] 求助如何可以读取邮箱中邮件啊<br><br>
看来是Perl Beginner,是在做项目还是个人练习?<br><br>my @dirs = readdir DH;<br><br>or <br><br>while (&lt;DH&gt;) {<br>&nbsp;&nbsp;&nbsp; // $_<br>}<br><br><br><div class="gmail_quote">2008/1/29 Steven Zhu &lt;<a rel="nofollow" ymailto="mailto:stevenzyk@gmail.com" target="_blank" href="mailto:stevenzyk@gmail.com">stevenzyk@gmail.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">怎么把读出来,赋值哪,请教<br><br><br></blockquote></div><br><br clear="all"><br>-- <br>如果觉得无聊,您不妨访问Google Reader消遣 <a rel="nofollow" target="_blank" href="http://www.google.com/reader/view">http://www.google.com/reader/view</a><br>
要尝试黑版本Google,请访问 <a rel="nofollow" target="_blank" href="http://www.google.com/custom?q=&amp;sa=Search&amp;client=pub-4021907304270164&amp;forid=1&amp;channel=7519554017&amp;ie=UTF-8&amp;oe=UTF-8&amp;cof=GALT%3A%23FF9900%3BGL%3A1%3BDIV%3A%230033FF%3BVLC%3ACC9900%3BAH%3Acenter%3BBGC%3A000000%3BLBGC%3A000000%3BALC%3AFFFFFF%3BLC%3AFFFFFF%3BT%3ACCCCCC%3BGFNT%3A33CC00%3BGIMP%3A33CC00%3BFORID%3A1%3B&amp;hl=en">http://www.google.com/custom?q=&amp;sa=Search&amp;client=pub-4021907304270164&amp;forid=1&amp;channel=7519554017&amp;ie=UTF-8&amp;oe=UTF-8&amp;cof=GALT%3A%23FF9900%3BGL%3A1%3BDIV%3A%230033FF%3BVLC%3ACC9900%3BAH%3Acenter%3BBGC%3A000000%3BLBGC%3A000000%3BALC%3AFFFFFF%3BLC%3AFFFFFF%3BT%3ACCCCCC%3BGFNT%3A33CC00%3BGIMP%3A33CC00%3BFORID%3A1%3B&amp;hl=en</a>
<!-- kill --><div><br><br>-----Inline Attachment Follows-----<br><br>_______________________________________________<br>China-pm 
mailing 
list<br><a ymailto="mailto:China-pm@pm.org" href="mailto:China-pm@pm.org">China-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/china-pm" target="_blank">http://mail.pm.org/mailman/listinfo/china-pm</a></div></div><br></div></div></body></html>