[23503] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5713 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 26 21:05:41 2003

Date: Sun, 26 Oct 2003 18:05:08 -0800 (PST)
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, 26 Oct 2003     Volume: 10 Number: 5713

Today's topics:
        A global has among threads <admin@asarian-host.net>
    Re: A global has among threads <usenet@morrow.me.uk>
        Cookies are not saved to cookie_jar (benny s.)
    Re: Cygwin and Microsoft SQL <steve-no-spam@hatless-dot-com-without-the-spam.com>
    Re: Fastest Perl Interpreter <x@boog.co.uk>
    Re: Fastest Perl Interpreter <steve-no-spam@hatless-dot-com-without-the-spam.com>
    Re: Fastest Perl Interpreter <abigail@abigail.nl>
    Re: Fastest Perl Interpreter <tom@none.com>
    Re: First Perl/CGI need critique on current code before <snowhare@nihongo.org>
        Help with spamassassin perl error messages pls. <VinceHeuring@dimensional.com>
        Installing Module on Remote Host (Mike)
    Re: Installing Module on Remote Host <usenet@morrow.me.uk>
    Re: Outlook email headers <someone@somewhere.nl>
    Re: Portable @INC (Tielman de Villiers)
        Question (Kobe Clinton)
    Re: Question (none) ()
    Re: Question <me@privacy.net>
    Re: Question <davido@pacifier.com>
    Re: SendMail Problem <defenderjim4@no_spam_juno.com>
    Re: SendMail Problem <tore@aursand.no>
    Re: Use in if..elsif <smario@rol.ru>
    Re: Use in if..elsif (Sam Holden)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 27 Oct 2003 01:57:35 +0100
From: "Mark" <admin@asarian-host.net>
Subject: A global has among threads
Message-Id: <0e6dndxRbeQY8AGiRVn-vw@giganews.com>

Hello,

Is there a way I can uses a global hash within Perl (5.8.0) with threads?

The reason I ask, is that I have a Milter (Sendmail::Milter) running, which
is a daemonized version of Perl 5.8.0 with threads enabled. I would like to
maintain a global hash of hostnames who have already been looked up
previously, so as to avoid renewed DNS queries.

Short of resorting to using shmget and all the other shared memory stuff, I
was wondering whether there is ANY way to maintain a global hash, shared
among all threads?

Thanks,

- Mark




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

Date: Mon, 27 Oct 2003 01:17:47 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: A global has among threads
Message-Id: <bnhrnr$imk$2@wisteria.csv.warwick.ac.uk>

"Mark" <admin@asarian-host.net> wrote:
> Short of resorting to using shmget and all the other shared memory stuff, I
> was wondering whether there is ANY way to maintain a global hash, shared
> among all threads?

You want to start by reading perldoc threads::shared. Note that you
*must* use the locking primitives, or you will get in a terrible mess
:).

Ben

-- 
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~                   Jorge Luis Borges, 'The Babylon Lottery'


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

Date: 26 Oct 2003 17:46:43 -0800
From: tvfw@hotmail.com (benny s.)
Subject: Cookies are not saved to cookie_jar
Message-Id: <1ffea2a.0310261746.29c999df@posting.google.com>

Hello,<p>

I have got this script to automate submitting a form to a website and
getting the response back. <br>only this site is powered by .net and
when I use user agent to get even the home page it is allways getting
an <br>error and redirecting to an error page asperrorpath=...<br><br>

I found out the if I turn of the cookies I get this message all the
time - meaning that the site is storing id <br>and session on my
computer as a cookie.<br><br>

so I added the cookie functionality to the user agent but I can't seem
to have the site store the <br>cookies on any cookie folder not the
cutom lwp_cookies (see script) <br>
and not he default microsoft cookie folder.<br><br><br>

any suggestions???<br>

<br><br>
use LWP::UserAgent;<br>
use HTTP::Request::Common qw(POST);<br>
use HTTP::Cookies;<br>
use HTTP::Cookies::Microsoft;<br>
<br><br>

BEGIN { $LWP::DebugFile::outname = 'c:/ua_debug.txt' }<br>
use LWP::DebugFile qw(+); <br>
<br><br>

