Grep to find item in Perl array

后端 未结 6 2059
名媛妹妹
名媛妹妹 2021-02-04 03:51

Every time I input something the code always tells me that it exists. But I know some of the inputs do not exist. What is wrong?

#!/usr/bin/perl

@array = <&g         


        
6条回答
  •  既然无缘
    2021-02-04 04:13

    In addition to what eugene and stevenl posted, you might encounter problems with using both <> and in one script: <> iterates through (=concatenating) all files given as command line arguments.

    However, should a user ever forget to specify a file on the command line, it will read from STDIN, and your code will wait forever on input

提交回复
热议问题