[12339] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5939 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 9 22:17:31 1999

Date: Wed, 9 Jun 99 19:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 Jun 1999     Volume: 8 Number: 5939

Today's topics:
    Re: ANSWER: Re: uninitialized value? what am i doing wr <admin@asarian-host.org>
    Re: Apache Authenticate and CGI (Abigail)
    Re: Apache Authenticate and CGI (Hasanuddin Tamir)
    Re: Bulletin Board in Perl (Abigail)
        duplicate rows <technology@workmail.com>
    Re: E-mailing with perl is driving me crazy! (Abigail)
    Re: Getting HTTP Error 405 (Abigail)
        Help on a news updating script I wrote... <mace@calweb.com>
    Re: help using large memory from perl (Larry Rosler)
    Re: How do I change my frameset thru perl <webmaster@chatbase.com>
    Re: How to get info from a file with sed/awk/perl (Ken Pizzini)
    Re: Intersection of several lists (Abigail)
    Re: know Perl to maintain Perl (was: Re: I pass an arra <admin@asarian-host.org>
        mail file with form and cgi-scipt <webmaster@vogelfreund.de>
    Re: Need a book ... (Larry Rosler)
        OLE reference (john kelly)
    Re: Perl script to purge old messages in mailboxes ? ynotssor@my-deja.com
    Re: Problems sorting. I'm stupid and I'll die (Larry Rosler)
    Re: Real Problem: CGI file upload and IE (Abigail)
    Re: Regexpr for loop to handle e-address list dalehend@flash.net
    Re: Regexpr for loop to handle e-address list <rootbeer@redcat.com>
        Reserved Characters <mace@calweb.com>
    Re: Reserved Characters <rootbeer@redcat.com>
    Re: Rounding excessive trailing decimals (Abigail)
    Re: Slowness in flock? <rootbeer@redcat.com>
    Re: VERSION numbers (Abigail)
        Where is sendmail on NT using Perl <roland@oco.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 10 Jun 1999 03:37:56 +0200
From: Mark <admin@asarian-host.org>
Subject: Re: ANSWER: Re: uninitialized value? what am i doing wrong?
Message-Id: <199906100138.TAA14738@asarian-host.org>

Bastiaan S van den Berg <office@asc.nl> wrote in message
news:7j5sfp$l4k$1@zonnetje.NL.net...

> yaaaaaahooooooooooooooooooooooooooooooooooooo!!!!!!!!!!
>
> ok ok , i found the answer , and NOT in a perldoc :)
>
> to check if a variable is defined :
>
> print "Car exists !\n" if defined $car;


Or simply:

 .. if ($car);

Sometimes life is hard; not today. :)

- Mark

        System Administrator Asarian-host.org





--
For more information about this posting service, contact:
help@asarian-host.org -- for all info about our server.
If you want an anonymous account, visit our sign-up page:

http://asarian-host.org/emailform.html


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

Date: 9 Jun 1999 18:32:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Apache Authenticate and CGI
Message-Id: <slrn7ltuss.1h2.abigail@alexandra.delanet.com>

Chinasee B. (chinaseeb@unocal.com) wrote on MMCVIII September MCMXCIII in
<URL:news:01beb254$c9ce73a0$49d0f886@chinaseeb.bkk.unocal.com>:
~~ I use authentication on Apache to protect my webpage.
~~ How can I use cgi to check username when user login
~~ I wan to write cgi for user to change password and profile.
~~ anyone who experinced this would you please supply me a example source


You should write your program in Fortran and ask this question in
comp.lang.fortran.



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Jun 1999 15:45:39 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: Apache Authenticate and CGI
Message-Id: <slrn7lt6ah.s1p.hasant@borg.intern.trabas.co.id>

On 9 Jun 1999 08:55:18 GMT, Chinasee B. <chinaseeb@unocal.com> wrote:
> I use authentication on Apache to protect my webpage.
> How can I use cgi to check username when user login
> I wan to write cgi for user to change password and profile.
> anyone who experinced this would you please supply me a example source

