[11942] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5542 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 2 12:07:28 1999

Date: Sun, 2 May 99 09:00:19 -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           Sun, 2 May 1999     Volume: 8 Number: 5542

Today's topics:
    Re: checking the existence of a directory (Larry Rosler)
        E-Mail Attachments <strauman@gte.net>
    Re: extracting text gertyk@mail.cybernex ADD .net
    Re: extracting text (Larry Rosler)
    Re: Fill a listbox or Pull_down <gellyfish@gellyfish.com>
        Filtering a file <chrisl@muskox.alaska.edu>
    Re: Filtering a file (Larry Rosler)
    Re: finding the right doc WAS Re: using perl to manage  <dtbaker@bus-prod.com>
    Re: finding the right doc WAS Re: using perl to manage  <dtbaker@bus-prod.com>
    Re: finding the right doc WAS Re: using perl to manage  <tchrist@mox.perl.com>
    Re: getting a remote URL (Michel Dalle)
    Re: getting a remote URL <gellyfish@gellyfish.com>
    Re: global var disappearing, reappearing <otis@my-dejanews.com>
    Re: global var disappearing, reappearing <tchrist@mox.perl.com>
    Re: global var disappearing, reappearing <tchrist@mox.perl.com>
    Re: Help (Tad McClellan)
    Re: How to get POP3D hostname from a given domain name? <gellyfish@gellyfish.com>
        Job Offer <tony.mail@tesco.net>
        Novice or what? <mike@effingpot.com>
    Re: Novice or what? <design@raincloud-studios.com>
    Re: pattern matching <revjack@radix.net>
    Re: Perl web watching script <gellyfish@gellyfish.com>
    Re: Perl web watching script <flavell@mail.cern.ch>
    Re: Possible to modify gif/jpeg images with Perl?? <gellyfish@gellyfish.com>
    Re: Q: Getting sendmail to work <gellyfish@gellyfish.com>
    Re: Security:HowTo not pass UserID/Password as hidden v <gellyfish@gellyfish.com>
        Stripping Newline Characters from Form Input (Rick Alber)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 2 May 1999 07:59:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: checking the existence of a directory
Message-Id: <MPG.11960817871b215f989993@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <372d0066.976511@news.skynet.be> on Sun, 02 May 1999 08:21:37 
GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Larry Rosler wrote:
> >I've seen that advice before, but I don't think much of it.  If the 
> >mkdir fails, you don't know whether the directory already existed or 
> >couldn't be created.  So you have to either examine $! or do the -d test 
> >anyway.  So why not just test first and avoid the unnecessary mkdir 
> >system call?
> 
> Like Tad McClennan wrote: there may be a file with tha same name.

The pre-test is '-d', not '-e'.
 
> If you do:
> 
> 	mkdir $directory,0755;
> 	-d $directory 
> 		or die "Directory $directory still doesn't exist ($!)";
> 
> I think this covers all bases. Note that $! will be set through the
> failure of mkdir().

But your code does 'the unnecessary mkdir system call' I was referring 
to.

Rick Delaney posted The Best Way To Do It (modified to use a variable 
for the directory name):

    -d $dir or mkdir $dir, 0777 or die "Can't mkdir '$dir': $!\n";

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Sun, 02 May 1999 14:55:08 GMT
From: "John J. Straumann" <strauman@gte.net>
Subject: E-Mail Attachments
Message-Id: <372C66E1.78325E56@gte.net>

Hey All:

I am sending mail via a PERL script that looks like this:

open ( MAIL, "| /usr/lib/sendmail -t");
print MAIL "Subject: Whatever\n";
print MAIL "From: $me\n";
print MAIL "To: $eMail\n";
print MAIL "Reply-To: $me\n";
print MAIL "Text Content ";
close ( MAIL );

Can anyone give me an example of how to attach an .exe file?

I tried it like this:

open ( MAIL, "| /usr/lib/sendmail -t");
print MAIL "Subject: Whatever\n";
print MAIL "From: $me\n";
print MAIL "To: $eMail\n";
print MAIL "Reply-To: $me\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "X-Accept-Language: en\n";
print MAIL "Content-Type: multipart/mixed;\n";
print MAIL "Content-Type: application/octet-stream; name=$file\n";
print MAIL "Content-Transfer-Encoding: base64\n";
print MAIL "Content-Disposition: attachment; filename=$file\n";
print MAIL "Text Content";
close ( MAIL );

