Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

perl-beginner · Perl Beginners Mailing List

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 3765
  • Category: Perl
  • Founded: Aug 2, 1998
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 17873 - 17902 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#17873 From: "mah_19812003" <mah_techpub@...>
Date: Thu Jan 29, 2004 9:22 am
Subject: Expect Perl Module
mah_19812003
Send Email Send Email
 
Hai all,
I am new to this group.I have a problem regarding insatlling of
Expect Perl Module in Solris system.So Please anyone having an idea
about this are most welcome.Please specify the file in CPAN that we
are supposed to install,the in which directory of solaris should i
install and the detailed procedure of the same.
Thanks,
Mahesh S.

#17874 From: "kishorevutukuru" <krishna.kishore@...>
Date: Thu Jan 29, 2004 10:00 am
Subject: Re: [PBML] Unable to locate DBI.pm
kishorevutukuru
Send Email Send Email
 
Franki,

Thanks for your suggesstion.
Can you tell me where can i download the drivers.

regds
kishore

- In perl-beginner@yahoogroups.com, franki <franki@h...> wrote:
> Yes,
>
> Have your sysadmin install it.
>
> http://search.cpan.org/~timb/DBI-1.40/
>
>
> rgds
>
> Franki
>
>
> kishorevutukuru wrote:
> > HI all,
> >
> > I am new to Perl Scripts.
> > In my Scripts, I am using 'USE DBI' Package. When I am trying to
> > compile my code, it is saying that 'Unable to location DBI.pm
file. I
> > searched for file in Unix directories, I couldn't find.  Can any
one
> > suggest how to resolve this issue.
> >
> > Thanks in Advance.
> >
> > regds
> > kishore
> >
> >
> >

#17875 From: daymobrew@...
Date: Thu Jan 29, 2004 10:21 am
Subject: Re: Expect Perl Module
daymobrew
Send Email Send Email
 
--- In perl-beginner@yahoogroups.com, "mah_19812003"
<mah_techpub@r...> wrote:
> Hai all,
> I am new to this group.I have a problem regarding insatlling of
> Expect Perl Module in Solris system.So Please anyone having an idea
> about this are most welcome.Please specify the file in CPAN that we
> are supposed to install,the in which directory of solaris should i
> install and the detailed procedure of the same.
> Thanks,
> Mahesh S.

Mahesh,

What problems are you having?
As you asking for where to download the module it sounds like you
haven't started.

I used http://search.cpan.org and entered 'expect'
The first link brought me to:
http://search.cpan.org/~rgiersig/Expect-1.15/
where you can download the module tarball.
Neither the 'Changes' or 'README' files mention Solaris which may
mean there is nothing special about.

To take a few steps back, if you don't have the 'expect' application
you can get it for Solaris at http://www.sunfreeware.com
This uses 'pkgadd' to install the files to /usr/local.

Do you have a compiler on your system?

#17876 From: franki <franki@...>
Date: Thu Jan 29, 2004 10:21 am
Subject: Re: [PBML] Unable to locate DBI.pm
frankhauptle
Send Email Send Email
 
Well, DBI is the interface, and DBD is the DataBase Drivers..

So a quick search on cpan shows this:
http://search.cpan.org/search?query=DBD&mode=all

8 pages of DBD modules for pretty much every DB around.

rgds

Franki


kishorevutukuru wrote:
> Franki,
>
> Thanks for your suggesstion.
> Can you tell me where can i download the drivers.
>
> regds
> kishore
>
> - In perl-beginner@yahoogroups.com, franki <franki@h...> wrote:
>
>>Yes,
>>
>>Have your sysadmin install it.
>>
>>http://search.cpan.org/~timb/DBI-1.40/
>>
>>
>>rgds
>>
>>Franki
>

#17877 From: "Jeff Eggen" <jeggen@...>
Date: Thu Jan 29, 2004 1:52 pm
Subject: [PBML] Re: LWP :content_file problems
jeggen@...
Send Email Send Email
 
>>> daymobrew@... 01/28/04 10:48am >>>
>$request = HTTP::Request->new('GET', 'https://website/blah/');
>$response = $ua->request($request, 'w302.payroll');

>Will that work for you?

Yes, that worked like a charm.  Thanks!  I never think of separating the
request/response step into two steps.  Boo me.

Anybody know why this way works, but the way I had originally mentioned
(':content_file' => '/some/file' in the $ua->get() method) doesn't?

Thanks again,

Jeff Eggen
IT Programmer Analyst
Saskatchewan Government Insurance
Ph (306) 751-1795
email jeggen@...

#17878 From: Denny Malloy <denny.malloy@...>
Date: Thu Jan 29, 2004 2:44 pm
Subject: SGML Tags
denny.malloy@...
Send Email Send Email
 
Does anyone know of a module I could use to convert SGML tags?

Dennis Malloy
Systems Programmer
NPC, Inc.
Old Route 220
Claysburg, PA  16625
http://www.npcweb.com
814-239-8787
Fax: 814-239-8706
denny.malloy@...

#17879 From: Jeff 'japhy' Pinyan <japhy@...>
Date: Thu Jan 29, 2004 3:11 pm
Subject: Re: [PBML] SGML Tags
evilffej
Send Email Send Email
 
On Jan 29, Denny Malloy said:

>Does anyone know of a module I could use to convert SGML tags?

Convert SGML tags to what?  I'm sure there's a module on CPAN for parsing
SGML.

   http://search.cpan.org/

--
Jeff "japhy" Pinyan      japhy@...      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]

#17880 From: Denny Malloy <denny.malloy@...>
Date: Thu Jan 29, 2004 3:24 pm
Subject: FW: [PBML] SGML Tags
denny.malloy@...
Send Email Send Email
 
Sorry more information.  I found modules from CPAN to parse information from
tags but I need to actually change the tag.  Examples:

like this:

<EMPH TYPE="B">Form 1098–T;</EMPH>
<EMPH TYPE="I">Form 1098–T;</EMPH>

To:

<BOLD>Form 1098–T;</BOLD>
<ITALIC>Form 1098–T;</ITAIC>

I could use regexps but it would be a nightmare trying to find all the
combinations.  If I didn't have to change the ending tag it would be easy.
I'll keep looking.

Thanks.

Denny

#17881 From: Brad Lhotsky <brad@...>
Date: Thu Jan 29, 2004 4:07 pm
Subject: Re: FW: [PBML] SGML Tags
brad@...
Send Email Send Email
 
Why not just use an XML Parser.  See, you setup these procedures,
"startTag" and "endTag", then basically, you can have a global FIFO
array.  so like

my @FIFO = ();

my %convert = ( B => "BOLD", I => "ITALIC" );

sub startTag {
	 my ($tagname, %attrs, $text) = @_;
	 if(exists $convert{$attr{type}}) {
		 push @FIFO, $convert{$attr{type}};
		 print "<$convert{$attr{type}}>";
	 }
	 else {
		 push @FIFO, $tagname;
		 print "<$text>";
	 }
}

sub endTag {
	 my $tagname = shift;

	 my $end = pop @FIFO;

	 print "</$end>";
}


