컴퓨터 엑셀 워드 포토샵 구글어스 WINDOWS JAVASCRIPT JAVA C++

 
Monday, August 14, 2006

[Perl] perldoc으로, 모듈 파일 내용 보기, 코드를 화면에 출력하기


가령 File::Find 라는 모듈의 내용을 보고 싶다면,

perldoc -m File::Find

이렇게 하면 됩니다.


그러면 다음과 같은 화면이 나옵니다:
D:\Z>perldoc -m File::Find
package File::Find;
use 5.006;
use strict;
use warnings;
use warnings::register;
our $VERSION = '1.10';
require Exporter;
require Cwd;

#
# Modified to ensure sub-directory traversal order is not inverded by stack
# push and pops.  That is remains in the same order as in the directory file,
# or user pre-processing (EG:sorted).
#

=head1 NAME

File::Find - Traverse a directory tree.

=head1 SYNOPSIS

    use File::Find;
    find(\&wanted, @directories_to_search);
    sub wanted { ... }

    use File::Find;
    finddepth(\&wanted, @directories_to_search);
    sub wanted { ... }

    use File::Find;
    find({ wanted => \&process, follow => 1 }, '.');

=head1 DESCRIPTION

These are functions for searching through directory trees doing work
on each file found similar to the Unix I<find> command.  File::Find
exports two functions, C<find> and C<finddepth>.  They work similarly
but have subtle differences.

=over 4

=item B<find>

  find(\&wanted,  @directories);
  find(\%options, @directories);
-- More  --



모듈들을 일일이 찾아서 편집기로 열어보는 것은 힘들기에, 이 방법으로 간단히 모듈의 내용을 훓어볼 수 있습니다.


모듈이 설치되어 있는지 확인하는 용도로도 쓸 수 있습니다. 만약 지정한 모듈이 없다면 예를 들어,
No module found for "Foo2::Foo3".
이런 메시지가 나옵니다. (▶▶ [Perl] 특정 펄 모듈이 이미 설치되어 있는지 확인하는 배치 파일 참조)




☞ Perl

0 Comments:

Post a Comment

<< Home RSS 2.0 feed

구글 Google 에서 제공하는 무료 블로그 서비스인 블로거 Blogger 의 인터넷 주소는 www.blogger.com 입니다. Blogger 에 블로그를 만들면, blogspot.com 이라는 주소에 블로그가 생성됩니다.
블로그를 직접 방문하지 않고도 최신 게시물을 구독하려면 RSS 2.0 feed 주소를 리더기에 등록하시면 됩니다.
Previous Posts
Monthly Archives
Top