but no joy...

TIA.

John.


------------------------------

Date: Sun, 02 May 1999 12:06:49 GMT
From: gertyk@mail.cybernex ADD .net
Subject: Re: extracting text
Message-Id: <372c3dfe.73219354@news.cybernex.net>

Try this:

$s="<FONT><STRONG>Text To Extract</STRONG></FONT>";
$s=~/(<[^>]*>)*([^<]*)(<[^>]*)*/;
print $2;

Text to extract is in $2


This won't work on the following string (it finds only "Text"):

$s="<FONT>Text <b>To</B>Extract</FONT>";

To remove all the tags on the line use this:

$s=~s/<[^>]*>//g;
print $s;



On Thu, 29 Apr 1999 14:24:21 +0100, "Mario Anthony Thomas"
<mario@alamar.net> wrote:

>How do I extract text from the middle of a string when I don't know what
>that text is? For example,
>in the string below i'd like to extract the bit that says 'Text To Extract'.
>How do I do this - can I do
>it with pattern matching or not?
>
>
>.....<FONT><STRONG>Text To Extract</STRONG></FONT>.......
>
>Hope someone can help with this.
>
>Cheers
>
>Mario
>
>



------------------------------

Date: Sun, 2 May 1999 07:41:43 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: extracting text
Message-Id: <MPG.119603face207557989992@nntp.hpl.hp.com>

In article <372c3dfe.73219354@news.cybernex.net> on Sun, 02 May 1999 
12:06:49 GMT, gertyk@mail.cybernex <gertyk@mail.cybernex> says...
> $s="<FONT><STRONG>Text To Extract</STRONG></FONT>";
> $s=~/(<[^>]*>)*([^<]*)(<[^>]*)*/;
> print $2;

That's a lot of heavy lifting in the regex, for not much purpose.  Also, 
we have been subjected in the last week to serious criticism from Randal 
Schwartz for using the results of a pattern match without verifying the 
success of the match.  So...

  my $s = '<FONT><STRONG>Text To Extract</STRONG></FONT>';
  if ($s =~ />([^<]+)/) {
    print $1
  } else {
    print "No match.\n"
  }

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: 2 May 1999 13:32:39 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Fill a listbox or Pull_down
Message-Id: <7ghk5n$1ma$1@gellyfish.btinternet.com>

On Fri, 30 Apr 1999 12:34:55 -0500 Michael Hill wrote:
> All,
> 
> I have this code that retrieves data from Oracle and I want to populate
> a web listbox or pull_down. It is not working, the output is:
> 
> parta partb partc
> 
> The HTML equavalent is:
> 
<snip>
>  print "<OPTION value>$row[0]\n";

I think you mean :

    qq|<OPTION value="$row[0]">$row[0]\n|;

Or alternatively you might consider using the module CGI.pm that has
useful methods for producing HTML.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 1 May 1999 17:57:53 -0800
From: "Chris" <chrisl@muskox.alaska.edu>
Subject: Filtering a file
Message-Id: <7ggbd1$5q5$1@news.alaska.edu>

I picked up a Perl book because I need to write a program that will read in
a file and spit out into another file all the lines that contain any of a
list of various strings. Is there some more efficient/"Better" way to do
this than to have a long series of if/elsif statements? Ideally, I would
compare against a list which I could create dynamically based on another
file of "trigger" strings, but I am unsure how to do that...

tia -- c
--
Chris Lott <chrisl@muskox.alaska.edu> "This sentence has threee erors."




------------------------------

Date: Sun, 2 May 1999 08:44:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Filtering a file
Message-Id: <MPG.11961298c81f8589989994@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7ggbd1$5q5$1@news.alaska.edu> on Sat, 1 May 1999 17:57:53 -
0800, Chris <chrisl@muskox.alaska.edu> says...
> I picked up a Perl book because I need to write a program that will read in
> a file and spit out into another file all the lines that contain any of a
> list of various strings. Is there some more efficient/"Better" way to do
> this than to have a long series of if/elsif statements? Ideally, I would
> compare against a list which I could create dynamically based on another
> file of "trigger" strings, but I am unsure how to do that...

