⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perllecture.html

📁 黑客培训教程
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

<html>

<head>

   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

   <meta name="Author" content="default">

   <meta name="GENERATOR" content="Mozilla/4.7 [en] (Win98; U) [Netscape]">

   <title>Perl Web Automation Lecture</title>

</head>

<body>

&nbsp;

<p>

<hr SIZE=1 WIDTH="61%">

<center>Perl - Web Automation Lecture

<br>By <a href="mailto:tejanshu@rediffmail.com">BitsNbytes</a>

<br>for

<br><a href="http://blacksun.box.sk">http://blacksun.box.sk</a></center>



<hr SIZE=1 WIDTH="73%">

<br>&nbsp;

<p>*** bitsNbytes has joined #bsrf

<br>&lt;bitsNbytes> hi ppl

<br>&lt;bitsNbytes> I am EXtremely sorry for being late

<br>&lt;bitsNbytes> should we begin with the lecture

<br>&lt;fatboyjoe> just when everyone had given up hope of seeing it

<br>&lt;bitsNbytes> yeah ..sorry man

<br>&lt;fatboyjoe> heh

<br>&lt;fatboyjoe> oh well

<br>&lt;fatboyjoe> better late than never I guess :)

<br>&lt;bitsNbytes> K..is everyone eager and attentive

<br>&lt;pitpat> oh

<br>&lt;pitpat> yea

<br>&lt;bitsNbytes> hehe

<br>&lt;pitpat> i'm all ears

<br>&lt;pitpat> finally

<br>&lt;pitpat> ;O)

<br>&lt;bitsNbytes> lol

<br>&lt;Yodason> =)

<br>&lt;pitpat> ok bits

<br>&lt;pitpat> are you doing it on perl?

<br>&lt;bitsNbytes> k..the connection here in India is haywire t'day

<br>&lt;bitsNbytes> and hence the delay

<br>&lt;bitsNbytes> yeah..i'd like to know if there r total newbies too

<br>&lt;pitpat> &lt;--- newbie of perl

<br>&lt;bitsNbytes> i mean those who are absolutely oblivious to the existence

of perl and its basics

<br>*** Getalife has joined #bsrf

<br>*** _ciR_ has quit IRC (Ping timeout: 180 seconds)

<br>&lt;Getalife> Any phreakers around?

<br>&lt;pitpat> &lt;--- not that much of a newbie

<br>&lt;pitpat> hehe

<br>&lt;bitsNbytes> hmm good then

<br>&lt;bitsNbytes> what i am about to share with you t'day is the relation

of perl and the web

<br>&lt;pitpat> cgi

<br>&lt;pitpat> common gateway interface

<br>&lt;bitsNbytes> PRECISELY

<br>&lt;pitpat> ;O)

<br>&lt;bitsNbytes> hmm i have got a learned audience .. i must say

<br>*** wascy|prepare_hack is now known as wascy

<br>&lt;pitpat> go on...

<br>&lt;bitsNbytes> when we talk of cgi..

<br>&lt;bitsNbytes> we are talking about dynamic information

<br>&lt;bitsNbytes> and interactivity

<br>&lt;pitpat> server-side

<br>&lt;pitpat> web

<br>&lt;bitsNbytes> yess.. that is what makes the web so ALIVE

<br>*** jacs has quit IRC (Ping timeout: 180 seconds)

<br>&lt;bitsNbytes> Perl very much like other languages

<br>&lt;pitpat> doesn't need to be compiled

<br>&lt;bitsNbytes> supports the concept of modularity

<br>&lt;bitsNbytes> ok.. that too (very basic tho) ;)

<br>*** wascy has quit IRC (Quit: )

<br>*** jacs has joined #bsrf

<br>&lt;bitsNbytes> all modules are available today on Comprehensive Perl

Archive Network (CPAN)

<br>&lt;bitsNbytes> for Perl and CGI to&nbsp; be integrated we need the

cgi.pm module

<br>&lt;Getalife> Any phreakers around?

<br>*** fatboyjoe has quit IRC (Ping timeout: 180 seconds)

<br>&lt;bitsNbytes> that has to be included in our pel script

<br>*** _ciR_ has joined #bsrf

<br>&lt;pitpat> ciR

<br>&lt;pitpat> i found the lecturer

<br>&lt;_ciR_> who

<br>&lt;pitpat> bitsNbytes

<br>*** demontanus has quit IRC (Quit: Math is like sex. Add the people,

subtract the clothes, divide the legs, and multiply.)

<br>&lt;pitpat> hehe

<br>&lt;bitsNbytes> let us begin with a sample basic program

<br>&lt;_ciR_> hehe