OF course this is only a start.  You need to read up on the various XML
Parser modules.  I'd suggest using one that supports this "event driven"
architecture.

http://search.cpan.org/~msergeant/XML-Parser-2.34/Parser.pm
http://search.cpan.org/~ehood/perlSGML.1997Sep18/

Hope that helps.
On Thu, Jan 29, 2004 at 10:24:00AM -0500, Denny Malloy wrote:
> Sorry more information.  I found modules from CPAN to parse information from
> tags but I need to actually change the tag.  Examples:
>
> like this:
>
> <EMPH TYPE="B">Form 1098–T;</EMPH>
> <EMPH TYPE="I">Form 1098–T;</EMPH>
>
> To:
>
> <BOLD>Form 1098–T;</BOLD>
> <ITALIC>Form 1098–T;</ITAIC>
>
> I could use regexps but it would be a nightmare trying to find all the
> combinations.  If I didn't have to change the ending tag it would be easy.
> I'll keep looking.
>
> Thanks.
>
> Denny
>
> Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/perl-beginner/
>
> To unsubscribe from this group, send an email to:
>  perl-beginner-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>

--
Brad Lhotsky <brad@...>

#17882 From: "wadunn83" <wadunn83@...>
Date: Thu Jan 29, 2004 4:32 pm
Subject: The best book for an extreme Newbie to programming
wadunn83
Send Email Send Email
 
Hello.

I am a biologist.  I have been interested in learning to program for a
long time and have decided to just jump in and try not to drown.  I am
looking for a book that will give me what I need to form a strong
foundation that I can use to start experimenting and grow.  Does
anyone have a favorite EXTREME beginner's book that they like?  Also
why is it good.  I should say that I will be using a Mac running OS
10.2.  Thank you all and good day.

Augustine

#17883 From: Brad Lhotsky <brad@...>
Date: Thu Jan 29, 2004 5:15 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
brad@...
Send Email Send Email
 
Two perl books come to mind:

Essential:
http://www.oreilly.com/catalog/lperl3/

This may drive things a bit closer to home for you:
http://www.oreilly.com/catalog/begperlbio/

These will help out once you feel comfortable:
http://www.oreilly.com/catalog/pperl3
http://www.oreilly.com/catalog/perlckbk2
http://www.manning.com/Conway/index.html

Hope that helps.


On Thu, Jan 29, 2004 at 04:32:21PM -0000, wadunn83 wrote:
> Hello.
>
> I am a biologist.  I have been interested in learning to program for a
> long time and have decided to just jump in and try not to drown.  I am
> looking for a book that will give me what I need to form a strong
> foundation that I can use to start experimenting and grow.  Does
> anyone have a favorite EXTREME beginner's book that they like?  Also
> why is it good.  I should say that I will be using a Mac running OS
> 10.2.  Thank you all and good day.
>
> Augustine
>
>
>
> Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/perl-beginner/
>
> To unsubscribe from this group, send an email to:
>  perl-beginner-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>

--
Brad Lhotsky <brad@...>

#17884 From: "Dustin Davis" <dustin@...>
Date: Thu Jan 29, 2004 3:52 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
xhenxhe
Send Email Send Email
 
One book that got me started in a hurry was Cross-Platform Perl by Eric
Foster-Johnson. Here's an amazon link: (check out the reviews - many
suggest  this book for beginners)

http://linkcloak.com/1

-Dustin


wadunn83 said:
> Hello.
>
> I am a biologist.  I have been interested in learning to program for a
> long time and have decided to just jump in and try not to drown.  I am
> looking for a book that will give me what I need to form a strong
> foundation that I can use to start experimenting and grow.  Does
> anyone have a favorite EXTREME beginner's book that they like?  Also
> why is it good.  I should say that I will be using a Mac running OS
> 10.2.  Thank you all and good day.
>
> Augustine
>
>
>
> Unsubscribing info is here:
> http://help.yahoo.com/help/us/groups/groups-32.html
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/perl-beginner/
>
> To unsubscribe from this group, send an email to:
>  perl-beginner-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>
>


Dustin Davis
--
http://LDSPDA.com
http://Shiblon.com

#17885 From: "Mike Muratet" <muratet@...>
Date: Thu Jan 29, 2004 5:24 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
muratet@...
Send Email Send Email
 
Augustine

There are several O'Reilly books by Tisdale or Gibas that are good intros to
perl for biologists. There is also a famous article by Lincoln Stein about
perl you will find interesting. (I don't have the URL, but it should be easy
enough to find.) There are perl modules for just about everything you could
want at bioperl.org along with a good tutorial.

Enjoy

Mike

----- Original Message -----
From: "wadunn83" <wadunn83@...>
To: <perl-beginner@yahoogroups.com>
Sent: Thursday, January 29, 2004 10:32 AM
Subject: [PBML] The best book for an extreme Newbie to programming


> Hello.
>
> I am a biologist.  I have been interested in learning to program for a
> long time and have decided to just jump in and try not to drown.  I am
> looking for a book that will give me what I need to form a strong
> foundation that I can use to start experimenting and grow.  Does
> anyone have a favorite EXTREME beginner's book that they like?  Also
> why is it good.  I should say that I will be using a Mac running OS
> 10.2.  Thank you all and good day.
>
> Augustine
>
>
>
> Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/perl-beginner/
>
> To unsubscribe from this group, send an email to:
>  perl-beginner-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>
>

#17886 From: perl-beginner@yahoogroups.com
Date: Thu Jan 29, 2004 7:03 pm
Subject: Reminder - Job oppertunities (Work Remotly)
perl-beginner@yahoogroups.com
Send Email Send Email
 
We would like to remind you of this upcoming event.

Job oppertunities (Work Remotly)

Date: Thursday, January 29, 2004
Time: 12:00PM PST (GMT-08:00)

Allfreelance.net is fastest growing software company.
So whether you're an experienced professional, or just starting
out, we can bring you hot leads and cool projects. Come register
with us to get the projects.

Visit http://www.allfreelance.net for more info.

#17887 From: "J.E. Cripps" <cycmn@...>
Date: Thu Jan 29, 2004 9:59 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
cycmn@...
Send Email Send Email
 