The username is stored in environment variable $ENV{REMOTE_USER}.


HTH,
-hasan-
uhm, no more sig(h)


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

Date: 9 Jun 1999 18:33:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Bulletin Board in Perl
Message-Id: <slrn7ltuud.1h2.abigail@alexandra.delanet.com>

Christian Hummert (Hummert@infantry.usmc.net) wrote on MMCVIII September
MCMXCIII in <URL:news:375E86DD.3AD07A4F@infantry.usmc.net>:
!! Hi,
!! 
!! I try to develop a Standart Bulletin Board for my Homepage... (All this
!! free once are so full of advertisment :-( ) 
!! I did a Perl CGI Script, but it doesn't work... I don't know why - I
!! read the source for several 100 times and I can't find any mistake...


There must be a bug on line 17.


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 09 Jun 1999 17:01:28 -0700
From: Raj <technology@workmail.com>
Subject: duplicate rows
Message-Id: <375F0058.459D9D9E@workmail.com>

how do i eliminate duplcate rows in a textfield which has say..only one
column
ASAP....please  ! TIA
~Raj



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

Date: 9 Jun 1999 18:35:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: E-mailing with perl is driving me crazy!
Message-Id: <slrn7ltv30.1h2.abigail@alexandra.delanet.com>

Christopher Fairbairn (lgcl01@es.co.nz) wrote on MMCVIII September
MCMXCIII in <URL:news:928919148.152293@inv.ihug.co.nz>:
,, Hi,
,, 
,, I have a small question.
,, 
,, Why does the following peice of perl code fail:
,, 
,, #!/usr/local/bin/perl
,, 
,, open(MAIL,"|/usr/lib/sendmail lgcl01\@ihug.co.nz");
,, print MAIL "Subject: This is a subject line\n\n";
,, print MAIL "This is an empty body.\n";
,, close(MAIL);
,, 
,, open(MAIL,"|/usr/lib/sendmail lgcl01\@es.co.nz");
,, print MAIL "Subject: This is a subject line\n\n";
,, print MAIL "This is an empty body.\n";
,, close(MAIL);


There could be many reasons it fails, and Perl is very eager to
tell you. Unless, like in your case, you do your utter best to
keep Perl silent.

Use -w, use strict, and *CHECK THE RETURN VALUES OF SYSTEM CALLS*.


If you can't help yourself, neither can we.



Abigail
-- 
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 9 Jun 1999 18:29:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Getting HTTP Error 405
Message-Id: <slrn7ltumu.1h2.abigail@alexandra.delanet.com>

Tiny Troll (chess@mocom.net) wrote on MMCVIII September MCMXCIII in
<URL:news:XCn73.433$JL3.21381@typ42b.nn.bcandid.com>:
\\ I'm relatively new to perl and figure that this has a rather simple
\\ resolution, but *I* don't know what it is! ;-) Any help would be very
\\ appreciated.
\\ 
\\ 
\\ HTTP Error 405
\\ 405 Method Not Allowed
\\ 
\\ The method specified in the Request Line is not allowed for the resource
\\ identified by the request. Please ensure that you have the proper MIME type
\\ set up for the resource you are requesting.


That's not a Perl error. Furthermore, the server gives you an extended
description of the problem! Djees, what more do you need?



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 9 Jun 1999 17:05:03 -0700
From: "Mace" <mace@calweb.com>
Subject: Help on a news updating script I wrote...
Message-Id: <375f0146@calwebnnrp>

Hi,

I recently wrote a news script in which I implented some javascript.  When I
ran the script everything went fine.  Then when I tried to use one of the
buttons that used javascript it said "An error has occured in this page."
When I transfered the form over to an html page it worked perfectly.  Can
someone help?  Here is the source code:



#!/usr/bin/perl5
#####################################
#            NewsMan 1.0            #
#Created By: Mace & XxagentxX       #
#You can pass around this script as #
#long as you keep this header in the#
#script.                            #
#####################################

########### Varialbes ################################


# URL To the Script
$scripturl = "http://cgizone.stormerwebdesign.com/cgi-bin/newsman.pl";

# Directory where fils will be made.  Don't put in CGI-Bin and Chmod to 777
$datadir = "/usr/local/etc/httpd/htdocs/cgizone/newsdata";

# Admin password
$admin_pass = "zone";

# Turn autolinks on (1) or off (0)
$autolink = "1";


## There is no need to edit below this point #########


### Parse form and Parse Query ###
&parse_form;
&parse_query;


### If statements ###

if ($query{'addnews'} eq "1") {
 &step1;
}
elsif ($query{'addnews'} eq "2") {
 &step2;
}
elsif ($query{'addnews'} eq "3") {
 &step3;
}
elsif ($query{'addnews'} eq "4") {
 &step4;
}
else {
 &step1;
}
### Subs ###

sub step1 {
 &header;
 print "<FORM ACTION=\"$scripturl\?addnews=2\" method=\"POST\">\n";
 print "<strong>Password: </strong><input type=\"text\" size=\"40\"
name=\"password\"><br>\n";
 print "<input type=\"submit\" name=\"set\" value=\"Sign Up\">\n";
 print "<input type=\"reset\" value=\"reset\"></FORM>\n";

exit;
}

sub step2 {
 &header;

 if ($FORM{'password'} eq "$admin_pass"){
  &step3;
 }
 else

  &step1;
 }

}

