随笔分类 - Perl
摘要:有时候需要将字符串的原始字符打印出来,即不转义字符串中的转义字符
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ 记录一些常用的 模块 / 方法 。 多线程 使用模块 threads use 5.010; use threads; # 定义一个需要并发的子函数 sub func { my $id = shift; sleep 1; print
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ code #!/usr/bin/env perl # # Program : reverseRowCol.pl # Language : Perl # Author : YEUNGCHIE # Version : 2021.09.
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ 使用此模块可以解决默认函数 sleep 睡眠时间无法小于 1 秒的问题。 使用方式 #!/usr/bin/env perl use v5.10; use strict; use warnings; use Time::HiRes
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ 关键函数 alarm alarm.pl #!/usr/bin/env perl use v5.10; use warnings; use strict; use POSIX qw(strftime); say "start - "
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ 便于数据结构的存储和还原 这里的方法是将 HASH 转为 字符串 写入文件的,再读取文件中字符串内容转为 HASH 使用 JSON 作为数据交换格式 ( JavaScript Object Notation ) 使用 JSON 模
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ 导入模块 POSIX use POSIX qw(strftime); 获取时间 time 返回新纪元时间 : 从 1970-01-01 00:00:00 到现在经过的秒数 say time; # 1631228323 localt
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ 使用 utf8 模块 use utf8; 标准输出设置 binmode STDOUT,':encoding(gbk)'; 标准输入设置 binmode STDIN,':encoding(gbk)'; 标准错误输出设置 binmod
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ Perl 服务端 ycSocketServer.pl #!/bin/env perl # # Program : ycSocketServer.pl * # Language : Perl * # Author : YEUNGCH
阅读全文
摘要:https://www.cnblogs.com/yeungchie/ code #!/usr/bin/perl -w use strict; use Getopt::Long; # 声明使用模块 my ($input,$output,$help); # 定义输入参数 Getopt::Long::Co
阅读全文

浙公网安备 33010602011771号