Perl的grep用法

#!/usr/bin/perl

@list = (1,”Test”, 0, “foo”, 20 );

@has_digit = grep ( !/\d/, @list ); #!非真

print ”@has_digit\n”;

结果如下:

Test foo

shells/program/perl/perl-grep.txt · 最后更改: 2011/03/03 05:49 由 狐狸
[unknown link type]到顶部
GNU Free Documentation License 1.3
京ICP备05034962号 Debian Driven by DokuWiki get firefox browser Recent changes RSS feed Valid XHTML 1.0