- 1
- 0
- 约2.1万字
- 约 71页
- 2017-03-13 发布于湖北
- 举报
center22-国立中央大学电算中心陈庆彦
國立中央大學電算中心 陳慶彥 國立中央大學電算中心 陳慶彥 主題 CGI 及其環境簡介 Perl 程式設計 應用系統實作 – 公佈欄 CGI 及其環境簡介 CGI 及其環境簡介(cont) 為什麼我的 HTML page/form 需要用 script 因為有的時候您需要在 HTML 文件中使用動態資料(非固定不變的資料) CGI 各代表什麼? Common 向您確保 CGI 可以使用多種程式語言並和多種 不同的系統互動 Gateway 提示您 CGI 的力量不在於它本身所做的事,而 在於它提供了連結其他系統的潛力 Interface 只是表示 CGI 對如何善用其特性提供了明確的 界定-換句話說,您可以設計程式來適當利用這 個介面。 CGI 及其環境簡介(cont) CGI程式相關的環境變數 CGI 及其環境簡介(cont) CGI 及其環境簡介(cont) CGI 及其環境簡介(cont) 哪些平台上有 Perl?要到哪裡去找? CGI 及其環境簡介(cont) Perl的相關資料要上哪兒找? Perl程式設計-執行環境 server 通常是設定成去執行放在 ``cgi-bin‘’ 目錄底下的 CGI 程式。不過, server 管理者同時也可以在設定檔中設定 aliases,讓所有含某些副檔名(如 .cgi、.pl)的 scripts 都能執行 Directory /home/httpd/cgi-bin AllowOverride None Options ExecCGI /Directory Directory /home/*/public_html Options Indexes Includes ExecCGI AllowOverride None order allow,deny /Directory 什麼是檔案使用權限?怎樣改? Perl程式設計-Lab 1.您的第一個程式 選擇編輯器 vi , joe , ee , pe2或是在client端將編輯好了的檔案上傳到server 您的第一個程式hello.cgi #! /usr/bin/perl print “hello world! \n”; Chmod 755 hello.cgi 執行hello.cgi Perl程式設計-資料型態 Scalar:純量變數是Perl裡最基本的一種資料型態,它可以代表一個字元、字串、整數、甚至浮點數,而Perl把它們都看成是一樣的! Scalar Array:純量陣列,陣列內的每一個元素都是Scalar variable Hash Array(Associative Array):雜湊陣列也叫做相關陣列,它和一般陣列沒什麼不同,差別只是在它的索引值用的是字串,而非一般陣列所用的整數值 References(Pointer):Perl 5新增了參考指標的資料型態使Perl和C一樣可借由指標建立一些複雜的資料結構。 Perl程式設計-資料型態(cont) Scalar:字串運算子 Perl程式設計-資料型態(cont) Perl程式設計-資料型態(cont) Scalar:數值運算子 Perl程式設計-資料型態(cont) Scalar:數值運算子 Perl程式設計-資料型態(cont) Scalar:數值運算子 Perl程式設計-資料型態(cont)-Lab 2 Perl程式設計-資料型態(cont) Perl程式設計-資料型態(cont)-Lab 3 Perl程式設計-資料型態-Lab 3(cont) Perl程式設計-資料型態(cont) Scalar Array: Perl程式設計-資料型態(cont) Scalar Array: Perl程式設計-資料型態(cont)-Lab4 Perl程式設計-資料型態(cont)-Lab5 Lab 5 scalearray2.cgi(Mixed Data Assigned to Array Cells ) Perl程式設計- 資料型態-Lab5(cont) Perl程式設計-資料型態(cont) Hash Array(Associative Array) Perl程式設計-資料型態(cont) -Lab6 Lab 6 hasharray.cgi Perl程式設計-資料型態-Lab6 (cont) Lab 6 hasharray.cgi (cont) Perl程式設計-資料型態-Lab6 (cont) Pe
原创力文档

文档评论(0)