I think that what you are looking for is in perlfaq6:  "How do I 
efficiently match many regular expressions at once"

That gives a solution that uses a new feature of perl5.005, qr//.  For 
older perls, you can create a unified regex.  The following causes the 
"trigger" strings to be matched literally:

   my $re = join '|', map quotemeta, @trigger_strings;
   /$re/o and print while <>;

To allow the "trigger" strings to be matched as if they were arbitrary 
regexes, the processing is a bit more elaborate:

   my $re = '(?:' . join(')|(?:', @trigger_strings) . ')';

PS:  When you 'compare against a list which I could create dynamically 
based on another file of "trigger" strings,' don't forget to chomp off 
the newlines:

   chomp(my @trigger_strings = <FILE>);

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Sun, 02 May 1999 08:23:54 -0500
From: Dan Baker <dtbaker@bus-prod.com>
Subject: Re: finding the right doc WAS Re: using perl to manage passwords?
Message-Id: <372C51EA.A495D4F8@bus-prod.com>

Larry Rosler wrote:
> 
> In article <372BCC3F.43A26571@bus-prod.com> on Sat, 01 May 1999 22:53:35
> -0500, Dan Baker <dtbaker@bus-prod.com> says...
> > Matthew Bafford wrote:
> ...
> > > Or, you could even *gasp* resort to the program that comes with Windows!
> > > The Find program (start menu) will search files.
> > -------
> > file names perhaps, but it certainly won't search the contents of files
> > for keywords...
> 
> It certainly will.  Look again.  They call that capability 'Advanced'.
> But it is not advanced enough to use regexes.
-----------------

awesome, I can't believe I missed that up until now.... learn sumptin
every day I guess...
Thanx Larry

Dan


------------------------------

Date: Sun, 02 May 1999 08:25:06 -0500
From: Dan Baker <dtbaker@bus-prod.com>
Subject: Re: finding the right doc WAS Re: using perl to manage passwords?
Message-Id: <372C5232.40DF8ABF@bus-prod.com>

Tom Christiansen wrote:
> 
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, Eric Bohlman <ebohlman@netcom.com> writes:
> :perldoc has quite a few nifty search facilities;
> 
> I think not.  Its days are numbered.
------------

what will be the preferred documentation method of the future? 

Dan


------------------------------

Date: 2 May 1999 08:10:24 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: finding the right doc WAS Re: using perl to manage passwords?
Message-Id: <372c5cd0@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Dan Baker <dtbaker@bus-prod.com> writes:
:what will be the preferred documentation method of the future? 

Voice mail, with on of those push-button menus.

--tom
-- 
#define SVs_RMG   0x00008000  /* has random magical methods */
    --Larry Wall, from sv.h in the v5.0 perl distribution


------------------------------

Date: Sun, 02 May 1999 12:10:55 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: getting a remote URL
Message-Id: <7ghfau$fs$1@xenon.inbe.net>

In article <372c23ea.4609999@news.online.ee>, cim@online.ee (Cim) wrote:
>How could I access a remote URL via perl?
>http://someplace.com/cgi-bin/abc.cgi?img=123&xx=xxxxx ........
>
>This URL could return a HTML with img links inside or just an image.
>Then I want to print it.
>What will the <img src> be? I want to hide the original location. So
>that it would look as if the output would come from my server.

1) there is a newsgroup called comp.infosystems.www.authoring.cgi
that can help you in more detail
2) apart from any ethical and copyright issues, I'd have a look at CPAN
for modules like LWP and HTML for extracting links from web pages

Michel.

--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html


------------------------------

Date: 2 May 1999 12:26:22 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: getting a remote URL
Message-Id: <7ghg9e$198$1@gellyfish.btinternet.com>

On Sun, 02 May 1999 10:16:59 GMT Cim wrote:
> How could I access a remote URL via perl?
> http://someplace.com/cgi-bin/abc.cgi?img=123&xx=xxxxx ........
> 
> This URL could return a HTML with img links inside or just an image.
> Then I want to print it.

You will want to use the LWP::UserAgent module that is available from
CPAN - that is <http:://www.perl.com/CPAN> (I thought that it was
unnecessary to point that ought until today).

The module comes with good documentation including a 'cookbook' lwpcook.pod
and a variety of examples so I wont bother everyone else with the details.

