perl 入门项目 Demo 点餐系统

PerlProjects:各种Perl项目和较小的Perl脚本 立即下载
视频
 
 
1. 正则
2. 类的继承使用
3. 文件读写
4. 全局变量的使用
5. 数组
6. 哈希 (map)
 

 

订单信息

order.txt

customer Marry order 2 cup of vegetable_soup, 1 white_bread ,2020-01-03;
2020-01-03, customer John : 2 cups of broth ,and 3 white_bread ,4 cups of vegetable_soup,;
customer Alex 5 cups broth,and 2 wheat_bread ,2020-01-03;

customer John 1 cups broth ,and 3 white_bread ,2020-01-04;
customer Alex 2 cups vegetable_soup 2020-01-04;
2020-01-04, customer Marry order 55 cup of vegetable_soup, 5 white_bread;

2020-01-05, 5 cups broth ,and 1 wheat_bread  customer John;
2020-01-05, 5 cups vegetable_soup ,and 10 white_bread  customer Alex;
2020-01-05, 2 cups broth ,and 10 wheat_bread  customer Marry;

运行结果

 

目录结构与运行结果

 

代码

main.pl

#!/usr/bin/perl

BEGIN{push @INC, "D:/wks_perl/dish_perl/util";}
BEGIN{push @INC, "D:/wks_perl/dish_perl/obj";}

use utf8;
use warnings;
use strict;


binmode(STDOUT,":encoding(gbk)");
#标准输出使用gbk作为编码格式,也可以把gbk改为gb2312
binmode(STDIN,":encoding(gbk)");
binmode(STDERR,":encoding(gbk)");


use Global_setting;
use Reg_util;
use File_util;
use Common_util;



sub main{
	my @orders=File_util->read_file("./doc/order.txt");

	# 初始化 log
	File_util->cratre_overwrite_file("./doc/res.txt","");

	my $size = @orders;
	my $cur_date="";
	my %data=();

	for (my $i=0;$i<$size;$i++){
		my $line=$orders[$i];
		$line=Reg_util->remove_end_space($line);

		File_util->append_file("./doc/res.txt",$line);

		my $date=Reg_util->get_date($line);
		my $customer=Reg_util->get_customr_name($line);
		File_util->append_file("./doc/res.txt","customer:$customer\n");
		if($date cmp  $cur_date){
			$cur_date=$date;
			Global_setting->reset_max_num();
		}
		if(!exists($data{$date})){
			 $data{$date}=();
		}

		my @order_array=Common_util->get_order_array($line);

		$data{$date}{$customer}=\@order_array;
	}

	Common_util->report(%data);

}



&main();

Food.pm

package Food;
use utf8;
use warnings;
use strict;

sub new{
	my $class = shift;
	my $self = {
		_name => shift,
		_price => shift,
	};
	bless $self,$class;
	return $self;
}

sub set_name{
	my ($self,$new_name)= @_;
	if (defined ($new_name)){
		$self->{_name} = $new_name;
		return 1;
	}
	else {
		return 0;
	}
}

sub get_name{
	my($self)=@_;
	return $self->{_name};
}

sub set_price{
	my ($self,$new_price)= @_;
	$self->{_price} = $new_price if defined($new_price);
}

sub get_price{
	my($self) = @_;
	return $self->{_price};
}

1;

Bread.pm

package Bread;

use utf8;
use warnings;
use strict;


use Global_setting;
use Food;

use base qw(Food);

sub new {
	my $class = shift;

	my $self = $class->SUPER::new(shift, shift);	
	
	# 添加更多属性
	$self->{_units}   = shift;

	# bless $self, $class;

	$self;
}

sub order{
	my($self,$order_num)=@_;
	if($order_num>$Global_setting::white_bread_discount_num and $self->{_name} eq Global_setting::WHITE_BREAD){
		$self->{_price}*=0.8;
	}
	$self->{_units}=$order_num;
}

sub print_self {
	my($self)=@_;
	my $str= "bread:name:".$self->{_name}.",price:".$self->{_price}.",units:".$self->{_units}."\n";

	File_util->append_file("./doc/res.txt",$str);
}



1;

Soup.pm

package Soup;

use utf8;
use warnings;
use strict;

use Global_setting;
use Food;

