[8073] in Perl-Users-Digest
Perl-Users Digest, Issue: 1692 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 21 13:08:16 1998
Date: Wed, 21 Jan 98 10:00:29 -0800
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, 21 Jan 1998 Volume: 8 Number: 1692
Today's topics:
Re: A use question (Andrew M. Langmead)
Re: Automatic E-Mail Forwarding <Jacqui.Caren@ig.co.uk>
Re: Byte Ordering using Perl (Clinton Pierce)
Can anyone help me????????? <seong@cse.bridgeport.edu>
Re: Can anyone help me????????? (M.J.T. Guy)
Re: Email Autoresponder (Andreas Karrer)
Re: Embedded variable names in text files....possible? <eilara@cortext.co.il>
Re: FAQ too big (Was: Re: PERL forking) lvirden@cas.org
Re: FAQ too big (Was: Re: PERL forking) (Andrew M. Langmead)
Re: FAQ too big (Was: Re: PERL forking) (DIAL-MB-Edward Finch)
Re: FAQ too big (Was: Re: PERL forking) (M.J.T. Guy)
Re: FAQ too big (Was: Re: PERL forking) (Tad McClellan)
Re: FAQ too big (Was: Re: PERL forking) <ajohnson@gpu.srv.ualberta.ca>
Re: Forms and Perl <barnett@houston.Geco-Prakla.slb.com>
fractional second sleep using select broken on NT? <junk@sober.com>
FS: Cross-Platform Perl (Oleg Raisky)
Re: FULL TIME EMPLOYMENT <Jacqui.Caren@ig.co.uk>
Help - Shopping Cart - Auto Add Function (Ed Jamison)
help please. [N,S,O]dbm weirdness beetle@cisco.com
Re: Help wanted for new perl programmer <Jacqui.Caren@ig.co.uk>
How to print right off the webpage? (Jared Evans)
Re: I need a man to lick me in to a frenzy!!! <dballing@speedchoice.com>
Re: I need a man to lick me in to a frenzy!!! (I R A Aggie)
Re: I need money [Re: I need a script] <Jacqui.Caren@ig.co.uk>
Re: I need some help pleeze (M.J.T. Guy)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 21 Jan 1998 15:31:01 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: A use question
Message-Id: <En54Fq.E2z@world.std.com>
brandi@wheel.dcn.davis.ca.us (Brandi Weed) writes:
>How do I specify using a module when it is on a completely different
>path from the Perl executable? In this case, the binary is
>/usr/bin/perl but the library is /var/local/lib/perl5!
If the modules you want to use are not in the path compiled into the
perl executable (or overridden in the PERLLIB or PERL5LIB environment
variables) You can add paths at compile time with the
use lib '/usr/local/lib/perl5';
directive.
Of course, if perl can't find its standard modules, then the
installation is broken and should be fixed anyway.
--
Andrew Langmead
------------------------------
Date: Wed, 21 Jan 1998 17:07:27 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Automatic E-Mail Forwarding
Message-Id: <En58wG.48L@ig.co.uk>
In article <Pine.GSO.3.96.980103123906.3188L-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>On Sat, 3 Jan 1998, BEBEAU wrote:
>
>> I'm trying to receive an incoming e-mail (on Linux 2.0.27),
>
>Perl doesn't (yet) receive mail directly! :-)
Well I do have a Net::SMTPD still in the works :-)
>You probably want to use
>.forward or procmail or both; check their docs or a newsgroup about email
>for more information. Good luck!
There is no reason why you cannot use a perl script as a delivery agent.
You do not need to use procmail but could add a deliver rule to
sendmail (or PP etc).
You could then use the Mail::* modules to consume the incoming messgae
from STDIN split its contents into reasonable chunks (including handling MIME
multipart correctly) and generate a sequence of messages.
If you have MH you will notice a nice little utility that will do most of
this for you already.
The splitter should only be around 20 line of perl if written well..
Jacqui
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: 21 Jan 1998 15:29:06 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
Subject: Re: Byte Ordering using Perl
Message-Id: <6a5482$gjo1@eccws1.dearborn.ford.com>
In article <6a502c$2cs$1@news.ox.ac.uk>,
chris@plato.wadham.ox.ac.uk (Chris Cladingboel) writes:
>biju@mindless.com wrote:
>
>> I have a problem of byte ordering on NT using Perl.
>
>I've just tried:
>
>$value = 0x09c80000;
>$value = ($value >> 24) | ($value >> 8) & 0xff00 |
> ($value << 8) & 0xff0000 | ($value << 24);
>printf "0x%08x\n", $value;
>
>and that gives the expected result, under both NT and Linux. Note the
>additional `>> 8' that you forgot, but that doesn't account for the
>answer that you got.
>
>> Is there is any efficient way of swapping the bytes on NT using Perl.
>
>There's bound to be a better way, but hey, that's perl!
>
TIMTOWDI, not better but different.
>From an generic byte-swab routine I have:
$value=0x09c80000;
$value=unpack('N',pack('C4',(unpack('C4',pack('N',$value)))[2,3,0,1]));
Change the order of the subscripts at the end to affect the order of the
outcome. Because things get packed in/out of "Network" byte order, this
should be portable, and only a 19% hit in speed.
clpmfunc, timethis 500000: 16 secs (15.82 usr 0.01 sys = 15.83 cpu)
myfunc, timethis 500000: 13 secs (12.58 usr 0.01 sys = 12.59 cpu)
There's time efficiency...
..and then there's porter & maintainer efficiency...
--
+------------------------------------------------------------------------+
| Clinton A. Pierce | "If you rush a Miracle Man, | http://www. |
| cpierce1@ford.com | you get rotten miracles" | dcicorp.com/ |
| fubar@ameritech.net |--Miracle Max, The Princess Bride| ~clintp |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*
------------------------------
Date: Tue, 20 Jan 1998 11:37:47 -0500
From: "Seong Y. Kim" <seong@cse.bridgeport.edu>
Subject: Can anyone help me?????????
Message-Id: <34C4D2DB.2F0A@cse.bridgeport.edu>
Hello, whoever out there. . . . .
I am having a difficulty with programing recursive subroutine.
As you see this is my recursive subroutine. It is supposed to make
directory tree on initialized directory. However I am having a
difficulty to control "." and ".." dir.
I will be really happy, if this question is solved, and i will be
appreciated.
Thanks. . ..
sub find_file_dir{
local ($locdir) = @_;
local (@locfile, $rdir);
local ($eone);
local (*OD);
chdir $locdir;
opendir(OD, $locdir) || die "can't open";
@locfile = readdir(OD);
foreach $eone (@locfile){
if (-d $eone){
unless ($eone == "." || $eone == ".."){
print "\n$eone\t\t:";
&find_file_dir($eone);
}
}
else {
print "$eone\t";
}
}
chdir "..";
close (OD);
print "\n";
}
------------------------------
Date: 21 Jan 1998 17:28:26 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Can anyone help me?????????
Message-Id: <6a5b7q$mac$1@lyra.csx.cam.ac.uk>
Seong Y. Kim <seong@cse.bridgeport.edu> wrote:
> unless ($eone == "." || $eone == ".."){
If you were using -w, Perl would have told you your mistake. Try it.
>From perldoc perl:
BUGS
The -w switch is not mandatory.
Mike Guy
------------------------------
Date: 21 Jan 1998 15:08:58 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: Email Autoresponder
Message-Id: <slrn6cc3t4.i2n.karrer@kuru.ee.ethz.ch>
In article <6a3oip$gr5$1@loomi.telstra.net>, Michael Slater wrote:
> Anybody know of an Email Autoresponder script written perl, and where
>it can be obtained from.
The classical example is lwall/tchrists "vacation" clone from
CPAN/scripts/mailstuff/vacation. It responds with a selectable message,
and keeps addresses it has already responded to in a dbm file so that
nobody gets the same message twice.
- Andi
------------------------------
Date: Wed, 21 Jan 1998 18:28:22 +0200
From: eilara <eilara@cortext.co.il>
Subject: Re: Embedded variable names in text files....possible?
Message-Id: <34C62226.36D25844@cortextSPAM.co.il>
Jonathan Cunningham was heard saying:
> Hi,
> I have a file called 'contact1.txt', and I want to open it and print
> its contents to the screen. Within the text of this file I have what
> I hoped would have been a variable name '$emailaddress', however upon
> opening and printing this file, instead of printing the contents of
> '$emailaddress' it instead prints "$emailaddress". See example:
>
> ### contents of contact.txt ###
> This is my email address: $emailaddress.
> ### contents of my code ###
> open(CONTACT1, "<contact1.txt") or die "contact1.txt not found";
> $emailaddress = 'my@address.com';
> while(<CONTACT1>) {
> $contact1 = "$contact1<br> $_";
> }
> close(CONTACT1);
> print $contact1;
try this instead:
open(CONTACT1, "<contact1.txt") or die "contact1.txt not found";
$emailaddress = 'my@address.com';
while(<CONTACT1>) {
$contact1 .=
'<br> '.
(eval qq{ return qq{$_} });
}
close(CONTACT1);
print $contact1;
also, take a look at the much better ways for indenting text that exist
in the CSS standard.
hope this helps,
ran
> Thanks in advance,
> Jonathan
> dawfun@seanet.com
------------------------------
Date: 21 Jan 1998 14:52:28 GMT
From: lvirden@cas.org
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <6a523c$m8$2@srv38s4u.cas.org>
Keywords: from just another new york perl hacker
According to brian d foy <comdog@computerdog.com>:
:In article <01bd25e8$5f0a68c0$a041f9a5@dyyfc1.aca.arcochem.com>, "Kevin
:Hawley" <cchkxh@ARCO.com> posted:
:
:>I don't have 40 years to read the FAQ.
:
:that's why it's divided into sections which may be further subdivided.
:you only need to read the parts relevant to your particular problem.
I assume that someone earlier in this thread (not all has reached here
yet) has discussed the concept of _searching for answers_ in the FAQ?
It shouldn't be necessary for someone with a question to read everything
there is to know about Perl - they should be able to do a search
which gets them in the neighborhood.
Certainly altavista, etc. are places to start, but are a bit broad.
Dejanews and Reference.com searches would at least show folk what
previous posters discovered.
Are there search engines which have as their sole focus answering questions
about Perl?
--
Larry W. Virden INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
------------------------------
Date: Wed, 21 Jan 1998 15:27:21 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <En549M.B0s@world.std.com>
"Kevin Hawley" <cbpkxh@arcochem.com> writes:
>I don't have 40 years to read the FAQ.
Do you have any ideas on how the information could be better organized
so that the information that you want would be easy to find?
I find myself "grep"ping through it for keywords that may have
something to do with the subject at hand. Like any reference material,
most people don't read it beginning to end. They just jump to the
places they need.
If you can think of how to improve the FAQs ability to point a
programmer to the information they need, contact the FAQs author. I'm
sure he would do what he could to get the information widely read.
--
Andrew Langmead
------------------------------
Date: 21 Jan 1998 16:09:20 GMT
From: efinch@sun.vais.net (DIAL-MB-Edward Finch)
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <6a56jg$9b9@netaxs.com>
Kevin Hawley (cbpkxh@arcochem.com) wrote:
: I don't have 40 years to read the FAQ. I use lots of languages
: not just perl, if I read all the FAQ's I would be one smart dude,
: but out of a job! That is why I appreciate people like you that take
: the time to answer questions. By the way I do nibble at the FAQ
: when I get some spare time (sometimes I even read it :^).
The FAQs serve several purposes, among them:
1) To prevent simple mistakes, which waste time. Which, in turn, costs
your employer money.
2) To answer common questions quickly, so you don't have to wait for a
response to a newsgroup posting.
3) To show generally-agreed-upon ways of doing things, and some of
examples of the "perl way".
I just went to http://www.perl.com and looked at the FAQs again. It
would take less than an hour to skim the subject lines.
The FAQs are a distillation of knowledge; drink liberally.
Ed
--
Ed Finch
UNIX & ClearCase Administrator
NASA's Earth Observation System, "Mission To Planet Earth"
Linux. Because using the Windows 95 interface is like watching
"Who Framed Roger Rabbit?".
- me
------------------------------
Date: 21 Jan 1998 16:41:38 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <6a58g2$k58$1@lyra.csx.cam.ac.uk>
Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> wrote:
>
>Also, perl is very good for writing 'grep' type scripts...why not
>write yourself a script that greps through the .pod files?
It's already been done. Use Jeffrey Friedl's "search" program,
which can be found in the perl distribution at
perl5.004_04/win32/bin/search.pl
(Despite the filename, it isn't win32 specific.)
Mike Guy
------------------------------
Date: Wed, 21 Jan 1998 06:29:48 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <snp4a6.805.ln@localhost>
Bart Lateur (bart.mediamind@tornado.be) wrote:
: "Kevin Hawley" <cbpkxh@arcochem.com> wrote:
: >I don't have 40 years to read the FAQ.
: >> On Mon, 19 Jan 1998, ARCO Chemical Company wrote:
: >>
: >> > P.S. The Perl FAQ is TOO big!!
: Hmmm... What I think is lacking, is an overview of everything that is
: covered in the FAQ. A TOC, a list with ALL the questions and where the
: answers can be found.
Just get the *.pod files and make one:
perl -ne 'print "$ARGV: $_" if /^=head2/' perlfaq*pod
;-)
: Not everybody uses Unix, where you can use grep to look it up for you...
: On a PC, you have to (manually) open and search through 9 documents.
^^^^^^^ ^^^^^^^^
I don't use the Windoze perl, but can't they write a Perl script
to do grepping with?
perl -ne 'print "$ARGV: $_" if /someword/' *.html
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 21 Jan 1998 11:34:11 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <34C63193.79FE85C2@gpu.srv.ualberta.ca>
M.J.T. Guy wrote:
!
! Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> wrote:
! >
! >Also, perl is very good for writing 'grep' type scripts...why not
! >write yourself a script that greps through the .pod files?
!
! It's already been done. Use Jeffrey Friedl's "search" program,
! which can be found in the perl distribution at
!
! perl5.004_04/win32/bin/search.pl
!
! (Despite the filename, it isn't win32 specific.)
!
!
! Mike Guy
certainly a worthwhile script...I'd never bothered to really
examine the contents of the win32 subdirectory.
however, I was thinking of something more tailored to finding and
retrieving FAQ responses...I posted one some time ago, and its
included at the end of this message.
basic usage:
faqgrep 'pattern'
prints on STDOUT, the list of questions containing the pattern
prependend by the filename it was found in.
faqgrep -f 'pattern'
prints on STDOUT, the entire FAQ blurb for every question
containing 'pattern'
example:
[danger:ajohnson:~]$ faqgrep sort
perlfaq4.pod:=head2 How do I sort an array by (anything)?
perlfaq4.pod:=head2 How do I sort a hash (optionally by value instead of
key)?
perlfaq4.pod:=head2 How can I always keep my hash sorted?
[danger:ajohnson:~]$ faqgrep -f 'hash sorted'
=head2 How can I always keep my hash sorted?
You can look into using the DB_File module and tie() using the
$DB_BTREE hash bindings as documented in L<DB_File/"In Memory
Databases">.
[danger:ajohnson:~]$
for nicer formatting, you can always pipe the output
through pod2text
here is the script (36 lines)...the path to the pod directory
is hardcoded, so you'll have to change it appropriately.
(probably many improvements could be made---like creating a single
file with all the faq questions in it to grep through...possibly
with filename and offsets to the actual location--- but its
simple and works fast enough on my system so...)
enjoy
andrew
---cut faqgrep---
#!/usr/bin/perl -w
use strict;
# NOTE:change the $faqdir to point to your pod directory
my $faqdir="/usr/local/perl5.004_04/pod";
my $opt=shift @ARGV if $ARGV[0]=~/-f/;
my $pattern=$ARGV[0];
opendir(FAQDIR,$faqdir)||die "can't open $faqdir: $!";
my @faqs=grep /faq/,readdir FAQDIR;
close FAQDIR;
if ($opt) {
get_faq();
} else {
grep_faq_heads();
}
sub grep_faq_heads {
foreach my $faq (@faqs) {
open(FAQ,"$faqdir/$faq")||die "can't open $faq: $!";
while (<FAQ>) {
print "$faq:$_" if /^=head.*?$pattern/;
}
close FAQ;
}
}
sub get_faq {
my($n);
foreach my $faq (@faqs) {
open(FAQ,"$faqdir/$faq")||die "can't open $faq: $!";
while (<FAQ>) {
$n=1 if /^=head.*?$pattern/;
$n=0 if /^=head(?!.*?$pattern)/;
print if $n;
}
close FAQ;
}
}
__END__
------------------------------
Date: Wed, 21 Jan 1998 09:31:05 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Forms and Perl
Message-Id: <34C614B9.174C34E0@houston.Geco-Prakla.slb.com>
Ron Gambill wrote:
>
> > Do you mean like:
> >
> > <FORM ACTION="http://your.server.com/scripts/myscript.pl" METHOD=POST>
> >
>
> I've been playing around with it today, and it seems to be a combination
> of things I'm not quite getting. What I've been trying to do is run the
> script on my PC before loading it up on the server.
>
> I have Perl for Win32, like I said. I've recreated the structure of the
> directories that reside on the server. When I access the page via the
> form, I'm getting the code displayed instead of run.
I'm assuming you are pointing your web browser to the file. In that
case, the web broswer is doing its thing. It doesn't know what else to
do with it, so it reads it as a plain text file, and displays it that
way.
The web server is responsible for execution of scripts, programs, etc,
not the broswer. Therefore, you must have a web server running in order
to properly parse and understand your cgi/perl script and pass the
results to the web browser. The other option is to use CGI.pm, and use
offline mode to manually enter your variable=value entries.
HTH.
>
> I'm thinking two things - either I'm not handling the arguments correctly
> in the script (I just found more info on this through the groups) or
> might I need to install the perl into the directory structure I've set up
> rather than in a generic structure.
>
> Apologies if I've mis-posted. First time user of the groups.
>
> -Ron
> my office is trying to make me perl instead of cobol...
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
* Schlumberger Geco-Prakla (281) 596-1434 (Office Number) *
* 1325 S. Dairy Ashford (281) 596-1807 (Fax) *
* Houston, TX 77077 *
------------------------------------------------------------------------
------------------------------
Date: Wed, 21 Jan 1998 12:31:15 -0500
From: Jason Moore <junk@sober.com>
Subject: fractional second sleep using select broken on NT?
Message-Id: <34C630E3.2D53FD2E@sober.com>
hi,
I'm finding perlfunc manpage for getting a millisecond sleep using
select doesn't work on NT (5.004_01). Anyone know of a workaround to
get a 0.1 second sleep?
Here's my test:
perl -e "select(undef, undef, undef, 10)"
[returns almost instantly. As does:]
perl -e "for(0..100){select(undef, undef, undef, 0.1)}"
(btw - the above works as expected on linux - returns in 10 secs)
:jason
------------------------------
Date: Wed, 21 Jan 1998 16:16:56 GMT
From: olrcc@sci.ccny.cuny.edu (Oleg Raisky)
Subject: FS: Cross-Platform Perl
Message-Id: <En56K8.MAp@scisun.sci.ccny.cuny.edu>
Hi,
I'd like to sell:
Cross-Platform Perl (with CD-ROM) by Eric F. Johnson - $24.
This book got 4 camels (out of 5) from T. Christiansen in his "Camel
Critiques"
Shipping included in price. Please, email me if interested.
--
Oleg Raisky
______________________
olrcc@scisun.sci.ccny.cuny.edu
http://www.sci.ccny.cuny.edu/~olrcc
------------------------------
Date: Wed, 21 Jan 1998 16:50:16 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: FULL TIME EMPLOYMENT
Message-Id: <En583s.41v@ig.co.uk>
Keywords: from just another new york perl hacker
In article <comdog-ya02408000R0401981719240001@news.panix.com>,
brian d foy <comdog@computerdog.com> wrote:
>In article <34AD72E5.349E@alex.net>, marcus@alex.net posted:
>
>>The Alexander Group, Inc. is seeking qualified PERL programmers for full
>>and part-time employment along with contract work. We are a custom
>>Internet Applications company that has been around for nearly five
>>years. We are located in Indianapolis, Indiana USA.
>
>i asked last time, but i'll ask again (and keep asking until you get
>it). what is "qualified". just because someone knows perl, or
He does not want any of us - because
1) He is too lazy to repond to requests for information.
2) He is too cheap to pay for a TPJ advert - and the TPJ is
CHEAP compared to advert rates in many professional mags.
This infers that he does not care what sort of moron he gets to do the
job - just as long as he gets paid commision with minimum effort.
>so what is "qualified"? databases experience? networking experience?
>can form complete sentences? has a temperature above the ambient
>temperature?
Someone who would never apply to such a vague, badly written
trawl^H^H^H^H^Hadvert from a cheap *.net based spam artist? :-)
Theye days it seems *.net is either an legitimate ISP such as demon.net
or some cheapo scumbag or spam artist - it is usually pretty easy to
determine which category they fall into...
Jacqui
p.s. It looks like being polite does not work - perhaps this will get
a response? :-)
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: Wed, 21 Jan 1998 16:07:57 GMT
From: edwardj@weblogic.cncoffice.com (Ed Jamison)
Subject: Help - Shopping Cart - Auto Add Function
Message-Id: <MPG.f2fd7f43832edea989741@news.ais.net>
I need help with 2 projects I am working on.
1. I am thinking of building a shopping cart for one of the sites I have
designed. Can anyone direct me to a resource that would help me learn
this information? Also, anywhere I could find information about cookies,
etc....
2. I am already working on a links page for a friend of mine. She has
this wild idea about having a bit of a search engine type of resource on
her web page. What I am trying to help out with is the building of an
auto add function for her search engine. Is there a resource available,
or a free perl script, that I could use to build this?
Any information or help would be greatly appreciated.
Ed Jamison
------------------------------
Date: 21 Jan 1998 17:36:25 GMT
From: beetle@cisco.com
Subject: help please. [N,S,O]dbm weirdness
Message-Id: <6a5bmp$62o$1@news-sj-2.cisco.com>
Hello Folks.
I'm seeing a weird problem with dbm files that I'd like some help on. I have
an existing dbm file that I would like to access via perl5. The weird thing
is that I can only get the keys out if I define the the dbm file as a
SDBM file, but I can only get the values out if I define the dbm file as a
NDBM file!
This works fine:
tie (%WH,'SDBM_File','/var/aliases/which',O_RDONLY,undef);
while (($k,$v) = each %WH)
{
print $k;
}
but if I replace 'SDBM_File' with 'NDBM_File', I get a severely truncated
list of keys (181 instead of tens of thousands). So, I thought I MUST have
a SDBM file. But, I can't access the values if its defined to be a SDBM
File!
This doesn't work:
tie (%WH,'SDBM_File','/var/aliases/which',O_RDONLY,undef);
print $WH{$k};
But this does:
tie (%WH,'NDBM_File','/var/aliases/which',O_RDONLY,undef);
print $WH{$k};
So, I don't get it. I can only get the keys out if I open the dbm file as a
SDBM file. But I can only access the values if I open the dbm file as a
NDBM file.. and this is on the same file! I also tried opening it as a
ODBM file, but it behaved similar to a NDBM file (can access values, but
severely truncated list of keys). GDBM doesn't appear to be installed
on my machine. Is there another format that I'm missing here?
Any thoughts/ideas would greatly be appreciated. Thanks!
-bailey
beetle@cisco.com
--
------------------------------
Date: Wed, 21 Jan 1998 17:00:02 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Help wanted for new perl programmer
Message-Id: <En58K2.45v@ig.co.uk>
In article <34ADF96C.30BBE556@ekn.net>,
Greg Cobble /TechJD <gregc@ekn.net> wrote:
>Hi I have some programming background (basic, fortran, cobol,(oldtimer
>lol) and VB )
>perl and cgi are new to me
>I'm working on a chat script and want to make the the user able
>to change the background color , the script runs good with out this
>option , I'm getting
>
>Internal Server Error
>
>The server encountered an internal error or misconfiguration and was
>unable to complete your request.
>
>Please contact the server administrator, [no address given] and inform
>them of the time the error occurred, and anything
>you might have done that may have caused the error.
>
>There was also some additional information available about the error:
>[Sat Jan 3 00:02:51 1998] access to /usr/local/www/cgi-bin/cgiwrap
>failed for
>reason: malformed header from script. Bad header=Scalar found where
>operator ex
try running your perl script at the command line first - I doubt that this
software would compile correctly.
>I'm trying to use
> print "<SELECT NAME="$cclor">\n";
> print "<OPTION>blue\n";
> print "<OPTION>yellow\n";
> print "<OPTION>red\n";
> print "<OPTION selected>white</SELECT><BR>\n";
you need to escape the "s within "s.
Try this instead
print <<"END";
<SELECT NAME="$cclor">
<OPTION>blue
<OPTION>yellow
<OPTION>red
<OPTION selected>white
</SELECT>
<BR>
END
# must more readable :-)
# remember that END *must* start at the beginning of the line.
# if you decide to indent this code.
The above also has one further advantage in that you do not end up
doing 5+ prints - only one.
in order to debug try running your software under the commandline.
try perl -c script.pl and see what it comes out with...
then
try perl -w script.pl and see what it comes out with...
also look up "use strict" in a perl book - this will also help
you (a bit) to stick to good perl writing practises. :-)
Have fun!
Jacqui Caren
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: 21 Jan 1998 14:58:17 GMT
From: jared@frontiernet.net (Jared Evans)
Subject: How to print right off the webpage?
Message-Id: <6a52e9$5pe$1@node17.cwnet.frontiernet.net>
Is it possible to have this concept (and how to set it up?) on the web:
A resume in HTML with a button at the bottom labelled "PRINT" which when
clicked on will print out the resume locally in RTF format?
I'm prettty acquainted with perl- but I'm not sure if this was the most
proper method to use for such a task on the web?
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("H*",$&)/eg
1f8b080853ed5434000b7465737400e3e5f24a2c4a4d51702d4bcc2bd655e0e55250f02a2d2e0133141412f3f24b32528ba03c058580d4a21c384741212331393bb5488f978b970b000e2b3b4448000000
EOF
------------------------------
Date: Wed, 21 Jan 1998 09:26:52 -0600
From: Derek Balling <dballing@speedchoice.com>
Subject: Re: I need a man to lick me in to a frenzy!!!
Message-Id: <1FB7609112ED9473.249505A429756CE3.7C3C04CD8ADADE4D@library-proxy.airnews.net>
Jay Flaherty wrote:
>
> Derek Balling (dballing@speedchoice.com) wrote:
> : I would think
> :
> : while(!($frenzy)) {
> : lick($me);
> : }
> :
> : would be more appropriate. Always code your functions as general
> : purpose. What if she wants you to lick her friend? Are you gonna rewrite
> : a whole new function that does essentially the same task? Even better
> : would be:
> :
> : push @licked, $me;
> : while(!($frenzy)) {
> : lick(\@licked);
> : }
> :
> : So if it was a group grope thing your function would be covered as well.
> : :)
> :
> : Derek
> : (and there's no WAY I speak for my employers on this one)
>
> You are so right, my employer would be appaled at my lack of generality.
> In fact, he would suggest making it a module that had more versatility.
> Why limit it to just licking? Why not biting? Tickling?
>
> Package Frenzy;
>
> sub new {
> ...
> }
> sub lick {
> ...
> }
>
> sub bite {
> ...
> }
>
> sub tickle {
> ...
> }
> __END__
>
> #!/usr/bin/perl -Tw
>
> use strict;
> use Frenzy;
> my $frenzy = new Frenzy;
> my $me = ["tom","dick","harry"];
> $frenzy->lick($me);
> $frenzy->bite($me);
> $frenzy->tickle($me);
> __END__
This sounds like a thread destined to end up like the ASR manpages
effort. :)
# man lart
# man luser
:)
Derek
------------------------------
Date: Wed, 21 Jan 1998 10:57:08 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: I need a man to lick me in to a frenzy!!!
Message-Id: <fl_aggie-2101981057080001@aggie.coaps.fsu.edu>
In article
<1FB7609112ED9473.249505A429756CE3.7C3C04CD8ADADE4D@library-proxy.airnews.net>,
Derek Balling <dballing@speedchoice.com> wrote:
+ This sounds like a thread destined to end up like the ASR manpages
+ effort. :)
+
+ # man lart
+ # man luser
Shhhhh!!! Don't be giving away our secrets!
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Wed, 21 Jan 1998 16:32:55 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: I need money [Re: I need a script]
Message-Id: <En57Aw.3y2@ig.co.uk>
Keywords: from just another new york perl hacker
In article <884055470.317915@cabal>,
? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au> wrote:
>Interesting fact, you can get any multipal of 10 greater then 70 by the
>combernations of $20 and $50.
Why 70?
I assume you mean +/- combination?
>For extra points prove the above by use of indution.
Why - won't any even and odd number (sharing a common even multiple) do just as
well?
>--
>Please excuse my spelling as I suffer from agraphia see the url in my header.
>Never trust a country with more peaple then sheep.
>Support NoCeM http://www.cm.org/
>I'm sorry but I just don't consider 'because its yucky' a convincing argument
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: 21 Jan 1998 17:11:11 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: I need some help pleeze
Message-Id: <6a5a7f$lnf$1@lyra.csx.cam.ac.uk>
In article <dvhvd6g1k.fsf@elmo.s3i.com>, Clark Dorman <clark@s3i.com> wrote:
>
>Before you say that it can't be done, Perl has plenty of magic in
>other places, so why not here? If I have the variable $letter = "e"
>and I do $letter++, I get "j".
Your Perl is obviously broken. Mine gives "f".
> I can't believe that converting a
>character string into a number would be any more difficult.
Of course it's not difficult. And Perl does it. I explained the
algorithm in a previous posting in this thread - basically the same
as atof in the C library.
But something that _can_ be done isn't necessarily something that it's
sensible to do. Which is why with -w Perl tells you you are doing
something daft.
Mike Guy
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
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 1692
**************************************