????????????
| ?????? | ???? |
| -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);