use base qw(Food);

sub new {
	my $class = shift;
	my $self = $class->SUPER::new(shift, shift);	
	
	# 添加更多属性
	$self->{_cups}   = shift;
    # bless $self, $class;
	$self;
}


sub get_avaialable_num {
	my($self)=@_;
	# print "get_avaialable_num name:".$self->{_name}."\n";
	if($self->{_name} eq Global_setting::VEGETABLE_SOUP)
	{
		return Global_setting::MAX_VEG_SOUP_PER_DAY - $Global_setting::cur_veg_soup_num;
	} elsif($self->{_name} eq Global_setting::BROTH) 
	{
		return Global_setting::MAX_BROTH_PER_DAY - $Global_setting::cur_broth_num;
	}else{
		return 0;
	}
}

sub amend_cur_num{
	my($self)=@_;
	if($self->{_name} eq Global_setting::VEGETABLE_SOUP){
		$Global_setting::cur_veg_soup_num+=$self->{_cups};
		return 1;
	}elsif($self->{_name} eq Global_setting::BROTH){
		$Global_setting::cur_broth_num+=$self->{_cups};
		return 1;
	}else{
		return 0;
	}
}

sub order{
	my($self,$order_num)=@_;+		
	my $avail_num=get_avaialable_num($self);
	if($avail_num<$order_num){
		$self->{_cups}=$avail_num;
	}else{
		$self->{_cups}=$order_num;
	}
	amend_cur_num($self);
}

sub print_self {
	my($self)=@_;
	my $str="soup:name:".$self->{_name}.",price:".$self->{_price}.",cups:".$self->{_cups}."\n";
	File_util->append_file("./doc/res.txt",$str);

}


1;

Common_util.pm

package Common_util;

use utf8;
use warnings;
use strict;



use Reg_util;
use Global_setting;
use Soup;
use Bread;

sub get_order_array {
	my($class,$line)=@_;
	my @res;

	my @line_arr=split /,/,$line;
	foreach my $line_item (@line_arr){
		my @nums=Reg_util->get_numbers($line_item);

		if(Reg_util->contain($line_item,Global_setting::VEGETABLE_SOUP,1)){

			my $object =new Soup( Global_setting::VEGETABLE_SOUP,$LB::veg_soup_price,0);

			$object->order($nums[0]);
			if($object->{_cups}>0)
			{
				push @res,$object;
			}

		}elsif(Reg_util->contain($line_item,Global_setting::BROTH,1)){
			my $object =new Soup();
			$object->set_name(Global_setting::BROTH);
			$object->set_price($LB::broth_price);


			$object->order($nums[0]);

			if($object->{_cups}>0)
			{
				push @res,$object;
			}

		}elsif(Reg_util->contain($line_item,Global_setting::WHITE_BREAD,1)){
			
			my $object =new Bread();
			$object->{_name}=Global_setting::WHITE_BREAD;
			$object->{_price}=$LB::white_bread_price;


			$object->order($nums[0]);
			if($object->{_units}>0)
			{
				push @res,$object;
			}

		}elsif(Reg_util->contain($line_item,Global_setting::WHEAT_BREAD,1)){
			my $object =new Bread();
			$object->{_name}=Global_setting::WHEAT_BREAD;
			$object->{_price}=$LB::wheat_bread_price;
			$object->order($nums[0]);
			if($object->{_units}>0)
			{
				push @res,$object;
			}
		}else{
			;
		}
		

	}

	# log
	for my $item (@res){
		$item->print_self();
	}
	File_util->append_file("./doc/res.txt","----------------------------------------------------\n");
	

	return @res;
}


