加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

运行Perl程序———hello.plx

发布时间:2020-12-15 21:04:22 所属栏目:大数据 来源:网络整理
导读:昨天把第一个python程序运行出来了,很容易。 今天运行Perl程序的时候,发现运行不了,书里面记载的是unix里面的运行方式,在百度里面找了找,好几个网页里面写的都是乱七八糟的东西。 去了一趟官方文档原来真有。 To run your Perl scripts,enter the follo

昨天把第一个python程序运行出来了,很容易。

今天运行Perl程序的时候,发现运行不了,书里面记载的是unix里面的运行方式,在百度里面找了找,好几个网页里面写的都是乱七八糟的东西。

去了一趟官方文档原来真有。

To run your Perl scripts,enter the following command at the command prompt:

perl -w yourscriptname.pl

Where?yourscriptname.pl?is the name of the script you want to run. If you are using Windows and have associated the extension of the file with Perl,typing?yourscriptname.pl?(that is,without calling?perl?first) will also launch the script.


随便用了一个文本编辑器写了一个入门的程序。

#!/usr/bin/perl
print "Hello,world!n";


保存为hello.plx?

在windows下的run里面写cmd按回车,然后进入hello.plx的所在的文件目录里面。

perl -w hello.plx

出现运行了结果(当然我事先安装了activePerl,当前在Perl的官方网站上推荐的几款免费的编译器也可以):

Hello,world

感觉很爽。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读