/
perlfunc.pod
21518 lines (15382 loc) · 704 KB
/
perlfunc.pod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
=encoding euc-jp
=head1 NAME
X<function>
=begin original
perlfunc - Perl builtin functions
=end original
perlfunc - Perl 組み込み関数
=head1 DESCRIPTION
=begin original
The functions in this section can serve as terms in an expression.
They fall into two major categories: list operators and named unary
operators. These differ in their precedence relationship with a
following comma. (See the precedence table in L<perlop>.) List
operators take more than one argument, while unary operators can never
take more than one argument. Thus, a comma terminates the argument of
a unary operator, but merely separates the arguments of a list
operator. A unary operator generally provides scalar context to its
argument, while a list operator may provide either scalar or list
contexts for its arguments. If it does both, scalar arguments
come first and list argument follow, and there can only ever
be one such list argument. For instance,
L<C<splice>|/splice ARRAY,OFFSET,LENGTH,LIST> has three scalar arguments
followed by a list, whereas L<C<gethostbyname>|/gethostbyname NAME> has
four scalar arguments.
=end original
この節の関数は、式の中で項として使うことができます。
これらは、大きく二つに分けられます:
リスト演算子と名前付き単項演算子です。
これらの違いは、その後に出て来るコンマとの優先順位の関係にあります。
(L<perlop> の優先順位の表を参照してください。)
リスト演算子は 2 個以上の引数をとるのに対して、単項演算子が複数の引数を
とることはありません。
つまり、コンマは単項演算子の引数の終わりとなりますが、リスト演算子の
場合には、引数の区切りでしかありません。
単項演算子は一般に、引数に対してスカラコンテキストを与えるのに対して、
スカラ演算子の場合には、引数に対してスカラコンテキストを与える場合も、
リストコンテキストを与える場合もあります。
一つのリスト演算子が両方のコンテキストを与える場合には、スカラ引数が
いくつか並び、最後にリスト引数が一つ続きます;
そしてそのようなリスト引数は一つだけしかありません。
たとえば、L<C<splice>|/splice ARRAY,OFFSET,LENGTH,LIST> は三つのスカラ引数に
一つのリスト引数が続きます;
一方 L<C<gethostbyname>|/gethostbyname NAME> は四つのスカラ引数を持ちます。
=begin original
In the syntax descriptions that follow, list operators that expect a
list (and provide list context for elements of the list) are shown
with LIST as an argument. Such a list may consist of any combination
of scalar arguments or list values; the list values will be included
in the list as if each individual element were interpolated at that
point in the list, forming a longer single-dimensional list value.
Commas should separate literal elements of the LIST.
=end original
後に載せる構文記述では、リストをとり (そのリストの要素にリストコンテキストを
与える)リスト演算子は、引数として LIST をとるように書いています;
そのようなリストには、任意のスカラ引数の組み合わせやリスト値を
含めることができ、リスト値はリストの中に、個々の要素が展開されたように
埋め込まれます。
1 次元の長いリスト値が形成されることになります。
LIST のリテラルな要素は、コンマで区切られます。
=begin original
Any function in the list below may be used either with or without
parentheses around its arguments. (The syntax descriptions omit the
parentheses.) If you use parentheses, the simple but occasionally
surprising rule is this: It I<looks> like a function, therefore it I<is> a
function, and precedence doesn't matter. Otherwise it's a list
operator or unary operator, and precedence does matter. Whitespace
between the function and left parenthesis doesn't count, so sometimes
you need to be careful:
=end original
以下のリストの関数はすべて、引数の前後の括弧は省略可能となっています。
(構文記述では省略しています。)
括弧を使うときには、単純な、(しかし、ときには驚く結果となる規則が
適用できます:
I<関数に見える>ならば、I<それは関数>で、優先順位は関係ありません。
そう見えなければ、それはリスト演算子か単項演算子で、優先順位が関係します。
関数と開き括弧の間の空白は関係ありませんので、ときに
気を付けなければなりません:
print 1+2+4; # Prints 7.
print(1+2) + 4; # Prints 3.
print (1+2)+4; # Also prints 3!
print +(1+2)+4; # Prints 7.
print ((1+2)+4); # Prints 7.
=begin original
If you run Perl with the L<C<use warnings>|warnings> pragma, it can warn
you about this. For example, the third line above produces:
=end original
Perl に L<C<use warnings>|warnings> プラグマを付けて実行すれば、
こういったものには警告を出してくれます。
たとえば、上記の三つめは、以下のような警告が出ます:
print (...) interpreted as function at - line 1.
Useless use of integer addition in void context at - line 1.
=begin original
A few functions take no arguments at all, and therefore work as neither
unary nor list operators. These include such functions as
L<C<time>|/time> and L<C<endpwent>|/endpwent>. For example,
C<time+86_400> always means C<time() + 86_400>.
=end original
いくつかの関数は引数を全くとらないので、単項演算子としても
リスト演算子としても動作しません。
このような関数としては L<C<time>|/time> や L<C<endpwent>|/endpwent> が
あります。
例えば、C<time+86_400> は常に C<time() + 86_400> として扱われます。
=begin original
For functions that can be used in either a scalar or list context,
nonabortive failure is generally indicated in scalar context by
returning the undefined value, and in list context by returning the
empty list.
=end original
スカラコンテキストでも、リストコンテキストでも使える関数は、致命的でない
エラーを示すために、スカラコンテキストでは未定義値を返し、
リストコンテキストでは空リストを返します。
=begin original
Remember the following important rule: There is B<no rule> that relates
the behavior of an expression in list context to its behavior in scalar
context, or vice versa. It might do two totally different things.
Each operator and function decides which sort of value would be most
appropriate to return in scalar context. Some operators return the
length of the list that would have been returned in list context. Some
operators return the first value in the list. Some operators return the
last value in the list. Some operators return a count of successful
operations. In general, they do what you want, unless you want
consistency.
X<context>
=end original
以下に述べる重要なルールを忘れないで下さい: リストコンテキストでの
振る舞いとスカラコンテキストでの振る舞いの関係、あるいはその逆に
B<ルールはありません>。
2 つの全く異なったことがあります。
それぞれの演算子と関数は、スカラコンテキストでは、もっとも適切と
思われる値を返します。
リストコンテキストで返す時のリストの長さを返す演算子もあります。
リストの最初の値を返す演算子もあります。
リストの最後の値を返す演算子もあります。
成功した操作の数を返す演算子もあります。
一般的には、一貫性を求めない限り、こちらが求めることをします。
X<context>
=begin original
A named array in scalar context is quite different from what would at
first glance appear to be a list in scalar context. You can't get a list
like C<(1,2,3)> into being in scalar context, because the compiler knows
the context at compile time. It would generate the scalar comma operator
there, not the list concatenation version of the comma. That means it
was never a list to start with.
=end original
スカラコンテキストでの名前付き配列は、スカラコンテキストでのリストを
一目見たものとは全く違います。
コンパイラはコンパイル時にコンテキストを知っているので、
C<(1,2,3)> のようなリストをスカラコンテキストで得ることはできません。
これはスカラコンマ演算子を生成し、コンマのリスト結合版ではありません。
これは初めからリストであることはないことを意味します。
=begin original
In general, functions in Perl that serve as wrappers for system calls
("syscalls") of the same name (like L<chown(2)>, L<fork(2)>,
L<closedir(2)>, etc.) return true when they succeed and
L<C<undef>|/undef EXPR> otherwise, as is usually mentioned in the
descriptions below. This is different from the C interfaces, which
return C<-1> on failure. Exceptions to this rule include
L<C<wait>|/wait>, L<C<waitpid>|/waitpid PID,FLAGS>, and
L<C<syscall>|/syscall NUMBER, LIST>. System calls also set the special
L<C<$!>|perlvar/$!> variable on failure. Other functions do not, except
accidentally.
=end original
一般的に、同じ名前のシステムコールのラッパーとして動作する Perl の関数
(L<chown(2)>, L<fork(2)>, L<closedir(2)> など)は、以下に述べるように、
成功時に真を返し、そうでなければ L<C<undef>|/undef EXPR> を返します。
これは失敗時に C<-1> を返す C のインターフェースとは違います。
このルールの例外は L<C<wait>|/wait>, L<C<waitpid>|/waitpid PID,FLAGS>,
L<C<syscall>|/syscall NUMBER, LIST> です。
システムコールは失敗時に特殊変数 L<C<$!>|perlvar/$!> をセットします。
その他の関数は、事故を除いて、セットしません。
=begin original
Extension modules can also hook into the Perl parser to define new
kinds of keyword-headed expression. These may look like functions, but
may also look completely different. The syntax following the keyword
is defined entirely by the extension. If you are an implementor, see
L<perlapi/PL_keyword_plugin> for the mechanism. If you are using such
a module, see the module's documentation for details of the syntax that
it defines.
=end original
エクステンションモジュールは、新しい種類のキーワードが頭に付いた式を
定義するために Perl パーサをフックできます。
これらは関数のように見えるかもしれませんが、全く別物かもしれません。
キーワード以降の文法は完全にエクステンションによって定義されます。
もしあなたが実装者なら、この機構については L<perlapi/PL_keyword_plugin> を
参照してください。
もしあなたがそのようなモジュールを使っているなら、
定義されている文法の詳細についてはモジュールの文書を参照してください。
=head2 Perl Functions by Category
X<function>
(カテゴリ別の Perl 関数)
=begin original
Here are Perl's functions (including things that look like
functions, like some keywords and named operators)
arranged by category. Some functions appear in more
than one place. Any warnings, including those produced by
keywords, are described in L<perldiag> and L<warnings>.
=end original
以下に、カテゴリ別の関数(キーワードや名前付き演算子のような、
関数のように見えるものも含みます)を示します。
複数の場所に現れる関数もあります。
キーワードによって生成されるものを含む全ての警告は
L<perldiag> と L<warnings> に記述されています。
=over 4
=item Functions for SCALARs or strings
X<scalar> X<string> X<character>
(スカラや文字列のための関数)
=for Pod::Functions =String
L<C<chomp>|/chomp VARIABLE>, L<C<chop>|/chop VARIABLE>,
L<C<chr>|/chr NUMBER>, L<C<crypt>|/crypt PLAINTEXT,SALT>,
L<C<fc>|/fc EXPR>, L<C<hex>|/hex EXPR>,
L<C<index>|/index STR,SUBSTR,POSITION>, L<C<lc>|/lc EXPR>,
L<C<lcfirst>|/lcfirst EXPR>, L<C<length>|/length EXPR>,
L<C<oct>|/oct EXPR>, L<C<ord>|/ord EXPR>,
L<C<pack>|/pack TEMPLATE,LIST>,
L<C<qE<sol>E<sol>>|/qE<sol>STRINGE<sol>>,
L<C<qqE<sol>E<sol>>|/qqE<sol>STRINGE<sol>>, L<C<reverse>|/reverse LIST>,
L<C<rindex>|/rindex STR,SUBSTR,POSITION>,
L<C<sprintf>|/sprintf FORMAT, LIST>,
L<C<substr>|/substr EXPR,OFFSET,LENGTH,REPLACEMENT>,
L<C<trE<sol>E<sol>E<sol>>|/trE<sol>E<sol>E<sol>>, L<C<uc>|/uc EXPR>,
L<C<ucfirst>|/ucfirst EXPR>,
L<C<yE<sol>E<sol>E<sol>>|/yE<sol>E<sol>E<sol>>
=begin original
L<C<fc>|/fc EXPR> is available only if the
L<C<"fc"> feature|feature/The 'fc' feature> is enabled or if it is
prefixed with C<CORE::>. The
L<C<"fc"> feature|feature/The 'fc' feature> is enabled automatically
with a C<use v5.16> (or higher) declaration in the current scope.
=end original
L<C<fc>|/fc EXPR> は L<C<"fc"> 機能|feature/The 'fc' feature> が有効か
C<CORE::> が前置されたときにのみ利用可能です。
L<C<"fc"> 機能|feature/The 'fc' feature> は現在のスコープで
C<use v5.16> (またはそれ以上) が宣言されると自動的に有効になります。
=item Regular expressions and pattern matching
X<regular expression> X<regex> X<regexp>
(正規表現とパターンマッチング)
=for Pod::Functions =Regexp
L<C<mE<sol>E<sol>>|/mE<sol>E<sol>>, L<C<pos>|/pos SCALAR>,
L<C<qrE<sol>E<sol>>|/qrE<sol>STRINGE<sol>>,
L<C<quotemeta>|/quotemeta EXPR>,
L<C<sE<sol>E<sol>E<sol>>|/sE<sol>E<sol>E<sol>>,
L<C<split>|/split E<sol>PATTERNE<sol>,EXPR,LIMIT>,
L<C<study>|/study SCALAR>
=item Numeric functions
X<numeric> X<number> X<trigonometric> X<trigonometry>
(数値関数)
=for Pod::Functions =Math
L<C<abs>|/abs VALUE>, L<C<atan2>|/atan2 Y,X>, L<C<cos>|/cos EXPR>,
L<C<exp>|/exp EXPR>, L<C<hex>|/hex EXPR>, L<C<int>|/int EXPR>,
L<C<log>|/log EXPR>, L<C<oct>|/oct EXPR>, L<C<rand>|/rand EXPR>,
L<C<sin>|/sin EXPR>, L<C<sqrt>|/sqrt EXPR>, L<C<srand>|/srand EXPR>
=item Functions for real @ARRAYs
X<array>
(実配列のための関数)
=for Pod::Functions =ARRAY
L<C<each>|/each HASH>, L<C<keys>|/keys HASH>, L<C<pop>|/pop ARRAY>,
L<C<push>|/push ARRAY,LIST>, L<C<shift>|/shift ARRAY>,
L<C<splice>|/splice ARRAY,OFFSET,LENGTH,LIST>,
L<C<unshift>|/unshift ARRAY,LIST>, L<C<values>|/values HASH>
=item Functions for list data
X<list>
(リストデータのための関数)
=for Pod::Functions =LIST
L<C<grep>|/grep BLOCK LIST>, L<C<join>|/join EXPR,LIST>,
L<C<map>|/map BLOCK LIST>, L<C<qwE<sol>E<sol>>|/qwE<sol>STRINGE<sol>>,
L<C<reverse>|/reverse LIST>, L<C<sort>|/sort SUBNAME LIST>,
L<C<unpack>|/unpack TEMPLATE,EXPR>
=item Functions for real %HASHes
X<hash>
(実ハッシュのための関数)
=for Pod::Functions =HASH
L<C<delete>|/delete EXPR>, L<C<each>|/each HASH>,
L<C<exists>|/exists EXPR>, L<C<keys>|/keys HASH>,
L<C<values>|/values HASH>
=item Input and output functions
X<I/O> X<input> X<output> X<dbm>
(入出力関数)
=for Pod::Functions =I/O
L<C<binmode>|/binmode FILEHANDLE, LAYER>, L<C<close>|/close FILEHANDLE>,
L<C<closedir>|/closedir DIRHANDLE>, L<C<dbmclose>|/dbmclose HASH>,
L<C<dbmopen>|/dbmopen HASH,DBNAME,MASK>, L<C<die>|/die LIST>,
L<C<eof>|/eof FILEHANDLE>, L<C<fileno>|/fileno FILEHANDLE>,
L<C<flock>|/flock FILEHANDLE,OPERATION>, L<C<format>|/format>,
L<C<getc>|/getc FILEHANDLE>, L<C<print>|/print FILEHANDLE LIST>,
L<C<printf>|/printf FILEHANDLE FORMAT, LIST>,
L<C<read>|/read FILEHANDLE,SCALAR,LENGTH,OFFSET>,
L<C<readdir>|/readdir DIRHANDLE>, L<C<readline>|/readline EXPR>,
L<C<rewinddir>|/rewinddir DIRHANDLE>, L<C<say>|/say FILEHANDLE LIST>,
L<C<seek>|/seek FILEHANDLE,POSITION,WHENCE>,
L<C<seekdir>|/seekdir DIRHANDLE,POS>,
L<C<select>|/select RBITS,WBITS,EBITS,TIMEOUT>,
L<C<syscall>|/syscall NUMBER, LIST>,
L<C<sysread>|/sysread FILEHANDLE,SCALAR,LENGTH,OFFSET>,
L<C<sysseek>|/sysseek FILEHANDLE,POSITION,WHENCE>,
L<C<syswrite>|/syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET>,
L<C<tell>|/tell FILEHANDLE>, L<C<telldir>|/telldir DIRHANDLE>,
L<C<truncate>|/truncate FILEHANDLE,LENGTH>, L<C<warn>|/warn LIST>,
L<C<write>|/write FILEHANDLE>
=begin original
L<C<say>|/say FILEHANDLE LIST> is available only if the
L<C<"say"> feature|feature/The 'say' feature> is enabled or if it is
prefixed with C<CORE::>. The
L<C<"say"> feature|feature/The 'say' feature> is enabled automatically
with a C<use v5.10> (or higher) declaration in the current scope.
=end original
L<C<say>|/say FILEHANDLE LIST> は
L<C<"say"> 機能|feature/The 'say' feature> が有効か C<CORE::> が
前置されたときにのみ利用可能です。
L<C<"say"> 機能|feature/The 'say' feature> は現在のスコープで
C<use v5.10> (またはそれ以上) が宣言されると自動的に有効になります。
=item Functions for fixed-length data or records
(固定長データやレコードのための関数)
=for Pod::Functions =Binary
L<C<pack>|/pack TEMPLATE,LIST>,
L<C<read>|/read FILEHANDLE,SCALAR,LENGTH,OFFSET>,
L<C<syscall>|/syscall NUMBER, LIST>,
L<C<sysread>|/sysread FILEHANDLE,SCALAR,LENGTH,OFFSET>,
L<C<sysseek>|/sysseek FILEHANDLE,POSITION,WHENCE>,
L<C<syswrite>|/syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET>,
L<C<unpack>|/unpack TEMPLATE,EXPR>, L<C<vec>|/vec EXPR,OFFSET,BITS>
=item Functions for filehandles, files, or directories
X<file> X<filehandle> X<directory> X<pipe> X<link> X<symlink>
(ファイルハンドル、ファイル、ディレクトリのための関数)
=for Pod::Functions =File
L<C<-I<X>>|/-X FILEHANDLE>, L<C<chdir>|/chdir EXPR>,
L<C<chmod>|/chmod LIST>, L<C<chown>|/chown LIST>,
L<C<chroot>|/chroot FILENAME>,
L<C<fcntl>|/fcntl FILEHANDLE,FUNCTION,SCALAR>, L<C<glob>|/glob EXPR>,
L<C<ioctl>|/ioctl FILEHANDLE,FUNCTION,SCALAR>,
L<C<link>|/link OLDFILE,NEWFILE>, L<C<lstat>|/lstat FILEHANDLE>,
L<C<mkdir>|/mkdir FILENAME,MODE>, L<C<open>|/open FILEHANDLE,EXPR>,
L<C<opendir>|/opendir DIRHANDLE,EXPR>, L<C<readlink>|/readlink EXPR>,
L<C<rename>|/rename OLDNAME,NEWNAME>, L<C<rmdir>|/rmdir FILENAME>,
L<C<select>|/select FILEHANDLE>, L<C<stat>|/stat FILEHANDLE>,
L<C<symlink>|/symlink OLDFILE,NEWFILE>,
L<C<sysopen>|/sysopen FILEHANDLE,FILENAME,MODE>,
L<C<umask>|/umask EXPR>, L<C<unlink>|/unlink LIST>,
L<C<utime>|/utime LIST>
=item Keywords related to the control flow of your Perl program
X<control flow>
(プログラムの流れを制御することに関連するキーワード)
=for Pod::Functions =Flow
L<C<break>|/break>, L<C<caller>|/caller EXPR>,
L<C<continue>|/continue BLOCK>, L<C<die>|/die LIST>, L<C<do>|/do BLOCK>,
L<C<dump>|/dump LABEL>, L<C<eval>|/eval EXPR>,
L<C<evalbytes>|/evalbytes EXPR>, L<C<exit>|/exit EXPR>,
L<C<__FILE__>|/__FILE__>, L<C<goto>|/goto LABEL>,
L<C<last>|/last LABEL>, L<C<__LINE__>|/__LINE__>,
L<C<next>|/next LABEL>, L<C<__PACKAGE__>|/__PACKAGE__>,
L<C<redo>|/redo LABEL>, L<C<return>|/return EXPR>,
L<C<sub>|/sub NAME BLOCK>, L<C<__SUB__>|/__SUB__>,
L<C<wantarray>|/wantarray>
=begin original
L<C<break>|/break> is available only if you enable the experimental
L<C<"switch"> feature|feature/The 'switch' feature> or use the C<CORE::>
prefix. The L<C<"switch"> feature|feature/The 'switch' feature> also
enables the C<default>, C<given> and C<when> statements, which are
documented in L<perlsyn/"Switch Statements">.
The L<C<"switch"> feature|feature/The 'switch' feature> is enabled
automatically with a C<use v5.10> (or higher) declaration in the current
scope. In Perl v5.14 and earlier, L<C<continue>|/continue BLOCK>
required the L<C<"switch"> feature|feature/The 'switch' feature>, like
the other keywords.
=end original
L<C<break>|/break> は、実験的な
L<C<"switch"> 機能|feature/The 'switch' feature> が有効か C<CORE::> 接頭辞を
使ったときにのみ利用可能です。
L<C<"switch"> 機能|feature/The 'switch' feature> は、
L<perlsyn/"Switch Statements"> で文書化されている
C<default>, C<given>, C<when> 文も有効にします。
L<C<"switch"> 機能|feature/The 'switch' feature> は、現在のスコープで
C<use v5.10> (またはそれ以上) 宣言があると自動的に有効になります。
Perl v5.14 以前では、L<C<continue>|/continue BLOCK> は他のキーワードと同様に
L<C<"switch"> 機能|feature/The 'switch' feature> が必要です。
=begin original
L<C<evalbytes>|/evalbytes EXPR> is only available with the
L<C<"evalbytes"> feature|feature/The 'unicode_eval' and 'evalbytes' features>
(see L<feature>) or if prefixed with C<CORE::>. L<C<__SUB__>|/__SUB__>
is only available with the
L<C<"current_sub"> feature|feature/The 'current_sub' feature> or if
prefixed with C<CORE::>. Both the
L<C<"evalbytes">|feature/The 'unicode_eval' and 'evalbytes' features>
and L<C<"current_sub">|feature/The 'current_sub' feature> features are
enabled automatically with a C<use v5.16> (or higher) declaration in the
current scope.
=end original
L<C<evalbytes>|/evalbytes EXPR> は
L<C<"evalbytes"> 機能|feature/The 'unicode_eval' and 'evalbytes' features>
(L<feature> 参照) が有効か C<CORE::> が前置されたときにのみ利用可能です。
L<C<__SUB__>|/__SUB__> は
L<C<"current_sub"> 機能|feature/The 'current_sub' feature> が有効か
C<CORE::> が前置されたときにのみ利用可能です。
L<C<"evalbytes">|feature/The 'unicode_eval' and 'evalbytes' features> と
L<C<"current_sub">|feature/The 'current_sub' feature> の両方の機能は
現在のスコープで
C<use v5.16> (またはそれ以上) が宣言されると自動的に有効になります。
=item Keywords related to scoping
(スコープに関するキーワード)
=for Pod::Functions =Namespace
L<C<caller>|/caller EXPR>, L<C<import>|/import LIST>,
L<C<local>|/local EXPR>, L<C<my>|/my VARLIST>, L<C<our>|/our VARLIST>,
L<C<package>|/package NAMESPACE>, L<C<state>|/state VARLIST>,
L<C<use>|/use Module VERSION LIST>
=begin original
L<C<state>|/state VARLIST> is available only if the
L<C<"state"> feature|feature/The 'state' feature> is enabled or if it is
prefixed with C<CORE::>. The
L<C<"state"> feature|feature/The 'state' feature> is enabled
automatically with a C<use v5.10> (or higher) declaration in the current
scope.
=end original
L<C<state>|/state VARLIST> は
L<C<"state"> 機能|feature/The 'state' feature> が有効か C<CORE::> を
前置した場合にのみ利用可能です。
L<C<"state"> 機能|feature/The 'state' feature> は現在のスコープで
C<use v5.10> (またはそれ以上) を宣言した場合自動的に有効になります。
=item Miscellaneous functions
(さまざまな関数)
=for Pod::Functions =Misc
L<C<defined>|/defined EXPR>, L<C<formline>|/formline PICTURE,LIST>,
L<C<lock>|/lock THING>, L<C<prototype>|/prototype FUNCTION>,
L<C<reset>|/reset EXPR>, L<C<scalar>|/scalar EXPR>,
L<C<undef>|/undef EXPR>
=item Functions for processes and process groups
X<process> X<pid> X<process id>
(プロセスとプロセスグループのための関数)
=for Pod::Functions =Process
L<C<alarm>|/alarm SECONDS>, L<C<exec>|/exec LIST>, L<C<fork>|/fork>,
L<C<getpgrp>|/getpgrp PID>, L<C<getppid>|/getppid>,
L<C<getpriority>|/getpriority WHICH,WHO>, L<C<kill>|/kill SIGNAL, LIST>,
L<C<pipe>|/pipe READHANDLE,WRITEHANDLE>,
L<C<qxE<sol>E<sol>>|/qxE<sol>STRINGE<sol>>,
L<C<readpipe>|/readpipe EXPR>, L<C<setpgrp>|/setpgrp PID,PGRP>,
L<C<setpriority>|/setpriority WHICH,WHO,PRIORITY>,
L<C<sleep>|/sleep EXPR>, L<C<system>|/system LIST>, L<C<times>|/times>,
L<C<wait>|/wait>, L<C<waitpid>|/waitpid PID,FLAGS>
=item Keywords related to Perl modules
X<module>
(Perl モジュールに関するキーワード)
=for Pod::Functions =Modules
L<C<do>|/do EXPR>, L<C<import>|/import LIST>,
L<C<no>|/no MODULE VERSION LIST>, L<C<package>|/package NAMESPACE>,
L<C<require>|/require VERSION>, L<C<use>|/use Module VERSION LIST>
=item Keywords related to classes and object-orientation
X<object> X<class> X<package>
(クラスとオブジェクト指向に関するキーワード)
=for Pod::Functions =Objects
L<C<bless>|/bless REF,CLASSNAME>, L<C<dbmclose>|/dbmclose HASH>,
L<C<dbmopen>|/dbmopen HASH,DBNAME,MASK>,
L<C<package>|/package NAMESPACE>, L<C<ref>|/ref EXPR>,
L<C<tie>|/tie VARIABLE,CLASSNAME,LIST>, L<C<tied>|/tied VARIABLE>,
L<C<untie>|/untie VARIABLE>, L<C<use>|/use Module VERSION LIST>
=item Low-level socket functions
X<socket> X<sock>
(低レベルソケット関数)
=for Pod::Functions =Socket
L<C<accept>|/accept NEWSOCKET,GENERICSOCKET>,
L<C<bind>|/bind SOCKET,NAME>, L<C<connect>|/connect SOCKET,NAME>,
L<C<getpeername>|/getpeername SOCKET>,
L<C<getsockname>|/getsockname SOCKET>,
L<C<getsockopt>|/getsockopt SOCKET,LEVEL,OPTNAME>,
L<C<listen>|/listen SOCKET,QUEUESIZE>,
L<C<recv>|/recv SOCKET,SCALAR,LENGTH,FLAGS>,
L<C<send>|/send SOCKET,MSG,FLAGS,TO>,
L<C<setsockopt>|/setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL>,
L<C<shutdown>|/shutdown SOCKET,HOW>,
L<C<socket>|/socket SOCKET,DOMAIN,TYPE,PROTOCOL>,
L<C<socketpair>|/socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL>
=item System V interprocess communication functions
X<IPC> X<System V> X<semaphore> X<shared memory> X<memory> X<message>
(System V プロセス間通信関数)
=for Pod::Functions =SysV
L<C<msgctl>|/msgctl ID,CMD,ARG>, L<C<msgget>|/msgget KEY,FLAGS>,
L<C<msgrcv>|/msgrcv ID,VAR,SIZE,TYPE,FLAGS>,
L<C<msgsnd>|/msgsnd ID,MSG,FLAGS>,
L<C<semctl>|/semctl ID,SEMNUM,CMD,ARG>,
L<C<semget>|/semget KEY,NSEMS,FLAGS>, L<C<semop>|/semop KEY,OPSTRING>,
L<C<shmctl>|/shmctl ID,CMD,ARG>, L<C<shmget>|/shmget KEY,SIZE,FLAGS>,
L<C<shmread>|/shmread ID,VAR,POS,SIZE>,
L<C<shmwrite>|/shmwrite ID,STRING,POS,SIZE>
=item Fetching user and group info
X<user> X<group> X<password> X<uid> X<gid> X<passwd> X</etc/passwd>
(ユーザーとグループの情報取得)
=for Pod::Functions =User
L<C<endgrent>|/endgrent>, L<C<endhostent>|/endhostent>,
L<C<endnetent>|/endnetent>, L<C<endpwent>|/endpwent>,
L<C<getgrent>|/getgrent>, L<C<getgrgid>|/getgrgid GID>,
L<C<getgrnam>|/getgrnam NAME>, L<C<getlogin>|/getlogin>,
L<C<getpwent>|/getpwent>, L<C<getpwnam>|/getpwnam NAME>,
L<C<getpwuid>|/getpwuid UID>, L<C<setgrent>|/setgrent>,
L<C<setpwent>|/setpwent>
=item Fetching network info
X<network> X<protocol> X<host> X<hostname> X<IP> X<address> X<service>
(ネットワーク情報取得)
=for Pod::Functions =Network
L<C<endprotoent>|/endprotoent>, L<C<endservent>|/endservent>,
L<C<gethostbyaddr>|/gethostbyaddr ADDR,ADDRTYPE>,
L<C<gethostbyname>|/gethostbyname NAME>, L<C<gethostent>|/gethostent>,
L<C<getnetbyaddr>|/getnetbyaddr ADDR,ADDRTYPE>,
L<C<getnetbyname>|/getnetbyname NAME>, L<C<getnetent>|/getnetent>,
L<C<getprotobyname>|/getprotobyname NAME>,
L<C<getprotobynumber>|/getprotobynumber NUMBER>,
L<C<getprotoent>|/getprotoent>,
L<C<getservbyname>|/getservbyname NAME,PROTO>,
L<C<getservbyport>|/getservbyport PORT,PROTO>,
L<C<getservent>|/getservent>, L<C<sethostent>|/sethostent STAYOPEN>,
L<C<setnetent>|/setnetent STAYOPEN>,
L<C<setprotoent>|/setprotoent STAYOPEN>,
L<C<setservent>|/setservent STAYOPEN>
=item Time-related functions
X<time> X<date>
(時刻に関する関数)
=for Pod::Functions =Time
L<C<gmtime>|/gmtime EXPR>, L<C<localtime>|/localtime EXPR>,
L<C<time>|/time>, L<C<times>|/times>
=item Non-function keywords
=for Pod::Functions =!Non-functions
C<and>, C<AUTOLOAD>, C<BEGIN>, C<CHECK>, C<cmp>, C<CORE>, C<__DATA__>,
C<default>, C<DESTROY>, C<else>, C<elseif>, C<elsif>, C<END>, C<__END__>,
C<eq>, C<for>, C<foreach>, C<ge>, C<given>, C<gt>, C<if>, C<INIT>, C<le>,
C<lt>, C<ne>, C<not>, C<or>, C<UNITCHECK>, C<unless>, C<until>, C<when>,
C<while>, C<x>, C<xor>
=back
=head2 Portability
X<portability> X<Unix> X<portable>
(移植性)
=begin original
Perl was born in Unix and can therefore access all common Unix
system calls. In non-Unix environments, the functionality of some
Unix system calls may not be available or details of the available
functionality may differ slightly. The Perl functions affected
by this are:
=end original
Perl は Unix 環境で生まれたので、全ての共通する Unix システムコールに
アクセスします。
非 Unix 環境では、いくつかの Unix システムコールの機能が使えなかったり、
使える機能の詳細が多少異なったりします。
これによる影響を受ける Perl 関数は以下のものです:
L<C<-I<X>>|/-X FILEHANDLE>, L<C<binmode>|/binmode FILEHANDLE, LAYER>,
L<C<chmod>|/chmod LIST>, L<C<chown>|/chown LIST>,
L<C<chroot>|/chroot FILENAME>, L<C<crypt>|/crypt PLAINTEXT,SALT>,
L<C<dbmclose>|/dbmclose HASH>, L<C<dbmopen>|/dbmopen HASH,DBNAME,MASK>,
L<C<dump>|/dump LABEL>, L<C<endgrent>|/endgrent>,
L<C<endhostent>|/endhostent>, L<C<endnetent>|/endnetent>,
L<C<endprotoent>|/endprotoent>, L<C<endpwent>|/endpwent>,
L<C<endservent>|/endservent>, L<C<exec>|/exec LIST>,
L<C<fcntl>|/fcntl FILEHANDLE,FUNCTION,SCALAR>,
L<C<flock>|/flock FILEHANDLE,OPERATION>, L<C<fork>|/fork>,
L<C<getgrent>|/getgrent>, L<C<getgrgid>|/getgrgid GID>,
L<C<gethostbyname>|/gethostbyname NAME>, L<C<gethostent>|/gethostent>,
L<C<getlogin>|/getlogin>,
L<C<getnetbyaddr>|/getnetbyaddr ADDR,ADDRTYPE>,
L<C<getnetbyname>|/getnetbyname NAME>, L<C<getnetent>|/getnetent>,
L<C<getppid>|/getppid>, L<C<getpgrp>|/getpgrp PID>,
L<C<getpriority>|/getpriority WHICH,WHO>,
L<C<getprotobynumber>|/getprotobynumber NUMBER>,
L<C<getprotoent>|/getprotoent>, L<C<getpwent>|/getpwent>,
L<C<getpwnam>|/getpwnam NAME>, L<C<getpwuid>|/getpwuid UID>,
L<C<getservbyport>|/getservbyport PORT,PROTO>,
L<C<getservent>|/getservent>,
L<C<getsockopt>|/getsockopt SOCKET,LEVEL,OPTNAME>,
L<C<glob>|/glob EXPR>, L<C<ioctl>|/ioctl FILEHANDLE,FUNCTION,SCALAR>,
L<C<kill>|/kill SIGNAL, LIST>, L<C<link>|/link OLDFILE,NEWFILE>,
L<C<lstat>|/lstat FILEHANDLE>, L<C<msgctl>|/msgctl ID,CMD,ARG>,
L<C<msgget>|/msgget KEY,FLAGS>,
L<C<msgrcv>|/msgrcv ID,VAR,SIZE,TYPE,FLAGS>,
L<C<msgsnd>|/msgsnd ID,MSG,FLAGS>, L<C<open>|/open FILEHANDLE,EXPR>,
L<C<pipe>|/pipe READHANDLE,WRITEHANDLE>, L<C<readlink>|/readlink EXPR>,
L<C<rename>|/rename OLDNAME,NEWNAME>,
L<C<select>|/select RBITS,WBITS,EBITS,TIMEOUT>,
L<C<semctl>|/semctl ID,SEMNUM,CMD,ARG>,
L<C<semget>|/semget KEY,NSEMS,FLAGS>, L<C<semop>|/semop KEY,OPSTRING>,
L<C<setgrent>|/setgrent>, L<C<sethostent>|/sethostent STAYOPEN>,
L<C<setnetent>|/setnetent STAYOPEN>, L<C<setpgrp>|/setpgrp PID,PGRP>,
L<C<setpriority>|/setpriority WHICH,WHO,PRIORITY>,
L<C<setprotoent>|/setprotoent STAYOPEN>, L<C<setpwent>|/setpwent>,
L<C<setservent>|/setservent STAYOPEN>,
L<C<setsockopt>|/setsockopt SOCKET,LEVEL,OPTNAME,OPTVAL>,
L<C<shmctl>|/shmctl ID,CMD,ARG>, L<C<shmget>|/shmget KEY,SIZE,FLAGS>,
L<C<shmread>|/shmread ID,VAR,POS,SIZE>,
L<C<shmwrite>|/shmwrite ID,STRING,POS,SIZE>,
L<C<socket>|/socket SOCKET,DOMAIN,TYPE,PROTOCOL>,
L<C<socketpair>|/socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL>,
L<C<stat>|/stat FILEHANDLE>, L<C<symlink>|/symlink OLDFILE,NEWFILE>,
L<C<syscall>|/syscall NUMBER, LIST>,
L<C<sysopen>|/sysopen FILEHANDLE,FILENAME,MODE>,
L<C<system>|/system LIST>, L<C<times>|/times>,
L<C<truncate>|/truncate FILEHANDLE,LENGTH>, L<C<umask>|/umask EXPR>,
L<C<unlink>|/unlink LIST>, L<C<utime>|/utime LIST>, L<C<wait>|/wait>,
L<C<waitpid>|/waitpid PID,FLAGS>
=begin original
For more information about the portability of these functions, see
L<perlport> and other available platform-specific documentation.
=end original
これらの関数の移植性に関するさらなる情報については、
L<perlport> とその他のプラットホーム固有のドキュメントを参照してください。
=head2 Alphabetical Listing of Perl Functions
=over
=item -X FILEHANDLE
X<-r>X<-w>X<-x>X<-o>X<-R>X<-W>X<-X>X<-O>X<-e>X<-z>X<-s>X<-f>X<-d>X<-l>X<-p>
X<-S>X<-b>X<-c>X<-t>X<-u>X<-g>X<-k>X<-T>X<-B>X<-M>X<-A>X<-C>
=item -X EXPR
=item -X DIRHANDLE
=item -X
=for Pod::Functions a file test (-r, -x, etc)
=begin original
A file test, where X is one of the letters listed below. This unary
operator takes one argument, either a filename, a filehandle, or a dirhandle,
and tests the associated file to see if something is true about it. If the
argument is omitted, tests L<C<$_>|perlvar/$_>, except for C<-t>, which
tests STDIN. Unless otherwise documented, it returns C<1> for true and
C<''> for false. If the file doesn't exist or can't be examined, it
returns L<C<undef>|/undef EXPR> and sets L<C<$!>|perlvar/$!> (errno).
With the exception of the C<-l> test they all follow symbolic links
because they use C<stat()> and not C<lstat()> (so dangling symlinks can't
be examined and will therefore report failure).
=end original
X は以下にあげる文字で、ファイルテストを行ないます。
この単項演算子は、ファイル名かファイルハンドルを唯一の引数として動作し、
「あること」について真であるか否かを判定した結果を返します。
引数が省略されると、C<-t> では STDIN を調べますが、その他は
L<C<$_>|perlvar/$_> を調べます。
特に記述されていなければ、真として C<1> を返し、偽として C<''> を返します。
ファイルが存在しないか、テスト出来なければ、L<C<undef>|/undef EXPR> を返し、
L<C<$!>|perlvar/$!> (errno) を設定します。
C<-l> テストを例外として、これら全てはシンボリックリンクに従います;
C<lstat()> ではなく C<stat()> を使っているからです
(従って壊れたシンボリックリンクは検査されず、失敗が報告されます)。
=begin original
Despite the funny names, precedence is the same as any other named unary
operator. The operator may be any of:
=end original
みかけは変わっていますが、優先順位は名前付き単項演算子と同じで、
他の単項演算子と同じく、引数を括弧で括ることもできます。
演算子には以下のものがあります:
=begin original
-r File is readable by effective uid/gid.
-w File is writable by effective uid/gid.
-x File is executable by effective uid/gid.
-o File is owned by effective uid.
=end original
-r ファイルが実効 uid/gid で読み出し可。
-w ファイルが実効 uid/gid で書き込み可。
-x ファイルが実効 uid/gid で実行可。
-o ファイルが実効 uid の所有物。
=begin original
-R File is readable by real uid/gid.
-W File is writable by real uid/gid.
-X File is executable by real uid/gid.
-O File is owned by real uid.
=end original
-R ファイルが実 uid/gid で読み出し可。
-W ファイルが実 uid/gid で書き込み可。
-X ファイルが実 uid/gid で実行可。
-O ファイルが実 uid の所有物。
=begin original
-e File exists.
-z File has zero size (is empty).
-s File has nonzero size (returns size in bytes).
=end original
-e ファイルが存在する。
-z ファイルの大きさがゼロ(空)。
-s ファイルの大きさがゼロ以外 (バイト単位での大きさを返す)。
=begin original
-f File is a plain file.
-d File is a directory.
-l File is a symbolic link (false if symlinks aren't
supported by the file system).
-p File is a named pipe (FIFO), or Filehandle is a pipe.
-S File is a socket.
-b File is a block special file.
-c File is a character special file.
-t Filehandle is opened to a tty.
=end original
-f ファイルは通常ファイル。
-d ファイルはディレクトリ。
-l ファイルはシンボリックリンク(ファイルシステムが非対応なら偽)。
-p ファイルは名前付きパイプ (FIFO) またはファイルハンドルはパイプ。
-S ファイルはソケット。
-b ファイルはブロック特殊ファイル。
-c ファイルはキャラクタ特殊ファイル。
-t ファイルハンドルは tty にオープンされている。
=begin original
-u File has setuid bit set.
-g File has setgid bit set.
-k File has sticky bit set.
=end original
-u ファイルの setuid ビットがセットされている。
-g ファイルの setgid ビットがセットされている。
-k ファイルの sticky ビットがセットされている。
=begin original
-T File is an ASCII or UTF-8 text file (heuristic guess).
-B File is a "binary" file (opposite of -T).
=end original
-T ファイルは ASCII または UTF-8 テキストファイル (発見的に推測します)。
-B ファイルは「バイナリ」ファイル (-T の反対)。
=begin original
-M Script start time minus file modification time, in days.
-A Same for access time.
-C Same for inode change time (Unix, may differ for other
platforms)
=end original
-M スクリプト実行開始時刻からファイル修正時刻を引いたもの(日単位)。
-A 同様にアクセスがあってからの日数。
-C 同様に(Unix では) inode が変更されてからの日数(それ以外の
プラットフォームでは違うかもしれません)。
=begin original
Example:
=end original
例:
while (<>) {
chomp;
next unless -f $_; # ignore specials
#...
}
=begin original
Note that C<-s/a/b/> does not do a negated substitution. Saying
C<-exp($foo)> still works as expected, however: only single letters
following a minus are interpreted as file tests.
=end original
C<-s/a/b> は、置換演算 (s///) の符号反転ではありません。
しかし、C<-exp($foo)> は期待どおりに動作します; しかし、マイナス記号の後に
英字が 1 字続くときにのみ、ファイルテストと解釈されます。
=begin original
These operators are exempt from the "looks like a function rule" described
above. That is, an opening parenthesis after the operator does not affect
how much of the following code constitutes the argument. Put the opening
parentheses before the operator to separate it from code that follows (this
applies only to operators with higher precedence than unary operators, of
course):
=end original
これらの演算子は上述の「関数のように見えるルール」から免除されます。
つまり、演算子の後の開きかっこは、引き続くコードのどこまでが引数を
構成するかに影響を与えません。
演算子を引き続くコードから分離するには、演算子の前に開きかっこを
置いてください (これはもちろん、単項演算子より高い優先順位を持つ
演算子にのみ適用されます):
-s($file) + 1024 # probably wrong; same as -s($file + 1024)
(-s $file) + 1024 # correct
=begin original
The interpretation of the file permission operators C<-r>, C<-R>,
C<-w>, C<-W>, C<-x>, and C<-X> is by default based solely on the mode
of the file and the uids and gids of the user. There may be other
reasons you can't actually read, write, or execute the file: for
example network filesystem access controls, ACLs (access control lists),
read-only filesystems, and unrecognized executable formats. Note
that the use of these six specific operators to verify if some operation
is possible is usually a mistake, because it may be open to race
conditions.
=end original
ファイルのパーミッション演算子 C<-r>, C<-R>, C<-w>, C<-W>, C<-x>,
C<-X> の解釈は、ファイルのモードとユーザの実効/実 uid と
実効/実 gid のみから判断されます。
実際にファイルが読めたり、書けたり、実行できたりするためには、
別の条件が必要かもしれません:
例えば、ネットワークファイルシステムアクセスコントロール、
ACL(アクセスコントロールリスト)、読み込み専用ファイルシステム、
認識できない実行ファイルフォーマット、などです。
これらの 6 つの演算子を、特定の操作が可能かどうかを確認するために使うのは
通常は誤りであることに注意してください; なぜなら、これらは競合条件を
招きやすいからです。
=begin original
Also note that, for the superuser on the local filesystems, the C<-r>,
C<-R>, C<-w>, and C<-W> tests always return 1, and C<-x> and C<-X> return 1
if any execute bit is set in the mode. Scripts run by the superuser
may thus need to do a L<C<stat>|/stat FILEHANDLE> to determine the