<br>&lt;pitpat> don't do the hello world plz

<br>&lt;pitpat> :O(

<br>&lt;_ciR_> looks like bsrf ous u

<br>&lt;bitsNbytes> nah don't worry

<br>&lt;pitpat> can you go a bit faster bits?

<br>&lt;pitpat> i'm getting sleepy

<br>&lt;bitsNbytes> i am trying

<br>&lt;bitsNbytes> but the network connection seems to be outof order

<br>&lt;bitsNbytes> #! /usr/bin/perl -w

<br>&lt;bitsNbytes> this is the line that acts like a include &lt;> line

in C

<br>&lt;bitsNbytes> the -w is for warnings on

<br>&lt;bitsNbytes> # a program for your type of babe

<br>&lt;bitsNbytes> this was a comment

<br>*** rek has joined #bsrf

<br>*** ChanServ sets mode: +o rek

<br>&lt;rek> hey

<br>*** Arrowhead has quit IRC (Quit: )

<br>&lt;bitsNbytes> use CGI qw (param)&nbsp;&nbsp; # a very important line..

includes the cgi.pm module

<br>&lt;rek> no lecture?

<br>&lt;pitpat> yea bitsNbytes is doing it right now

<br>&lt;bitsNbytes> print &lt;&lt;END_of_start;

<br>&lt;bitsNbytes> Content-type: text/html&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

#needs no explanation

<br>&lt;bitsNbytes> &lt;HTML>

<br>&lt;bitsNbytes> &lt;HEAD>

<br>&lt;bitsNbytes> &lt;TITLE> My kinda girl &lt;/TITLE>

<br>*** fatboyjoe has joined #bsrf

<br>&lt;bitsNbytes> &lt;/HEAD>

<br>&lt;bitsNbytes> &lt;BODY>

<br>&lt;Getalife> Can anyone assist me in making a scanner out of a cordless

phone?

<br>&lt;_ciR_> hahah not its HTML lecture

<br>&lt;_ciR_> then &lt;p>hahah,&lt;/p>

<br>*** rek has quit IRC (Quit: Leaving)

<br>&lt;bitsNbytes> &lt;H1> Greetings Mortal &lt;/H1>

<br>*** rek has joined #bsrf

<br>*** ChanServ sets mode: +o rek

<br>*** rek sets mode: +v bitsNbytes

<br>&lt;bitsNbytes> END_of_start

<br>*** sohed has joined #bsrf

<br>*** zwanderer has joined #bsrf

<br>&lt;bitsNbytes> my $favorite=param("brunette");

<br>&lt;bitsNbytes> print "&lt;P> Your favorite flavor is $favorite.";

<br>&lt;bitsNbytes> print &lt;&lt;ALL_Done;

<br>&lt;bitsNbytes> &lt;/BODY>

<br>&lt;bitsNbytes> &lt;/HTML>

<br>&lt;bitsNbytes> ALL_Done

<br>&lt;bitsNbytes> well was this understood

<br>*** freespeachlamer has joined #bsrf

<br>&lt;freespeachlamer> is the lecture over?

<br>&lt;bitsNbytes> we just created a small basic interactive CGI-perl

script that propmts the user for his

<br>&lt;bitsNbytes> favorite chick type

<br>*** TCL has joined #bsrf

<br>*** ChanServ sets mode: +v TCL

<br>&lt;freespeachlamer> umm can someone send me a log of the lecture?

<br>&lt;bitsNbytes> no ... its just begun

<br>&lt;freespeachlamer> oh

<br>&lt;freespeachlamer> sorry :)

<br>&lt;rek> bitsNbytes: your a little late

<br>&lt;bitsNbytes> now if we don't wanna type all that HTML stuff

<br>&lt;bitsNbytes> OK .. so what do u sugget "rek"

<br>&lt;bitsNbytes> i mean suggest

<br>&lt;rek> what u mean?

<br>&lt;bitsNbytes> yeah .. i know i am late .....??

<br>&lt;bitsNbytes> as long as there are a pair of attentive ears .. it's

ok

<br>&lt;rek> well, we had a lot more people, lot of us left @ 1:30...

<br>&lt;rek> i was just makin sure u know.. go on with the lecture

<br>&lt;bitsNbytes> yeah .. iknow and i am sorry (for the umpteenth time

now)

<br>*** jacs has quit IRC (Ping timeout: 180 seconds)

<br>&lt;bitsNbytes> ok lemme ask how many of us are familiar with basic

unix concepts and cgi scripting

<br>&lt;Yodason> not me =p

<br>*** jacs has joined #bsrf

<br>* rek is