> What will the <img src> be? I want to hide the original location. So
> that it would look as if the output would come from my server.
> 

Perl doesnt have an <img src> so  I guess you will want to ask that
question in a group that discusses such matters.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sun, 02 May 1999 14:50:24 GMT
From: Otis Gospodnetic <otis@my-dejanews.com>
Subject: Re: global var disappearing, reappearing
Message-Id: <7ghong$ul4$1@nnrp1.dejanews.com>

In article <372c2024@cs.colorado.edu>,
  tchrist@mox.perl.com (Tom Christiansen) wrote:
>  [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
>     Otis Gospodnetic <otis@my-dejanews.com> writes:
> :What is the correct way to declare a global variable that is to be visible
> :from all subroutines in the program?
> :
> :I thought:
> :my $foo = 'bar'; # correct
> :$foo = 'bar';    # bad
>
> my is not global.

I knew somebody would say that :)
True, I should use 'use vars' to make it global, I guess.
However, how come that a my-ed variable declared right at the beginning of
script (outside any blocks) is sometimes seen properly from within subroutines
and sometimes it is not?
Why the inconsistency?

Thanks,

Otis

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: 2 May 1999 09:01:53 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: global var disappearing, reappearing
Message-Id: <372c68e1@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Otis Gospodnetic <otis@my-dejanews.com> writes:
:I knew somebody would say that :)
:True, I should use 'use vars' to make it global, I guess.
:However, how come that a my-ed variable declared right at the beginning of
:script (outside any blocks) is sometimes seen properly from within subroutines
:and sometimes it is not?
:Why the inconsistency?

There is no inconsistency.  But perhaps you have some mistaken
notion that lexical variable are shared amongst threads.  

They aren't.

--tom
-- 
I'm TRYING to be a back end!  - --Andrew Hume


------------------------------

