0

I need to perform a scheduled backup of my MySQL database.

My web hosting service can run PHP and Perl scripts at chosen hours, so I've decided I would make a Perl script that would call mysqldump.

But in the first line of the Perl script I should put the location of the perl interpreter like #!/usr/bin/perl in Linux.

I didn't find the perl file in my / directory (I have cgi-bin directory).

What should I put in this path?

4

2 回答 2

4

#!/usr/bin/perl适合你吗?您确实需要询问您的服务提供商他们在哪里安装了 perl。但是,您将通过使用获得可移植性

#!/usr/bin/env perl

相反,它将搜索目录PATH以确定 perl 在每个平台上的安装位置。

于 2013-04-24T17:54:57.197 回答
0

whereis此外,您可以使用命令找到路径:

whereis perl

/usr/bin/perl如果安装不是自定义的,这通常会产生路径。

#!/usr/bin/perl

shebang线。在这里查看更多。

于 2013-04-24T20:09:42.290 回答