[10078] in Perl-Users-Digest
Perl-Users Digest, Issue: 3671 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 9 17:07:51 1998
Date: Wed, 9 Sep 98 14:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 9 Sep 1998 Volume: 8 Number: 3671
Today's topics:
Re: Another newbie OO question <sidi@angband.org>
Re: column extraction from a string <jdporter@min.net>
Re: column extraction from a string (Matt Knecht)
Design by Contarct Seminar Series <training@eiffel.com>
Detecting one character in a Form Field <_nospam_eric@kissco.com>
failure on LWP install; please help <jdhunter@nitace.bsd.uchicago.edu>
Re: failure on LWP install; please help (brian moore)
getting default browser from registry dlynch@morrisonscientific.com
Re: History of Perl - round 1 <jdporter@min.net>
How to act as a cookie enable browser? (was: Any LWPng hup@addall.com
Re: How to act as a cookie enable browser? (was: Any LW (Mads Toftum)
Re: Internet Developer Job Vacancy <jdporter@min.net>
Re: Memory Management <jason.holland@dial.pipex.com>
Re: Off topic, but ... [Was Re: Perl & Java - differenc (I R A Aggie)
Re: Outputting Images & Links in HTML wheller@my-dejanews.com
Re: Perl Data Structures: trees etc... <jdporter@min.net>
Re: Perl Data Structures: trees etc... (Mark-Jason Dominus)
Re: Perl Programmer Needed (Faust Gertz)
Re: Perl Search Engine (Michael J Gebis)
Problem with dbm files and arrays <topper@virginia.edu>
Re: Problems with UNC on Windows platforms <felber@cybernetic.ch>
QUESTIONS (was: Perl Programmer Needed) (Patrick Timmins)
Re: QUESTIONS (was: Perl Programmer Needed) (Craig Berry)
Re: sleep <eashton@bbnplanet.com>
Re: String to Binary <jdw@alder.dev.tivoli.com>
Re: unsubscribe (Kevin Reid)
Re: Why Perl Again ? dn5006@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Sep 1998 18:58:48 GMT
From: Chris Sidi <sidi@angband.org>
Subject: Re: Another newbie OO question
Message-Id: <6t6j58$6du$1@news-int.gatech.edu>
You never used $class below. The blesses below should be:
my $self = bless {name => 'tony', age => 32, @_}, $class;
and
my $self = bless {}, $class;
-Sidi
Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> wrote:
> sub new {
> my $class = shift;
> my $self = bless {
> name => 'tony',
> age => 32,
> @_,
> };
> $self;
> }
> sub new {
> my $class = shift;
> my $self = bless {};
> my ($name, $age) = @_;
> $self->{name} = $name;
> $self->{age} = $age;
> $self;
> }
------------------------------
Date: Tue, 08 Sep 1998 15:17:18 -0400
From: John Porter <jdporter@min.net>
Subject: Re: column extraction from a string
Message-Id: <35F582BE.EB31F008@min.net>
Raj Subramani wrote:
>
> raj 7146 7088 220 12:10:38 ttypa 207:23 foo
> raj 7134 7088 220 12:10:27 ttypa 156:26 foo
> raj 7140 7088 220 12:10:33 ttypa 157:43 foo
>
> I need to extract the pid numbers which are in the 2nd
> column (i.e 7146, 7134 and 7140).
>
> At the moment I am going through a rather convoluted
> process to extract this 2nd column (spliting the string
> into a list and cycling through this list etc etc).
What's so convoluted about
for ( `ps -f` ) {
my $pid = (split)[1];
}
???
John Porter
------------------------------
Date: Wed, 09 Sep 1998 19:26:47 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: column extraction from a string
Message-Id: <XDAJ1.95$Mo5.607027@news2.voicenet.com>
John Porter <jdporter@min.net> wrote:
>What's so convoluted about
>
>for ( `ps -f` ) {
> my $pid = (split)[1];
>}
The coulmns in ps are not guarenteed to be seperated by spaces. Some
columns aren't even guarenteed to have values. The only reliable way to
parse ps data is by byte offset, not split on whitespace.
Although, split works for a quick and dirty hack. :)
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: Wed, 9 Sep 1998 13:31:06 -0700
From: "Interactive Software Eng." <training@eiffel.com>
Subject: Design by Contarct Seminar Series
Message-Id: <6t6ohk$599$1@news.rain.org>
DESIGN BY CONTACT AND THE COMPONENT REVOLUTION
Presented by Dr. Bertrand Meyer
The New Breakthrough in Software Technology
Design by Contract is the major technological breakthrough in software
engineering in the past 15 years. Design by Contract tackles head-on the
issue of software reliability, by taking a holistic approach to the
construction of systems so that
they will work correctly the first time around. Based on a simple yet
powerful metaphor - software systems as collections of components that
interact through contracts, similar to those between people or companies -
it has a profound effect on almost every aspect of software development,
from analysis and design to implementation, documentation, debugging,
quality assurance, maintenance, and project management.
The information-packed one-day seminar will present the principles of Design
by Contract and show how to apply them to build robust component-based
systems. Among other topics it will cover how to express the concepts in
languages such as Ada, C++, Eiffel, and Java ; applying Design by Contract
with COM/DCOM and CORBA; documenting software components; contracts and
software testing; contracts and quality assurance; exception handling;
contracts and standards; etc.
Find out the answers to the most pressing issues in this radically new
approach to software construction:
- What's Design by Contract beyond the buzzword?
- How much of Design by Contract can be applied in Java and C++? How much
can you do in classical languages such as C?
- What gains can you expect in terms of quality and productivity?
- How does Design by Contract fit with quality-enhancing standards such as
ISO 9001 and the CMM?
- How can you ascertain the quality of software components?
- How can developers produce useful documentation without huge extra work?
- How does Design by Contract affect the software lifecycle and project
management?
- What tools are available today to support Design by Contract?
Part of the course material will include a free book of your choice: Object
Oriented Software Construction, 2nd Edition or Reusable Software, both
authored by Dr. Bertrand Meyer.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FOR THE DETAILED PROGRAM AND LOCATIONS OF THE SEMINAR
PLEASE VISIT US AT http://www.eiffel.com/services/training/seminars
OR EMAIL TO training@eiffel.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Wed, 09 Sep 1998 20:49:58 GMT
From: "Eric" <_nospam_eric@kissco.com>
Subject: Detecting one character in a Form Field
Message-Id: <WRBJ1.280$BF.3033749@nnrp2.ni.net>
I'm new to perl programming and I need help on 1 problem. I have a form
field, which is a serial number($FORM{'Serial'}), and I need to detect what
the 5th character is. It sounds simple enough, but I can't figure it out.
Thanks,
Eric
------------------------------
Date: Wed, 9 Sep 1998 19:58:46 GMT
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: failure on LWP install; please help
Message-Id: <1r90jtvz0p.fsf@cace.bsd.uchicago.edu>
I am having trouble getting the libwww-perl routines installed system
wide. I have installed a number of other CPAN modules, all without
any problem. I have successfully installed all the prerequisites for
this module. Perhaps someone can give me some advice as to how I
should proceed. Below I have included the xterm session I used to try
and install the module. I piped the outputs of the commands into files
to make it more readable; the contents of the files are included
below.
I have tried this a few times already, each with the same effect. I
even went so far as to wipe out the entire base perl5 on my system and
reinstalled it from source, again to no effect. Apparently the
install script is encountering a file that already exists and dies; is
there any way to circumvent this behavior?
Thanks in advance,
JDH
xterm session:
Perl/CPAN-modules> tar xfz libwww-perl-5.36.tar.gz
Perl/CPAN-modules> cd libwww-perl-5.36
Perl/CPAN-modules/libwww-perl-5.36> perl Makefile.PL > perl.build
Perl/CPAN-modules/libwww-perl-5.36> make > perl.make
Perl/CPAN-modules/libwww-perl-5.36> make test > perl.test
The MediaTypes test might fail because you have a private ~/.mime.types file
If you get a failed test, try to move it away while testing.
Perl/CPAN-modules/libwww-perl-5.36> su
Password:
[root@cace libwww-perl-5.36]# make install
/usr/local/bin/perl -e 'use Config; chdir q{./blib/script}; foreach (qw(GET HEAD POST)) {' \
-e 'unlink "$_";' \
-e 'system("$Config{\"lns\"} lwp-request $_") && die; }'
/bin/ln: GET: File exists
Died at -e line 3.
make: *** [all] Error 13
[root@cace libwww-perl-5.36]#
The outputs of the commands are included below:
perl.build
Checking for HTML::Parser.. ok
Checking for MIME::Base64.. ok
Checking for Net::FTP...... ok
Checking for MD5 .......... ok
Checking if your kit is complete...
Looks good
Writing Makefile for libwww-perl
perl.make
mkdir ./blib
mkdir ./blib/lib
mkdir ./blib/arch
mkdir ./blib/arch/auto
mkdir ./blib/arch/auto/libwww-perl
mkdir ./blib/lib/auto
mkdir ./blib/lib/auto/libwww-perl
mkdir ./blib/man1
mkdir ./blib/man3
cp lib/HTTP/Request/Common.pm ./blib/lib/HTTP/Request/Common.pm
cp lib/LWP/Protocol.pm ./blib/lib/LWP/Protocol.pm
cp lib/LWP/Protocol/https.pm ./blib/lib/LWP/Protocol/https.pm
cp lib/HTTP/Request.pm ./blib/lib/HTTP/Request.pm
cp lib/HTTP/Headers/Util.pm ./blib/lib/HTTP/Headers/Util.pm
cp lib/URI/URL/_login.pm ./blib/lib/URI/URL/_login.pm
cp lib/URI/URL/prospero.pm ./blib/lib/URI/URL/prospero.pm
cp lib/URI/URL/data.pm ./blib/lib/URI/URL/data.pm
cp lib/HTTP/Response.pm ./blib/lib/HTTP/Response.pm
cp lib/LWP/RobotUA.pm ./blib/lib/LWP/RobotUA.pm
cp lib/URI/URL/file.pm ./blib/lib/URI/URL/file.pm
AutoSplitting URI::URL::file (./blib/lib/auto/URI/URL/file)
cp lib/HTTP/Daemon.pm ./blib/lib/HTTP/Daemon.pm
cp lib/LWP/Protocol/nntp.pm ./blib/lib/LWP/Protocol/nntp.pm
cp lib/LWP/Protocol/http.pm ./blib/lib/LWP/Protocol/http.pm
cp lib/WWW/RobotRules.pm ./blib/lib/WWW/RobotRules.pm
cp lib/URI/URL/gopher.pm ./blib/lib/URI/URL/gopher.pm
cp lib/File/Listing.pm ./blib/lib/File/Listing.pm
cp lib/LWP/Debug.pm ./blib/lib/LWP/Debug.pm
cp lib/LWP/Protocol/mailto.pm ./blib/lib/LWP/Protocol/mailto.pm
cp lib/URI/URL/ftp.pm ./blib/lib/URI/URL/ftp.pm
cp lib/URI/URL/whois.pm ./blib/lib/URI/URL/whois.pm
cp lib/HTTP/Headers/Auth.pm ./blib/lib/HTTP/Headers/Auth.pm
cp lib/URI/URL/rlogin.pm ./blib/lib/URI/URL/rlogin.pm
cp lib/URI/URL/telnet.pm ./blib/lib/URI/URL/telnet.pm
cp lib/URI/Heuristic.pm ./blib/lib/URI/Heuristic.pm
cp lib/URI/URL/tn3270.pm ./blib/lib/URI/URL/tn3270.pm
cp lib/HTTP/Negotiate.pm ./blib/lib/HTTP/Negotiate.pm
cp lib/URI/Escape.pm ./blib/lib/URI/Escape.pm
cp lib/LWP/UserAgent.pm ./blib/lib/LWP/UserAgent.pm
AutoSplitting LWP::UserAgent (./blib/lib/auto/LWP/UserAgent)
cp lib/URI/URL.pm ./blib/lib/URI/URL.pm
AutoSplitting URI::URL (./blib/lib/auto/URI/URL)
cp lib/LWP.pm ./blib/lib/./LWP.pm
cp lib/HTTP/Status.pm ./blib/lib/HTTP/Status.pm
cp lib/URI/URL/https.pm ./blib/lib/URI/URL/https.pm
cp lib/HTTP/Message.pm ./blib/lib/HTTP/Message.pm
cp lib/URI/URL/wais.pm ./blib/lib/URI/URL/wais.pm
cp lib/LWP/Authen/Digest.pm ./blib/lib/LWP/Authen/Digest.pm
cp lib/LWP/MediaTypes.pm ./blib/lib/LWP/MediaTypes.pm
cp lib/LWP/Authen/Basic.pm ./blib/lib/LWP/Authen/Basic.pm
cp lib/LWP/media.types ./blib/lib/LWP/media.types
cp lib/HTTP/Headers/ETag.pm ./blib/lib/HTTP/Headers/ETag.pm
cp lib/HTTP/Cookies.pm ./blib/lib/HTTP/Cookies.pm
cp lib/URI/URL/finger.pm ./blib/lib/URI/URL/finger.pm
cp lib/Bundle/LWP.pm ./blib/lib/Bundle/LWP.pm
cp lib/LWP/Protocol/data.pm ./blib/lib/LWP/Protocol/data.pm
cp lib/URI/URL/webster.pm ./blib/lib/URI/URL/webster.pm
cp lib/URI/URL/_generic.pm ./blib/lib/URI/URL/_generic.pm
AutoSplitting URI::URL::_generic (./blib/lib/auto/URI/URL/_generic)
cp lib/URI/URL/news.pm ./blib/lib/URI/URL/news.pm
cp lwpcook.pod ./blib/lib/lwpcook.pod
cp lib/LWP/MemberMixin.pm ./blib/lib/LWP/MemberMixin.pm
cp lib/URI/URL/nntp.pm ./blib/lib/URI/URL/nntp.pm
cp lib/URI/URL/http.pm ./blib/lib/URI/URL/http.pm
AutoSplitting URI::URL::http (./blib/lib/auto/URI/URL/http)
cp lib/LWP/Protocol/file.pm ./blib/lib/LWP/Protocol/file.pm
cp lib/URI/URL/mailto.pm ./blib/lib/URI/URL/mailto.pm
cp lib/LWP/Protocol/gopher.pm ./blib/lib/LWP/Protocol/gopher.pm
cp lib/HTTP/Headers.pm ./blib/lib/HTTP/Headers.pm
cp lib/LWP/Simple.pm ./blib/lib/LWP/Simple.pm
cp lib/HTTP/Date.pm ./blib/lib/HTTP/Date.pm
cp lib/LWP/Protocol/ftp.pm ./blib/lib/LWP/Protocol/ftp.pm
cp lib/WWW/RobotRules/AnyDBM_File.pm ./blib/lib/WWW/RobotRules/AnyDBM_File.pm
/usr/local/bin/perl -I./blib/arch -I./blib/lib -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 bin/lwp-download.PL
Extracting lwp-download (with variable substitutions)
/usr/local/bin/perl -I./blib/arch -I./blib/lib -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 bin/lwp-request.PL
Extracting lwp-request (with variable substitutions)
/usr/local/bin/perl -I./blib/arch -I./blib/lib -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 bin/lwp-rget.PL
Extracting lwp-rget (with variable substitutions)
/usr/local/bin/perl -I./blib/arch -I./blib/lib -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 bin/lwp-mirror.PL
Extracting lwp-mirror (with variable substitutions)
Manifying ./blib/man3/URI::Heuristic.3
Manifying ./blib/man3/HTTP::Negotiate.3
Manifying ./blib/man1/lwp-download.1
Manifying ./blib/man3/HTTP::Request::Common.3
Manifying ./blib/man3/URI::Escape.3
Manifying ./blib/man3/LWP::UserAgent.3
Manifying ./blib/man3/URI::URL.3
Manifying ./blib/man1/lwp-mirror.1
Manifying ./blib/man3/LWP.3
Manifying ./blib/man3/HTTP::Status.3
Manifying ./blib/man3/LWP::Protocol.3
Manifying ./blib/man3/HTTP::Message.3
Manifying ./blib/man3/LWP::MediaTypes.3
Manifying ./blib/man3/HTTP::Headers::Util.3
Manifying ./blib/man3/HTTP::Request.3
Manifying ./blib/man3/Bundle::LWP.3
Manifying ./blib/man3/HTTP::Cookies.3
Manifying ./blib/man3/LWP::RobotUA.3
Manifying ./blib/man3/HTTP::Response.3
Manifying ./blib/man3/LWP::MemberMixin.3
Manifying ./blib/man3/lwpcook.3
Manifying ./blib/man1/lwp-request.1
Manifying ./blib/man3/HTTP::Daemon.3
Manifying ./blib/man3/WWW::RobotRules.3
Manifying ./blib/man3/LWP::Debug.3
Manifying ./blib/man3/File::Listing.3
Manifying ./blib/man1/lwp-rget.1
Manifying ./blib/man3/HTTP::Headers.3
Manifying ./blib/man3/LWP::Simple.3
Manifying ./blib/man3/HTTP::Date.3
Manifying ./blib/man3/WWW::RobotRules::AnyDBM_File.3
mkdir ./blib/script
cp bin/lwp-download ./blib/script/lwp-download
/usr/local/bin/perl -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 -MExtUtils::MakeMaker -e "MY->fixin(shift)" ./blib/script/lwp-download
cp bin/lwp-request ./blib/script/lwp-request
/usr/local/bin/perl -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 -MExtUtils::MakeMaker -e "MY->fixin(shift)" ./blib/script/lwp-request
cp bin/lwp-rget ./blib/script/lwp-rget
/usr/local/bin/perl -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 -MExtUtils::MakeMaker -e "MY->fixin(shift)" ./blib/script/lwp-rget
cp bin/lwp-mirror ./blib/script/lwp-mirror
/usr/local/bin/perl -I/usr/lib/perl5/i586-linux/5.00404 -I/usr/lib/perl5 -MExtUtils::MakeMaker -e "MY->fixin(shift)" ./blib/script/lwp-mirror
/usr/local/bin/perl -e 'use Config; chdir q{./blib/script}; foreach (qw(GET HEAD POST)) {' \
-e 'unlink "$_";' \
-e 'system("$Config{\"lns\"} lwp-request $_") && die; }'
perl.test:
/usr/local/bin/perl -e 'use Config; chdir q{./blib/script}; foreach (qw(GET HEAD POST)) {' \
-e 'unlink "$_";' \
-e 'system("$Config{\"lns\"} lwp-request $_") && die; }'
/usr/local/bin/perl t/TEST 0
base/common-req.....ok
base/cookies........ok
base/date...........ok
base/headers-auth...ok
base/headers-etag...ok
base/headers-util...ok
base/headers........ok
base/listing........ok
base/mediatypes.....ok
base/message........ok
base/negotiate......ok
base/response.......ok
base/status.........ok
uri/abs-config......ok
uri/base............ok
uri/heuristic.......ok
uri/rel-base........ok
robot/rules-dbm.....ok
robot/rules.........ok
robot/ua............ok
local/autoload......ok
local/get...........ok
local/http..........ok
local/protosub......ok
All tests successful.
Files=24, Tests=301, 32 secs (11.70 cusr 1.52 csys = 13.22 cpu)
--
John D. Hunter h:(773) 288-3970
University of Chicago w:(773) 702-5857
------------------------------
Date: 9 Sep 1998 20:27:31 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: failure on LWP install; please help
Message-Id: <slrn6vdp5q.r63.bem@thorin.cmc.net>
On Wed, 9 Sep 1998 19:58:46 GMT,
John Hunter <jdhunter@nitace.bsd.uchicago.edu> wrote:
>
> I am having trouble getting the libwww-perl routines installed system
> wide. I have installed a number of other CPAN modules, all without
> any problem. I have successfully installed all the prerequisites for
> this module. Perhaps someone can give me some advice as to how I
> should proceed. Below I have included the xterm session I used to try
> and install the module. I piped the outputs of the commands into files
> to make it more readable; the contents of the files are included
> below.
>
> I have tried this a few times already, each with the same effect. I
> even went so far as to wipe out the entire base perl5 on my system and
> reinstalled it from source, again to no effect. Apparently the
> install script is encountering a file that already exists and dies; is
> there any way to circumvent this behavior?
> /bin/ln: GET: File exists
rm /usr/bin/GET /usr/bin/HEAD /usr/bin/PUT
--
Brian Moore | "The Zen nature of a spammer resembles
Sysadmin, C/Perl Hacker | a cockroach, except that the cockroach
Usenet Vandal | is higher up on the evolutionary chain."
Netscum, Bane of Elves. Peter Olson, Delphi Postmaster
------------------------------
Date: Wed, 09 Sep 1998 18:35:52 GMT
From: dlynch@morrisonscientific.com
Subject: getting default browser from registry
Message-Id: <35f6c9ae.3167975@news.canuck.com>
Hi,
Does anyone know how to get the default browser from the registry? I
need to invoke a user's default browser from a Perl script. Any help
would be greatly appreciated.
David.
------------------------------
Date: Tue, 08 Sep 1998 15:55:40 -0400
From: John Porter <jdporter@min.net>
Subject: Re: History of Perl - round 1
Message-Id: <35F58BBC.1F0EF0A7@min.net>
Norman UNsoliciteds wrote:
>
> In article <KcBI1.8$qx3.716475@burlma1-snr1.gtei.net>, "Elaine
> -HappyFunBall- Ashton" <eashton@bbnplanet.com> wrote:
>
> > i lurked here and posted
> > occasionally as a guy, same style, never flamed. in one weeks time, as my
> > female self, i have been flamed no less than 3 times for my lack of
> > punctuation. now, i draw my own conclusions, you can draw yours.
>
> To be fair old Abigail flames anyone regardless of sex. Something of a
> rarity - an indiscriminate biggot
And why not? He plays the same game himself.
--
John Porter
------------------------------
Date: Wed, 09 Sep 1998 19:42:49 GMT
From: hup@addall.com
Subject: How to act as a cookie enable browser? (was: Any LWPng example?)
Message-Id: <6t6lnp$40c$1@nnrp1.dejanews.com>
> A nice example can be found at:
> http://www.stonehenge.com/merlyn/WebTechniques/col27.html
It's a great example for Parallel UserAgent. Thanks for your help. :)
Do you have any idea where could I find a example code which can make
my program act like a cookie enable browser?
As some web site do cookie checking, I have to enable cookie for accesing.
Many Thanks.
--
----------------------------------------------------------------------
AddALL is a book searching and price comparison meta search engine.
The free service find books and compare prices among 18 online bookstores.
Please visit http://www.addall.com to save your Time and Money.
-- Chai-Hup Chen hup@addall.com --------------------------------------
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 09 Sep 1998 20:22:53 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: How to act as a cookie enable browser? (was: Any LWPng example?)
Message-Id: <35f7e2ad.36073626@news.inet.tele.dk>
On Wed, 09 Sep 1998 19:42:49 GMT, hup@addall.com wrote:
> Do you have any idea where could I find a example code which can make
> my program act like a cookie enable browser?
you might want to take a look at HTTP::Cookies (part of the
libwww-perl distribution). The included pod should be able to get you
started.
vh
Mads Toftum, QDPH
som pe USENET reprfsenterer sig selv og ingen andre.
------------------------------
Date: Tue, 08 Sep 1998 15:20:31 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Internet Developer Job Vacancy
Message-Id: <35F5837F.6FFE8AE0@min.net>
richardashrowan@my-dejanews.com wrote:
>
> Internet developer/Network support
>[...]
> Richard Ashrowan
Oh, the delicious irony.
--
John Porter
------------------------------
Date: Wed, 09 Sep 1998 20:23:01 +0000
From: Jason Holland <jason.holland@dial.pipex.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Memory Management
Message-Id: <35F6E3A5.128297A5@dial.pipex.com>
Thanks Larry,
Re: your reply about my Perl memory management question.
I scanned the FAQa myself, but missed this one I'm afraid. I will be
more vigilant in future. However what you turned up has got me even more
stumped.
So memory that Perl grabs is NOT returned to the system eh? Well, the
variables that I would like to clear are contained within an object
(part of a blessed hash) and so will probably never go out of scope as
such, at least not for the lifetime of the program.
Perhaps using a sub-object contained within the larger object for
holding potentially volatile data??? The sub-object can then be deleted,
severing all contained variables and references.
Although the FAQ mentions that one should not worry about memory
management too much, I need to concern myself because my program is
running on a web server with lots of other user's programs.
Unfortunately I designed the main program in such a way that it is a
memory hog, I think I dug my own hole this time :-)
Thanks again, bye!
(sorry about the smiley, I couldn't resist it!)
--
sub jasonHolland {
my %hash = ( website =>
'http://dspace.dial.pipex.com/jason.holland/',
email => 'jason.holland@dial.pipex.com' );
}
------------------------------
Date: Wed, 09 Sep 1998 15:21:42 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Off topic, but ... [Was Re: Perl & Java - differences and uses]
Message-Id: <fl_aggie-0909981521420001@aggie.coaps.fsu.edu>
In article <8c7lzdz1it.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:
+ Ditto for California (shielding us from Mexico). :)
Ah, but what shields you from those Californicators who seek refuge?
James
------------------------------
Date: Wed, 09 Sep 1998 20:15:27 GMT
From: wheller@my-dejanews.com
Subject: Re: Outputting Images & Links in HTML
Message-Id: <6t6nks$7me$1@nnrp1.dejanews.com>
"an airline pilot asking how to get the landing gear down?"
Hmm, thats very cute. Maybe before you flame someone you should be sure you
understand the question. If you don't understand perl and want to make witty
comments about how to add links to an HTML document go to alt.html! There are
people here trying to learn and work. Everyone has to start somewhere and
lamers like you only discourage people who want to learn.
Now Bruce, if I am correct you are looking to pass either a link and an image
tag or an image itself back to the browser from your perl script.
Since it sounds like you are altering an existing script look for the line
that looks something like this...
print "content-type: XXXX/XXX\n\n";
where 'XXXX/XXX' is either 'text/plain' or 'text/html' to pass html tags back
to the browser this must be, of course, 'text/html' or the browser will just
print the url on the page.
once that is set you can easily include statements like...
print "<a href='URL'><img src='http://pics/blah/blah'></a>"
I'm not sure how perl handles the quotes inside quotes I'm fairly new to perl
myself, but that should put you on the right track.
for passing the dynamic image you need the GD graphics library (GD.pm)
installed on your server you can find these on the 'net if you dont already
have them installed. You would then do something like...
use GD;
print "content-type: image/gif\n\n";
my $im = new GD::Image(width,height);
at this point you will need to write code to load or generate the image such
as...
$im->line(x1,y1,x2,y2,color);
then convert the image to gif and pass it to the server...
print $im->gif;
I am far from a perl expert i'm just learning myself, If there are flaws in
this I hope someone will correct me, but at least this should point you in
the right direction.
In article <35d6dd0a.96298026@news2.cais.com>,
root.noharvest.\@not_even\here.com wrote:
> "bon" <TOWER_DENE_EDU@email.msn.com> Said this:
>
>>Can anyone please show me how I can include images and links in a script
>>that I have found?
>
> Same way you would in a normal web page <img src="blah.gif"> and <a
> href="there.html">A Link</a>.
>
>>Also, is it possible to have dynamically generated images in CGI output?
>
> Sure. Anything is possible. If you have a program to create the
> images, just include those images in a page with, again, <img
> src="dynamo_image.cgi"> or whatever.
>
>>__________________________________________
>>webmaster@tradingtactics.com
>
> You're a webmaster and you're asking these basic questions? Isn't
> that like an airline pilot asking how to get the landing gear down?
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 08 Sep 1998 15:36:18 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Data Structures: trees etc...
Message-Id: <35F58732.38EFAA3@min.net>
John-Paul Arp wrote:
>
> Where could I find information on how to make linked lists and trees in
> Perl? Does Perl even have pointers?
The perl documentation is included in the distribution,
obtainable from www.perl.com. That and additional
tutorials and recipes are available on-line at www.perl.com.
--
John Porter
------------------------------
Date: 9 Sep 1998 16:08:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl Data Structures: trees etc...
Message-Id: <6t6n7o$m21$1@monet.op.net>
In article <35F6C8DA.892DA515@formalsys.ca>,
John-Paul Arp <jpa@formalsys.ca> wrote:
>Where could I find information on how to make linked lists and trees in
>Perl? Does Perl even have pointers?
Perl does not have pointers. Instead, it has references, which are
better than pointers for what you want, because they have built-in
garbage collection and because you can't do pointer arithmetic with
them.
But you are asking the wrong question. What you're doing is like
getting into a 747 jet and asking whether it has an automatic
transmission like your Nissan. You have some problem you want to
solve, let's call it `X', and you have determined that one way to
accomplish X is to use technique Y, so you come and ask how to do Y in
Perl. This is a mistake for two reasons. The first reason is that
there is probably a technique Z which is a much better way to
accomplish X in Perl, but you have prematurely committed to Y instead.
The second reason is that you didn't say what X was, so nobody can
help you figure out what to use instead of Y. Some general advice
follows.
Perl's arrays are usually better than linked lists for most of the
things you want to use linked lists for; you can use the `splice'
function to insert or remove items from the middle, the `push' and
`unshift' functions to add items at the ends, and the `pop' and
`unshift' to remove items from the ends.
Trees are used for several different things. They're used for
sorting, and for sorting in perl you should use lists and Perl's
built-in `sort' operator. Trees are used for qucik searching of keyed
data; in this case you should certainly use a hash, even when you're
programming in some language where trees make more sense. Trees are
used for management of hierarchical data such as expressions; in this
case the solution in Perl usually involves a hash, or perhaps a
collection of hierarchically nested hashes.
Finally, yes, you can implement traditional-style lists and trees in
Perl, although it is almost always a mistake to do so.
The best advice I can give you is to get a book about Perl and to read
it carefully and learn the language *before* making any fundamental
design decisions.
------------------------------
Date: Wed, 09 Sep 1998 20:36:52 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Perl Programmer Needed
Message-Id: <35fce585.7724360@news.wwa.com>
On 08 Sep 1998 20:12:57 +0100, Jim Brewer <jimbo@soundimages.co.uk>
wrote:
>Which part of the post did you find difficult to comprehend?
>c.l.p.misc seems to be missing any reference whatsoever to commercial
>undertakings. No forsale, no (would you believe it) jobs, nothing of
>the sort that would lead anyone who reads and writes English as a
>first language to believe that c.l.p.misc is commerce enabled.
Perhaps an explicit statement forbidding articles which should be
posted to a misc.jobs*, forsale.*, or alt.dev.null should be
periodically posted to the current c.l.p.* hierarchy so that at least
there is an periodic posting to point to when this topic arises again.
Of course, such an article runs the risk of being off-topic.
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
------------------------------
Date: 9 Sep 1998 19:41:11 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Perl Search Engine
Message-Id: <6t6lkn$h6k@mozo.cc.purdue.edu>
John-Paul Arp <jpa@formalsys.ca> writes:
}I am working on a perl search engine for a massive and disorganized
}Intranet. (Nearly 2
}gigs worth of text formatted files.) I am looking for a way to index
}these files to speed up
}the search.
I feel obligated to point out that this is not a perl question, and
this is all off topic, blah blah blah, but it does provide me the
perfect opportunity to mention glimpse" which pretty much does exactly
what you requested. It's just too cool.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 09 Sep 1998 14:59:32 -0400
From: "David J. Topper" <topper@virginia.edu>
Subject: Problem with dbm files and arrays
Message-Id: <35F6D014.E30DD7D3@virginia.edu>
Hello,
I'm writing a little online signup for our machines. Everything's been
working fine using dbm files (with the dbmopen function) until now.
Here's what I'm trying to do:
foreach $machine (@sel_machines) {
print "machine = $machine\n";
$date = "$year$month$day";
checkTimes($machine,$user,$start_time,$end_time,$date);
updateHours($user,$start_time,$end_time);
}
inside of checkTimes() I basically do the following:
if (!dbmopen %machine_db, "$machine", 0766) {
print "ERROR: can't open $machine database\n";
}
# stuff ...
# this line bombs ...
$machine_db{$datetime} = $user;
# more stuff
close %machine_db;
I can get values from the %machine_db array but can't assign any new
ones. In fact, the script exits at the problem line. No error ...
nothing. It just exits.
Anyone have ideas? Please respond via email if you can.
Thanks,
DT
--
Technical Director, Virginia Center for Computer Music
Programmer / Analyst, Dean's Office (School of A&S)
http://www.panix.com/~topper
(804) 924-6887
------------------------------
Date: Wed, 9 Sep 1998 21:23:59 +0200
From: "Claudio Felber" <felber@cybernetic.ch>
Subject: Re: Problems with UNC on Windows platforms
Message-Id: <6t6kkv$kgm$1@news.imp.ch>
>>A non-portable (and un-tested) solution for WinNT would be:
>>
>>my $UNC = "//PDC-Intranet/Backup";
>>$UNC =~ tr!/!\\!;
>>my $result = `NET USE T: $UNC`;
>>die "Dooohhh: $result" unless ($result =~ /successful/);
>>
>>then you can use the Perl functions with drive T:
>>
>>chdir "T:/";
>>mkdir "T:/Linux"
>>...
I was thinking of that, too, but I wished there would be a nicer way
of doing it.
>mkdir "//zilla/snaserv/temp/tempdir",444 or die "couldn't mkdir: $!\n";
>chdir "//zilla/snaserv/temp/tempdir" or die "couldn't chdir: $!\n";
>open OUT,">myfile.txt" or die "couldn't open for write: $!\n";
>print OUT "Hi there!\n";
>close OUT or die "couldn't close: $!\n";
Yes, this works (with paths replaced, of course) with my system, too.
It seems that I had problems because I used an unsuited method for
testing the whole thing. After changing the directory I tried to
read the new current directory and print it on the screen and
that's where I received an error message. Try this...
chdir "//PDC-Intranet/Backup";
@dir = <*.*>;
foreach $x (@dir) {
print "$x\n";
}
I always get the contents of the Windows directory here and above all
this the following system error message:
'\\PDC-Intranet\Backup' ist ein ung|ltiges aktuelles Verzeichnis.
UNC-Pfade werden nicht unterst|tzt.
Der Standard wird auf das Windows-Verzeichnis gesetzt.
Which means something like...
'\\PDC-Intranet\Backup' is an invalid directory.Verzeichnis.
UNC paths are not supported.
The standard will be set to the Windows directory.
That's exactly the same error message that the DOS chdir/cd command
produces when I try to cd to '\\PDC-Intranet\Backup'. But the funny
thing is, that it's not the Perl chdir command that generates the
error message but the <*.*> directory filter... Obviously it implicitly
makes a chdir internally before reading the current directory and
the implementation there is different from the one that Perl chdir
uses, I suppose. What do you think?
Furthermore I guess that the procedure mkpath() from the package
File::Path is not UNC-ready, too.
-Claudio
------------------------------
Date: Wed, 09 Sep 1998 19:00:34 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: QUESTIONS (was: Perl Programmer Needed)
Message-Id: <6t6j8i$h$1@nnrp1.dejanews.com>
help me out quick buds ...
got some big work for any def perl programmers who
don't mind a rad work setup ... need on call 24/7
earn some money and stock options while workin for the
next microsoft
need you now but you gotta respond now ... this will
go fast ... you gotta be expert html programmer and
know NT web servers like the back of my hand ... and
ready to go
but you gotta prove yourself first (you gotta give a little
to get a little ... yeah ... ya know it!)
all of our perl programs are giving us some major '500'
errors to our clients ... not cool ... (i know, i know
why aren't ya usin ASP? well we'll get there dude, we
just inherited this perl lameness ... maybe you'll help us
out)
so here's your perl test ... get this right, and you might
get a shot at workin here:
first, our CGI scripts runs from the command line but not the
browser (500 Server Error) ... what's gives?
two, how do ya extract URLs?
three, how do ya decode a CGI form?
i took a look 'round the web, to try to get some clues on
all this, but come up short ... and the perl documentation
sucks, so if you think you can nail this, why not let me
know ... it could be your last chance to get in on this
anybody who wants to help me gotta send some email cuz i
don't normally read this group
you help me out ... maybe i'll help you out some time
cool
ptimmins@|NO.SPAM|netserv.unmc.edu
p.s.
Hitlers need not respond
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 9 Sep 1998 20:34:45 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: QUESTIONS (was: Perl Programmer Needed)
Message-Id: <6t6op5$ppm$1@marina.cinenet.net>
Patrick Timmins (ptimmins@netserv.unmc.edu) wrote:
: help me out quick buds ...
Oh, my...somehow from the first line I knew this was going to be a doozy.
: got some big work for any def perl programmers who
: don't mind a rad work setup ... need on call 24/7
: earn some money and stock options while workin for the
: next microsoft
You do know this is going to cost you a great big pile of money, correct?
If you want good Perl folks, that is. (For that matter, one Microsoft is
quite enough for me!)
: need you now but you gotta respond now ... this will
: go fast ... you gotta be expert html programmer and
: know NT web servers like the back of my hand ...
Having never seen the back of your hand, I already feel underqualified,
but I'll slog onward nonetheless.
: and ready to go
:
: but you gotta prove yourself first (you gotta give a little
: to get a little ... yeah ... ya know it!)
Oh, *my*. Did it ever occur to you just to ask your questions, in the
standard "I need help with this" way, then ask those who meet your high
answer standards if they'd care to work for you? Rest assured that this
approach is going to alienate most of the people you're (presumably)
trying to attract.
: all of our perl programs are giving us some major '500'
: errors to our clients ... not cool ... (i know, i know
: why aren't ya usin ASP? well we'll get there dude, we
: just inherited this perl lameness ... maybe you'll help us
: out)
...and you just succeeded in alienating virtually *everyone* on clpm, for
whom 'perl' and 'lameness' don't comfortably cohabit a sentence.
: so here's your perl test ... get this right, and you might
: get a shot at workin here:
:
: first, our CGI scripts runs from the command line but not the
: browser (500 Server Error) ... what's gives?
Server and command-line environments are different. Investigate paths,
permissions, environment variables.
: two, how do ya extract URLs?
(1) You can't, reliably, from arbitrary text.
(2) You can do it from arbitrary text if you're willing to accept nonzero
false positive or false negative rates. See recent clpm threads on
this topic.
(2) Use HTML::Parse to do it from HTML documents.
: three, how do ya decode a CGI form?
use CGI;
There, do I win? :)
: i took a look 'round the web, to try to get some clues on
: all this, but come up short ... and the perl documentation
: sucks,
I'm coming increasingly to believe this is a particularly elegant troll.
You want to hire Perl gurus, and spend this much time knocking Perl?
Amazing.
: so if you think you can nail this, why not let me
: know ... it could be your last chance to get in on this
I'm holding my breath...
: anybody who wants to help me gotta send some email cuz i
: don't normally read this group
...but then exhaling. Ask here, answer here.
: p.s.
: Hitlers need not respond
You can call me Benito. :)
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 09 Sep 1998 19:09:24 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: sleep
Message-Id: <35F6D007.6BDE35EB@bbnplanet.com>
*chuckle*
broken caps key?
/me ducks
e.
------------------------------
Date: 09 Sep 1998 14:06:44 -0500
From: Jim Woodgate <jdw@alder.dev.tivoli.com>
Subject: Re: String to Binary
Message-Id: <obu32hrtq3.fsf@alder.dev.tivoli.com>
mike@stok.co.uk (Mike Stok) writes:
> In article <ob3ea1o3st.fsf@alder.dev.tivoli.com>,
> Jim Woodgate <jdw@dev.tivoli.com> wrote:
>
> >dchen <dchen@aludra.usc.edu> writes:
> >> I have tried Mr. Larry Rosler's perl line and it works (except parentheses
> >> needed around pack and unpack).
> >
> >you might want to get a copy of perl 5, the parentheses aren't needed
> >for newer versions of perl...
>
> Although they're not needed you might think of maintainers in the future.
> Most whitespace in many perl programs isn't needed but is considered a
> good thing as it is frequently used to indent the code to reflect its
> logical structure. Maybe a human needed the parentheses...
In my code I tend to err on the side of having extra parenthesis, but
in this case I believe the version without parenthesis looked
better. (IMHO of course)
As you can see from the the original quoted source however, dchen made
it sound like the code as posted didn't work, when in fact it did.
--
Jim Woodgate
Tivoli Systems
E-Mail: jdw@dev.tivoli.com
------------------------------
Date: Wed, 9 Sep 1998 14:54:07 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: unsubscribe
Message-Id: <1df3dvn.132w3jc1rz9czkN@slip166-72-108-118.ny.us.ibm.net>
Michael Chen <mchen@aud.alcatel.com> wrote:
> unsubscribe
This isn't a mailing list. If you want to stop reading this group, the
option is somewhere in your newsreader software.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Wed, 09 Sep 1998 18:55:38 GMT
From: dn5006@my-dejanews.com
Subject: Re: Why Perl Again ?
Message-Id: <6t6iv9$va8$1@nnrp1.dejanews.com>
As John Porter pointed out:
perl -wde
does not do Shell.
I enhance line continuation with backslash and Zenin's recommendation of
command history.
#!/usr/bin/perl -w use Shell; use Term::ReadLine; my $term = new
Term::ReadLine "Perl Super Shell"; $IPERL::l=1; $IPERL::statement=''; while
(defined ($_ = $term->readline("$IPERL::l> ")) ) { next if (/^\s*($|#)/);
# ignore empty & comment line $IPERL::statement .= $_; # concatenate
statement sofar if (!($IPERL::statement =~ s/\\\s*$//)) { # backslash as
line continuation print eval $IPERL::statement; print ($@ || "\n");
$IPERL::l++; $IPERL::statement=''; $term->addhistory($_) if /\S/; } }
As not having enough, I already devised another version, with which I can do:
3> for (1 .. 2) {
3> print "Hello $_\n"
3>}
Hello 1
Hello 2
without the line continuation backslash.
Dat Nguyen
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3671
**************************************