_____ tried that <br>
#create cookies jar to hold the cookies for this user agent<br>
my $cookie_jar = HTTP::Cookies->new( <br>
                                    file =>
"c:/MyFolder/Cookies/lwp_cookies.dat",<br>
                                    autosave => 1, <br>

                                   );<br>
<br>
_____and also that<br>
#create cookies jar to hold the cookies for this user agent<br>
 my $cookie_jar = HTTP::Cookies::Microsoft->new(<br>
                   file     => "c:/Documents and
Settings/owner/Cookies/index.dat",<br>
                   'delayload' => 0,<br>
               );<br>
<br><br>

my $ua;  #user agent<br>
$ua = LWP::UserAgent->new;<br>
$ua->cookie_jar($cookie_jar);<br>
<br><br>

  $curUrl ="http://www.mysite.com/Default.aspx";<br>
  print "getting $curUrl\n";<br>
  @curContent =  newGetRequest($curUrl);<br>
<br><br>

sub newGetRequest() {<br>
<br>
  my $myUrl;<br>
  my $myRes;<br>
  my $myReq;<br>

  # get url to create a request from<br>
  $myUrl=@_[0];<br>
<br>
  # Create a request<br>
  $myReq = HTTP::Request->new(GET =>"$myUrl");<br>
<br>
  #pass any cookies that exsists with this request <br>
  $cookie_jar->add_cookie_header($myReq);<br>
<br>
  # pass request to user agents<br>
  $myRes = $ua->send_request($myReq); <br>
<br>
  # if response put some cookies get them<br>
  $myRes->base("http://mysite.com/");<br>
  $cookie_jar->extract_cookies($myRes);  # get cookies put by the
site<br>
<br>
     if ($myRes->is_success) {<br>
                print  "Success in GET $myUrl" ;<br>
	  return $myRes->content;<br>
     }else<br>
         {         <br> 
          print "Fail in GET $myUrl";          <br>
          }<br>
<br>
}<br>


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

Date: Sun, 26 Oct 2003 16:17:36 GMT
From: sk <steve-no-spam@hatless-dot-com-without-the-spam.com>
Subject: Re: Cygwin and Microsoft SQL
Message-Id: <AsSmb.34457$Fm2.13532@attbi_s04>

Unless you need the other Unixy services of Cygwin, why not use 
ActiveState perl? It supports Expect these days, and with PPM you can 
get precompiled modules for stuff like ODBC and ADO, sparing you some of 
the occasional CPAN headaches on Win32. Plus, if Perl's all you'd be 
doing with Cygwin install, you'll get quicker startup and less overhead.

--
Steve Koppelman
http://www.hatless.com/

John Call wrote:
 .. <snip> ..
> Sorry, I was in such a hurry I didn't make myself very clear. I need
> Expect.pm so I can connect to some other boxes with ssh and then su
> and run a program but since they want this running on a Win32 box I
> will have to use Cygwin for Expect.pm to work. Wasn't sure if the perl
> in Cygwin could see Microsoft SQL as being on the same box.
> 
> I will be using DBI or Win32::ODBC for the database connection.
> 
> Thanks,
> 
> John



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

Date: Sun, 26 Oct 2003 15:37:21 -0000
From: "Peter Cooper" <x@boog.co.uk>
Subject: Re: Fastest Perl Interpreter
Message-Id: <bngptq$10u6ca$1@ID-194358.news.uni-berlin.de>

"Michael J. Astrauskas" <trevie@cox.net> wrote:
> I'm attempting build a system that needs to run a perl script very
> quickly. There will be no disk access, but the system will be doing an
> intense amount of network and processor work. Is there any particular
> processor architecture (32-bit AMD/Intel, Opteron, Sun, Apple, etc.),
> operating system, and interpreter that are known to be the most powerful
> combination?
>
> My current idea is to use a dual Xeon with a gigabyte ethernet port and
> at least 2 GB of RAM.

From a pure 'server speed' point of view (you've already received a few good
opinions on the specifics), I'd reserve dual Opterons, without a doubt.
They're faster than the Xeons in UNIX/Linux server scenarios (but not
workstation scenarios), and cheaper to setup too. You may also get a benefit
from the 64 bit compatability (Perl can be compiled to a 64 bit executable -
see perl.64bit on nntp.perl.org)