sub step3 {

print <<EOF ;
<HTML>
<HEAD>
 <TITLE>News Updating Form</TITLE>
<Script language="Javascript">

<!--

var body=0;

linkvar = 0;


function prompt2(String , msg, tags, tags2) {

String=prompt(msg, "");

if (String != "" || null)
{document.Form1.message.value=document.Form1.message.value + tags + String +
tags2 + '\r'

}

}

function addtostory( tag )
  {
    document.Form1.message.value += tag;
  }

function href()

 {

   var destination = "";

   var phrase;

   destination = prompt( "Where do you want to link to?", "http://" );

   phrase = prompt( "What do you want the phrase to say for the link?",
"" );

   if ( destination != null && phrase != null && destination != "http://" )

   {
     document.Form1.message.value += ' <a href=';

     document.Form1.message.value += destination + '>'+ phrase + "</a>";
   }
  }








file://-->

</script>
</HEAD>

<BODY>
<table border=1 bordercolor=black align=center cellpadding=0 cellspacing=0
width=580>
<tr>
<td bgcolor=#800000>
<center>
<font color=white size=5 face=courier new><b>Add Story</b></font><br>
</center>
</td>
</tr>
<tr>
<td bgcolor=#cecece>
<center>
<br>
<p>
<FORM
ACTION=http://www.stormerwebdesign.com/cgizone/cgi-bin/newsman.pl?addnews=4
method=post name=Form1>
<b>Subject:</b><INPUT TYPE=subject  NAME=subject SIZE=40>
<b>Author:</b><INPUT TYPE=author  NAME=author SIZE=15><p>
<b>E-mail:</b><INPUT TYPE=email  NAME=email SIZE=15>
<b>Date:</b><INPUT TYPE=date  NAME=date SIZE=15><p>
<b>Message:</b><br>
<textarea name=message rows=10 cols=55 wrap=virtual></textarea>
<p>
<input type=button name=bold value="Bold text" onclick="prompt2('bold',
'What text Shall be Bold?', '<B>', '</B>')">
<input type="button"
name="Paragraph"value="Paragraph"onclick="addtostory('\n\n&lt;p&gt;');">
<input type="button" name="B1" value="Link" onclick="href();">
<input type="button" name="Line Brake"value="Link Brake"
onclick="addtostory('\n\n&lt;br&gt;');">
<input type=button name=quote value="Quote" onclick="prompt2('bold', 'What
do you want to quote?', '<i>', '</i>')">
<p>
<strong>Password:</strong> <input type="Text" name="password">
<br>
<INPUT TYPE=hidden NAME=function VALUE=post>
<br><INPUT TYPE=submit VALUE=ADDNEWS>
</form>
</center>
</td>
</tr>
</table>


