[8045] in Perl-Users-Digest
Perl-Users Digest, Issue: 1670 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 19 03:47:42 1998
Date: Mon, 19 Jan 98 00:00:42 -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 Mon, 19 Jan 1998 Volume: 8 Number: 1670
Today's topics:
Re: Array Troubles <ebohlman@netcom.com>
Re: Array Troubles (brian d foy)
Re: Book review wanted (brian d foy)
Re: Building indexes in Perl (brian d foy)
Re: can anybody help me please? (brian d foy)
Can unix Perl Modules be used under Win32 (Bernard Arumainathan)
Re: Determining file type <joseph@5sigma.com>
Re: Does anyone know where to get a WIN NT 4.0 version <bowlin@sirius.com>
Re: EMTY FILE? <aQlWaEnR@TaYnUeIcOdPoAtSeD.FcGoHm>
Re: Exporter Question (brian d foy)
Re: get machine name from IP? (brian d foy)
Re: How on earth....?!?! (brian d foy)
Re: How to sorting lists alphabetically? (brian d foy)
Re: I am still a virgin (Mike Heins)
Re: I am still a virgin (Kelly Hirano)
Re: I am still a virgin (brian d foy)
Re: I am still a virgin (brian d foy)
Re: I am still a virgin <bowlin@sirius.com>
Re: LWP SSL POST requests <nick@xwing.xwing.org>
Re: MacPerl carriage returns (brian d foy)
Re: Perl Library (brian d foy)
Re: Question about outputting HTML w/ images (brian d foy)
Re: REGEXP: Does it need optimization? (brian d foy)
Re: Sort question <aQlWaEnR@TaYnUeIcOdPoAtSeD.FcGoHm>
Re: source into binary code (John Stanley)
Re: Why does'nt this sub work <joseph@5sigma.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Jan 1998 06:23:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Array Troubles
Message-Id: <ebohlmanEn0prE.ME6@netcom.com>
Todd McLaughlin <toddm@rahul.net> wrote:
: I have an array question. Here's the bit of code:
: for($i = 0; $person[$i][0] <> ""; $i++)
: {
: @person[$i]=split(/ /,<datafile>);
: }
: I'm trying to read lines (~50) in from a data file, separate the fields
: (3), and dump it into an 2D array. Can you explain what's wrong with the
: above code?
You're testing the location you want to store your data in for nullity
*before* you store anything there. Rewrite your loop so you read in a
line, test to make sure you haven't reached the end of the file, and then
do your processing. You may want to look at push() and the anonymous
array reference composer [].
------------------------------
Date: Mon, 19 Jan 1998 02:20:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Array Troubles
Message-Id: <comdog-ya02408000R1901980220590001@news.panix.com>
Keywords: from just another new york perl hacker
In article <69upfo$o92$1@samba.rahul.net>, Todd McLaughlin <toddm@rahul.net> posted:
>I have an array question. Here's the bit of code:
>
>for($i = 0; $person[$i][0] <> ""; $i++)
>{
> @person[$i]=split(/ /,<datafile>);
>}
>
>I'm trying to read lines (~50) in from a data file, separate the fields
>(3), and dump it into an 2D array. Can you explain what's wrong with the
>above code?
is $person[$i][0] defined? do you ever make it inside that block?
what's that <> thingy? did that get past perl -cw ?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Mon, 19 Jan 1998 01:37:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Book review wanted
Message-Id: <comdog-ya02408000R1901980137000001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C2C63E.71029C2B@mail.uca.edu>, Cameron Dorey <camerond@mail.uca.edu> posted:
>Save the $20, spend it on books from O'Reilly (no, I don't work for
>them, but I would be glad to accept a free copy of a title for the
>unsolicited plug - the ones I have are all very good).
O'Reilly would quickly go out of business if they gave a free book
per unsolicited plugs :)
i suggested an O'Reilly Bookshelf to the friendly O'Reilly sales
force since all those animal books are starting to stack up on
my floor. i think anyone who buys a hundred O'Reilly books
should get an O'Reilly Bookshelf!
--
brian d foy <comdog@computerdog.com>
needs the new Bat Book though.
------------------------------
Date: Mon, 19 Jan 1998 01:05:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Building indexes in Perl
Message-Id: <comdog-ya02408000R1901980105410001@news.panix.com>
Keywords: from just another new york perl hacker
In article <69sk49$lgt@uni2f.unige.ch>, friha@cui.unige.ch posted:
>I a beginner in Perl and have to build different indexes on a set of ASCII files, describing different
>products. Each file contains different informations on the product (+errors of syntax...etc). What is the best way to do that?
[ "best" depends on the available resources, time, and other factors
beyond the scope of Perl ].
i would start with a database book. one you understand a little about
databases, check out the database modules and thingys for Perl [1].
if you have questions about Perl (as opposed to questions with Perl
in the sentence), ask here. otherwise, there is probably a forum
better suited to your questions.
good luck :)
--
brian d foy <comdog@computerdog.com>
so which lake is the best?
------------------------------
Date: Mon, 19 Jan 1998 01:09:06 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: can anybody help me please?
Message-Id: <comdog-ya02408000R1901980109060001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C2168B.9AE840BA@xarch.tu-graz.ac.at>, jahnel@xarch.tu-graz.ac.at posted:
>i ve a file with datas:
>I want to read the data in (one line is a data set)
>and then put it out again but sortedon the 3rd entry
>like this:
>698 klaus 0000
>487 klaus 0855
>
>How can i perform this (but please no linls to perlfaq i have read it no
>luck)
sounds trivial for sed or sort.
but i have to tell you about perlfaq4 because it answers your
question (and everyone else that asks how they can sort an array
by anything). if you have trouble with the answer given in the
FAQ, perhaps we could clarify the points which you don't understand
if you ask a specific question.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 19 Jan 1998 07:18:21 GMT
From: dilana@vcn.bc.ca (Bernard Arumainathan)
Subject: Can unix Perl Modules be used under Win32
Message-Id: <69uunt$skt@milo.vcn.bc.ca>
Keywords: perl win32 perlmod
Is is possible to use perl modules from Perl distributions for Unix under
Win32.
Thanks in advance.
------------------------------
Date: Sun, 18 Jan 1998 23:21:49 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Determining file type
Message-Id: <34C2F0A8.3F15D7@5sigma.com>
I am sure that I have seen some discussion of a module along the
lines of the file(1) command, but now I can't find it. Well, ok,
maybe I was dreaming.
Speaking of which, have you heard of the file(1) command?
-joseph
http://www.effectiveperl.com
Martien Verbruggen wrote:
>
> In article <jMGlTRAHTqw0EwsN@worsdall.demon.co.uk>,
> Mark Worsdall <scriptabuser@127.0.0.1> writes:
>
> > Now the program that has this file needs to work out what type of file
> > it is, graphic, text, binary etc, then it will do this:-
> >
> > if (html or text) print "Content-type: text/html\n\n";
> > if (graphic) print "Content-type: image/gif\n\n";
> > (Here though I want it to display any image including jpegs etc)
> > if (binary) force broswer to download
> >
> > Is there any modules to achieve my goal?
>
> You seem to be a bit confused about what binary means. A GIF file
> also contains binary data.
>
> That aside: perl has the -T and -B operators (perldoc -f -X) [...]
------------------------------
Date: Sun, 18 Jan 1998 23:33:28 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: "David W. Faix" <faixinc@crosslink.net>
Subject: Re: Does anyone know where to get a WIN NT 4.0 version of PERL 5?
Message-Id: <34C301C8.CD5328A5@sirius.com>
http://www.perl.org/CPAN/ports/winNT
> David W. Faix wrote:
>
> Looking for a quick way to get perl running under windows NT?
> Many thanks
> David W. Faix
> faixinc@crosslink.net
------------------------------
Date: Sat, 17 Jan 1998 20:42:44 -0500
From: Alan Gutierrez <aQlWaEnR@TaYnUeIcOdPoAtSeD.FcGoHm>
Subject: Re: EMTY FILE?
Message-Id: <34C15E14.96AB1B74@TaYnUeIcOdPoAtSeD.FcGoHm>
William Byrd wrote:
>
<snip>
>
> There are many of us using perl on Macs or Win systems, thus no
> perlfunc manpage. I do have the camel book and can look it up (the
> book never leaves my computer desk), but is there a winhelp file or
> one of those nifty apple help files or hypercard stacks or something
> that us non unix users can keep on our desktops for quick reference?
>
> a URL would be appreciated
>
> Bill
perldoc perlfunc
The above works for me on Win32. The standard distribution of perl for
Win32 also converts all of the Plain Old Documentation (POD) files to
HTML, including any perl modules you might install. I mapped /perldocs
on my workstation's web server to the html directory that it creates and
use that for my online documentation. You could also just point your
browser at the directory.
Look for pod2html to get you started.
Alan Gutierrez
My first news post at this address. I suppose I will now being receiving
all sorts of money making opportunities (i.e. spam).
------------------------------
Date: Mon, 19 Jan 1998 01:49:01 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Exporter Question
Message-Id: <comdog-ya02408000R1901980149010001@news.panix.com>
Keywords: from just another new york perl hacker
In article <000c01bd2455a1495640a1123018@default.pha.adelphia.net>, vkakarla@adelphia.net ("Verma Kakarlapudi") posted:
>I am moving old Perl4 code to Perl5 and have been struggling
>to understand the significance of Exporter function.
>Please HELP!!
>Here is my Argument:
>a) One can access subs and module level variables(local) from
> any other module by including the name of the module and
> coding &module_name::sub_name and $module_name::var_name
> without using Exporter function.
okay...
>b) Using Exporter function, one has to still include the module in the
> calling module and access the sub or varaiable with the same above
> notation(::, can't avoid) even after exporting the sub, and variable to
> arrays @EXPORT or @EXPORT_OK
not okay... if you've imported the subroutines or variables into
your package, you don't need to fully qualify them. things in
@EXPORT are imported by default, but you need to specifically
ask for things in @EXPORT_OK to be imported. perhaps the
perlmodlib manpage and related documentation may be of
assistance.
>WHY.. WHY..?
perhaps something else is wonky?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Mon, 19 Jan 1998 01:00:35 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: get machine name from IP?
Message-Id: <comdog-ya02408000R1901980100350001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C1E672.A0AE44FB@5sigma.com>, joseph@5sigma.com posted:
>Perhaps your server already provides the resolved host name in a
>different environment variable? If not (some don't), see the other
>answers posted here.
let's not forget that this is generally a useless pursuit with
proxies and all of that. some users aren't even people.
>Jerry Davis wrote:
>>
>> one can track the IP of the user who activates a perl script with the
>> $ENV('REMOTE_ADDR') variable. Is there a perl command to either get or
>> convert that to the machine name. [...]
however, new perl users would be wise to skim through the perlfunc man
page or chapter 3 of the Camel to see what's available. in the
future one may remember something about some function that one had
seen previously and be able to go back to find it (without posting
to usenet). in this case, one would have found all sorts of
functions starting with get* that perform these sorts of tasks.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 19 Jan 1998 01:51:25 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How on earth....?!?!
Message-Id: <comdog-ya02408000R1901980151250001@news.panix.com>
Keywords: from just another new york perl hacker
Please read this information on how to choose a good subject for a post:
<URL:http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post>
In article <mzzvnAAC+nw0Ewe5@cydaps.co.uk>, James <James@cydaps.nospam.co.uk> posted:
>Does anyone know how www.classified2000.com setup their Cool Notify and
>how we could do something similar. Often their are around 20,000 jobs
>per month so it needs to be robust. Can anyone help?
you could always ask www.classified2000.com, but it's not that
difficult of a thing to do. with which part of the process are
you having trouble?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Mon, 19 Jan 1998 01:13:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to sorting lists alphabetically?
Message-Id: <comdog-ya02408000R1901980113380001@news.panix.com>
Keywords: from just another new york perl hacker
In article <69t8ls$229$1@uranium.btinternet.com>, "Michael Georgiadis" <michael.georgiadis@btinternet.com> posted:
>i have a file with entries (1 per line) in the following form:
>
>company name,description,tel,fax,email
>the name of the company in the first line may be Zephyr and the second may
>be Acme. i want to be able to write some code which will read in one line at
>a time and then sort the list alphabetically and output to <STDOUT>
ironic that all the "how do i sort questions" all next to each other
in the list tonight (at least the way that i sort them). your
answer is in perlfaq4, or in some of the responses to the same question
yesterday (and the day before that, and the day before the day before,
ad infinitum).
>also, is it possible to write some code to search for a particular word
>within the list?
someone already did. it's calls itself "grep", but maybe you
wanted something different?
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 19 Jan 1998 05:50:42 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: I am still a virgin
Message-Id: <69upji$3ds$1@vixen.cso.uiuc.edu>
Jonathan Stowe (Gellyfish@btinternet.com) wrote:
: In article <34C22707.304E3D13@hotmail.com>, katigaebler@hotmail.com says...
: >
: >Hello,
: >
: >Could someone help me get started.
: >
: >I made a simple test and placed
: >it in my cgi bin:
: >
: <example code snipped>
:
: This is due to a http server configuration problem almost certainly. I
: would read the docs on your server software and check your cgi-bin directory
: is set as being executable for the server.
:
: Jonathan
:
With the subject, and the return address, I was sure this was
a spam until I saw the multiple replies. 8-)
--
Regards,
Mike Heins
This post reflects the
opinion of my employer.
------------------------------
Date: 18 Jan 1998 22:22:02 -0800
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: I am still a virgin
Message-Id: <69urea$elv@Xenon.Stanford.EDU>
i believe the line "Content-type: text/html\n\n" is case sensitive and the
't' in type must be lowercase, not uppercase.
hope that helps!
kelly
In article <34C22707.304E3D13@hotmail.com>,
Kati <katigaebler@hotmail.com> wrote:
>Hello,
>
>Could someone help me get started.
>
>I made a simple test and placed
>it in my cgi bin:
>
>#!/usr/bin/perl
>
>print "Content-Type: text/html\n\n";
>print "This is my first test\n";
>
>exit;
>
>Naturally - this should return the
>words "This is my first Test".
>
>I do the chmod a+x test.pl, then
>type test.pl and the shell returns
>correctly "This is my first test".
>
>But when I access the same file
>via Netscape browser, the phrase
>is not printed, the above file
>is shown in full as ASCII characters.
>
>How can I could make this work,
>please kindly help me out.
>
>Kati
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
--
Kelly William Hirano Stanford Athletics:
hirano@cs.stanford.edu http://www.gostanford.com/
hirano@alumni.stanford.org (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20
------------------------------
Date: Mon, 19 Jan 1998 01:56:33 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: I am still a virgin
Message-Id: <comdog-ya02408000R1901980156330001@news.panix.com>
Keywords: from just another new york perl hacker
Please read this information on how to choose a good subject for a post:
<URL:http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post>
In article <34C22707.304E3D13@hotmail.com>, Kati <katigaebler@hotmail.com> posted:
>I made a simple test and placed
>it in my cgi bin:
>I do the chmod a+x test.pl, then
>type test.pl and the shell returns
>correctly "This is my first test".
>
>But when I access the same file
>via Netscape browser, the phrase
>is not printed, the above file
>is shown in full as ASCII characters.
sounds like a server problem. the documentation for your server
should tell you how to set up CGI access. you might also want
to check the references in the CGI Meta FAQ.
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Mon, 19 Jan 1998 02:16:17 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: I am still a virgin
Message-Id: <comdog-ya02408000R1901980216170001@news.panix.com>
Keywords: from just another new york perl hacker
In article <69urea$elv@Xenon.Stanford.EDU>, hirano@Xenon.Stanford.EDU (Kelly Hirano) posted:
>i believe the line "Content-type: text/html\n\n" is case sensitive and the
>'t' in type must be lowercase, not uppercase.
strange, the last HTTP specification [1] i read lists it as "Content-Type"
even more strange - this works:
#!/usr/bin/perl
print <<"HERE";
CONTENT-TYPE: TEXT/HTML
<body>
<blink>just another new york perl hacker</blink>
</body>
HERE
__END__
but that's because that same specification says that header field
names are case insensitive [2].
[1] that would be RFC 2068 for those of you reading along at home.
see section 14.18
[2] section 4.2. see the third sentence.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
almost forgot which newsgroup i was in. thought i abandoned c.i.w.a.c ...
------------------------------
Date: Sun, 18 Jan 1998 23:28:04 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: Kati <katigaebler@hotmail.com>
Subject: Re: I am still a virgin
Message-Id: <34C30084.C934E5F7@sirius.com>
You did not mention that you put the file on a server.
If your Perl code is just on your local machine and the
URL in the Location: box near the top of the browser starts
with file:///... then you are just browsing the file locally
and you will not get CGI programs to run this way.
There are many servers that are easy to use that you can
download for free for almost any platform.
Another point is that you did not write any html in your
html document. It is good practice to (at least) enclose
the text you want displayed inside of
<html><head><title>Page Title Here</title></head><body>
Your text goes here
</body></html>
-- Jim Bowlin
Kati wrote:
>
> Could someone help me get started.
>
> I made a simple test and placed
> it in my cgi bin:
> [snip]
------------------------------
Date: 18 Jan 1998 14:18:21 GMT
From: Nick Busigin <nick@xwing.xwing.org>
Subject: Re: LWP SSL POST requests
Message-Id: <emzh2l.hn0@xwing.xwing.org>
Webmaster <webmaster@fccj.cc.fl.us> wrote:
: HTTP(S) POST looks just like a GET, but it does not show up on the URL. You
: may want to look at Lincoln Steins 'CGI.pm' (which is now included with Perl
: 5.004 anyways :-)
: www-url-encoded would be another place to peek at your possible problem(s)
: :-)
Is there any work being done to enhance the LWP module to utilize the
SSLeay-Perl features for implementing secure web transaction capabilities?
It seems like a useful and logical extension.
Best regards,
Nick
Version: 2.6.3ia
Charset: noconv
Comment: Nick Busigin <nick@xwing.org>
iQCVAwUBNMIPKKOTonS/KSgFAQHKmgP/VmbhyvyRnLnR9ebpbeydrC8xaCaniBmp
SctJbUnmPZGMaDLzR1TTavGo6iyGf5c6GiRQYgC6Qj6nOzicfB63xDVqEsPzPP+3
y2qDuIGJb+0hkGePi1njG7s8dTtc0ubCcIgCnAFKYfB+JT6KAzKSiwq6dedmQiIh
PP8KsyXSxHU=
=0irJ
-----END PGP SIGNATURE-----
--
--------------------------------------------------------------------------
Nick Busigin <Sent from my Debian/GNU Linux Machine> nick@xwing.org
------------------------------
Date: Mon, 19 Jan 1998 01:32:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: MacPerl carriage returns
Message-Id: <comdog-ya02408000R1901980132080001@news.panix.com>
Keywords: from just another new york perl hacker
In article <aaron-1801982151190001@digi2-059.wwa.com>, "Aaron Young" <aaron@soltec.net> posted:
>I am trying to write a client that talks to a pop server on a macintosh.
>When I send the USER command like this
>
>USER username\n
>
>The server seems to be timing out on me
>
>Is there another way I should be sending the carriage return since it is
>sitting on a macintosh?
check the data to sure what you are sending (i.e. what \n gets
translated to) and make sure that is what the Mac is expecting
(which is a little goofy on the \r, \n issue).
intercepting the POP data then looking at the hex dump of that
will tell you what your script received. once you know what
data are coming in (i.e. what terminates a line of input), you
can adjust your server code to recognize that line ending.
or maybe it's something else, but i remember this same sort of
problem from my Mac programming days. the people of those
Mac programming groups prabably know all about this sort of thing.
good luck :)
--
brian d foy <comdog@computerdog.com>
thank god i don't do GUI programming stuff anymore.
------------------------------
Date: Mon, 19 Jan 1998 01:41:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Library
Message-Id: <comdog-ya02408000R1901980141130001@news.panix.com>
Keywords: from just another new york perl hacker
Please read this information on how to choose a good subject for a post:
<URL:http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post>
In article <Pine.LNX.3.96.980118164512.3629A-100000@ieee.engg.uregina.ca>, "John R. Powell" <jpowell@*NOSPAM*ieee.engg.uregina.ca> posted:
>Where would one find sample 'database' perl scripts to be run on Linux?
um, CPAN [1]?
>REMOVE *NOSPAM* before replying
i just won't reply.
[1]
Comprehensive Perl Archive Network
find one near you at <URL:http://www.perl.com>
--
brian d foy <comdog@computerdog.com>
------------------------------
Date: Mon, 19 Jan 1998 01:24:18 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Question about outputting HTML w/ images
Message-Id: <comdog-ya02408000R1901980124180001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34C2D84B.5B27B63E@vt.edu>, Steve Ellis <sellis@vt.edu> posted:
>Greetings all! Sorry to post in the wrong spot if this isn't an
>appropriate question....but:
>
>I'm trying to output an HTML page from a script. The text parts are
>just fine, but when it gets to an <IMG> tag, the browser window
>(Netscape) goes black and then displays the picture. After that, I have
>to hit ESC to get away from the image, and the rest of the script is
>locked up.
doesn't sound like a Perl problem. your script is sending whatever
data you tell it to send (an HTTP or CGI issue). if the client
has problems with the data, it's either a client problem or a
data problem. figure out which one it is, ask in a newsgroup
devoted to that issue, then make your script send the data in
a way to please the client (or be a purist and wait for the
client to correctly implement the "standard(s)").
good luck :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 19 Jan 1998 01:17:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: REGEXP: Does it need optimization?
Message-Id: <comdog-ya02408000R1901980117590001@news.panix.com>
Keywords: from just another new york perl hacker
In article <34c57b20.12120348@nntp2.ba.best.com>, rick@marinweb.com posted:
>I'm pretty new to this and was wondering if anhone has any suggestions
>here. A search script I modified now uses the following regexp to
>exclude portions of an HTML page from searches:
>
>s#(^.*)(</head>.*<!--content-->)(.*)(<!--/content-->.*$)#\1 \3#i
you may want to use the Benchmark modules to compare the
"efficiency" of your regular expression. realize though
that "efficiency" in one factor, such as speed, might
translate to "inefficiency" in another factor, such as
memory.
>And yes, some day I *do* plan to read "Mastering Regular Expressions."
>TIA for that suggestion. :-)
no time like the present :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Sat, 17 Jan 1998 21:55:39 -0500
From: Alan Gutierrez <aQlWaEnR@TaYnUeIcOdPoAtSeD.FcGoHm>
Subject: Re: Sort question
Message-Id: <34C16F2B.CAB150BC@TaYnUeIcOdPoAtSeD.FcGoHm>
Andrew Spiers wrote:
>
> PLEASE HELP ME. I AM GOING MAD !!!!
>
> I have two fields : one contains a URL and the other contains the number
> of hits on this URL. I want to sort them so that the most visited
> appears at the top. Sounds simple but I cant get it to work. I have
> tried looking in the usual places, FAQs etc, but I just cant seem to get
> it to work.
>
> Many thanks,
>
> Andrew Spiers
>
> P.s. If you ever come to West London I will buy you a beer ! Promise !!
--
Well, I like beer..
#!/usr/bin/perl
%URL = (
'http://www.dejanews.com/' => 129,
'http://www.FreeBSD.org/' => 110,
'http://www.perl.com/' => 143,
'http://www.linux.org/' => 110,
'http://www.gnu.org/' => 132,
);
for my $url (sort { $URL{$b} <=> $URL{$a} } keys %URL) {
print $url, "\n";
}
You are going to want to read the perlfunc man page on sort or do a
perldoc -f sort.
Alan Gutierrez
My email address is: alan at NO anecdote SPAM dot com
------------------------------
Date: 19 Jan 1998 06:24:34 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: source into binary code
Message-Id: <69urj2$d01$1@news.orst.edu>
In article <34C2E36D.1C02218D@coos.dartmouth.edu>,
Chipmunk <rjk@coos.dartmouth.edu> wrote:
>Abigail wrote:
>>
>> Johnny wants to have a program that does foo, and possible "steal"
>> the code, without willing to do much effort. Now, whose code is Johnny
>> going to buy/use? Dan's, or Betty's?
>
>Betty's.
Almost. Johnny is going to buy nothing. He is going to use Betty's.
>> Certainly Dan has succeeded in "protected" his code, by making it
>> harder to read the source than Betty's. So, why should people use
>> Dan's code at all?
Because Dan's code runs reliably. Because Dan will support it if it
doesn't. Because it runs on the platform it is needed on. Because it
does bar and bletch as well as foo. Because the report it creates
when it finishes doing foo is compatible with the corporate database.
Because they are part of a corporate culture that doesn't like free
software because there is no support and nobody to sue if it breaks.
>The problem is that, while obscuring the code keeps out the bad guys, it
>also turns away the good guys.
I have yet to see anyone refuse to buy Excel or Word because it wasn't
available in source.
------------------------------
Date: Sun, 18 Jan 1998 23:24:04 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Why does'nt this sub work
Message-Id: <34C2F12F.309725DA@5sigma.com>
Here we have a good example of the "Frankenstein monster" school
of software architecture, no offense intended.
-joseph
------------------------------
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 1670
**************************************