http://www.tomshardware.com/cpu/20030422/index.html

Also see these, mostly workstation oriented, benchmarks for G5/Opteron/P4
comparisons:

http://www.pcworld.com/news/article/0,aid,112749,pg,8,00.asp

The Opteron wins almost all tests. The Firing Squad have also produced an
article on building an Opteron workstation, which may be of some ancillary
interest:

http://firingsquad.com/hardware/building_gaming_opteron_2003_Part1/default.a
sp

If you could elaborate on your 'intense amount of network and processor
work' we might be able to narrow things down a bit. For example, your
process might not be memory intensive, meaning money saved there could go
into other areas of the system architecture.

I'd also echo the comments of another respondant, and recommend you look
into producing a compiled version of whatever it is you want to do. The
increased power would, in most cases, pay for itself if the project is over
a certain length, unless the application is too complex.

Pete




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

Date: Sun, 26 Oct 2003 17:40:10 GMT
From: sk <steve-no-spam@hatless-dot-com-without-the-spam.com>
Subject: Re: Fastest Perl Interpreter
Message-Id: <_FTmb.34975$Fm2.14274@attbi_s04>

Michael J. Astrauskas wrote:

> I'm attempting build a system that needs to run a perl script very 
> quickly. There will be no disk access, but the system will be doing an 
> intense amount of network and processor work. Is there any particular 
> processor architecture (32-bit AMD/Intel, Opteron, Sun, Apple, etc.), 
> operating system, and interpreter that are known to be the most powerful 
> combination?

Is it going to be running a large number of short tasks or a small 
number of long ones? Starting up a Perl interpreter each time will be an 
issue if it's the former. If that's the case, you probably want to write 
your Perl program as a server that launches once and handles repeated 
requests or tasks without exiting. As long as you're not spawning perl 
interpreters over and over again, your performance should be good and it 
will make it unnecessary to output "compiled" Perl, which is just a 
snapshot of what really gets executed once the interpreter chews through 
the raw code.

Apart from that, your question is really vague. "Intense amount of 
network and processor work" doesn't tell us anything, much less whether 
Perl is the right language for the job at all. Is it doing one linear 
task or lots of small tasks in parallel? Is it handling small chunks of 
data or huge ones? All of which points more to the language and the 
compiler used to build the language than to the shininess of a brand of 
CPU or bus speed.



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

Date: 26 Oct 2003 22:53:39 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Fastest Perl Interpreter
Message-Id: <slrnbpok3j.e7.abigail@alexandra.abigail.nl>

Michael J. Astrauskas (trevie@cox.net) wrote on MMMDCCVII September
MCMXCIII in <URL:news:4UCmb.80044$vj2.6293@fed1read06>:
))  I'm attempting build a system that needs to run a perl script very 
))  quickly. There will be no disk access, but the system will be doing an 
))  intense amount of network and processor work. Is there any particular 
))  processor architecture (32-bit AMD/Intel, Opteron, Sun, Apple, etc.), 
))  operating system, and interpreter that are known to be the most powerful 
))  combination?

Last week, this question had an easy answer: a laptop on the Concorde.
But they aren't flying those planes anymore.



Abigail
-- 
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()


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

Date: Sun, 26 Oct 2003 23:40:29 -0000
From: "Tom" <tom@none.com>
Subject: Re: Fastest Perl Interpreter
Message-Id: <3f9c5bbe$0$15124$bed64819@pubnews.gradwell.net>

An option maybe to split the processing between multiple machines?  A cheap
option if you have some oldish systems, however that would require
considerable work to enable.

Cheers,
Tom

"Michael J. Astrauskas" <trevie@cox.net> wrote in message
news:4UCmb.80044$vj2.6293@fed1read06...
> I'm attempting build a system that needs to run a perl script very
> quickly. There will be no disk access, but the system will be doing an
> intense amount of network and processor work. Is there any particular
> processor architecture (32-bit AMD/Intel, Opteron, Sun, Apple, etc.),
> operating system, and interpreter that are known to be the most powerful
> combination?
>
> My current idea is to use a dual Xeon with a gigabyte ethernet port and
> at least 2 GB of RAM.
>
> Thank you for any advice, recommendations, and pointers!
>
> -- 
>   - Michael J. Astrauskas
>




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