sub report {
	my($class,%data)=@_;

	my %sum_by_date=();
	my %sum_by_customer=();
	my %sum_by_name=();

	for my $date (keys %data){
		my %tmp=%{$data{$date}};
		for my $customer (keys  %tmp){
			my @order=@{$data{$date}{$customer}};
			foreach my $item (@order){


				# 取出数据
				my $name=$item->{_name};
				my $price=$item->{_price};
				my $num;
				if(($name eq Global_setting::VEGETABLE_SOUP) || ($name eq Global_setting::BROTH)){
					$num = $item->{_cups};
				}else{
					$num = $item->{_units};
				}

				my $money=$num*$price;


				if(!exists($sum_by_date{$date})){
					$sum_by_date{$date}=$money;
				}else{
					$sum_by_date{$date}+=$money;
				}

				if(!exists($sum_by_customer{$customer})){
					$sum_by_customer{$customer}=$money;
				}else{
					$sum_by_customer{$customer}+=$money;
				}

				if(!exists($sum_by_name{$name})){
					$sum_by_name{$name}=$money;
				}else{
					$sum_by_name{$name}+=$money;
				}
			}
		}
	}

	File_util->append_file_and_print("./doc/res.txt","=====Final SUM beg========================================\n");

	my $sum=0;
	my @date_list= keys %sum_by_date;
	@date_list = sort(@date_list);
	foreach my $date (@date_list){
		my $money=$sum_by_date{$date};
		
		File_util->append_file_and_print("./doc/res.txt","date $date sum:".$money."\n");
		
		$sum+=$money;
	}

	File_util->append_file_and_print("./doc/res.txt","sum:".$sum."\n");
	File_util->append_file_and_print("./doc/res.txt","-----------------------------------------------------------\n");

	$sum=0;
	while (my($customer,$money) = each(%sum_by_customer)){ 
		File_util->append_file_and_print("./doc/res.txt","customer $customer sum:".$money."\n");
		$sum+=$money;
	}

	File_util->append_file_and_print("./doc/res.txt","sum:".$sum."\n");

	File_util->append_file_and_print("./doc/res.txt","-----------------------------------------------------------\n");
	
	$sum=0;
	while (my($name,$money) = each(%sum_by_name)){ 
		File_util->append_file_and_print("./doc/res.txt","name $name sum:".$money."\n");
		$sum+=$money;
	}

	File_util->append_file_and_print("./doc/res.txt","sum:".$sum."\n");
	File_util->append_file_and_print("./doc/res.txt","=====Final SUM end========================================\n");
}

1;

File_util.pm

package File_util;
use utf8;
use warnings;
use strict;

use Reg_util;

sub read_file {
	my($class,$file_path)=@_;
  	open(MYFILE,$file_path)||die "err: $!\n";
	# @array = <MYFILE>;
	my @array;
	while($_ = <MYFILE>){
		if(Reg_util->contain_words($_)==1){
			$_=Reg_util->remove_end_space($_);
			$_ =Reg_util->remove_begin_space($_);
			push @array,$_;
		}
	}

	close MYFILE;
	return @array;
}


sub append_file {
	my($class,$file_path,$str)=@_;
  	open(MYFILE,">>".$file_path)||die "err: $!\n";
  	print MYFILE $str;
	close MYFILE;
}

sub append_file_and_print {
	my($class,$file_path,$str)=@_;
	append_file($class,$file_path,$str);
	print $str;
}


sub cratre_overwrite_file {
	my($class,$file_path,$str)=@_;
  	open(MYFILE,">".$file_path)||die "err: $!\n";
  	print MYFILE $str;
	close MYFILE;
}


sub readable {
	my($class,$file_path)=@_;
	return 1 if(-r $file_path);
	0;
}


sub writeable {
	my($class,$file_path)=@_;
	return 1 if(-w $file_path);
	0;
}

sub is_exists {
	my($class,$file_path)=@_;
	return 1 if(-e $file_path);
	0;
}

sub is_empty {
	my($class,$file_path)=@_;
	return 1 if(-z $file_path);
	0;
}


sub file_size {
	my($class,$file_path)=@_;
	return (-s $file_path);
}



sub is_file {
	my($class,$file_path)=@_;
	return 1 if(-f $file_path);
	0;
}


sub is_dir {
	my($class,$file_path)=@_;
	return 1 if(-d $file_path);
	0;
}

sub is_text_file {
	my($class,$file_path)=@_;
	return 1 if(-T $file_path);
	0;
}

sub is_binary_file {
	my($class,$file_path)=@_;
	return 1 if(-B $file_path);
	0;
}

sub write_file {
	my($class,$file_path,$str)=@_;
	if(is_exists("",$file_path)){
		append_file("",$file_path,$str);
	}else{
		cratre_overwrite_file("",$file_path,$str);
	}
}

1;

Global_setting.pm

