PageID:Perl/FAQ1



FAQ リスト

FAQ Web by Tom Christiansen
http://mox.perl.com/perl/faq/part1.html
http://mox.perl.com/perl/faq/part2.html
http://mox.perl.com/perl/faq/part3.html
http://mox.perl.com/perl/faq/part4.html
http://mox.perl.com/perl/faq/part5.html

○meta-FAQ:

UseNet FAQs
ftp://rtfm.mit.edu (英語)
ftp://ftp.uu.ne (英語)

Perl meta FAQ
http://www.khoros.unm.edu/staff/neilb/perl/metaFAQ/metaFAQ.html <(英語)BR>

チュートリアル


http://www.teleport.com/~merlyn/UnixReview/(英語)
http://perl.com/perl/faq/index.html(英語)
http://agora.leeds.ac.uk/nik/Perl/start.html (英語)

http://www.phlab.missouri.edu/perl/perlcourse.html 2時間コース(英語)
http://www.phlab.missouri.edu/perl/perlcourse.ps <(英語)BR> 印刷用フォーマット (19ページ 分)

CGIスクリプトのチュートリアル http://www.catt.ncsu.edu/~bex/tutor/index.html(英語)
カウンター
counter

server side include のかわりをする perl スクリプト
ssis

CGI用ライブラリ
cgi-lib.pl
cgi libraries

Generic Server Push - スクリプトについて
GaSP (英語)

MacPerl
ftp://ftp.switch.ch/software/mac/perl/
ftp://ftp.share.com/pub/macperl/
Perl内からのping fping (ftp)
 スクリプト  @lines = `ping -c 1 thehost.domain`;  foreach(@lines) { print; } よく起きるコンパイルエラー(SunOS 4.1.3, gcc 2.7.0等)
LD_LIBRARY_PATHに/lib および /usr/lib が入ってないケースが多いようです。
perl irc クライアント http://sci.dixie.edu:/pub/irc/clients/perl/

95% of all problems of the form "script works from command line, doesn't
work from CGI" are permissions problems.  CGI scripts run as the user
"nobody" (or whatever user the httpd is running as), and generally don't
have proper write access.

-spp
--
Stephen P Potter        Pencom Systems Administration         AMP Incorporated
spp@peach.epix.net      spp@psa.pencom.com                steve.potter@amp.com
Home: 717-540-0131      Pager: 1-800-759-8888, 547-9561     Work: 717-986-5401
                Systems Administation: It's a Kind of Magic
○Perlから環境変数を知る方法
%ENV がプロセスの現時点の環境を反映したマジックハッシュです。

foreach $v (keys %ENV) {
  print $ENV{$v};
}

○暗号化されたパスワードのチェック

    $encrypted_password = crypt($clear_text_passwd,$salt);

The salt is a pseudo-random 8-bit value chosen at password creation time,
used to make it harder to crack the password (256 combos for every
password).  It is stored as the first 2 chars in the encrypted password
string.

Suppose you used the getpwent() function to get the encrypted password
for a user.  Having that, you just do the following to compare:

$salt = substr($encrypted_from_passwd_file,0,2);

if (crypt($clear_text_password,$salt) eq $encrypted_from_passwd_file) {
    print "You are authorized. Welcome!\n";
}
else {
    print "No dice, buddy!\n";
}

Mike Heins       mikeh@iac.net 513.523.5028

○その他 "validate" html (英語)
Perl 5.001m(ftp)

○foreach (<$foo>)ではうまくいかないゾ!
推奨:<${foo}>を使う。(< $foo>, <$foo >でもうまくいくそうな・・)

正規表現
"123:\:456\:7:89" はダブルーテーションで括られているので
"123::456:7:89"と同じ。


○Perl5でのGetHostName()の実現方法

use Sys::Hostname;
print hostname();


○^M(改行文字)を取りたい

普通
s/^M//;
を考えますが、うまくいかないケースが多いようです。また、
s/\r//;
でうまくいく機種もあるようですが、^Mを\rで代替するのは全機種でサポート されているわけではなく、Mac では、^Jとなっています。結局、
s/\cM//
s/\015//
がお勧めとされています。

○メールエージェント
ftp.foretune.co.jp:/pub/network/mail/mailagent

○perlからsendmailを使う
 Form-mail.pl
  Reuven M. Lerner (reuven@the-tech.mit.edu)作

○最後のフィールドでテキストファイルをソートしたい

たとえば、
Name     Played    Won   Drawn    Lost    Points

のPoints項目をソートするような場合
ftp://mox.perl.com/pub/perl/info/everything_to_know/sorting
http://mox.perl.com/perl/all_about/sort.html

○5.001mのモデュールリスト

http://www.cis.ohio-state.edu/hypertext/faq/usenet/perl-faq/top.html


ご意見、ご要望は、 電子メールまたは 投稿にお願い致します。

ホームページへ戻る。