小编Vam*_*ond的帖子

如何在执行时在perl脚本中显示子例程及其名称的数量?

考虑下面的Perl脚本script.pl作为示例:

use strict;
use warnings;
sub f1
{statements}
sub f2
{statements}
sub f3
{statements}
f1();f2();f3();
Run Code Online (Sandbox Code Playgroud)

当我执行脚本时,它应该显示如下输出:

./script.pl

子程序数:3个子程序
名:f1 f2 f3

regex linux perl

3
推荐指数
2
解决办法
125
查看次数

打印@array和在perl中打印"@array"有什么区别?

考虑以下代码,例如:

@array=(1..10);
print @array;
print "@array";

The output is as follows:
12345678910
1 2 3 4 5 6 7 8 9 10
Run Code Online (Sandbox Code Playgroud)

perl perl-data-structures

2
推荐指数
1
解决办法
574
查看次数

Perl中"open function"和"touch command"的区别?

以下两种文件创建方式有何不同?

  open(DATA,">newfile.txt");       #1.using open function
  close(DATA);

  `touch newfile.txt`;             #2.using touch command  
Run Code Online (Sandbox Code Playgroud)

哪一个好又快?注意:当在Perl脚本中使用open function和touch命令时,并考虑将其用于创建空文件.

linux perl file

2
推荐指数
1
解决办法
2881
查看次数

非管理员使用记事本打开时如何隐藏文件的某些内容?

我编写了一个Perl脚本并放在Linux/Windows机器上,并希望限制它

  • 如果管理员使用记事本打开程序,那么他们将看到整个文件

  • 如果非管理员用记事本打开程序,那么他们应该只看到30%的内容

linux perl

-10
推荐指数
1
解决办法
177
查看次数

标签 统计

perl ×4

linux ×3

file ×1

perl-data-structures ×1

regex ×1