package Global_setting;
use utf8;
use warnings;
use strict;


# 汤的种类
use constant { 
    VEGETABLE_SOUP   => 'vegetable_soup',
    BROTH   => 'broth',
};

# 面包的种类
use constant {
    WHITE_BREAD => 'white_bread',
    WHEAT_BREAD => 'wheat_bread',
};

# 每日最大供应量
use constant {
    MAX_VEG_SOUP_PER_DAY   => 5,
    MAX_BROTH_PER_DAY   => 5,
};


# 全局变量 当前供应量

$LB::veg_soup_price=4;
$LB::broth_price=9;

$LB::white_bread_price=3;
$LB::wheat_bread_price=5;


our $cur_broth_num=0;
our $cur_veg_soup_num=0;


our $white_bread_discount_num=2;


sub reset_max_num {
	# 清除供应量
	$cur_broth_num =0;
	$cur_veg_soup_num=0;

	# 每天涨价1元
	$LB::veg_soup_price+=1;
	$LB::broth_price+=1;
	$LB::white_bread_price+=1;
	$LB::wheat_bread_price+=1;
}


1;

Reg_util.pm


package Reg_util;
use utf8;
use warnings;
use strict;


sub contain {
	my ($class,$word,$target,$ignore_cap)=@_;
	$_=$word;
	if($ignore_cap){
		return 1 if /$target/i;
	}else{
		return 1 if /$target/;
	}
	0;
}

sub contain_space {
	my ($class,$word)=@_;
	$_=$word;
	return 1 if /\p{Space}/;
	0;
}

sub contain_words {
	# 包含数字或符号
	my ($class,$word)=@_;
	$_=$word;
	return 1 if /\w/;
	0;
}


sub is_digit{
	my ($class,$num)=@_;
	my $reg1 = qr/^-?\d+(\.\d+)?$/;
	my $reg2 = qr/^-?0(\d+)?$/;
	return 1 if ( $num =~ $reg1 && $num !~ $reg2 );    
	0;
}


sub contain_digit {
	my ($class,$word,$target)=@_;
	$_=$word;
	# (?# return 1 if /\p{Digit}/;)
	return 1 if /\d/;
	0;
}


sub to_lower { 
	# 转成小写
	my ($class,$word)=@_;
	$word =~ tr/A-Z/a-z/;
	$word;
}

sub to_cap {
	# 转成大写
	my ($class,$word)=@_;
	$word =~ tr/a-z/A-Z/;
	$word;
}



sub replace {
	# 替换
	my ($class,$word,$tar,$replace,$ignore_cap) = @_;
	if($ignore_cap==1){
		$word =~ s/$tar/$replace/i;
	}else{
		$word =~ s/$tar/$replace/;
	}
	$word;
}


sub get_numbers {
	# 找出数字并存放在一个数组里返回
	my ($class,$str)=@_;
	my @d = $str =~/[\-\d]?[\d]*[\.]?[\d]+/g;
	@d;
}



sub get_first_match {
	# 截取匹配后的第一个字符
	my ($class,$str,$criteria)=@_;
	my @d =$str =~/$criteria[\s]+(.*?)[\s;,]/;
	$d[0];
}

sub get_customr_name {
	my ($class,$str)=@_;
	$str = get_first_match($class,$str,"customer");
	$str = remove_end_space($class,$str);
	$str = remove_begin_space($class,$str);
}

sub get_date {
	# 截取匹配后的第一个字符2021-05-01
	my ($class,$str)=@_;
	# @d = $str =~/[\d]+[\-\d]+[\-\d]+/g;
	my @d = $str =~/[\d]+[\-][\d]+[\-][\d]+/g;
	$d[0];
}



sub remove_end_space {
	my ($class,$str)=@_;
	$str =~ s/[\r\n\s]$//; 
	$str;
}

sub remove_begin_space {
	my ($class,$str)=@_;
	$str =~ s/^[\s\t]+//; 
	$str;
}

1;

main.pl

#!/usr/bin/perl

BEGIN{push @INC, "D:/wks_perl/dish_perl/util";}
BEGIN{push @INC, "D:/wks_perl/dish_perl/obj";}

use utf8;
use warnings;
use strict;


