#!/usr/bin/perl

 use strict;
use warnings; $_ = 'oireqo````'; unless($_ =~ /^a/m){print "no match to a\n"} #no match to a if(!($_ =~ /^a/m)){print "no match to a\n"} #no match to a unless($_ =~ /^o/m){print "no match to a"}else{print "match!\n"} my $number = ; while($number<)
{
$number++;print "$number\n";
} #2
#3
#4
#5
#6
#7
#8
#9
#10
#11
#12 until($number<)
{
$number--;print "$number\n"
} #11
#10
#9
#8
#7
#6
#5
#4
#3
#2
#1 print "match!\n"if($_ =~ /^o/m); #match! my @arr=(,,,,,,);print foreach(@arr);print"\n"; #1234567 #my @arr_1=(1,2,3,4,5,6,7);print"$k" foreach my $k($#arr_1);print"\n";
#Global symbol "$k" requires explicit package name (did you forget to declare "my $k"?) at t.pl line 62.
#syntax error at t.pl line 62, near "$k("
#Execution of t.pl aborted due to compilation errors. {
my $k = "good";
}
#print "$k\n"; #Global symbol "$k" requires explicit package name (did you forget to declare "my $k"?) at t.pl line 70.
#Execution of t.pl aborted due to compilation errors. my @fruit = ('apple','banana','peach','apple','apple');my %match;$match{$_}++ foreach(@fruit);print "$match{$_}\n"foreach(keys %match); #1
#1
#3 my $five_1= ;my $six_1 = $five_1++;print "$six_1\t$five_1\n";
my $five_2= ;my $six_2 = ++$five_2;print "$six_2\t$five_2\n"; #5 6
#6 6 my %seen;foreach(@fruit) {print "i 've get $_!\n" if $seen{$_}++;} #i 've get apple!
#i 've get apple! for($_ = "abcdefg";s/(.)//;){print "$1\n";if($ eq "f"){last;}} #a
#b
#c
#d
#e
#f
my %seen; READ:while(<>)
{
foreach(split)
{
next READ if /\W/;$seen{$_}++;
}
} foreach (keys %seen){print "last:$_ is $seen{$_}\n";last if /dewm/;}
foreach (keys %seen){print "next:$_ is $seen{$_}\n";next if /dewm/;}
#foreach (keys %seen){print "redo:$_ is $seen{$_}\n";redo if /dewm/;} # cat 1.txt
# shsjsk 123
# dewm
# shsjsk 123
# shsjsk 123
# shsjsk 123
# cat 1.txt |perl t.pl
#last:shsjsk is 4
#next:shsjsk is 4
#next:123 is 4
#next:dewm is 1
#redo:dewm is 1
#…… my $zero = ;my $one = ;
if (($zero != )&&($one%$zero==)){print "get!\n"} # my %zoo;$zoo{'fish'}='cat',$zoo{'mouse'} ='dog';$zoo{'dog'}="";
my $animal=$zoo{'dog'}||'nobody';print "$animal\n";
my $animal_1=$zoo{'panda'}||'nobody';print "$animal_1\n";
my $animal_2=defined $zoo{'dog'}? '1':'nobody';print "$animal_2\n";
my $animal_3=$zoo{'dog'}//'nobody';print "$animal_3\n"; #nobody
#nobody
#1
# printf "%s\n",$animal_3//'nobody'; # my $m =;($m>)||print "$m\n"; # $m> or die "wrong judgement"; #wrong judgement at t.pl line 152, <> line 5.

最新文章

  1. SQL 数字分割的字符串
  2. shell流程控制
  3. label添加手势(触摸改变其背景颜色)
  4. Codeforces Round #355 (Div. 2) D. Vanya and Treasure dp+分块
  5. [Objective-c 基础 - 2.1] 封装
  6. [codevs3862]竞赛班的垃圾处理
  7. JVM参数配置大全
  8. Treasure Hunt - POJ 1066(线段相交判断)
  9. T-SQL 控制流语句
  10. hdu5976贪心乘法逆元
  11. C#对注册表的操作
  12. 文件进行MD5计算
  13. Docker最全教程之树莓派和Docker(十五)
  14. nginx--default_server定义规则及配置
  15. PHP如何实现在数据库随机获取几条记录
  16. 一些简单的ajax的特点,方法、属性。以及ajax的创建 请求
  17. spring学习(03)之bean实例化的三种方式
  18. LG4781 【模板】拉格朗日插值
  19. Jmeter(五)录制功能
  20. LeetCode OJ 144. Binary Tree Preorder Traversal

热门文章

  1. bzoj1415 NOI2005聪聪和可可
  2. 如何把控好Essay写作结构
  3. 吴裕雄--天生自然TensorFlow2教程:张量限幅
  4. spring boot输入数据校验(validation)
  5. 关于构造函数中的this()和super()
  6. 布局基础&lt;kotlin&gt;2,自定义控件(整理自网络)
  7. ADO多线程数据库查询
  8. SQL基础教程(第2版)第4章 数据更新:4-2 数据的删除(DELETE)
  9. Vmotion迁移要求
  10. linux下的hashpump安装