QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 581|回复: 3

Problem of Perl. Help!

[复制链接]
发表于 2003-6-26 15:50:57 | 显示全部楼层 |阅读模式
I am cainiao.
From a book, i see the perl program:

[code:1]
#!/usr/local/bin/perl
print "Hello world.\n"
[/code:1]

i input these words into a file: hello.pl and chmod its property:
   chmod +x hello.pl
i use:
   which perl
know that perl is in: /usr/bin/perl and modify it in the hello.pl
but: hello.pl can't run.
says: -bash: hello.pl: command not found
who knows why?please tell me.
发表于 2003-6-26 18:56:23 | 显示全部楼层
not found?你是怎么运行的啊?
回复

使用道具 举报

发表于 2003-6-26 20:17:57 | 显示全部楼层
u must have run like this
$hello.pl
it is wrong!
you should run it like this
$./hello.pl
回复

使用道具 举报

发表于 2003-6-26 21:52:42 | 显示全部楼层
another choise:
1.execute your progame like this $ perl hello.pl
2.export your path to @env
in bash you can do it like this :export PATH ./your program path
now you can just run your program like $hello.pl
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 13:51 , Processed in 0.040395 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表