binmode(STDOUT,":encoding(gbk)");
#标准输出使用gbk作为编码格式,也可以把gbk改为gb2312
binmode(STDIN,":encoding(gbk)");
binmode(STDERR,":encoding(gbk)");


use Global_setting;
use Reg_util;
use File_util;
use Common_util;



sub main{
	my @orders=File_util->read_file("./doc/order.txt");

	# 初始化 log
	File_util->cratre_overwrite_file("./doc/res.txt","");

	my $size = @orders;
	my $cur_date="";
	my %data=();

	for (my $i=0;$i<$size;$i++){
		my $line=$orders[$i];
		$line=Reg_util->remove_end_space($line);

		File_util->append_file("./doc/res.txt",$line."\n");

		my $date=Reg_util->get_date($line);
		my $customer=Reg_util->get_customr_name($line);
		File_util->append_file("./doc/res.txt","customer:$customer\n");
		if($date cmp  $cur_date){
			$cur_date=$date;
			Global_setting->reset_max_num();
		}
		if(!exists($data{$date})){
			 $data{$date}=();
		}

		my @order_array=Common_util->get_order_array($line);

		$data{$date}{$customer}=\@order_array;
	}

	Common_util->report(%data);

}



&main();

 

perl 项目编写工具 perl 项目编写工具:Pleditor;即编即调。不用浏览器也可看到测试结果。 立即下载

相关推荐

LabVIEW与MySQL的连接:软件下载与安装至UDL文件创建全过程

依据个人经验编辑的十分完备的使用教程

tiaowudexiaoyu的博客 5576

关于Perl几个基本操作的Demo

 一.输出到文件的Demo#!F:/Program Files/Perl/bin/perluse strict; open(MYFILE,">>hhh.txt"); while() {  $|=1;  select MYFILE;  $|=1;  print MYFILE $_;  $|=1;  select STDOUT;  print $_ ; } close(MYFILE);        

laogeng86的专栏 702

MRST开源油藏模拟:从入门到精通的全流程指南

本文全面介绍了MRST开源油藏模拟工具的使用方法,从环境搭建到核心功能实战,再到性能优化和工业级应用。MRST作为一款基于MATLAB的开源工具,为油藏工程师提供了强大的数值模拟能力,特别适合教学和科研场景。文章还分享了二次开发技巧和常见问题解决方案,帮助读者快速掌握油藏模拟技术。

beer8的博客 331

2025 Perl核心模块实战指南:从入门到性能优化

你是否还在为复杂的文本处理任务寻找高效解决方案?是否在系统管理中需要兼顾灵活性与性能?Perl( Practical Extraction and Reporting Language,实用提取与报告语言)作为一门诞生超过30年的编程语言,依然在文本处理、系统管理和Web开发领域占据不可替代的地位。本文将通过10个核心模块的实战案例,带你掌握Perl的现代用法,解决90%的日常开发难题。 读完本...

gitblog_00498的博客 710

7-1 链式基数排序 (20 分)

7-1 链式基数排序 (20 分) 实现链式基数排序,待排序关键字n满足1≤n≤1000,最大关键字数位≤5。 输入样例: 第一行输入待排序个数n(1≤n≤1000),再输入n个数(n的数位≤5)。 10 278 109 63 930 589 184 505 269 8 83 输出样例: 输出每趟分配-收集后链表中的关键字,趟数为序列中最大值的数位(如样例中930的数位为3),每行结尾有空格。 930 63 83 184 505 278 8 109 589 269 505 8 109 930 63 26

OwemShu的博客 4245

VS2019手动添加bits/stdc++.h全指南(附解决‘无法打开源文件‘错误)

本文详细介绍了在Visual Studio 2019中手动配置C++万能头文件bits/stdc++.h的完整方法,解决常见的'无法打开源文件'错误。通过分析GCC与MSVC编译器生态差异,提供了纯手动创建和MinGW移植两种可靠方案,并给出详细的步骤、常见错误排查及最佳实践建议,帮助开发者高效配置竞赛开发环境。

weixin_29011395的博客 550

转:perl-项目总结

一个小项目,用perl完成。环境windows,要求能够通过访问网页来启动网页所在服务器上的程序。安装了apache_2.2.4-win32-x86-no_ssl,ActivePerl-5.8.8.822-MSWin32-x86-280952。由于是第一次使用perl,而且是windows下的,一边学一边用,花了2个晚上搞定。几个关键点:1.用perl写cgii.在windows下

