摘要: 搞技术人的废话不多。巴拉巴拉的一大堆,其实就一句话,脚本中不允许有明文。最简单的方式就是借助openssl实现加解密。 最佳实践奉上: 上面一句是加密,下面是解密。 (加密语句运行多次,生成的密文不同,但是都能解密,且结果相同) 执行openssl help可以查看详细参数以及支持的加解密算法 [r 阅读全文
posted @ 2020-06-21 11:22 smallfishy 阅读(1776) 评论(0) 推荐(0) 编辑
摘要: #Example21 #对文件的处理#!/usr/bin/perl -w #Usage:perl test1.pl test?.txt #用"?"不用"*"可以加快程序运行 use strict; chomp(my $date = `date`); #引用系统命令date,取当前系统日期,保存到"$ 阅读全文
posted @ 2020-06-21 09:22 smallfishy 阅读(149) 评论(0) 推荐(0) 编辑
摘要: #Example17 #用 s/// 替换#!/usr/bin/perl $_ = "He's out bowling with Barney tonight.";$s=s/Barney/Fred/;print "$_\n"; #输出替换后的字符串print "$s\n"; #输出替换命令执行的结果 阅读全文
posted @ 2020-06-21 09:21 smallfishy 阅读(141) 评论(0) 推荐(0) 编辑
摘要: #Example11 #哈希数列2#!/usr/bin/perl my %hash = ("a" => 1, "b" => 2, "c" =>3);my @k = keys %hash;my @v = values %hash;print "@k\n";print "@v\n"; while ( ( 阅读全文
posted @ 2020-06-21 09:20 smallfishy 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #Example6 #数组(i堆栈)#!/usr/bin/perl @arry = qw/ a1 a2 b3 c4 d5 d6/; #声明一个堆栈print "@arry" . "\n"; @ff = pop(@arry); #出栈(最后一个d6)print "@ff" . "\n";print " 阅读全文
posted @ 2020-06-21 09:19 smallfishy 阅读(104) 评论(0) 推荐(0) 编辑
摘要: #Example1 #while循环#!/usr/bin/perl use 2.010; #声明本校本所使用的版本号 while(<>){ #接收键盘的任意输入chomp;print join("\t",(split /:/)), "\n"; 首先用':'分隔字符串,然后用'\t'(制表符)连接} 阅读全文
posted @ 2020-06-21 09:18 smallfishy 阅读(236) 评论(0) 推荐(0) 编辑