如何在具有相同扩展名的多个输入文件上运行Perl脚本? [英] How do I run a Perl script on multiple input files with the same extension?

查看:79
本文介绍了如何在具有相同扩展名的多个输入文件上运行Perl脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在具有相同扩展名的多个输入文件上运行Perl脚本?

How do I run a Perl script on multiple input files with the same extension?

 perl scriptname.pl file.aspx

我想让它为当前目录中的所有aspx文件运行

I'm looking to have it run for all aspx files in the current directory

谢谢!

推荐答案

在您的Perl档案中,

In your Perl file,

 my @files = <*.aspx>;
 for $file (@files) {

      # do something.

 }

< *。aspx> ; 被称为 glob

这篇关于如何在具有相同扩展名的多个输入文件上运行Perl脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