我为编程狂,我为外语狂 1286

Unity多渠道APK打包:同一工程稳定输出不冲突安装包

Android应用多渠道分发是移动开发的基础场景,其核心在于解决包名唯一性、渠道可识别性与构建可重复性三大问题。原理上,Unity安卓打包本质是三阶段流程:生成Android工程、Gradle编译、APK签名,而包名冲突根源在生成阶段对PlayerSettings的强依赖。技术价值体现在规避人工配置失误、支撑CI/CD自动化、满足华为/小米等商店合规要求。典型应用场景包括应用宝、TapTap、B站等渠道独立包管理,以及AB测试、灰度发布等运营需求。本文聚焦Unity原生方案,通过BuildPlayerOpt

weixin_33736048的博客 798

IDEA编写 Per 项目详细步骤 Perl入门级语法

首先在IDEA上安装 Perl插件: 1、文件 -设置- 插件 - 搜索Prel-然后在仓库中搜索perl-下载安装插件 2、插件安装好之后下载Perl SDK 编译工具:https://www.perl.org/get.html 一般都在使用草莓的那个 下载安装好之后配置IDEA,重新打开IDEA,点击箭头所指按钮,配置Perl SDK安装路径,即安装路径中的bi

Reserved_person的博客 5215

小程序 video 控制器外观调整_Kessil 360X Tuna Sun无线控制器使用分享

之前分享了Kessil 360X Tuna Sun开箱记录,时间关系,没来得及使用WiFi Dongle无线控制器。昨晚抽空实操了一下,做个操作记录,希望对大家有参考Kessil无线模块操作指南官方视频英文教程配中文字幕,非常详尽语速较快,重点位置可以暂停操作点击边框调出视频工具条1、拆包取控制器,保存二维码Kessil WiFi Dongle包装打开包装就能看到Kessil无线控制模...

weixin_39759060的博客 4736

立创开源4G+GPS定位系统:基于微信小程序的低成本低功耗追踪方案

本文介绍了一个基于立创开源平台的超小型4G+GPS定位系统方案。该方案采用28mm*28mm主板,集成4G Cat.1通信与GPS定位,通过微信小程序“点灯专家”实现远程追踪管理,具备低成本、低功耗、易于部署的特点,适用于电动车、宠物、资产追踪等多种场景。

weixin_28895791的博客 397

【亲测免费】 Strawberry Perl 项目安装与使用指南