Augustine<wadunn83@...> did lately here inquire:
> I am a biologist.  I have been interested in learning to program for a
> long time and have decided to just jump in and try not to drown.  I am
> looking for a book that will give me what I need to form a strong
> foundation that I can use to start experimenting and grow.  Does
> anyone have a favorite EXTREME beginner's book that they like?  Also
> why is it good.  I should say that I will be using a Mac running OS
> 10.2.  Thank you all and good day.

     Both Simon Cozens (Wrox) and Andrew Johnson (Manning) have
     written Perl books for ppl with little or no background.

     My advice: 1. Get the Perl "Hello World" running.
     2. Look at the books recommended on this list (try
     your local megastore... or beg from someone) and get
     one for your very own.   (Learn to live with the fact that
     you'll  want more than you have at any one moment.)
     3. Run "perldoc perl" on  your system. (this perhaps
     should be second)   4. Start trying the examples and
     exercises in the book...

     The O'Reilly advanced Perl books (Bioinformatics) should
     provide incentives to persevere.

#17888 From: "Fortuno, Adam" <fortunoa@...>
Date: Thu Jan 29, 2004 10:09 pm
Subject: RE: [PBML] The best book for an extreme Newbie to programming
fortunoa@...
Send Email Send Email
 
Augustine,

I'm running 10.3 (good to see another MacOS X user).

I recommend the llama book (Learning Perl by O'Reilly & Associates 3rd Edit;
ISBN 0596001320). If you are new to programming, I cannot think of a better
reference. Concise, informative, and readable by anyone. I think the books
ability to teach the 20% of perl code you'll use some 80% of the time makes
it a winner. I bought it a while ago and read it in about a month - doing
the examples. I'd say by 3-weeks in I was already putting what I learned to
use at work (I run Win32 at work). In some cases using code I wrote at home
(on my PB G4).

Learning Perl -> http://www.bookpool.com/.x/7q8bm64rp6/sm/0596001320

Regards,
Adam

-----Original Message-----
From: J.E. Cripps [mailto:cycmn@...]
Sent: Thursday, January 29, 2004 4:59 PM
To: perl-beginner@yahoogroups.com
Subject: Re: [PBML] The best book for an extreme Newbie to programming




Augustine<wadunn83@...> did lately here inquire:
> I am a biologist.  I have been interested in learning to program for a
> long time and have decided to just jump in and try not to drown.  I am
> looking for a book that will give me what I need to form a strong
> foundation that I can use to start experimenting and grow.  Does
> anyone have a favorite EXTREME beginner's book that they like?  Also
> why is it good.  I should say that I will be using a Mac running OS
> 10.2.  Thank you all and good day.

     Both Simon Cozens (Wrox) and Andrew Johnson (Manning) have
     written Perl books for ppl with little or no background.

     My advice: 1. Get the Perl "Hello World" running.
     2. Look at the books recommended on this list (try
     your local megastore... or beg from someone) and get
     one for your very own.   (Learn to live with the fact that
     you'll  want more than you have at any one moment.)
     3. Run "perldoc perl" on  your system. (this perhaps
     should be second)   4. Start trying the examples and
     exercises in the book...

     The O'Reilly advanced Perl books (Bioinformatics) should
     provide incentives to persevere.

#17889 From: merlyn@...
Date: Thu Jan 29, 2004 10:24 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
merlynstoneh...
Send Email Send Email
 
>>>>> "Adam" == Fortuno, Adam <fortunoa@...> writes:

Adam> I recommend the llama book (Learning Perl by O'Reilly &
Adam> Associates 3rd Edit; ISBN 0596001320). If you are new to
Adam> programming, I cannot think of a better reference.

Oddly, that's not really an intended use.  I don't really explain what
a variable is for, how to use an array, or why you might want to put
code into a subroutine.  I presume that people know that before they
pick up the llama.

Maybe you already knew that stuff, so you didn't notice that I didn't
teach it there. :)

But thanks for the recommendation.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#17890 From: Brian Gordon <microsteel@...>
Date: Thu Jan 29, 2004 10:28 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
bluechickidee
Send Email Send Email
 
I dunno whether ill get attacked for this or not but:
I am glad that I didn't try to program all at once with Perl. I would
have drowned. I went like this, in this order:

HTML- HTML 4 For Dummies
I actually somewhat regret that I learned this; it is of no advantage to
learning to program and I only ever used it to change existing HTML.

Javascript basics - http://webteacher.com/javascript
Here I learned the basic concepts of notation, syntax, and variables. It
also got me hyped about scripting

C++ - Sam's Teach Youself C++ in 24 Hours
Big mistake. I started out my first programming language with the DJGPP
compiler [insert beastlike hiss] and failed miserably. I just couldn't
get the compiler to work and as a result I never even got "Hello World!"
to work. Just before I quit, i downloaded and installed Dev_C++ by
Bloodshed Software and left the world of C++.

Perl- Online Community College course
I learned it well enough to rip off the instructor's (public domain of
course) code, like turning a wine database search into a keyword-based
intra-site websearch. My courses were good, but unfortunately had a very
steep learning curve and discouraged me from ever trying again. I rarely
tried again.

Java - Online Community College course
...dont....EVER.......   ...

TI-BASIC- Taught myself
This is the only language I have completely mastered and I consider
myself to be one of the top hundred programmers in the world (in 83
TI-BASIC). This language is interpreted by the Z80 TI-OS, which ships
with the TI graphing calculators. This was an utter mistake as you only
have access to ten string vars, 27 real number vars, ten bitmaps, ten
matrices, and a bunch of stat lists. But hey, it's portable. The
language runs at less than 2mhz, but nevertheless it's fast enough for
math and non-graphics-intensive games. I started learning Z80 assembly
(gameboys, graphing calculators, etc) but quit when I saw what you had
to do to divide (w/o romcalls):

	 LD HL,5 ; 256 / 52 = 5
	 LD D,E
	 LD E,L

	 ADD HL,HL ; HL = $000A
	 ADD HL,DE ; HL = $000F
	 ADD HL,HL ; HL = $001E
	 ADD HL,DE ; HL = $0023
	 ADD HL,HL ; HL = $0046
	 ADD HL,DE ; HL = $004B
	 ADD HL,HL ; HL = $0096
	 ADD HL,DE ; HL = $009B
	 ADD HL,HL ; HL = $0136
	 ADD HL,DE ; HL = $013B
	 ADD HL,HL ; HL = $0276
	 ADD HL,DE ; HL = $027B


PHP - PHP/MySQL Programming for the absolute beginner
For an into to programming/scripting, I highly recommend this book. It
goes as far back as basic HTML and takes you straight through advanced
MySQL manipulation. Yeah, I know its PHP but you can't deny that its at
least beginner friendly (even if its not as powerful as perl) and the
book is great.

C++ - Sam's Teach Youself C++ in 24 Hours
I'm on this right now and its going great.

I think that HTML first (in 6th grade, too!) helped with learning basic
scripting which helped learn advanced scripting which helped me learn
programming.




wadunn83 wrote:

