????????????
| ?????? | ???? |
| -b | ???????õô |
| -c | ????????õô |
| -d | ?????? |
| -e | ?????? |
| -f | ?????????? |
| -g | ?????????setgid¦Ë |
| -k | ?????????sticky¦Ë |
| -l | ???????????? |
| -o | ?????§Ú???? |
| -p | ??????? |
| -r | ????? |
| -s | ????? |
| -t | ???????? |
| -u | ?????????setuid¦Ë |
| -w | ????§Õ |
| -x | ??????? |
| -z | ????????? |
| -A | ????¦Ç??????? |
| -B | ????????????? |
| -C | ????¦Ç????????inode????? |
| -M | ???????????? |
| -O | ??????????????????????? |
| -R | ?????§³??????????????? |
| -S | ????socket |
| -T | ?????????? |
| -W | ??????"?????????"??§Õ |
| -X | ??????"?????????"????? |
| ??????????????????????????userid????????????ID????????suid????????§¹???ID?? | |
????
unless (open(INFILE, "infile"))
{
die ("Input file infile cannot be
opened.\n");
}
if (-e "outfile") {
die ("Output file outfile already
exists.\n");
}
unless (open(OUTFILE,
">outfile")) {
die ("Output file outfile cannot be
opened.\n");
}
?????
open(INFILE, "infile")
&& !(-e "outfile") &&
open(OUTFILE, ">outfile") ||
die("Cannot open files\n");
?‰]?????§Ó???
??C?????PERL??§Õ›¥?????§Ó?????????@ARGV???????????????????????§Ó???????C????????$ARGV[0]????????????????????????????
$var = $ARGV[0]; # ?????????
$numargs = @ARGV; # ?????????
PERL?§µ?<>??????????????????@ARGV??????????????�a????????
1????PERL??????????¦Ï???<>???????$ARGV[0]?????????????
2????§Ø???shift(@ARGV); ????????@ARGV??????????????????????????????????????
3??<>???????????????????????§Ö??????§³?
4??????????????????????????
????
@ARGV = ("myfile1",
"myfile2"); #????????????§Ó??????
while ($line = <>) {
print ($line);
}
???????myfile1??myfile2??????????????
?????????
?¨®?????????????????????????????¨´??(ex:ls
> tempfile)???????open (MYPIPE, "| cat >hello");
???????????????MYPIPE????????????"cat
>hello"??????????cat???????????????????????????????open(MYPIPE,
">hello"); ?¨´????????????¡ê?
open (MESSAGE, "| mail dave");
print MESSAGE ("Hi, Dave! Your Perl
program sent this!\n");
close (MESSAGE);