Strawberry Perl 项目的目录结构如下: ``` Perl-Dist-Strawberry/ ├── Build.PL ├── Changes ├── LICENSE ├── MANIFEST.SKIP ├── README ├── TODO ├── HelperCA/ │ └── dll_src/ ├── devel/ │ └── utils/ ├── lib/ │ └...

gitblog_00213的博客 940

Python 爬虫实战:爬取 GitHub 热门项目(星数 / 语言 / 作者)

本文系统介绍了使用Python爬虫技术获取GitHub热门项目数据的完整方案。通过分析GitHub Trending页面和官方API两种数据源,详细讲解了HTML解析、JSON数据处理、反爬应对策略等关键技术。采用requests、BeautifulSoup、pandas等工具链,实现了项目信息(名称、星数、语言等)的结构化爬取,并配套数据清洗、统计分析及可视化功能。特别强调遵守GitHub API使用规范,包括Token认证、请求频率控制等合规要求。该方案为开发者提供了一种高效、合法的数据采集方法,适用于

2503_91057718的博客 2348

Perl入门-demo1

exit;)$/gi) {

weixin_56819992的博客 139

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

perl 操作mongodb 集锦 demo

use strict; use MongoDB; use MongoDB::OID; use Data::Dumper; use MongoDB::MongoClient; my $client = MongoDB::MongoClient->new(     host => 'mongodb://127.0.0.1:27017/admin',     username => "

kongjunlongaa的博客 618

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

mysql 多线程 demo_PERL实现多线程的一些demo程序

以前学perl时候的一些笔记。主要是perl来写多线程的程序,整理一下1#!/bin/perluse threads;use threads::shared; # 涉及到一些进程间变量的共享,用这个模块my $process = 4;my $child_num = 0;print $threads::VERSION.chr(10);while (1) {if ($child_num < $p...

weixin_39705850的博客 166

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

关于perl中命令执行以及@ARGV的使用

Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE

中关村村长的专栏 1万+

PERL简记

记下一点文字,为自己曾经所学留一点点痕迹。     PERL很强大,支持多平台,,,&amp;%$^&amp;*(&amp;^%。 现在使用的基本是都是版本5。 很简单易学的:   主要内容安排如下: 一,PERL的基本知识      看看官方文章,写写Hello Perl,基本就可以开始学习了。      PERL的变量    $ 单变量:声明,赋值 @数组变量...

自牧谦谦 203

自学perl笔记1_在windows上运行perl程序

今天去图书馆借书,忽然心血来潮想要学学perl。因为程序理论课上老师提了一句“做网络管理的一定要懂perl”(??差不多吧。半睡半醒ing……),然后又想起之前学web服务的时候好像在文献里瞅到perl的大名?好模糊,完全搞不清是不是错觉!不过不管怎么样,想学新东西总是好的。所以我果断拿起这本《Perl语言入门》,遁也~ 呃,这其实证明了一个道理,书的装帧对销量真的很重要…… 第一篇博客就这么

u014458962的专栏 2836

perl demo

#! usr/bin/perl $sss = "test"; $sss2 = 3; #变量的定义 print "fred ate $sss2 \n"; print "hello"; #必须加分号 #print "fred ate $n \n"  因为学习flex也学了点perl #chomp去掉变量中的换行符号 $hello="hello world \n"; pri...

126

perl:打开文件与读取里面的行-demo

1.经常会碰到打开几个文件进行处理。 2.容易把文件名和文件里的内容混淆。 3.使用钻石操作符可以非常方便的把文件里面内容提取出来。 #! /usr/bin/perl use 5.010; open $get_file,'>',"file.txt"; foreach my $file (@ARGV){ say "$file"; printf $get_file("%1...

seuwilson的博客 879

perl 面向对象demo

Vsftp:/root/perl/17# cat Critter.pm package Critter; sub new { my $self = {}; my $invocant = shift; my $class = ref($invocant) || $invocant; my ($name)=@_; my $s

zhaoyangjian724的专栏 559

5步快速掌握Perl-Dist-Strawberry:Windows平台Perl发行版构建完整指南

Perl::Dist::Strawberry 是一个专业工具集,专门用于构建和打包Windows平台上的Strawberry Perl发行版。它为Perl开发者提供了完整的自动化构建解决方案,能够生成MSI安装包、ZIP压缩包和便携版等多种格式的Perl发行版。无论您是想要定制自己的Perl环境,还是需要为团队部署标准化的开发环境,这个工具都能让您轻松实现。 ## ✨ 核心优势:为什么选择Per

gitblog_00797的博客 576

用perl 语言写freeswitch dialplan

我建了一个 Freeswitch 内核研究 交流群, 45211986, 欢迎加入, 另外,提供基于SIP的通信服务器及客户端解决方案, 承接 sip/ims 视频客户端开发,支持接入sip软交换,ims核心网,支持 语音,视频,即时通信功能,视频格式支持 h263,h264,mpeg4 软编软解,提供硬件编解码接口对接,提供服务器,有兴趣请联系我。 freeswtich支持 l

RTC hacker 2912

Perl语言的多线程(二)

很多时候使用perl多线程可以达到很不错的效果,可以节约很多时间完成很复杂的工作。但通过perl threads模块的描述文件可以看到,它也有很多缺点。比如说在使用perl多线程的时候,必须的保证所有引用的模块都是支持thread。而在实际应用中,我们很难做到这样。比如我们要多线程,但同时要应用OLE模块去操作activex。 此用例应该是一种很常见的用例。那是不是意味着此时我们不得不放弃使用多线...

weixin_33974433的博客 276
上一篇: gvim8.2 vim 用vim-plug安装配置taglist ctrlp nerdtree winmanager nerdcommenter neocomplete 等常用程序
下一篇: IC芯片验证 - 手把手教你搭建UVM验证环境
陈君豪
博客等级 码龄9年 725粉丝 201原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值