JPerl Advent Calendar 2008 Perl に関するちょっとした Tips をのっけてみるよ。ちゃんと続くかな?
こんばんは。ビンゴ中西です。 bingo_nakanishiのPerlではじめるプログラミング言語 では、プログラムがまったくはじめてという方を対象にPerlという言語を用いてプログラミングの楽しさを知っていただこうと書いてきましたが、本ブログでは、他言語出身の方を対象にPerlを紹介できればいいなと考えております。 他言語としては、 C言語, Java, Ruby, JavaScriptなどを考えています(といっても僕はそれほどこれらについては知らないのですが....)。 ということで第1回目の今日は、「スコープ」についてお話していければなぁと思います。 新しいプログラミング言語を覚えるにあって最も気になる部分のひとつにスコープがあると僕は思っています。 さて、さっそくですが、次のソースを実行してみましょう。 hoge(); foo(); sub hoge { $c = 1; $d =
序文 もしもプログラミング言語が宗教だったら……(全訳版)[絵文録ことのは]2008/12/21 によると、ブードゥー教徒らしい dankogai です。 ブードゥー教徒らしく、「上司があなたに金曜夜21時に緊急の仕事を命ずるときにしばしば使われる」呪文をここでまとめておくことにします。 基本中の基本 コマンドとしてのperlは、スイッチがない場合、引数はスクリプト名として扱われます。 % cat hello.pl print "Hello, world!\n"; % perl hello.pl Hello, world! % コマンドライン中の文字列をスクリプトとして解釈させるには、-eを使います。 % perl -e'print "Hello, World!\n"' Hello, world! % ちなみに、perlとコマンド名だけで起動すると、標準入力をスクリプトとして返します。 %
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く