Date: 2 May 1999 09:48:22 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: global var disappearing, reappearing
Message-Id: <372c73c6@cs.colorado.edu>

 [courtesy cc's sent]

:There is no inconsistency.  But perhaps you have some mistaken
:notion that lexical variable are shared amongst threads.  

Belay that order.  Must dig more.

--tom
-- 
"Twisted cleverness is my only skill as a programmer." --Elizabeth Zwicky


------------------------------

Date: Sat, 1 May 1999 15:35:14 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help
Message-Id: <i1lfg7.do1.ln@magna.metronet.com>

exorcist1@my-dejanews.com wrote:

: Subject: Help


    Please put the subject of your post in the Subject: of your post.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: 2 May 1999 11:59:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to get POP3D hostname from a given domain name?
Message-Id: <7ghenc$18v$1@gellyfish.btinternet.com>

On Sun, 02 May 1999 17:02:06 +0800 hkchan wrote:
> Hello,
> 
> I am wondering how to write a PERL script to get POP3D server hostname,
> for example, a user just type one's email address without specifying the
> POP3D server but only the domain name, username@domain.com, and the
> script would be intelligence enough to return the value such as
> username@pop3d_server_name.domain.com.
> 

I'll ignore the pop3d bit because that is a red herring - mail can be 
delivered by SMTP, UUCP etc etc with POP3 ever getting involved.

First the Perl bit.

It is possible to get the Mail Exchanger (MX) record from the DNS using
the module Net::DNS as per this example :


#!/usr/bin/perl -w

use strict;

use Net::DNS;

my $domain;

die 'Need E-Mail address ' unless $ARGV[0];

if ( $ARGV[0] =~ /.+@(.+)/ ) 
  {
    $domain = $1;
  }
else
  {
    die "$ARGV[0] is probably not an email address\n";
  }

my @mx = mx($domain); 

foreach (@mx)
 {
   print $_->preference,"\t",$_->exchange,"\n";
 }

Which will give you in order the mail exchangers and their preference
(the lowest number being the most prefered exchanger ) :


5	popmail.dircon.co.uk
10	mx1.dircon.net
10	mx0.dircon.net

Now the non Perl bit (Please avert your eyes if you might be offended ):

Of course this wont do you any good whatsoever - in this case for instance
if you tried to send a mail to doris&sceptic@popmail.dircon.co.uk rather
than to doris&sceptic@gellyfish.com you will get a bounce like this:


Reporting-MTA: dns; gellyfish.btinternet.com
Arrival-Date: Sun, 2 May 1999 11:31:22 GMT

Final-Recipient: RFC822; doris&sceptic@popmail.dircon.co.uk
Action: failed
Status: 5.1.1
Remote-MTA: DNS; popmail.dircon.co.uk
Diagnostic-Code: SMTP; 550 <doris&sceptic@popmail.dircon.co.uk>... User unknown
Last-Attempt-Date: Sun, 2 May 1999 11:32:16 GMT

Lets take another example :


5	mail.hastings.gov.uk
10	hinge.mistral.co.uk
20	hinge2.mistral.co.uk

Which is the MX for the hastings.gov.uk domain.  So you send a message to
jstowe@mail.hastings.gov.uk rather than jstowe@hastings.gov.uk.  
mail.hastings.gov.uk is on an ISDN line - so if you are foolish enough
to try and send your message directly by SMTP then the chances are it will
fail. Even if you are using a reiable MTA such as sendmail it wont have 
any knowledge of when mail.hastings.gov.uk is available (whereas the
exchanger hinge.mistral.co.uk does ) and so it comes down to the server
being available when your MTA process its queue - Er luck basically.

None of this takes into account the very likely possibility that the
server has been configured to prevent relaying - i.e. will only accept
mail for the domains for which it is the exchanger  - you might get lucky
with a second DNS lookup on the mail exchanger: if you get records back
then you might be OK if you dont you are probably out of luck.

There are other possibilities that will hamper you but I wont list them.

The moral of this story is that it is probably a pointless enterprise.
You should use the established mechanism for mail delivery - the MX record
are there for a purpose.

If you disagree with my verdict or want a second opinion then you should
ask in one of the comp.mail.* newsgroups as none of this has anything
to do with Perl.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sun, 02 May 1999 15:36:28 +0100
From: Tony <tony.mail@tesco.net>
Subject: Job Offer
Message-Id: <372C62E3.A5E04CA2@tesco.net>

Hello Group...

I have a small Web Design company which recently won a huge new client
and we can't really cope !

They have some very exciting but technically (for us) difficult ideas
about their site.
 So, I need to get in touch with one / maybe two guru level script
experts to help me out.
The money is not huge but it is a genuine "Feather in your cap" client.
The site will be heavily promoted on TV / Radio / Point of sale in the
UK and Framce
this summer and is expected to generate enormous traffic.

Right now, I have one specific problem which I imagine can be solved
with a combination of JavaScript
and perl, anyone interested please mail me and I can explian in detail
what I need, negotiate  fees etc.

I imagine that as time goes on (We have a 12 month contract) there will
certainly be more and more
stuff that I will need so a longish term relationship is what I'm after.

Best wishes

Tony

please mail me direct
tony.mail@tesco.net

apologies if this is very off topic.



------------------------------

Date: Sun, 02 May 1999 15:32:02 +0100
From: Mike Etherington <mike@effingpot.com>
Subject: Novice or what?
Message-Id: <372C61E2.44A4@effingpot.comNOSPAM>

Hi,
I have installed two perl scripts on my web site an do either of them
work? No! 
so I haven't prgrammed for about 10 years but I thought I'd do better
than that.
 
If any kind soul is interested in helping out this novice, the first is
a FORM that just gives internal errors. It's at
http://www.effingpot.com/member.html - the idea is that it e-mails me
the form and all I needed to do was change one field. I think there is
either fields in the form it doesn't like or a bug in the formmail.cgi -
though I would doubt it. The cgi file is at
http://www.effingpot.com/cgi-bin/formmail.cgi. Appreicate the help.

The second on is the search - see for yourself - it returns ridiculous
filenames - the / is missing!! Who knows why. My PERL skills are
somewhat non existent! /cgi-bin/search.pl is the offending file.

Thanks in advance - if you do have an inkling to take a look - please
e-mail me at mike@effingpot.com - thanks
Mike


------------------------------

Date: Sun, 02 May 1999 15:22:54 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Novice or what?
Message-Id: <i5_W2.356$iu1.817@news.rdc1.tn.home.com>

>I have installed two perl scripts on my web site an do either
of them
>work? No!

>so I haven't prgrammed for about 10 years but I thought I'd do
better
>than that.


>If any kind soul is interested in helping out this novice, the
first is
>a FORM that just gives internal errors. It's at


comp.infosystems.www.authoring.cgi is where you need to be. :)

