欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    2022年Perl语言高级编程专题 .pdf

    • 资源ID:27255594       资源大小:296.64KB        全文页数:12页
    • 资源格式: PDF        下载积分:4.3金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要4.3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    2022年Perl语言高级编程专题 .pdf

    Pomeftp.orgSpring, 20071Perl语言高级编程专题Lesson 14周晓方coursesxfzhou.homeftp.orgerlcoursesxfzhou.hSpring, 20072Web browser & Http Server1.User opens browser and enters a target address2.Browser connects to the server (on port 80), and sends request3.Server finds the web page and returns it with HTTP header.4.If not found, server returns an error message.5.Browser transforms the reply and display to user.ClientServerGET /index.htm HTTP /1.0HTTP /1.0 200 OK HTTP /1.0 404 Not Found?Try these:telnet 80type GET / HTTP /1.0, with 2 ENTERstelnet 25telnet 110名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 20073Web Server & CGI Perl1.User opens browser and enters a target address2.Browser connects to the server (on port 80), and sends request3.Server setups CGI environment and starts the Perl CGI script. After script terminals, server collects and returns the result.4.If Perl CGI script not found, server returns an error message.5.Browser transforms the reply and display to user.+The web page is dynamic, not static+Perl/CGI is almost platform independent (v.s. ASP etc) +Client browser is simple (v.s. client side scripts)-Speed may be slower if server is slow (v.s. ASP).ClientServerGETHTTPCGIPerl CGI scripterlcoursesxfzhou.hSpring, 20074Install a local Web Server? Check if tcp/ip protocol is installed on your PC? xitami free web server ()xitami/Pro 是带 SSL的xitami http:/ Install the GUI version of web server? Setuphttp:/localhost/admin? home of webpage: /xitami/webpages? home of cgi scripts: /xitami/cgi-bin? home of ftp root: /xitami/ftproot/?/? test server: http:/localhost/? test cgi: http:/localhost/cgi-bin/testcgi名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 20075Write a 1st Web Page? Add following lines to /webpages/home.htm? Open IE & links to http:/localhost/home.htmMy 1st Web PageHay! Welcome to my homepage!Still underconstruction.TimeHay! Welcome to my homepage!Still under construction. Timeerlcoursesxfzhou.hSpring, 20076Write a 1st CGI-Perl script? Add these lines to/cgi-bin/time.pl? Click the Timelink, and runs thescript on server.#!/usr/bin/perl -wuse strict;my $time = localtime();print HERE;Content-type: text/htmlWhats the time?Current time is$timeBackHERE1;Current time isSun Nov 9 08:17:07 2003Back名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 20077Xitami Server Hints? 公网网站一定要拿 ICP号http:/ 尽量避免开设论坛、博客、新闻等内容? 解包xiopen_2_5.zip后可直接运行GUI / Console / Server / Control panel 版本? 设置文件需要简单认证的网页口令和密码:xitami.aut网站和虚拟网站的设置:default.cfg, *.cfg? 配置方法:打开 admin口,进入 http:/127.0.0.1/admin? 什么是 SSL(网页过滤功能 ):看一下 perlssi脚本? 怎么调试 CGI:查看 cgierr.log? 在一台主机上建立多个虚拟网站分目录, 绑定不同 的ip地址,绑定不同 的域名? 提示:安装路径 和perl路径不 要包含空格erlcoursesxfzhou.hSpring, 20078HTML formats & tags? Tags: v.s. Container tags: , .Empty tag, open tag, or one-time tag: , , Tag with arguments: ? White spaces o Single space (with exceptions)? Special symbols (& is the escape-char in html):&nbsp or &nbsp, an non-breaking-space&lt (), &amp (& itself), &pi ( p), &#169 or &copy ( ), &reg (), &#165 (¥ )? 非frame的网页? Frame的网页 框架(用 notepad看一下 c:/perl/html/index.html )名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 20079Inside a section? , add a title on browser不宜过长? 显示中 文? sample: 周晓方 复旦大学 开课相关 网页 ? Good style Add comments in head section:erlcoursesxfzhou.hSpring, 200710Headings and paragraphs? ? Paragraphs: A paragraph.The is optional with align=?: with nowrap: ? Adding line brakes: ? Preformatedparagraphs:White spaces are significant inside ? horizontal bar: width= pixelswidth= percent%size=pixelsalign=centeralign=leftalign=rightcolor=#rrggbbcolor=red/green/lightblue/darkgray 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200711Text formatting? Bold粗体字 Italic 斜体下划线 划线? 大号字体 小号.? 字体.? 下标上标? 逻辑字体加重 等宽, .变量erlcoursesxfzhou.hSpring, 200712Listing? ordered list:Apply projectSign contract & budgetHardworkingCheck point? unordered list:Leaser Jet 6LLeaser Jet 1010cheeperfaster1. Apply project 2. Sign contract & budget 3. Hardworking 4. Check point?Leaser Jet 6L ?Leaser Jet 1010 cheeper faster 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200713Link?Link to other web pagesMy home pageBack to homeGoogleWhats the time now.?Link to named tagSection 1:Goto section 1Goto Sec 1 of Ch2?Open link in new windowsHere?Invoke your mail clientMeerlcoursesxfzhou.hSpring, 200714Table? ? ? row:? head cell: ? data cell: Team Statistics PlayerGoalsAssistsPoints Anne71219 Eric41115Team Statistics PlayerGoals Assists PointsAnne71219Eric41115名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200715Image? Image format: GIF and JPEGGIF: 256 color compressed, LZ-compressJPEG: True color compressed, DCT+Huffman? width= pixelhight=pixelalt=description textborder=pixelvspace=pixelhspace=pixelalign=top/middle/bottom/left/right? Image as Bullet CharactersItem 1Item 2Item 3 erlcoursesxfzhou.hSpring, 200716Frames? ? ? Inside index.html Inside toc.htmChapter1Chapter2banner.htmtoc.htmChapter1Chapter2main windowchapter1.htmchapter2.htm名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200717HTML Forms 发送、接收表 单信息? Client side: action=protocol:/server/path/script/extra_path_infoGET(default): append all encoded data at the end of URLPOST: sends data to server in a separate HTTP transaction? Server side (method=GET) CGI:Receive encoded data in $ENVQUERY_STRINGUse STDOUT to return dataData cant be too long. Usually 1K bytes? Server side (method=POST) CGI:Receive encoded data from STDIN. Note: no EOF at end!use $ENVCONTENT_LENGTHto determine the data sizeUse STDOUT to return dataerlcoursesxfzhou.hSpring, 200718Usefull CGI ENV VariablesName of the server software (Xitami)SERVER_SOFTWAREPort # of the server (default is 80)SERVER_PORTDomain name or IP of the serverSERVER_NAMEVirtual path of the scriptSCRIPT_NAMEGET or POSTREQUEST_METHODauthenticated remote user nameREMOTE_USERname of the remote computerREMOTE_HOSTIP address of remote computerREMOTE_ADDRencoded dataGETQUERY_STRINGphysical path/script/extra_path_infoPATH_TRANSLATEDextra path information stringPATH_INFOlength in byte of encoded dataPOSTCONTENT_LENGTHDescriptionMethodVariable名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200719TEXT, PASSWORD, TEXTAREA? A single line of text (user-name, phone #, etc)SIZE: the windows width show on browserMAXLENGTH can be larger then SIZE (scrolling)? A single line of password (password)Display * when you typing in PASSWORD lineText is not encrypted when sending to server. Better use with POST method.? Multiply lines of text (email body, etc)default textSince the size of text inputed is usually unlimited, youd better use TEXTAREA with POST methodName*erlcoursesxfzhou.hSpring, 200720Action buttons, Image buttons? Action buttons, SUBMIT and RESETDont include multiply SUBMIT or RESET button in one simple form? Image button sends co-ordinates!Same function as SUBMIT buttonreturn LOGO.x=?&LOGO.y=? in dataleft-top corner is (0,0)SendClear名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200721Buttons, Radio or Check Boxes? Radio button, choose one from manygrouped radios shall share the same name智商 &lt8080-120&gt120性别 保密男女? Check boxes, on-&-off styleEachshall have a different namePerlJavaCVerilogPerl Java C Verilog C1=1&C3=1&C4=1智商120 性别保密男女IQ=B&GE=Berlcoursesxfzhou.hSpring, 200722SELECT/OPTION单选或多选的列表? 单选 ? 多选 ? 选项 内容 内容DOSWindowsLinux小学中学大学Windowsplatform=Windows&options=%D6%D0%D1%A7&options=%B4%F3%D1%A7小学中学大学名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 11 页,共 12 页 - - - - - - - - - Pomeftp.orgSpring, 200723Encoding, etc? HIDDEN, send contextual data? Encoding in GET methodURL_in_action . ? . name=val&name=valspace converted to +special chars (like +) converted to %?, ? is the heximal ASCII value of the char. e.g.+ %2B% %25计算机%BC%C6%CB%E3%BB%FAerlcoursesxfzhou.hSpring, 200724POST method and Decoding? Useful Environment Variables:REQUEST_METHOD & CONTENT_LENGTH? Data parsing and decoding:$DataLen = $ENVCONTEXT_LENGTH;#获得数据长度read(STDIN, $QueryString, $DataLen);#读入指定长度NameValuePairs = split(/&/, $QueryString);foreach $NameValue (NameValuePairs) ($Name, $Value) = split(/=/, $NameValue);$Value = tr/+/ /;#恢复空格$Value = s/%(dA-Fa-f2)/pack(C,hex($1)/eg;#恢复 %? 编码的字符print Name = $Name, Value = $Valuen;名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 12 页,共 12 页 - - - - - - - - -

    注意事项

    本文(2022年Perl语言高级编程专题 .pdf)为本站会员(Che****ry)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开