</BODY>
</HTML>

EOF

exit;
}

sub step4 {
 &header;

if ($FORM{'subject'} eq ""){
  print "You forgot to fill out the subject of your story.  Please go back
and change it.\n";
  exit;
 }
 else

  $subject = $FORM{'subject'};
  $subject =~ s/\|//g;
 }

if ($FORM{'email'} eq ""){
  print "You forgot to fill out your email.  Please go back and change
it.\n";
  exit;
 }
 else

  $email = $FORM{'email'};
  $email =~ s/\|//g;
 }

if ($FORM{'author'} eq ""){
  print "You forgot to fill out your author name.  Please go back and change
it.\n";
  exit;
 }
 else

  $author = $FORM{'author'};
  $author =~ s/\|//g;
 }

if ($FORM{'date'} eq ""){
  print "You forgot to fill out the date of your story.  Please go back and
change it.\n";
  exit;
 }
 else

  $date = $FORM{'date'};
  $date =~ s/\|//g;
 }

if ($FORM{'message'} eq ""){
  print "You forgot to fill out the message of your story.  Please go back
and change it.\n";
  exit;
 }
 else

  $message = $FORM{'message'};
  $message =~ s/\|//g;
 }

  if ($autolink == 1){
   &autolink($message);
  }

open(FILE,"$datadir/news.txt");
@array = <FILE>;
close(FILE);

open(FILE,">$datadir/news.txt");
print FILE "$subject [<a href=\"mailto:$email\">$author</a> -
$date]<br>$message<p>\n";
print FILE (@array);   #old info
close(FILE);

print "Your story has been added";

}

sub autolink {
 $message = $_[0];

 open(FILE, "$datadir/autolink.txt");
       @autolinkdata = <FILE>;
 close(FILE);

 foreach $item (@autolinkdata) {
  chop($item);
     ($name, $url) = split(/\|/, $item);

  $replace = "<A HREF=\"$url\">$name</A>";
  $message =~ s/$name/$replace/g;
 }
 return $message;
 }

sub header {

 print "Content-type: text/html\n\n";

}

sub parse_query {
    @pairs = split(/&/, $ENV{'QUERY_STRING'});
    foreach $pair (@pairs) {
        ($name, $value) = split(/=/, $pair);
        $query{$name} = $value;
    }
}

sub parse_form {

 read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
       @pairs = split(/&/, $buffer);

      foreach $pair (@pairs) {
        ($name, $value) = split(/=/, $pair);
  $value =~ tr/+/ /;
           $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
           $value =~ s/<!--(.|\n)*-->//g;

           $FORM{$name} = $value;

       }
}





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

Date: Wed, 9 Jun 1999 17:04:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help using large memory from perl
Message-Id: <MPG.11c8a0caed55b0b4989ba0@nntp.hpl.hp.com>

In article <7jm9vv$et9$3@news.NERO.NET> on 9 Jun 1999 17:58:23 GMT, Dan 
Sugalski <sugalskd@netserve.ous.edu> says...
 ... 
> : Here is a code snippet that exhibits the same problem as my program:
> : perl -e 'for ($i = 0; $i < 9999999; $i++) { $hash{$i}= $i; }'
 ...
> You can try pre-extending the hash by doing a:
> 
>    keys(%myhash) = 1e6;
                       ^
                       7

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


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

Date: Wed, 09 Jun 1999 17:28:34 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: How do I change my frameset thru perl
Message-Id: <375F06B2.5BB811AE@chatbase.com>

shilpa_w@my-deja.com wrote:
> 
> My web application has a window that has 3 frames.
> When the user clicks on the submit button in the
> form in one of the frames, a perl program is
> executed that gets the data from the server. I
> want to display this data in a new framset that
> has only 2 frames. How can I do this?
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

You can print the location using a "target: frametargethere"

Although that will only work with some browsers. You might be better off
having the script update both frames, i.e., the script prints the
frameset, HTML, pages, etc... 
-- 
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.


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

