<dd id="sga4y"><optgroup id="sga4y"></optgroup></dd>
<nav id="sga4y"><code id="sga4y"></code></nav>
  • <optgroup id="sga4y"></optgroup>

    ?????? ?????

    ?????????????
    ?????????
    ???????
    ??????????
    ?]????????
    ?????????

    ?????????????
      ???open (filevar, filename)??????filevar???????????????????????????????????????filename??????????????????????????????????
        open(FILE1,"file1");
        open(FILE1, "/u/jqpublic/file1");
      ???????????????????????PERL?????????????????????????????????????????????????????????????????????????open(outfile,">outfile");??????????????????????????????????????open(appendfile, ">>appendfile")??????????????????????????/????????
      open??????????????????????????????????????????????????????????????????????
        if (open(MYFILE, "myfile")) {
        # here's what to do if the file opened successfully
        }
      ???????????????????
        unless (open (MYFILE, "file1")) {
        die ("cannot open input file file1\n");
        }
      ??????????????????????
        open (MYFILE, "file1") || die ("Could not open file");
      ???????????????close(MYFILE); ????????
    ?????????
      ???$line = <MYFILE>;???????????????????????$line???????????????????<STDIN>??????????????????????????????????
      ???@array = <MYFILE>;?????????????????????@array???????????(???????)?@array?????????
    ???????
      ??????
        open(OUTFILE, ">outfile");
        print OUTFILE ("Here is an output line.\n");
      ???STDOUT??STDERR???????????????????????????????????????
    ??????????
    1??????????????
      ?????-op expr???
        if (-e "/path/file1") {
        print STDERR ("File file1 exists.\n");
        }

    ????????????

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

    ????? ????? Perl???


    paper | appdir | ssv 97av