Your code is probably fine, you need to learn about setting
permissions and the enviroment Perl runs in on your system.

If you want something for free, the Perl CGI Faq...

ftp://ftp.orst.edu/pub/packages/CPAN/doc/FAQs/cgi/idiots-guide.h
tml

ftp://ftp.cs.colorado.edu/pub/perl/CPAN/doc/FAQs/cgi/perl-cgi-fa
q.html

and you better eventually read this too...

ftp://mirror.xmission.com/CPAN/doc/FAQs/cgi/www-security-faq.htm
l

If you can (and should) spend $20.00...

You might consider the Visual QuickStart Guide to 'Perl and CGI
for the World Wide Web' by Elizabeth Castro. ISBN 0-201-35358-X.
I think every newbie should be given one when they sign up with
a hosting provider. It's a well spent $18.99 and answers every
last beginner's question about using Perl for site development.

CT





------------------------------

Date: 2 May 1999 14:36:26 GMT
From: Hewitt Marjorie <revjack@radix.net>
Subject: Re: pattern matching
Message-Id: <7ghnta$735$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

TRG Software : Tim Greer explains it all:

:bing-du@tamu.edu wrote:
:> 
:> Greetings all...
:> 
:> I want to remove all the blank spaces before and after (but between 'a' and
:> 'b') the comma ','. But the following code snippet did not work.
:> 
:> $test = 'a, b c';
:> $test =~ s/(\s+),(\s+)/,/;
:> print "test is $test\n";  # the output is still 'a, b c' but rather 'a,b c'.

:Did you mean:
:$test =~ s/,(\s+)/,/;

Why are you capturing? Anyways, this doesn't meet his stated requirements,
as it ignores spaces before the comma. Larry got it right: 

  s/\s*,\s*/,/g; 

-- 
  /~\  planar augend registrant Hayes apologetic Aruba gaff approximan
 C oo  indicate hock thorn Burlington description seismograph Sussex q
 _( ^) 1 , 0 0 0 , 0 0 0   m o n k e y s   c a n ' t   b e   w r o n g
/___~\ http://www.radix.net/~revjack/mnj             revjack@radix.net


------------------------------

Date: 2 May 1999 13:22:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl web watching script
Message-Id: <7ghjjj$1km$1@gellyfish.btinternet.com>

On Fri, 30 Apr 1999 21:16:41 GMT exposuregraphics@hotmail.com wrote:
> Hello,
> 
> I have been trying to find a script out there and am so far having minimal
> success. I am looking for a perl script which will automatically take a URL
> list and check those web sites to see if they have been updated. I am sure
> there is something like that out and about but the only script I have found is
> somewhat spartan and cumbersome.
> 

If you are going to *write* a script that does that (Frankly this isnt the
place to be asking for someone to give you one) then you will probably
want to use the module LWP::UserAgent to retrieve the headers of the
document using the HEAD method.

How you will interpret those headers to determine the last modified date
however is probably best asked in a group that discusses HTTP.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sun, 2 May 1999 16:16:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl web watching script
Message-Id: <Pine.HPP.3.95a.990502160751.24231C-100000@hpplus01.cern.ch>

On 2 May 1999, Jonathan Stowe wrote:

> How you will interpret those headers to determine the last modified date
> however is probably best asked in a group that discusses HTTP.

Good principle, but, with respect, unfortunately there doesn't seem to
be one.

c.i.w.authoring.cgi does a neat line in getting confused between
the CGI.out interface, and the HTTP protocol.

c.i.w.servers.* are useful places to discuss how servers deal with HTTP
protocol.

c.i.w.browsers.* are far too busy discussing the extraneous newsreader
and mailclient functions of the Big Two browsers to get very close to
actually discussing WWW protocols.  And the "answer" offered there to
most problems seems to be META.

The logical comp.protocols.http doesn't exist.

Don't misunderstand me - it's not your fault that things are like that,
and for sure your verdict was right about it not being a perl language
problem.

all the best

-- 

        Why are more and more spammers sending spam mail that begins
        with the words 'This is not a spam'?  Would it be useful to 
        announce publicly that my procmail recipe detects that phrase, 
        and puts their junk into a special memory hole?




------------------------------

Date: 2 May 1999 12:39:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Possible to modify gif/jpeg images with Perl??
Message-Id: <7ghh2v$1cl$1@gellyfish.btinternet.com>


On Sun, 2 May 1999 02:32:07 +0100 darkstar wrote:
> Where can I download this module?
On Sun, 2 May 1999 02:32:07 +0100 darkstar wrote:
> Where can I download this module?
On Sun, 2 May 1999 02:32:07 +0100 darkstar wrote:
> Where can I download this module?

On Sun, 2 May 1999 02:37:04 +0100 darkstar wrote:
> 
> Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
> 7gg0ge$3bt$1@gellyfish.btinternet.com...
>>On Sat, 1 May 1999 14:17:07 +0100 darkstar wrote:
>>> i want to modify a gif or a jpg image with perl. I must resize an
> existing
>>> image. Is this possible with perl or have you any ideas?
>
>>I would go with the Image::Magick module available from CPAN.
> Where can I get this module?
> 

Sheesh ! That will be :

<http://www.perl.com/CPAN/authors/id/JCRISTY/PerlMagick-4.23.tar.gz>
<http://www.perl.com/CPAN/authors/id/JCRISTY/PerlMagick-4.23.tar.gz>
<http://www.perl.com/CPAN/authors/id/JCRISTY/PerlMagick-4.23.tar.gz>
<http://www.perl.com/CPAN/authors/id/JCRISTY/PerlMagick-4.23.tar.gz>

Got that.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: 2 May 1999 12:08:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Q: Getting sendmail to work
Message-Id: <7ghf8d$194$1@gellyfish.btinternet.com>

On Sun, 02 May 1999 06:02:18 -0400 Amer Neely wrote:
> Amer Neely wrote:
> 
>> Hi all,
>> I'm having a problem trying to call sendmail from an otherwise working
>> Perl script. 
> 

<snip>

> More information available. I get the message:
> 
> /etc/sendmail.cf: line 55: fileclass: cannot open /etc/mail/sendmail.cw:
> Group writable directory
> 
> printed to the HTML page. Looks like a question for my ISP. Sorry.

Or alternatively for comp.mail.sendmail (Or rather the FAQ for that
group first ).

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: 2 May 1999 14:12:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Security:HowTo not pass UserID/Password as hidden variables from page to  page
Message-Id: <7ghmfo$1mg$1@gellyfish.btinternet.com>

<comp.lang.perl is a close relative of the Norwegian Blue parrot>

In comp.lang.perl.misc nichols <nichols@blarg.net> wrote:
> I have a web application that is written in Perl that accesses an Oracle
> 
> database that requires a user_id/password for each person.
> 
> There is a login page that requires the user_id and password.   On
> subsequent pages, the user_id and password are passed as hidden
> variables..  Of course, this is a security hole.  The user can edit the
> source html and see the password.  If you save it as a cookie, it is
> still viewable on the user's machine.
> 
> What approach would you recommend to solve this problem?  Does anyone
> have sample code?
> 

A moments reflection would indicate that this is not really a Perl
problem - the solutions will most probably not be language solutions
at all as your two possible methods suggest.

I would either examine the CGI faq at:

<http://www.webthing.com/tutorials/cgifaq.html>

Or ask in comp.infosystems.www.authoring.cgi where there will probably
be a higher concentration of people who have dealt with this problem
before.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sun, 02 May 1999 14:08:11 GMT
From: ralber@ix.netcom.com (Rick Alber)
Subject: Stripping Newline Characters from Form Input
Message-Id: <372c5c2c.20827965@nntp.ix.netcom.com>

I use javascript in my form to display the content of a textarea input
field before posting it. (see http://www.drscience.com/ask.htm).
Unfortunately, users hit the enter key while entering data which
inserts unwanted newline characters in my input field. I'd like to
strip out those newline characters before displaying the field
contents to the user and certainly before posting the data.

Can anybody tell me how to do this? Do I use PERL or can I use
javascript to strip the newline characters? 

I'm using the OnSubmit method to trigger the display of the input
field contents before posting the data. I need a solution that works
with IE, Navigator and AOL browsers.

Thanks very much.

----- Rick Alber


------------------------------

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 5542
**************************************

home help back first fref pref prev next nref lref last post