Date: 10 Jun 1999 01:39:27 GMT
From: ken@halcyon.com (Ken Pizzini)
Subject: Re: How to get info from a file with sed/awk/perl
Message-Id: <slrn7lu37h.jjg.ken@pulsar.halcyon.com>

On Wed, 9 Jun 1999 14:58:24 -0400,
Claudio Gutierrez <cgutierr@firstcom.cl> wrote:
>Sorry if this a basic questionand, of course, the cross post. I need to
>process a text file containing statistics in the next way: 1)find the
>lines where appear the string 4[0-9][0-9][0-9] and after the 4 digits a
>blank space 2) once we find such line, join the previous line with the
>curren and the next.

sed -n '/4[0-9][0-9][0-9] /{
	  H;n;x;G;s/\n/ /gp;b
	}
	h'

(I originally wrote the line starting "H;n" as the simpler:
	  x;G;N;s/\n/ /gp
but that won't work quite right if there are not at least
two lines between each match of the /4.../ pattern.  As it
sits, I'm not sure if it does the right thing if there are
back-to-back lines which match, as that situation is
inadeqautely defined in the problem statement.)

		--Ken Pizzini


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

Date: 9 Jun 1999 18:37:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Intersection of several lists
Message-Id: <slrn7ltv5s.1h2.abigail@alexandra.delanet.com>

Thomas Weholt (u970130@studbo.hit.no) wrote on MMCVII September MCMXCIII
in <URL:news:375d4b51.9175871@news1.c2i.net>:
~~ 
~~ I got several ( 3 - 15) lists that I need to put into one, containing
~~ only the items that are in all the lists ( intersection ).


RTFFAQ.


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 10 Jun 1999 03:10:21 +0200
From: Mark <admin@asarian-host.org>
Subject: Re: know Perl to maintain Perl (was: Re: I pass an array...)
Message-Id: <199906100110.TAA08681@asarian-host.org>

David Cassell <cassell@mail.cor.epa.gov> wrote in message
news:37580352.9F18F3D5@mail.cor.epa.gov...

> [cc sent to poster]
>
> Bill Jones wrote:
> >
> > [Greg's comments snipped]
> >
> > Larry did say something about Baby Talk Perl :]
>
> I see the followups didn't notice the ':]' there.
>
> > But there is no reason not to program any way you
> > see fit, or can, program.  I myself spent some time
> > with some of the things I've seen here in the group.
>
> Ditto.  Not all of us came into Perl with a graduate degree
> that had an emphasis on operating systems design and
> computational linguistics.  :-)
>
> > I am Baby Perl, pleased to meet you,
>
> I've been waiting for the obligatory 'Spice Girls' joke,
> but I haven't seen it yet.


Okay, how about "Splice Girls"? Or, who is the mother of Baby Spice? Old Spice!
:) Sorry for being so goofy, but I have little to contribute, really; in my days
as an assembly programmer we took a less than politically correct view on
coding; we said: "If it was hard to write, it should be hard to read." And we
were proud if it. Sigh.

- Mark

        System Administrator Asarian-host.org





--
For more information about this posting service, contact:
help@asarian-host.org -- for all info about our server.
If you want an anonymous account, visit our sign-up page:

http://asarian-host.org/emailform.html


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

Date: Thu, 10 Jun 1999 02:34:57 +0200
From: "Patrick Enger" <webmaster@vogelfreund.de>
Subject: mail file with form and cgi-scipt
Message-Id: <7jn1ck$1ff$1@black.news.nacamar.net>

Hi,

i have a form with 4 text-fields and 1 file-field.

the script sends me the 4 formfields and stores the .jpg-file on my
webserver !

how can i get the script to send me the .jpg file by mail ?

You can see the form on:
http://www.s3club.de/s3cranking.shtml


--
Liebe Gr|_e
--
*************************************************************
   Vogelfreund Internetservice http://www.vogelfreund.de
     Inh. Patrick Enger,   Egilbertstr.12,   85354 Freising
              Tel.: 08161-12387, Fax: 08161-12391




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