<br>* fatboyjoe is

<br>&lt;bitsNbytes> so i can really move on to REAL stuff

<br>* freespeachlamer is not

<br>&lt;freespeachlamer> but dont worry about me :)

<br>*** freespeachlamer has quit IRC (Quit: )

<br>&lt;bitsNbytes> then let us begin with what we really can do

<br>&lt;bitsNbytes> k let us see this bit complex program i'vbe written

<br>&lt;bitsNbytes> #! /usr/bin/perl -w

<br>*** rek sets mode: +m

<br>*** zwanderer has quit IRC (Quit: bye bye peppe)

<br>&lt;bitsNbytes> # this program loads the cgi module to decide information

by web server

<br>&lt;bitsNbytes> use strict;

<br>&lt;rek> bbl have to leave

<br>*** pitpat has quit IRC (Quit: )

<br>*** rek sets mode: -m

<br>*** rek has quit IRC (Quit: )

<br>&lt;bitsNbytes> man .. am i that boring

<br>&lt;Yodason> lol'

<br>&lt;TCL> lol

<br>&lt;sohed> nope, go on

<br>&lt;bitsNbytes> # the strict module ensures your code is in order and

within the norms

<br>&lt;bitsNbytes> so we write

<br>&lt;bitsNbytes> use strict;

<br>&lt;bitsNbytes> use CGI qw (:standard escapeHTML);

<br>&lt;bitsNbytes> # now to get a parameter from a form

<br>&lt;bitsNbytes> my $value=param ('PARAM_NAME');

<br>*** Getalife has quit IRC (Read error: 104 (Connection reset by peer))

<br>&lt;bitsNbytes> # and output a document

<br>&lt;bitsNbytes> print header(), start_html("Howdy there!"),

<br>&lt;bitsNbytes> p("U typed: ", tt(escapeHTML($value))),

<br>&lt;bitsNbytes> end_html

<br>&lt;bitsNbytes> some explanation now

<br>&lt;bitsNbytes> CGI scripts are called in two main ways

<br>&lt;bitsNbytes> referred to as "methods" --> not HTTP methods

<br>&lt;bitsNbytes> one is the procedural method.. the other is object

oriented

<br>&lt;bitsNbytes> procedural for simple tasks

<br>&lt;bitsNbytes> and object oriented for complex ones

<br>&lt;bitsNbytes> our little program here can be analyzed as follows

<br>*** X has joined #bsrf

<br>*** DigitalFallout has quit IRC (Read error: 104 (Connection reset

by peer))

<br>&lt;bitsNbytes> as u might have guessed $anything stands for variable

declaration in perl

<br>&lt;X> meaw

<br>&lt;bitsNbytes> perl supports all kinds of data types

<br>*** essex has joined #bsrf

<br>&lt;bitsNbytes> collectively called as "scalar variables"

<br>&lt;bitsNbytes> u no longer have to specify a "type"

<br>&lt;essex> Hi ya

<br>&lt;bitsNbytes> u just say $whatever = somevalue

<br>&lt;bitsNbytes> the "my" reserved word makes that particular variable

or parameter

<br>&lt;bitsNbytes> passed to a subroutine "local" to ur specific program

<br>&lt;bitsNbytes> i.e. "my" for locality of reference ..ok

<br>* essex want's to know if anyone knows a good VB decompiler

<br>&lt;bitsNbytes> the header() returns a string content type

<br>&lt;bitsNbytes> followed by the start_html

<br>&lt;bitsNbytes> which returns the string, passed as parameter ,

<br>*** phil has quit IRC (Remote closed the connection)

<br>*** TCL has quit IRC (Quit: BBL)

<br>&lt;bitsNbytes> ok.. now how do we use this program

<br>&lt;bitsNbytes> i hope whatever i said was not too obvious

<br>&lt;bitsNbytes> anywayz

<br>&lt;bitsNbytes> i shall tell u how to get this prog running under UNIX

<br>&lt;bitsNbytes> since I have very lil knowledge bout windowz

<br>&lt;bitsNbytes> generally we place this program on a web server (running

APACHE preferrably)

<br>&lt;bitsNbytes> path-> /home/httpd/cgi-bin/program

<br>&lt;bitsNbytes> where program is the program name

<br>*** josh-hamster has joined #bsrf

<br>&lt;bitsNbytes> and then use a browser lynx (for the console) Netscape,

Amaya (for Xwin)

<br>&lt;bitsNbytes> get the program running

<br>&lt;bitsNbytes> am i .. making any sense to u ppl

<br>&lt;bitsNbytes> feedbacks plz

<br>&lt;HardW1r3> yeh

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -