YUANya

导航

 
 1 #!/usr/bin/perl
 2 
 3 use strict;
 4 use warnings;
 5 
 6 foreach my $arg(@ARGV)
 7 {
 8     print "one is $arg\n";
 9 }
10 
11 # perl t.pl *.txt
12 # one is 1.txt
13 # one is 2.txt
14 
15 my @all_files = glob '*';print "@all_files\n";
16 
17 # perl t.pl *.txt
18 # 1.txt 2.txt check.pl t.pl
19 
20 my @all_txt = glob '*.txt';print "@all_txt\n";
21 
22 # perl t.pl *.txt
23 # 1.txt 2.txt
24 
25 my @all = </hwfssz5/ST_DIVERSITY/B10K/PUB/USER/yuanjingnan/linkdata/*>;
26 print "@all\n";
27 
28 #/XXX/1.txt /XXX/2.txt /XXX/check.pl /XXX/t.pl
29 
30 open TXT,'1.txt';
31 my $readhand = 'TXT';
32 my @line = readline $readhand;print "$line[4]";
33 
34 #·······11111@@##¥¥#……¥%&……%*……&*
35 
36 my $way = '/hwfssz5/ST_DIVERSITY/B10K/PUB/USER/yuanjingnan/linkdata/';opendir DIR,$way;
37 foreach my $file (readdir DIR)
38 {
39     next if $file =~ /^\./;print "my fiels has $way$file\n";
40 }
41 
42 #my fiels has /hwfssz5/ST_DIVERSITY/B10K/PUB/USER/yuanjingnan/linkdata/2.txt
43 #my fiels has /hwfssz5/ST_DIVERSITY/B10K/PUB/USER/yuanjingnan/linkdata/check.pl
44 #my fiels has /hwfssz5/ST_DIVERSITY/B10K/PUB/USER/yuanjingnan/linkdata/t.pl
45 #my fiels has /hwfssz5/ST_DIVERSITY/B10K/PUB/USER/yuanjingnan/linkdata/1.txt
46 
47 my $successful=unlink glob '3.*';print "$successful\n";
48 
49 #1
50 # ls
51 # 1.txt  2.txt  check.pl  t.pl
52 
53 foreach my $file (glob "*.txt")
54 {
55     my $newfile = $file;$newfile =~ s/\.txt$/.in/;
56     if (-e $newfile)
57     {
58         warn "this file exists\n";
59     }
60     else
61     {
62         print "successful!,$newfile\n"
63     }
64 }
65 
66 #successful!,1.in
67 #successful!,2.in
68 
69 my $link = -l 'egg';my $exit = -e 'egg';my $address = readlink 'egg';print "$link\t$exit\t$address\n";
70 
71 #my $perladd= readlink '/usr/bin/perl';print "$perladd\n";
72 
73 #1
74 #
75 #2.txt
76 
77 my $eight=345;my $ten= oct($eight);print "$ten\n";
78 
79 #229
80 
81 my $user = getpwnam 'yuanjingnan';print "$user\n";
82 
83 #1000092

 

posted on 2019-06-30 22:12  YUANya  阅读(155)  评论(0编辑  收藏  举报