Date: Wed, 9 Jun 1999 17:37:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Need a book ...
Message-Id: <MPG.11c8a8a71f1d61fc989ba2@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <wJw73.2993$tU2.89033@news2.giganews.com> on Wed, 9 Jun 1999 
11:37:07 -0500, Matthew G. Turland <matthewg@eatel.net> says...
 ...
> I'm looking into using a CGI script programmed in Perl to solve the problem,
> but I have no knowledge of either. What I'm looking for is a book that will
> show me the basics of Perl and the characteristics of the language I need to
> solve this e-mail problem. Suggestions or any other information regarding a
> solution to this problem would be greatly appreciated.

http://www.perl.com/ for lots of information about Perl.  For books:

http://reference.perl.com/query.cgi?section=books

An experienced programmer should zip through 'Learning Perl', move on to 
'Programming Perl' and 'The Perl Cookbook'.  'Perl: The Programmer's 
Companion' is excellent as a first book also. 

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


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

Date: Thu, 10 Jun 1999 01:17:38 GMT
From: johnt.kelly@worldnet.att.net (john kelly)
Subject: OLE reference
Message-Id: <375f1190.690583@netnews.worldnet.att.net>

Can anyone please point me to some examples of how to use OLE objects
for word.  The doc makes references to looking up the objects in VB or
C manuals but I don't have any. Other  then  snip its of code examples
here or there, thats all I can find.

	Thank you
	John


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

Date: Thu, 10 Jun 1999 00:05:47 GMT
From: ynotssor@my-deja.com
To: perrot@francenet.fr
Subject: Re: Perl script to purge old messages in mailboxes ?
Message-Id: <7jmvgl$2r5$1@nnrp1.deja.com>

In article <rd4skj82zp.fsf@localhost.francenet.fr>,
  Gildas PERROT <perrot@francenet.fr> wrote:

 ...
> I am looking for a script which is able to first warn the user that
> some messages are too old.
>
> Thanks in advance for your help.			Gildas.
 ...

Please see my previous posting at
http://x42.deja.com/=dnc/getdoc.xp?AN=470042825


-   tony

____________________________________________________________________
"Man invented language to satisfy his deep need to complain."

-                -- Lily Tomlin



-


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 9 Jun 1999 17:22:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problems sorting. I'm stupid and I'll die
Message-Id: <MPG.11c8a5243c73bb58989ba1@nntp.hpl.hp.com>

In article <7jmacn$qli$1@nnrp1.deja.com> on Wed, 09 Jun 1999 18:05:20 
GMT, Don Roby <droby@copyright.com> says...
> In article <MPG.11c8132ed2c30288989b9e@nntp.hpl.hp.com>,
>   lr@hpl.hp.com (Larry Rosler) wrote:
> >
> > The following Orcish-Maneuver sort works with Perl 4, which doesn't
> > seem to have an 'lc' function, or a 'split' function that I can make work,
> > or lots of other goodies in regexes that we take for granted.  Hence the
> > ugliness in the sortkey extraction.
> 
> Odd.  I'm almost certain I used split & join in Perl 4.036 to deal with
> "records" stored as comma-separated values in a hash tied to a DBM file
> with good-old dbmopen.

There *is* a 'split' function.  The formulation

  (split /,/)[2]

didn't seem to work, though.
 
> The program and my Perl4 install are both long gone though, thank God!

Nothing dies around here.  Perl 4.036 is still running programs for real 
users.  The same machine has a 'modern' perl -- 5.002 (blush!).

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


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

Date: 9 Jun 1999 20:12:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Real Problem: CGI file upload and IE
Message-Id: <slrn7lu4p3.1h2.abigail@alexandra.delanet.com>

Bill Bohling (dembag@thuntek.net) wrote on MMCVIII September MCMXCIII in
<URL:news:375EAB98.E46E0DDD@thuntek.net>:
;; 
;; Is file upload a feature specific to Netscape?


That's not a Perl issue, now is it?


