Perl 正则二

前端之家收集整理的这篇文章主要介绍了Perl 正则二前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
my $command="cd /tmp";
print "\$command  is $command:\n";
my $newdir=(split /\s+/,"$command")[1]; ---取第2个元素
print "\$newdir is $newdir:\n";


[root@jhoa bin]# perl a1.pl 
$command  is cd /tmp:
$newdir is /tmp:

猜你在找的Perl相关文章