> Hello.
>
> I am a biologist.  I have been interested in learning to program for a
> long time and have decided to just jump in and try not to drown.  I am
> looking for a book that will give me what I need to form a strong
> foundation that I can use to start experimenting and grow.  Does
> anyone have a favorite EXTREME beginner's book that they like?  Also
> why is it good.  I should say that I will be using a Mac running OS
> 10.2.  Thank you all and good day.
>
> Augustine
>
>
>
>
> Unsubscribing info is here:
> http://help.yahoo.com/help/us/groups/groups-32.html
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
>
<http://rd.yahoo.com/SIG=12ctjbhfp/M=267637.4116732.5333197.1261774/D=egroupweb/\
S=1705006951:HM/EXP=1075480374/A=1945638/R=0/*http://www.netflix.com/Default?mqs\
o=60178383&partid=4116732>
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/perl-beginner/
>
>     * To unsubscribe from this group, send an email to:
>       perl-beginner-unsubscribe@yahoogroups.com
>       <mailto:perl-beginner-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

#17891 From: Brian Gordon <microsteel@...>
Date: Thu Jan 29, 2004 10:45 pm
Subject: Re: [PBML] The best book for an extreme Newbie to programming
bluechickidee
Send Email Send Email
 
oh and the reason that I said I downloaded dev_c++ is because I
redisovered it and its working great, best compiler I've ever used (free
too). However, you'll probably never have any need to write anything
executable unless it needs to be distributable. And something you should
know if you don't already, advanced scripting like Perl, PHP, and ASP
all need to run on a webserver. So unless you're going to upload all of
your code or just install Activeperl and/or apache on your system, you
just can't do it. asm and javascript and vbscript work on your comp, and
if you're willing to purchase some devtools like visual basic,
coldfusion, or .net, they work too. I would suggest not buying a devpack
just because if it needs one and its complicated enough to cost money,
then its too complicated for a beginner. I would blindly say that
Coldfusion would probably be the most beginner-friendly of the paid
ones, unless you get something platform-unique like calculator basic or
something.

Brian Gordon wrote:

> I dunno whether ill get attacked for this or not but:
> I am glad that I didn't try to program all at once with Perl. I would
> have drowned. I went like this, in this order:
>
> HTML- HTML 4 For Dummies
> I actually somewhat regret that I learned this; it is of no advantage to
> learning to program and I only ever used it to change existing HTML.
>
> Javascript basics - http://webteacher.com/javascript
> Here I learned the basic concepts of notation, syntax, and variables. It
> also got me hyped about scripting
>
> C++ - Sam's Teach Youself C++ in 24 Hours
> Big mistake. I started out my first programming language with the DJGPP
> compiler [insert beastlike hiss] and failed miserably. I just couldn't
> get the compiler to work and as a result I never even got "Hello World!"
> to work. Just before I quit, i downloaded and installed Dev_C++ by
> Bloodshed Software and left the world of C++.
>
> Perl- Online Community College course
> I learned it well enough to rip off the instructor's (public domain of
> course) code, like turning a wine database search into a keyword-based
> intra-site websearch. My courses were good, but unfortunately had a very
> steep learning curve and discouraged me from ever trying again. I rarely
> tried again.
>
> Java - Online Community College course
> ...dont....EVER.......   ...
>
> TI-BASIC- Taught myself
> This is the only language I have completely mastered and I consider
> myself to be one of the top hundred programmers in the world (in 83
> TI-BASIC). This language is interpreted by the Z80 TI-OS, which ships
> with the TI graphing calculators. This was an utter mistake as you only
> have access to ten string vars, 27 real number vars, ten bitmaps, ten
> matrices, and a bunch of stat lists. But hey, it's portable. The
> language runs at less than 2mhz, but nevertheless it's fast enough for
> math and non-graphics-intensive games. I started learning Z80 assembly
> (gameboys, graphing calculators, etc) but quit when I saw what you had
> to do to divide (w/o romcalls):
>
>       LD      HL,5      ; 256 / 52 = 5
>       LD      D,E
>       LD      E,L
>
>       ADD      HL,HL      ; HL = $000A
>       ADD      HL,DE      ; HL = $000F
>       ADD      HL,HL      ; HL = $001E
>       ADD      HL,DE      ; HL = $0023
>       ADD      HL,HL      ; HL = $0046
>       ADD      HL,DE      ; HL = $004B
>       ADD      HL,HL      ; HL = $0096
>       ADD      HL,DE      ; HL = $009B
>       ADD      HL,HL      ; HL = $0136
>       ADD      HL,DE      ; HL = $013B
>       ADD      HL,HL      ; HL = $0276
>       ADD      HL,DE      ; HL = $027B
>
>
> PHP - PHP/MySQL Programming for the absolute beginner
> For an into to programming/scripting, I highly recommend this book. It
> goes as far back as basic HTML and takes you straight through advanced
> MySQL manipulation. Yeah, I know its PHP but you can't deny that its at
> least beginner friendly (even if its not as powerful as perl) and the
> book is great.
>
> C++ - Sam's Teach Youself C++ in 24 Hours
> I'm on this right now and its going great.
>
> I think that HTML first (in 6th grade, too!) helped with learning basic
> scripting which helped learn advanced scripting which helped me learn
> programming.
>
>
>
>
> wadunn83 wrote:
>
> > Hello.
> >
> > I am a biologist.  I have been interested in learning to program for a
> > long time and have decided to just jump in and try not to drown.  I am
> > looking for a book that will give me what I need to form a strong
> > foundation that I can use to start experimenting and grow.  Does
> > anyone have a favorite EXTREME beginner's book that they like?  Also
> > why is it good.  I should say that I will be using a Mac running OS
> > 10.2.  Thank you all and good day.
> >
> > Augustine
> >
> >
> >
> >
> > Unsubscribing info is here:
> > http://help.yahoo.com/help/us/groups/groups-32.html
> >
> >
> > *Yahoo! Groups Sponsor*
> > ADVERTISEMENT
> >
>
<http://rd.yahoo.com/SIG=12ctjbhfp/M=267637.4116732.5333197.1261774/D=egroupweb/\
S=1705006951:HM/EXP=1075480374/A=1945638/R=0/*http://www.netflix.com/Default?mqs\
o=60178383&partid=4116732
>
<http://rd.yahoo.com/SIG=12ctjbhfp/M=267637.4116732.5333197.1261774/D=egroupweb/\
S=1705006951:HM/EXP=1075480374/A=1945638/R=0/*http://www.netflix.com/Default?mqs\
o=60178383&partid=4116732>>
>
> >
> >
> >
> > ------------------------------------------------------------------------
> > *Yahoo! Groups Links*
> >
> >     * To visit your group on the web, go to:
> >       http://groups.yahoo.com/group/perl-beginner/
> >
> >     * To unsubscribe from this group, send an email to:
> >       perl-beginner-unsubscribe@yahoogroups.com
> >
> <mailto:perl-beginner-unsubscribe@yahoogroups.com?subject=Unsubscribe>
> >
> >     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> >       Service <http://docs.yahoo.com/info/terms/>.
> >
> >
>
>
> Unsubscribing info is here:
> http://help.yahoo.com/help/us/groups/groups-32.html
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
>
<http://rd.yahoo.com/SIG=12c9br4c5/M=267637.4116732.5333197.1261774/D=egroupweb/\
S=1705006951:HM/EXP=1075501786/A=1945637/R=0/*http://www.netflix.com/Default?mqs\
o=60178397&partid=4116732>
>
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/perl-beginner/
>
>     * To unsubscribe from this group, send an email to:
>       perl-beginner-unsubscribe@yahoogroups.com
>       <mailto:perl-beginner-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

#17892 From: "J.E. Cripps" <cycmn@...>
Date: Fri Jan 30, 2004 1:39 am
Subject: De incunabula nostra (Was:The best book for an extreme Newbie to programming)
cycmn@...
Send Email Send Email
 
> From: Brian Gordon <microsteel@...> in forum haec scripsit hodie:
> replying to Augustine <wadunn83@...>
> > I dunno whether ill get attacked for this or not but:
> > I am glad that I didn't try to program all at once with Perl. I would
> > have drowned. I went like this, in this order...

    Brian's braver than I am.  Most ppl can recall a confusing and
    intermittent programming infancy but don't dare to relate the
    gory details, even though discussion would be helpful (I'm
    not sure where, though)

    His is not wildly unusual for ppl those who began
    in recent decade(s)  and at an early age (single-digit)
    But there's no "typical infancy" any more, if there ever was.

    The metaphor of "drowning" is interesting.  I have horrible
    memories of early failure (but not with Perl, because of the
    community support.)

    I'd like to say there's no real reason for fear, come in
    the water's fine (at the shallow end) You won't drown
    (unless you've made representations of skill or committments
    beyond your capacity to fulfill in a fairly limited time.)

    Or maybe another metaphor, flight, "ad astra per aspera"
    Frustrations will crop up, all the time. The earlier flights
    aren't long and you will crash.  But it will be more enjoyable
    long before your skills are stellar.

[BG, recalling a non-Perl language and one of its compilers...]
> > Big mistake. I started out my first programming language with the [a
> > well-regarded compiler] I just couldn't get the compiler to work and as
> > a result I never even got "Hello World!" to work.

     "This is the big hurdle: to leap over it you have to be able
      to create the program text somewhere... run it, and find out
      where your output went. With these mechanical difficulties
      mastered everything else is comparatively easy." Brian
      Kernighan and Dennis Ritchie, in a renowned non-Perl book [0]

   This is  one reason to  recommend Perl. I've installed it from
   a CD several times with no difficulty (although I prefer OSes
   where it's a standard) Not on a Mac, though.

    To recapitulate: text editor (or what you will), perl (lc, the
    interpreter, vide perlfaq1), perl perl (and all the other
    docs)... type the code, run it, and capture and read the error
    messages.  Repeat ad libitum...

Regards CYC/JEC


[0] The C Programming Language, 2nd edition (1988)
Glossarium: incunabula, incunabulorum: infants' clothes; cradle; infancy
	     astrum, astri: star
	     asper, -era, -erum: stormy, harsh, rude, difficult
--
A new day is dawning: http://www.nyxls.com

#17893 From: "Maria K Meyers" <mmeyer4@...>
Date: Fri Jan 30, 2004 2:06 am
Subject: Re: [PBML] The best book for an extreme Newbie to programming
compbrat75
Send Email Send Email
 
I'm a visual learner.  I started all of my programming interests with the
Visual Quickstart Guides.  They have one tailored to website CGIs.  That's
what I needed and it helped me a lot. From there, I bought the mammoth
Complete Reference Guide from Osborne/McGraw Hill, joined this group, and
book marked some helpful perl sites.  I am still a beginner in a lot of
ways.  My regret is that I learned only what I needed for each project.
So, I am missing some of the building blocks and that causes me some grief.
Some one recently gave me a helpful hint on this list about the $! scalar
variable.  It listed error output for me! So, I suggest that after the
Visual Quickstart Guide, get a good building blocks book.
~Maria



                       "wadunn83"
                       <wadunn83@...        To:      
perl-beginner@yahoogroups.com
                       >                        cc:       (bcc: Maria K
Meyers/CrownCenter/HALLMARK)
                                                Subject:  [PBML] The best book
for an extreme Newbie to programming
                       01/29/04 10:32 AM
                       Please respond to
                       perl-beginner






Hello.

I am a biologist.  I have been interested in learning to program for a
long time and have decided to just jump in and try not to drown.  I am
looking for a book that will give me what I need to form a strong
foundation that I can use to start experimenting and grow.  Does
anyone have a favorite EXTREME beginner's book that they like?  Also
why is it good.  I should say that I will be using a Mac running OS
10.2.  Thank you all and good day.

Augustine



Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html


Yahoo! Groups Links

To visit your group on the web, go to:
  http://groups.yahoo.com/group/perl-beginner/

To unsubscribe from this group, send an email to:
  perl-beginner-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
  http://docs.yahoo.com/info/terms/

#17894 From: destinydreamer_69 <destinydreamer_69@...>
Date: Fri Jan 30, 2004 2:38 pm
Subject: Re: The best book for an extreme Newbie to programming
destinydream...
Send Email Send Email
 
I am also a research person in a department that is
rapidly developing an interest in bioinformatics. A
very nice beginners book we've come across is
http://vig.prenhall.com/academic/product?ISBN=0130284181
  I am looking at taking a "Special Studies"
(independent) course in Perl here very soon. I like
the flow of this book and their emphasis on LiveCode
examples. Thought its not a (well-respected) O'Reilly
book, Deitel has a well established name made for
them. It also has a few chapters in it on the things
that you will be dealing with in terms of other
programs, while using perl: CGI, tk, CSS, and even a
chapter on Python (although I havent yet decided if us
bioinformatics folks do much with Python). If you
happen to have a Pren-Hall rep available, you can also
order the Instructors Solution manual etc etc.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

#17895 From: "Dustin Davis" <dustin@...>
Date: Fri Jan 30, 2004 1:54 pm
Subject: sort funtion
xhenxhe
Send Email Send Email
 
I have an array containg strings that I want to sort. If I do

@array = sort(@array);

I get something like this:

\BINDING.HTML
\TEACHINGS 2004.HTML
\TEACHINGS 2004\1.HTML
\TEACHINGS 2004\1\1.HTML
\TEACHINGS 2004\1\2.HTML
\TEACHINGS 2004\1\3.HTML
\TEACHINGS 2004\1\4.HTML
\TEACHINGS 2004\1\5.HTML
\TEACHINGS 2004\10.HTML
\TEACHINGS 2004\10\1.HTML
\TEACHINGS 2004\10\2.HTML
\TEACHINGS 2004\10\3.HTML
\TEACHINGS 2004\10\4.HTML
\TEACHINGS 2004\10\5.HTML
\TEACHINGS 2004\10\6.HTML
\TEACHINGS 2004\2.HTML
\TEACHINGS 2004\2\1.HTML
\TEACHINGS 2004\2\2.HTML
\TEACHINGS 2004\2\3.HTML

... But, I need to get something like this:

\BINDING.HTML
\TEACHINGS 2004.HTML
\TEACHINGS 2004\1.HTML
\TEACHINGS 2004\10.HTML
\TEACHINGS 2004\10\1.HTML
\TEACHINGS 2004\10\2.HTML
\TEACHINGS 2004\10\3.HTML
\TEACHINGS 2004\10\4.HTML
\TEACHINGS 2004\10\5.HTML
\TEACHINGS 2004\10\6.HTML
\TEACHINGS 2004\1\1.HTML
\TEACHINGS 2004\1\2.HTML
\TEACHINGS 2004\1\3.HTML
\TEACHINGS 2004\1\4.HTML
\TEACHINGS 2004\1\5.HTML
\TEACHINGS 2004\2.HTML
\TEACHINGS 2004\2\1.HTML
\TEACHINGS 2004\2\2.HTML
\TEACHINGS 2004\2\3.HTML


Is there a way to change how the sort function sorts numbers as apposed to
characters?

Thanks,
Dustin

Dustin Davis
--
http://LDSPDA.com
http://Shiblon.com

#17896 From: "wadunn83" <wadunn83@...>
Date: Fri Jan 30, 2004 4:56 pm
Subject: Re: The best book for an extreme Newbie to programming
wadunn83
Send Email Send Email
 
I want to thank everyone who has replied to my original post.  You
guys have given me much to think about, and I owe you all.  I believe
that I am going to start with beginning perl for bioinformatics due to
its unassuming starting place and because that is what I want to use
this skill for in the first place.  Once again, i thank you all, and I
will pop in later and let you know how it is going!

Thanks again.

Augustine

#17897 From: "Fortuno, Adam" <fortunoa@...>
Date: Fri Jan 30, 2004 5:03 pm
Subject: RE: [PBML] sort funtion
fortunoa@...
Send Email Send Email
 
Make a custom sort (see http://www.perldoc.com/perl5.8.0/pod/func/sort.html
for details).

-----Original Message-----
From: Dustin Davis [mailto:dustin@...]
Sent: Friday, January 30, 2004 8:54 AM
To: perl-beginner@yahoogroups.com
Subject: [PBML] sort funtion


I have an array containg strings that I want to sort. If I do

@array = sort(@array);

I get something like this:

\BINDING.HTML
\TEACHINGS 2004.HTML
\TEACHINGS 2004\1.HTML
\TEACHINGS 2004\1\1.HTML
\TEACHINGS 2004\1\2.HTML
\TEACHINGS 2004\1\3.HTML
\TEACHINGS 2004\1\4.HTML
\TEACHINGS 2004\1\5.HTML
\TEACHINGS 2004\10.HTML
\TEACHINGS 2004\10\1.HTML
\TEACHINGS 2004\10\2.HTML
\TEACHINGS 2004\10\3.HTML
\TEACHINGS 2004\10\4.HTML
\TEACHINGS 2004\10\5.HTML
\TEACHINGS 2004\10\6.HTML
\TEACHINGS 2004\2.HTML
\TEACHINGS 2004\2\1.HTML
\TEACHINGS 2004\2\2.HTML
\TEACHINGS 2004\2\3.HTML

... But, I need to get something like this:

\BINDING.HTML
\TEACHINGS 2004.HTML
\TEACHINGS 2004\1.HTML
\TEACHINGS 2004\10.HTML
\TEACHINGS 2004\10\1.HTML
\TEACHINGS 2004\10\2.HTML
\TEACHINGS 2004\10\3.HTML
\TEACHINGS 2004\10\4.HTML
\TEACHINGS 2004\10\5.HTML
\TEACHINGS 2004\10\6.HTML
\TEACHINGS 2004\1\1.HTML
\TEACHINGS 2004\1\2.HTML
\TEACHINGS 2004\1\3.HTML
\TEACHINGS 2004\1\4.HTML
\TEACHINGS 2004\1\5.HTML
\TEACHINGS 2004\2.HTML
\TEACHINGS 2004\2\1.HTML
\TEACHINGS 2004\2\2.HTML
\TEACHINGS 2004\2\3.HTML


Is there a way to change how the sort function sorts numbers as apposed to
characters?

Thanks,
Dustin

Dustin Davis
--
http://LDSPDA.com
http://Shiblon.com

Unsubscribing info is here:
http://help.yahoo.com/help/us/groups/groups-32.html

Yahoo! Groups Links

To visit your group on the web, go to:
  http://groups.yahoo.com/group/perl-beginner/

To unsubscribe from this group, send an email to:
  perl-beginner-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
  http://docs.yahoo.com/info/terms/

#17898 From: daymobrew@...
Date: Fri Jan 30, 2004 5:10 pm
Subject: Re: sort funtion
daymobrew
Send Email Send Email
 
--- In perl-beginner@yahoogroups.com, "Dustin Davis" <dustin@d...> wrote:
> I have an array containg strings that I want to sort. If I do
>
> @array = sort(@array);
>
> I get something like this:
>
> \BINDING.HTML
> \TEACHINGS 2004.HTML
> \TEACHINGS 2004\1.HTML
> \TEACHINGS 2004\1\1.HTML
> \TEACHINGS 2004\1\2.HTML
> \TEACHINGS 2004\1\3.HTML
> \TEACHINGS 2004\1\4.HTML
> \TEACHINGS 2004\1\5.HTML
> \TEACHINGS 2004\10.HTML
> \TEACHINGS 2004\10\1.HTML
> \TEACHINGS 2004\10\2.HTML
> \TEACHINGS 2004\10\3.HTML
> \TEACHINGS 2004\10\4.HTML
> \TEACHINGS 2004\10\5.HTML
> \TEACHINGS 2004\10\6.HTML
> \TEACHINGS 2004\2.HTML
> \TEACHINGS 2004\2\1.HTML
> \TEACHINGS 2004\2\2.HTML
> \TEACHINGS 2004\2\3.HTML
>
> ... But, I need to get something like this:
>
> \BINDING.HTML
> \TEACHINGS 2004.HTML
> \TEACHINGS 2004\1.HTML
> \TEACHINGS 2004\10.HTML
> \TEACHINGS 2004\10\1.HTML
> \TEACHINGS 2004\10\2.HTML
> \TEACHINGS 2004\10\3.HTML
> \TEACHINGS 2004\10\4.HTML
> \TEACHINGS 2004\10\5.HTML
> \TEACHINGS 2004\10\6.HTML
> \TEACHINGS 2004\1\1.HTML
> \TEACHINGS 2004\1\2.HTML
> \TEACHINGS 2004\1\3.HTML
> \TEACHINGS 2004\1\4.HTML
> \TEACHINGS 2004\1\5.HTML
> \TEACHINGS 2004\2.HTML
> \TEACHINGS 2004\2\1.HTML
> \TEACHINGS 2004\2\2.HTML
> \TEACHINGS 2004\2\3.HTML
>
>
> Is there a way to change how the sort function sorts numbers as
apposed to
> characters?
>
> Thanks,
> Dustin
>
> Dustin Davis
> --
> http://LDSPDA.com
> http://Shiblon.com

You could use a subroutine to do the sorting.
See http://www.perldoc.com/perl5.8.0/pod/func/sort.html
and the 'byage' example.

You might need to split out the numeric portions of the path
e.g. \TEACHINGS 2004\2\3.HTML
into 2004,2,3
Then compare each bit of one path with another.
For example:
Path 1: \TEACHINGS 2004\2\3.HTML
Path 2: \TEACHINGS 2004\1\2.HTML
becomes 2004,2,3 and 2004,1,2
when compared 2004 == 2004 and then 2 > 1 so the first one is greater.

You would do the splitting on '\' and then extract numbers out with, I
think, s/(\d)/$1/g
I'm terrible with s/// so I have to experiment a lot with that when I
use it.

Hopefully I haven't confused you too much.

#17899 From: merlyn@...
Date: Fri Jan 30, 2004 5:25 pm
Subject: Re: [PBML] sort funtion
merlynstoneh...
Send Email Send Email
 
>>>>> "Fortuno," == Fortuno, Adam <fortunoa@...> writes:

Fortuno,> Make a custom sort (see
http://www.perldoc.com/perl5.8.0/pod/func/sort.html
Fortuno,> for details).

Or "perldoc -f sort".  Why the web when it's already on YOUR DISK?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#17900 From: "Dustin Davis" <dustin@...>
Date: Fri Jan 30, 2004 8:50 pm
Subject: Re: [PBML] sort funtion
xhenxhe
Send Email Send Email
 
Randal,

Are you trying to conserve bandwidth for perldoc.com?

merlyn@... said:
>>>>>> "Fortuno," == Fortuno, Adam <fortunoa@...> writes:
>
> Fortuno,> Make a custom sort (see
> http://www.perldoc.com/perl5.8.0/pod/func/sort.html
> Fortuno,> for details).
>
> Or "perldoc -f sort".  Why the web when it's already on YOUR DISK?
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
> 0095
> <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
>
> Unsubscribing info is here:
> http://help.yahoo.com/help/us/groups/groups-32.html
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/perl-beginner/
>
> To unsubscribe from this group, send an email to:
>  perl-beginner-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>
>


Dustin Davis
--
http://LDSPDA.com
http://Shiblon.com

#17901 From: merlyn@...
Date: Fri Jan 30, 2004 10:05 pm
Subject: Re: [PBML] sort funtion
merlynstoneh...
Send Email Send Email
 
>>>>> "Dustin" == Dustin Davis <dustin@...> writes:

Dustin> Are you trying to conserve bandwidth for perldoc.com?

No, I'm trying to point you to local resources, and resources that
precisely fit *your* perl installation.  You might not have 5.8.0.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#17902 From: jnf <jnf@...>
Date: Sat Jan 31, 2004 4:36 pm
Subject: rfc 2817 type http tunnel/proxy
jnf@...
Send Email Send Email
 
Hello,

I am writing a perl (obviously) proxy/tunnel that complies with rfc 2817
as far as it uses the connect method to connect. I am however having some
problems that appear to be on the web clients (read: browser) end, but i
seem to have problems with all common browsers, so I think it must be me.
I have attached the relevant source code because well, its fairley long
and I cannot find an error that affect this for the life of me. Let me
explain the problem, and then explain problems that I know exist in the
script.

problem:
what happens is the client (say mozilla) connect to the proxy, it issues
CONNECT host:port HTTP/1.1 and the rest of its header.
my script replies with 200 ok, and a header
at this point they negotiate a ssl connection, then the client sends me
the request and i forward it to the correct host, when i get the reply, i
forward it back to the client, sounds easy enough right?
Ok well almost all of that works correctly, the client connects ok, issues
the request ok, ssl is negotiated ok, request is sent to the remote
server, remote server gets it and replies and i get the reply. The problem
seems to be in giving the reply to the client. I've setup a packet sniffer
and watched this all happening and Ive noticied the client sends a FIN
just after it hands me the request after it establishes the ssl connection
to the proxy (i.e. GET / HTTP/1.1), but this is only a half close and
should still be able to read data from me, yet when i actually try to give
it the reply i get a RST from the port, short packet dump below:

TCP localhost.1722 -> localhost.8000 PSH seq: XXXX ack XXXX
data: CONNECT www.google.com:443 HTTP/1.1\r\n ETC
[ack cut out here]
TCP localhost.8000 -> localhost.1722 PSHseq:XXXX ack XXXX
data: 200 OK ETC
[ack cut out here]
SSL between proxy and client is negotiated here,
client sends request (i.e. GET / ...)
TCP localhost.1722 -> localhost.8000 FIN,ACK seq:XYZ ...
proxy connects to remote server
forwards request, gets reply
proxy prints reply to client
TCP localhost.8000 -> localhost.1722 PSH seq: XXXX etc
TCP localhost.1722 -> localhost.8000 RST seq: XYZ+1

---

Problems that I know exist in this script. i dont loop the reads at the end
where i actually get/send data between
the client/server, i havent gotten that far yet, this part wont work at
all.

At any rate, I cant figure out what the problem is, it seems to be in my
implementation, rather than in the code itself, any help would be
appreciated.

jnf








   ----------

use strict;
use Cwd qw(abs_path);

our $conport        = 8000;
our $dolog     = 1;
my $log_path     = abs_path('.');
our $logfile     = "$log_path/proxy.log";
our $ssl_dir     = '/usr/local/ssl/ssl/private/';

   ----------

#!/usr/bin/perl -w

use strict;
use POSIX qw(setsid WNOHANG);
use IO::Socket;
use IO::Socket::SSL qw(debug4);

$| = 1;

my ($CR, $LF, $CR_LF, $SP,$ME,$VERSION, $REPLY_STRING);
$CR      = "\x0d";
$LF      = "\x0a";
$CR_LF   = "\x0d\x0a";
$SP      = "\x20";
$ME      = 'ptunnel';
$VERSION = 'v1.0';
$REPLY_STRING .= $CR_LF .'Date: ' . tstamp() . $CR_LF . "Proxy-Connection:
Keep-Alive" . $CR_LF . "Connection: Keep-Alive" . $CR_LF . "Keep-Alive: 600" .
$CR_LF .
		  "Proxy-Agent: $ME/$VERSION" . $CR_LF . $CR_LF; #. "Proxy-Agent: Apache/1.3.x
(Unix)" . $CR_LF . $CR_LF;


my ( $config,
	 $port,
	 $pid,
	 $in,
	 $name,
	 $pserv,
	 $client,
	 $peer,
	 $ssl,
	 $method,
	 $uri,
	 $proto,
	 $host,
	 $rport,
	 $len,
	 $remote);

our ( $conport,
	 $ssl_dir,
	 $dolog,
	 $logfile);


$config    = "./conf.pl";

$SIG{HUP}  = \&doConf;
$SIG{PIPE} = 'IGNORE';
$SIG{CHLD} = \&reapKids;


################################
# sig handlers / configuration #
################################

sub doConf
  {

	 lprint("reading $config for port...\n");
	 unless(do $config)
          {
		 lprint("couldn't parse $config: $@\n")         if $@;
		 lprint("failed!! port is defaulting to 8000\n");
		 $port = 8000;
		 goto NOCONF;
   	 }
	 lprint("using port $conport\n");
	 $port = $conport;

	 NOCONF:
}

sub reapKids
  {
	 1 until (-1 == waitpid(-1, WNOHANG));
	 $SIG{CHLD} = \&reapKids;
}

####################
# general routines #
####################


####################################################
# just a small function to print to stdout/logfile #
# replaces print/die in all master print's         #
# lprint("message\n"); for print like semantics    #
# lprint("messages\n",1); for die like semantics   #
####################################################

sub lprint
  {
	 my ($line, $fatal) = @_;

	 print STDOUT localtime() . " $ME" ."[$$]: " . " $line";
	 if(defined($fatal))
	  {
		 exit;
	 }
}

##################################################
# this just setups up the listening server       #
# no real reason to make it exist in its own     #
# routine other than I am intending on making    #
# another version of this which has a master     #
# server which spawns X children that serve the  #
# requests ala apache. And this part wont change #
##################################################

sub doProxy
  {

	 lprint("setting up proxy server...\n");
	 $pserv = IO::Socket::INET->new(Proto     => 'tcp',
				       Reuse     => 1,
				       Listen    => SOMAXCONN,
				       LocalPort => $port) || lprint("couldnt setup proxy server: $!\n",1);

	 undef($port); 		 # no longer needed


}


#################################################
# just a short routine to call to decide if we  #
# are going to log or not, made a routine for   #
# the same reasons as doProxy()                 #
#################################################

sub doLog
  {
	 if($dolog)
	  {
		 open(STDOUT, '>>', "/$logfile") || lprint("could not redirect stdout to
$logfile: $!\n",1);
	 }
	 undef $dolog; 		 # no longer needed

}

################################################
# generates http-style timestamps for our      #
# replies to the clients. 	       #
################################################

sub tstamp
  {
	 my @days = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	 my @months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",
"Sep","Oct","Nov","Dec");
	 my ($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime();
	 my ($tstamp,$tz, $longyr);

	 $tz = 'GMT';
	 $longyr = $year + 1900;
	 $tstamp = sprintf("%3s, %02d %3s %04d %02d:%02d:%02d $tz",$days[$wday],
$mday,$months[$mon], $longyr, $hr, $min, $sec);
	 return $tstamp;
}

##############################################
# this is just our error trap function for   #
# start_SSL which will allow us to error out #
# 'correctly' 			     #
##############################################

sub sslErr
{
	 my ($sock, $err) = @_;
	 lprint("ssl accept failed: $err\n");
	 $sock->syswrite("ssl accept failed: $err\n");
	 close($sock);
	 exit;
}

sub conErr
  {
	 my ($rem,$sock) = @_;
	 lprint("error in connecting to $rem, closing peers connection.\n");
	 $sock->syswrite("XXX remote connect failed, closing connection\n");
	 $sock->close(SSL_ctx_free => 1);
	 exit;
}

################
# main routine #
################

doConf();
doProxy();

my $str;
$pid = fork();
exit if $pid;
lprint("fork failed: $!\n",1) unless defined $pid;
setsid() || lprint("setsid(): $!\n",1);

lprint("Starting log facilities, going into background.\n");
doLog();

while(1)
  {
	 if(($client = $pserv->accept()))
	  {
		 lprint("incoming connection ...\n");
		 $pid = fork();
		 lprint("fork() failed: $!\n",1) unless defined $pid;
		 if($pid)
		  {
			 lprint("fork successful ... going to wait for next client\n");
			 last;
		 }

	    }

}


# we are now a child. (feel free to act like one).
close($pserv); 					 # child doesnt need
$peer = $client->peerhost(); 			 # i am $ME who are $YOU ?
lprint("connection accepted from $peer\n");

$len = $client->sysread($in, (128 * 1024 +1)); # max header len

if($len > (128 *1024)) # we dont deal with a uri thats too large, just an
overall header thats too large.
  {
	 lprint("$peer gave us an invalid header of size $len, closing connection with
code 413.\n");
	 $client->syswrite("413 Request entity too large HTTP/1.1" . $REPLY_STRING);
	 close($client);
	 exit;
}

$in =~ s/^(?:\x0d?\x0a)+//; # ignore leading \r's and/or \n's

if ($in !~ s/^(\S+)[ \t]+(\S+)(?:[ \t]+(HTTP\/\d+\.\d+))?[^\x0a]*\x0a//)
  {

	 lprint("$peer gave us an invalid header. closing connection with code 400\n");
	 $client->syswrite("400 Bad Request HTTP/1.1" . $REPLY_STRING);
	 close($client);
	 exit;
}
# we should now have the method, uri, and proto handed to us, along with the
rest of the header
# we will now test to see if method eq CONNECT and if so we will strip the
leading
# http://|https://|etc off of it, and try a gethostbyname()
# $1 = method $2 = uri $3 = proto

$method = $1;
$uri    = $2;
$proto  = $3;

lprint("in = $in\n");

if(uc($method) =~ /CONNECT/)
  {
	 lprint("$peer sent us $method $uri $proto\n");
	 $client->syswrite("200 OK HTTP/1.1" . $REPLY_STRING);

	 IO::Socket::SSL->start_SSL($client,
	 			 SSL_server      => 1,
				 SSL_version     => 'TLSv1.0',
				 SSL_use_cert    => 1, # shouldnt need to do this, but nice to do so.
				 SSL_key_file    => "$ssl_dir/privkey.pem",
				 SSL_cert_file   => "$ssl_dir/cacert.pem",
				 SSL_verify_mode => 0x00) || sslErr($client, &IO::Socket::SSL::Errstr);



	 ($host,$rport) = split(":",$uri);
	 if(!defined($host))
	  {
			 $client->syswrite("400 Bad Request HTTP/1.1" . $REPLY_STRING);
			 $client->close(SSL_ctx_free => 1);
			 lprint("$peer gave us bad uri ($uri)\n",1);
	 }
	 lprint("attempting to validate/connect to $host:$rport\n");
	 unless((($name, undef, undef, undef, undef) = gethostbyname($host)))
	  {

			 $client->syswrite("400 Bad Stuff d00de HTTP/1.1" . $REPLY_STRING);
			 $client->close(SSL_ctx_free => 1);
			 lprint("gethostbyname() failed for $host, disconnecting $peer\n",1);
	 }
	 lprint("host: $host name: $name\n");
	 if($rport == 443)
	  {
		 if(!($remote = IO::Socket::SSL->new( PeerAddr => $name,
                	                     	      PeerPort => $rport,
                                   	   	      Proto    => 'tcp',
                                   	   	     SSL_version => 'TLSv1')))
		  {

		 $client->syswrite("408 STUFF AND THINGS HTTP/1.1" . $REPLY_STRING);
		 $client->close(SSL_ctx_free => 1);
		 lprint("unable to create outbound socket to $name:$rport: " .
&IO::Socket::SSL::errstr . "\n");
		 exit;
		 }
	 }
	 else
	  {
	 $remote = IO::Socket::INET->new(PeerAddr => $name,
					 PeerPort => $rport,
					 Proto    => 6,
					 Type  => SOCK_STREAM) || conErr($uri,$client);


	 }
	 lprint("connect to $name\n");
	 my $buf;
	 $len = $client->sysread($buf, (128 * 1024));
	 lprint("len: $len\n");
	 lprint("buf: $buf\n");
	 $len = $remote->syswrite($buf);
	 lprint("wrote len: $len\n");

	 $len = $remote->sysread($buf, (1024 * 1024));
	 lprint("read len: $len\n");
	 $len = $client->syswrite($buf) || lprint("write to ssl failed: $!\n");
	 lprint("remote len: $len\n");
}


lprint("child exiting ...\n");
$client->close(SSL_ctx_free => 1);
close($remote);
exit;


[Non-text portions of this message have been removed]

Messages 17873 - 17902 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help