Please try asking your question in alt.bork.bork.bork, a group much
more suitable than this group to discuss browser issues.




Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 10 Jun 1999 00:01:42 GMT
From: dalehend@flash.net
Subject: Re: Regexpr for loop to handle e-address list
Message-Id: <375f0000.28685677@news.flash.net>


Thanks for your feedback Tom. I did look at Mail::Address, but I do
not think it can handle the backslash delimiter that must be present
in each email address as a part of the list.
I did find a regexpr that can parse the backslash delimiter leaving
just the email address and hope to find a happy medium somewhere.


On Wed, 9 Jun 1999 16:52:18 -0700, Tom Phoenix <rootbeer@redcat.com>
wrote:

>On Wed, 9 Jun 1999 dalehend@flash.net wrote:
>
>> $emaillist = "younme\@work.com shenhim\@work.com";
>> 
>> I would like to have the regexpr to get what is between the quotes.
>
>I think you mean, you want a pattern which will pick out the well-formed
>e-mail addresses within a single string. 
>
>I've said it before and I'll say it again: You want a parser to properly
>parse the e-mail addresses. A simple regular expression just ain't gonna
>cut it.
>
>Have you tried Mail::Address from CPAN yet? It may (or may not) be what
>you need.
>
>Good luck with it!
>
>-- 
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>



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

Date: Wed, 9 Jun 1999 17:27:13 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Regexpr for loop to handle e-address list
Message-Id: <Pine.GSO.4.02A.9906091724500.26349-100000@user2.teleport.com>

On Thu, 10 Jun 1999 dalehend@flash.net wrote:

> Thanks for your feedback Tom. I did look at Mail::Address, but I do
> not think it can handle the backslash delimiter that must be present
> in each email address as a part of the list.

This one?

> >> $emaillist = "younme\@work.com shenhim\@work.com";

There's no backslash in there. :-)  You _could_ have a backslash in a
valid address, but I don't think that's what you meant.

> I did find a regexpr that can parse the backslash delimiter leaving
> just the email address and hope to find a happy medium somewhere.

Does it correctly parse <"fred\\barney"@redcat.com>? And a few other
variations on that... :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 9 Jun 1999 17:00:59 -0700
From: "Mace" <mace@calweb.com>
Subject: Reserved Characters
Message-Id: <375f0051@calwebnnrp>

