开发者

Perl, open and read [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in开发者_如何学Go its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

how to get directory content, and read file in it ?

But i can't use commands and operators that included in this regexp:

/system|[)(\/}{`;,!\\*_]|open|exec|eval/

I think it's a very hard task and i don't known how to make it, please help me.


If this is homework, it's one of the worse questions I've seen, so I'm assuming it's not.

perl -E'say for glob chr 42'

or

perl -e'print qx^ ls ^'

or

perl -MFile::Find::Rule -MMIME::Base64 -E's^^decode_base64 "c2F5IGZvciBGaWxlOjpGaW5kOjpSdWxlLT5tYXhkZXB0aCgxKS0+aW4oJy4nKTs="^ee'

It's really hard because we can't use opendir or IO::Dir without using ";" or ",", can't use File::Find::Rule without using "(" and ")", etc.


Is this a homework assignment? If it is, you need to mark it as such.

Perl has commands to open, read, and close a directory.

  • To open a directory, you use the opendir.
  • To read a name of a file in the directory, you use the readdir command.
  • Once you're done, you can use the closedir.

The commands work in a similar fashion as the standard open, read, and close commands.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