> -----邮件原件-----
> 发件人: Jim Gibson [mailto:[email protected]]
> 发送时间: 2009年11月20日 15:08
> 收件人: gaochong; 'John W. Krahn'; 'Perl Beginners'
> 主题: Re: ìö‘` : the question of one program
>
> At 11:48 AM +0800 11/20/09, gaochong wrote:
> >Thanks .
> >But the code is from cpan.org ,and is crappy ,where I will go ?
>
> You figure out what is wrong with it and improve it. You have already
> been given some hints from people on this list. Here are some more:
thanks very much !
>
> 1. Don't call subroutines with the '&' character.
what's your meaning ? then how to call subroutines ?
> 2. Don't quote variables unnecessarily.
> 3. Don't capture in regular expressions if you do not use the captured strings
> 4. Don't use string comparison operators to compare numbers.
with your opinion ,I rewrite one line ,and can be understood easily .
if (@ARGV < 1) {
&usage;
exit;
} else { >
5. Use a little more horizontal whitespace and a little less vertical
> whitespace.
>
> Does the program do what you want it to do? If not, then let us know
> how it differs from your expectations.
Nearly ,but I have some question .
e.g,how to get the contents of environ line by line ? Now the re is not correct
.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/