Could someone please give me a list of all the reserved characters in perl?
(Everything you have to put a \ before such as " and !)

Thanks,

Mace
mace@calweb.com




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

Date: Wed, 9 Jun 1999 17:24:39 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Reserved Characters
Message-Id: <Pine.GSO.4.02A.9906091720200.26349-100000@user2.teleport.com>

On Wed, 9 Jun 1999, Mace wrote:

> Could someone please give me a list of all the reserved characters in
> perl? (Everything you have to put a \ before such as " and !)

(Exclamation mark?) I think you want to know which characters are magical
in quoted strings.

    In 'single-quoted' strings, backwhack
	the quote mark
	the backslash

    In "double-quoted" strings, backwhack
	the dollar sign
	the at sign
	the quote mark
	the backslash

(Some would say that you could make this simpler, but they're forgetting a
complication. This is a simple rule that should never lead you astray. :-)

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 9 Jun 1999 18:39:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Rounding excessive trailing decimals
Message-Id: <slrn7ltv97.1h2.abigail@alexandra.delanet.com>

Anthony Lalande (tonyboy@earthling.net) wrote on MMCVIII September
MCMXCIII in <URL:news:7jkmc9$9kc@tandem.CAM.ORG>:
{} 
{} I can't seem to find a way to have PERL return a shortened version of a
{} number such as (1.94456543 -> 1.94 or 1.9).


RTFFAQ.


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 9 Jun 1999 17:10:29 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Slowness in flock?
Message-Id: <Pine.GSO.4.02A.9906091652410.26349-100000@user2.teleport.com>

On Wed, 9 Jun 1999, Bill vill wrote:

> I have a lot of people accessing my CGI scripts (written in Perl,
> obviously), and I'm on a slow system, so in hopes to lessen errors,
> I've put in some locking so my data won't go screwy from the slow
> server.
> 
> The problem is, it seems that since I've added this, everything is a
> lot slower? Does "flock" in Perl slow things down?

Not "in Perl", but yes, it can. 

flock() is telling the system "set my process aside until no one else has
an exclusive lock, then give me the lock". That can make your process wait
for a millisecond or a millennium. 

But in the real world, you shouldn't have long to wait. If your process
has to wait for another to finish returning a web page, that should take
only a fraction of a second. (It _should_ take only that long, if
everything is working right.)

> I know that you don't have to "unlock", because when you close the
> file it does that already, however if I use it anyway, will it add
> double the time it uses to lock and then unlock and THEN close it?

No, it shouldn't, because you don't have to wait to unlock (besides flush
time). But you should simply close the file as soon as you can, since
someone else is waiting for a turn.

>   UNLOCKME(FILE);
>   close(FILE) or die "Close failed for FILE: $!\n";

Never unlock before close (unless you're an expert). Never unlock after
close (even if you're an expert). Just close; it's faster.

> sub LOCKME {
>     my $locked = shift;
>     flock($locked, 2) or die "Exclusive lock failed for $locked: $!\n";
> }

You'll speed this (marginally) by not using a subroutine. Just call flock
directly after opening.

When things are running slowly, check to see whether your webserver is
running multiple copies of your process. Are some even swapped out? (Check
with your sysadmin if you're not sure about this stuff.) If so, your
program is probably too slow, too memory-intensive, or both. You may need
to come up with a better algorithm at a minimum. (Sad, but true.) 

If instead you see that there's never more than one copy of your process
waiting to run, something else besides this flock is making things slow.
That doesn't mean it's not your fault, of course. :-)

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 9 Jun 1999 20:16:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: VERSION numbers
Message-Id: <slrn7lu508.1h2.abigail@alexandra.delanet.com>

I.J. Garlick (ijg@csc.liv.ac.uk) wrote on MMCVIII September MCMXCIII in
<URL:news:FD2Jyn.MoK@csc.liv.ac.uk>:
`` Can some one explain the $VERSION variable to me because there sure seems
`` to be a weird way of getting it to equal version numbers.
`` 
`` For instance Gisle Aas seems to favour this style (in HTTP modules anyway)
`` 
`` 	$VERSION = sprintf("%d.%02d", q$Revision: 1.36 $ =~ /(\d+)\.(\d+)/);
`` 
`` even I can work out how VERSION gets set but as to why?
`` 
`` Wouldn't it just be easier to do
`` 
`` 	$VERSION = 1.36;

No, because that means you have to modify the version number by hand.
$Revision: 1.36 $ means that RCS will take of things.

man rcs

`` Then there is this at the top of the file
`` 
`` 	# $Id: Headers.pm,v 1.36 1998/04/10 14:51:22 aas Exp $
`` 
`` Nice but does it do anything?

Yes it does. Not in Perl, as it's a comment. But it indentifies the name
of the file, the version, the date and time it was checked in and the
user who checked in the file. Isn't that a lot of information for just
one line?

`` Then I see other examples, Eryq, of MIME modules fame (sorry Eryq don't
`` know your surname) set VERSION like this
`` 
`` 	$VERSION = substr q$Revision: 4.115 $, 10;
`` 
`` again simple but why? followed by this at the bottom in the pod.

Same answer.



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 09 Jun 1999 17:30:08 -0700
From: RG <roland@oco.net>
Subject: Where is sendmail on NT using Perl
Message-Id: <375F070F.F1FFB064@oco.net>

My sysop is out of town , but is not real familiar with perl, and I need
to know where to point my formmail.pl script's tag to "sendmail" on the
NT server. I believe the right path would be d:/perl/lib/sendmail

$mailprog="d://perl//lib//sendmail";
or
$mailprog="d:/perl/lib/sendmail";

Both of these do not work, as the form doesnt get sent to my email
address. I do not get an error message, though.

Thanks in advance
Roland
Radiowave Internet
roland@oco.net



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

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

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