Date: Sun, 26 Oct 2003 17:51:07 GMT
From: "Jerry Franz" <snowhare@nihongo.org>
Subject: Re: First Perl/CGI need critique on current code before further developement
Message-Id: <fQTmb.3972$dg1.3506@newssvr25.news.prodigy.com>

"kazack" <kazack@talon.net> wrote in message
news:eyklb.5727$Bv6.1775291@news1.epix.net...
> This is part of an elaborate web counter that I am in the process of
> writing.

[...]

I've going to respond to this, even though it smells a little like a troll.
The errors in this script are _pervasive_.

It doesn't compile. That is the first error. You have an unneeded '}' at the
end of the script as posted.

> #!/usr/bin/perl

ALWAYS use taint in CGI scripts. It won't make a specific difference in this
particular script, but the habit should be ironclad.

 #!/usr/bin/perl -T

> use CGI::Carp qw(fatalsToBrowser);

fatalsToBrowser is a _DEBUGGING_ tool. In a production system use an
eval {#code here}; if ($@) { do_something_safe($@); } wrapper that _LOGS_
your errors but
doesn't mess up the user online if your script pukes.

Also, use

 use strict;
 use warnings;

This will 'fix' many bugs almost painlessly since you will know about them
early. Like the following mistakes

[Sun Oct 26 08:05:10 2003] webcounter.pl: Unquoted string "ip" may clash
with future reserved word at webcounter.pl line 12.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Unquoted string "ip" may clash
with future reserved word at webcounter.pl line 16.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Variable "$ip" is not imported at
webcounter.pl line 21.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Variable "%ip" is not imported at
webcounter.pl line 22.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Variable "$ip" is not imported at
webcounter.pl line 22.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Variable "%ip" is not imported at
webcounter.pl line 23.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Unquoted string "ip" may clash
with future reserved word at webcounter.pl line 24.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Variable "%ip" is not imported at
webcounter.pl line 25.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Unquoted string "ip" may clash
with future reserved word at webcounter.pl line 25.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Variable "%ip" is not imported at
webcounter.pl line 25.
[Sun Oct 26 08:05:10 2003] webcounter.pl: Unquoted string "ip" may clash
with future reserved word at webcounter.pl line 27.
Global symbol "$time" requires explicit package name at webcounter.pl line
5.
Global symbol "$slash" requires explicit package name at webcounter.pl line
8.
Global symbol "$document" requires explicit package name at webcounter.pl
line 8.
Global symbol "$slash" requires explicit package name at webcounter.pl line
9.
Global symbol "$ThisPage" requires explicit package name at webcounter.pl
line 9.
Global symbol "$ThisPage" requires explicit package name at webcounter.pl
line 10.
Global symbol "$ip" requires explicit package name at webcounter.pl line 21.
Global symbol "$file" requires explicit package name at webcounter.pl line
21.
Global symbol "%ip" requires explicit package name at webcounter.pl line 22.
Global symbol "$file" requires explicit package name at webcounter.pl line
22.
Global symbol "$ip" requires explicit package name at webcounter.pl line 22.
Global symbol "%ip" requires explicit package name at webcounter.pl line 23.
Global symbol "$ThisPage" requires explicit package name at webcounter.pl
line 23.
Global symbol "$file" requires explicit package name at webcounter.pl line
25.
Global symbol "%ip" requires explicit package name at webcounter.pl line 25.
Global symbol "%ip" requires explicit package name at webcounter.pl line 25.
Global symbol "$file" requires explicit package name at webcounter.pl line
25.
Global symbol "$file" requires explicit package name at webcounter.pl line
25.
Unmatched right curly bracket at webcounter.pl line 28, at end of line

webcounter.pl had compilation errors.

> my ($date_num, $month) = (localtime $time)[3,4];

$time? Didn't you mean 'time' instead?

> $month ++;
> my $ipfile = sprintf '%02d%02d.vipd', ++$month, $date_num;

You have double incremented '$month' at this point. And since you didn't
bother
with the year, the counter will 'loop' next year and put all the counts for
next
year in the same 'buckets' as for this year.

> ($slash, $document) = split(//, $ENV{'DOCUMENT_URI'});
>  if ($slash eq "/") { $ThisPage = $ENV{'DOCUMENT_URI'}; }
>  else { $ThisPage = "/$ENV{'DOCUMENT_URI'}"; }

'split' doesn't do what you think it does. So this code doesn't do
what you think it does - either. You could do what I think you _meant_
with:

 my $ThisPage = $ENV{'DOCUMENT_URI'};
$ThisPage = "/$ThisPage" unless ($ThisPage =~ m#^/#);

Also, stylistically, don't mix StudlyCap variables with underscore_seperated
variables.

>   if(-e $ipfile){
>  open(ip, "+<$ipfile") || die ("Can't open $ipfile\n");
>  }
>  else
>  {
>  open(ip, "+>>$ipfile") || die ("Can't open $ipfile\n");
>  }

You don't need the 'split opening'. And you should include '$!' in your die
so you can figure out _why_ the open failed. And it is considered standard
to use UPPERCASE for filehandles. This keeps them from conflicting
with 'built-in' functions and operators. Also, you didn't do any file
locking. So
nothing prevents two users from accessing the file at the _same_ time. This
_will_ cause Bad Things (tm) to happen eventually.  Check 'flock' and Fcntl
in the Perl documentation.

   use Fcntl qw(:flock);
   open(IP, "+<$ipfile") || die ("Can't open $ipfile: $!\n");
   my $lock_timeout = 100; # 10 second timeout
   while (not flock(IP,&LOCK_EX|&LOCK_NB)  {
      if ($lock_timeout-- < 0) {
        die ("Failed to get an exclusive lock on $ipfile: $!\n");
      }
       select(undef,undef,undef,0.1); # Sleep 0.1 second
   }

That will create the file, if needed, while opening for both reading and
writing and obtaining
an exclusive lock to prevent Bad Things (tm) from happening but timing out
eventually
if the file can't be locked in too long a time.

>  while (<ip>) {

use: while(<IP>) {

Uppercase filehandles. Remember.

>   chop;

Don't use 'chop' - use 'chomp'.

>   ($ip, $file) = split(/::/, $_);
>   $ip{$file} = $ip;}

Ow. ow. ow. You are using '$ip' for hash access and as scalar string.
DON'T DO THAT. You are asking to Get Hurt (tm). And you
didn't limit the split to only TWO pieces. And you didn't declare
_any_ of these variables. If, for whatever reason, the URL
 included '::', you would cause Wierd Things (tm) to happen. And
don't put closing '}' while brackets at the end of a contained statement.
It makes it difficult to spot them.

Try something more like:

my %ip;
while (<IP>) {
    chomp;
     my ($count, $file) = split(/::/,$_,2);
     $ip{$file} = $count;
 }

>   $ip{$ThisPage}++;
>   seek(ip, 0, 0);

Remember to check for success: seek(IP, 0, 0) || die ("Failed to seek to
start of $ipfile: $!\n");

>   foreach $file (keys %ip) { print ip $ip{$file}, "::", $file, "\n";

foreach my $file (keys %ip) { print IP $ip{$file}, "::", $file, "\n";

UPPERCASE filehandles and use 'my'.

>   }
>  close(ip);

close(IP) || die ("Failed to close $ipfile: $!\n");

UPPERCASE filehandles. close _can_ fail.

> }

That final '}' is unmatched. Delete it.

-- 
Benjamin Franz




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

Date: Sun, 26 Oct 2003 12:21:50 -0700
From: Vince Heuring <VinceHeuring@dimensional.com>
Subject: Help with spamassassin perl error messages pls.
Message-Id: <261020031221503577%VinceHeuring@dimensional.com>

I'm trying to train spamassassin and running the sa-learn script. 
Unfortunately I get a bunch of perl error messages, and not knowing
perl I have no idea what's up with them.  Anybody have an idea?

sa-learn --spam SPAM
Bareword "AF_UNIX" not allowed while "strict subs" in use at
/tools/cs/perl5.sit
e/lib.common/Mail/SpamAssassin/ArchiveIterator.pm line 128.
Bareword "SOCK_STREAM" not allowed while "strict subs" in use at
/tools/cs/perl5
 .site/lib.common/Mail/SpamAssassin/ArchiveIterator.pm line 128.
Bareword "PF_UNSPEC" not allowed while "strict subs" in use at
/tools/cs/perl5.s
ite/lib.common/Mail/SpamAssassin/ArchiveIterator.pm line 128.
BEGIN not safe after errors--compilation aborted at
/tools/cs/perl5.site/lib.com
mon/Mail/SpamAssassin/ArchiveIterator.pm line 446.
Compilation failed in require at
/tools/cs/perl5.site/lib.common/Mail/SpamAssass
in/CmdLearn.pm line 7.
BEGIN failed--compilation aborted at
/tools/cs/perl5.site/lib.common/Mail/SpamAs
sassin/CmdLearn.pm line 7.
Compilation failed in require at
/tools/cs/top/spamassassin-2.55/bin/sa-learn li
ne 46.

-- 
Vince Heuring To email, remove the Vince.


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

Date: 26 Oct 2003 16:53:00 -0800
From: csdude@hotmail.com (Mike)
Subject: Installing Module on Remote Host
Message-Id: <46cdc619.0310261653.5fc86030@posting.google.com>

Hi all,

I've just installed the Business::UPS module on my remote host, under
/home/mysite/modules. If you're familiar with it, this module also
requires LWP::UserAgent.

I used LIB to define where the Business::UPS module was located, and
my account does come with the LWP package. But when I try to run my
program, I get this error:

Can't locate object method "get" via package "LWP::UserAgent"

Any suggestions?

TIA,

Mike


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

Date: Mon, 27 Oct 2003 01:15:26 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Installing Module on Remote Host
Message-Id: <bnhrje$imk$1@wisteria.csv.warwick.ac.uk>

csdude@hotmail.com (Mike) wrote:
> I've just installed the Business::UPS module on my remote host, under
> /home/mysite/modules. If you're familiar with it, this module also
> requires LWP::UserAgent.
> 
> I used LIB 

I presume you mean you used a line like
  use lib qw(/home/mysite/modules);
? If not, you should have.

> to define where the Business::UPS module was located, and
> my account does come with the LWP package.

Are you sure it works? What happens when you invoke a minimal script
that uses LWP (with the same @INC settings)?

> But when I try to run my program, I get this error:
>
> Can't locate object method "get" via package "LWP::UserAgent"
> 
> Any suggestions?

use strict;
use warnings; if you aren't already.

Post us a MINIMAL script that exhibits the problem and the full error
output so we have some chance of working out what's going on.

Ben

-- 
  Joy and Woe are woven fine,
  A Clothing for the Soul divine       William Blake
  Under every grief and pine          'Auguries of Innocence'
  Runs a joy with silken twine.                                ben@morrow.me.uk


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

Date: Sun, 26 Oct 2003 15:49:39 +0100
From: "Stefan" <someone@somewhere.nl>
Subject: Re: Outlook email headers
Message-Id: <3f9bdf05$0$124$e4fe514c@dreader8.news.xs4all.nl>

"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> schreef in bericht
news:bngcnp$cpd$1@nets3.rz.RWTH-Aachen.DE...
> Also sprach Stefan:

> Must be some distant day then. FIrst of all, libpst is considerably more
> complex than libdbx. I had a look at it so I am not guessing. Secondly,
> I was recently forced to occupy myself with things that are still new to
> me, so I need quite some time for it.
>
> And finally (this might be the most important reason), unlike Outlook
> Express, Outlook is not freely available. As long as I don't have it, I
> would have to write and maintain a module that I can't test myself.

From a mailing list message, I know you took a look at the libpst library.
The trouble is that PST is protected by Microsoft and the author of libpst
had to overcome both legal as well as technical issues. Add to that the 2
types / formats (?) of the PST file, and you'll know that it isn't a
clear-cut case.
Btw, you already did a very good job with the Mail::Transport::Dbx module.
But I wasn't really refering to you personally but to *someone* who knows
how to make a Perl module out of a C-library. Pitty, I'm not amongst them :/


> > I did find a page full of usefull links at
> > http://www.emailman.com/conversion/index.html  and a mini-HowTo on
> > converting mailboxes. Without a module, it definitely isn't going to be
> > easy.
>
> All you need is probably some description of the PST file format. Once
> you have it, you can relatively easily decipher it with pack/unpack. But
> those descriptions are hard to find, especially when the file-format has
> been invented by Microsoft.

The libpst distribution has a file-format description but from what I saw,
that's not enough for cracking the code. Luckely, the source-code is also
available, so that might be helpfull.
I have some very vague ideas on how to proceed but it will take some time to
work them out into something usefull. You can be sure, though, that if I
find a way to process PST files using native Perl, I'll make this common
knowledge.

Stefan




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

Date: 26 Oct 2003 08:36:25 -0800
From: tjdevil@netbuilder.eu.com (Tielman de Villiers)
Subject: Re: Portable @INC
Message-Id: <37331a55.0310260836.7a81b9e3@posting.google.com>

Bob Walton <invalid-email@rochester.rr.com> wrote in message news:<3F9AAED8.7010205@rochester.rr.com>...
> Tielman de Villiers wrote:
> 
> > I want to compile a "portable perl" which will live in users' ~/usr
> > directory.
> > I tried to achieve this by:
> > ./Configure -Dprefix=\$HOME/usr -des 
> > and then
> > make install DESTDIR=/home/auser
> > By typing
> > /home/auser/usr/bin/perl -V
> > @INC displays what I want:
> > ====
> > Characteristics of this binary (from libperl):
> >   Compile-time options: USE_LARGE_FILES
> >   Built under linux
> >   Compiled at Oct 25 2003 14:10:07
> >   @INC:
> >     /home/auser/usr/lib/perl5/5.8.1/i686-linux
> >     /home/auser/usr/lib/perl5/5.8.1
> >     $HOME/usr/lib/perl5/site_perl/5.8.1/i686-linux
> >     $HOME/usr/lib/perl5/site_perl/5.8.1
> >     $HOME/usr/lib/perl5/site_perl
> > ====
> > BUT these "compiled in" @INC links do not work. 
> > Is there a way around it?
> > (Without using "use lib" or /home/auser/usr/bin/perl
> > -I$HOME/usr/lib/perl5/site_perl)
> > 
> 
> Hmmmmm...It isn't very clear to me what you are trying to accomplish. 
> You are compiling a copy of Perl for each luser's home directory.  OK -- 
> no problem -- not sure why or anything -- but just go ahead and do it, 
> and don't escape the $ in $HOME from the shell in the ./Configure, and 
> everything should go smoothly.  The reason things "do not work" above is 
> that the literal $HOME (which is supposed to be a shell variable 
> reference) is getting into Perl's internal stuff, like @INC, and it 
> never sees a shell from there.  Perl then looks for the literal 
> directory '$HOME/usr/...' and doesn't find a directory by that name.  If 
> you wouldn't have escaped the $ from the shell, the expansion 
> /home/asuer would be there instead, and everything would be fine.
> 
> Or am I totally misunderstanding what you are trying to do?

The idea is to compile the "portable perl" only once, tarball it, and
then expand the tarball in all the users' home dirs -- the "portable
perl" should then "automatically" / "dynamically" know that it is in,
say, "/home/usera" or "/home/userb" and have a corresponding @INC.
This is very do-able by prepending to @INC through "use lib" or
running /path/to/perl -I/path/to/auser, but I want to know if it can
be "hard-coded" into the compiled perl.


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

Date: 26 Oct 2003 08:18:55 -0800
From: kapavars@yahoo.com (Kobe Clinton)
Subject: Question
Message-Id: <52ea746.0310260818.54535a33@posting.google.com>

I would like to know if there is a perl module that would actually
help me send gif, gpeg files(like company logos) through Perl.
I am able to use net::smtp to generate mails containg text
information, however I would like to add company logo in every mail I
send.
Please let me know

Thanks


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

Date: Sun, 26 Oct 2003 16:24:23 +0000 (UTC)
From: mauzo@mauzo.(none) ()
Subject: Re: Question
Message-Id: <bngsfn$6od$1@wisteria.csv.warwick.ac.uk>

In article <52ea746.0310260818.54535a33@posting.google.com>,
Kobe Clinton <kapavars@yahoo.com> wrote:
> I would like to know if there is a perl module that would actually
> help me send gif, gpeg files(like company logos) through Perl.
> I am able to use net::smtp to generate mails containg text
> information, however I would like to add company logo in every mail I
> send.

ITYM jpeg? :)

You want MIME::Tools from CPAN.

Ben
-- 
"If a book is worth reading when you are six,                * ben@morrow.me.uk
it is worth reading when you are sixty." - C.S.Lewis


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

Date: Mon, 27 Oct 2003 10:23:37 +1300
From: "Tintin" <me@privacy.net>
Subject: Re: Question
Message-Id: <bnhe28$11cugs$1@ID-172104.news.uni-berlin.de>


"none" <mauzo@mauzo.> wrote in message
news:bngsfn$6od$1@wisteria.csv.warwick.ac.uk...
> In article <52ea746.0310260818.54535a33@posting.google.com>,
> Kobe Clinton <kapavars@yahoo.com> wrote:
> > I would like to know if there is a perl module that would actually
> > help me send gif, gpeg files(like company logos) through Perl.
> > I am able to use net::smtp to generate mails containg text
> > information, however I would like to add company logo in every mail I
> > send.
>
> ITYM jpeg? :)
>
> You want MIME::Tools from CPAN.

Better to use MIME::Lite is you are only *sending* MIME generated mail.




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

Date: Mon, 27 Oct 2003 00:12:25 GMT
From: "Dave Oswald" <davido@pacifier.com>
Subject: Re: Question
Message-Id: <JpZmb.16401$YO5.8158664@news3.news.adelphia.net>


"Kobe Clinton" <kapavars@yahoo.com> wrote:

> I would like to know if there is a perl module that would actually
> help me send gif, gpeg files(like company logos) through Perl.

MIME::Lite is what you're looking for.

I wish people would think twice before "prettying up" email with inline
images, HTML, and other gizmos.





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

Date: Sun, 26 Oct 2003 15:42:40 GMT
From: jim <defenderjim4@no_spam_juno.com>
Subject: Re: SendMail Problem
Message-Id: <QXRmb.2513$%e3.582@nwrddc03.gnilink.net>

James,

> Have you considered using the many email modules available in Perl?
> I know this doesn't directly answer your question, but I find this a
No, have not considered this.  I am an experienced programmer, but very new 
to Perl.  I am just trying to get code working that I was given, so I have 
tended to look at the leafs, not the forest.

Suggestions?

Thanks for the info.

-jim


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

Date: Sun, 26 Oct 2003 16:43:04 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: SendMail Problem
Message-Id: <pan.2003.10.26.15.30.07.156196@aursand.no>

On Sun, 26 Oct 2003 15:42:40 +0000, jim wrote:
>> Have you considered using the many email modules available in Perl?

> No, have not considered this.  [...]  Suggestions?

MIME::Lite.


-- 
Tore Aursand <tore@aursand.no>


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

Date: Mon, 27 Oct 2003 01:38:09 +0600
From: "Andrey" <smario@rol.ru>
Subject: Re: Use in if..elsif
Message-Id: <bnhaan$1a9$1@news.rol.ru>

Hello!

> if (0){
>     print "if\n";
> }
> else{
>     print "else\n";
>     my $use = "use Inc";
>     eval $use;
> }

I tried in this way
eval ("use My::Info; &edit_info();");

It's working, but in some strange manner, I need to reload page few times to
make it works, before that I see module export errors in log.




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

Date: 26 Oct 2003 21:30:17 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Use in if..elsif
Message-Id: <slrnbpof79.f78.sholden@flexal.cs.usyd.edu.au>

On Mon, 27 Oct 2003 01:38:09 +0600, Andrey <smario@rol.ru> wrote:
> Hello!
> 
>> if (0){
>>     print "if\n";
>> }
>> else{
>>     print "else\n";
>>     my $use = "use Inc";
>>     eval $use;
>> }
> 
> I tried in this way
> eval ("use My::Info; &edit_info();");
> 
> It's working, but in some strange manner, I need to reload page few times to
> make it works, before that I see module export errors in log.

Are you using mod_perl?

If so, it loads scripts and modules on their first use and then keeps them
in the embedded perl interpreter. Since apache uses multiple processes this
means when you change things some (but not all) of the apache processes might
have the old version loaded. 

Restarting the server will fix it, as will using one of the reload on change
modules (at some runtime cost).

Of course it may be something else causing your problem, but you never
know...

-- 
Sam Holden


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 5713
***************************************


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