[17356] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4778 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 31 18:10:50 2000

Date: Tue, 31 Oct 2000 15:10:35 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973033835-v9-i4778@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 31 Oct 2000     Volume: 9 Number: 4778

Today's topics:
        Having a brain fade dottiebrooks@my-deja.com
    Re: Having a brain fade <adamf@box43.gnet.pl>
    Re: Having a brain fade <yanick@babyl.sympatico.ca>
    Re: Help with regex / parsing <tim@ipac.caltech.edu>
    Re: I am learning Perl. Help, please. <russ_jones@rac.ray.com>
        In case you were wondering (Mark-Jason Dominus)
    Re: In case you were wondering (Jerome O'Neil)
    Re: In case you were wondering (Mark-Jason Dominus)
        Large numbers with Perl <evertonm@my-deja.com>
    Re: Large numbers with Perl (Chris Fedde)
    Re: Large numbers with Perl <jcook@strobedata.com>
    Re: LWP::UserAgent & loading images? <Aidan.Finn@ucd.ie>
    Re: LWP::UserAgent & loading images? joekind@my-deja.com
    Re: LWP::UserAgent & loading images? <Aidan.Finn@ucd.ie>
        Mail::Send (blaine)
    Re: Net::SMTP and subject? <ruedas@geophysik.uni-frankfurt.de>
        newbie again <vertical.reality@ntlworld.com>
        openssl-0.9.6 perl compilation problems (Jeff Haferman)
        Oracle connection ganchen@my-deja.com
        Oracle database connection ganchen@my-deja.com
    Re: parsing a majordomo archive file allym@usa.net
    Re: Perl and Outlook craber@my-deja.com
    Re: Perl CGI fallenang3l@my-deja.com
        Permutations (was Re: Having a brain fade) (Richard J. Rauenzahn)
        Pfff <soeder@ai-lab.fh-furtwangen.de>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 31 Oct 2000 19:43:53 GMT
From: dottiebrooks@my-deja.com
Subject: Having a brain fade
Message-Id: <8tn7dn$996$1@nnrp1.deja.com>

Hi,
  I need to do some work on all combinations of a variable number of
fields.  For example, if the current run has 3 variables (A, B, C), I
need to pull input for analysis of A, AB, AC, ABC, ACB, B, BA, BC,
BAC,...  The next run could have 4 variables, for example.  To make it
more interesting, each of the variables is a hash with multiple
associated values.  I've got the hashes created, but am having a total
brain meltdown on figuring out how to run through all combinations of
these variables.  Can anyone help?

Cheers,
Russ


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 21:48:16 +0100
From: Adam <adamf@box43.gnet.pl>
Subject: Re: Having a brain fade
Message-Id: <39FF3010.448@box43.gnet.pl>

dottiebrooks@my-deja.com wrote:
> 
> Hi,
>   I need to do some work on all combinations of a variable number of
> fields.  For example, if the current run has 3 variables (A, B, C), I
> need to pull input for analysis of A, AB, AC, ABC, ACB, B, BA, BC,
> BAC,...  The next run could have 4 variables, for example.  To make it
> more interesting, each of the variables is a hash with multiple
> associated values.  I've got the hashes created, but am having a total
> brain meltdown on figuring out how to run through all combinations of
> these variables.  Can anyone help?

in the "Perl Cook Book" (recip 4.19) there is a pretty solution 
to quite similar problem - permuting.

so with this you are half the way, or even further ;)

--
Adam.

taken from the Cook Book:

#!/usr/bin/perl -w
# mjd_permute: permute each word of input
use strict;

while (<>) {
    my @data = split;
    my $num_permutations = factorial(scalar @data);
    for (my $i=0; $i < $num_permutations; $i++) {
        my @permutation = @data[n2perm($i, $#data)];
        print "@permutation\n";
    }
}

# Utility function: factorial with memorizing
BEGIN {
  my @fact = (1);
  sub factorial($) {
      my $n = shift;
      return $fact[$n] if defined $fact[$n];
      $fact[$n] = $n * factorial($n - 1);
  }
}

# n2pat($N, $len) : produce the $N-th pattern of length $len
sub n2pat {
    my $i   = 1;
    my $N   = shift;
    my $len = shift;
    my @pat;
    while ($i <= $len + 1) {   # Should really be just while ($N) { ...
        push @pat, $N % $i;
        $N = int($N/$i);
        $i++;
    }
    return @pat;
}

# pat2perm(@pat) : turn pattern returned by n2pat() into
# permutation of integers.  XXX: splice is already O(N)
sub pat2perm {
    my @pat    = @_;
    my @source = (0 .. $#pat);
    my @perm;
    push @perm, splice(@source, (pop @pat), 1) while @pat;
    return @perm;
}

# n2perm($N, $len) : generate the Nth permutation of S objects
sub n2perm {
    pat2perm(n2pat(@_));
}


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

Date: Tue, 31 Oct 2000 21:25:10 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: Having a brain fade
Message-Id: <WMGL5.403749$Gh.12689733@news20.bellglobal.com>

dottiebrooks@my-deja.com wrote:
: Hi,
:   I need to do some work on all combinations of a variable number of
: fields.  For example, if the current run has 3 variables (A, B, C), I
: need to pull input for analysis of A, AB, AC, ABC, ACB, B, BA, BC,
: BAC,...  The next run could have 4 variables, for example.  To make it
: more interesting, each of the variables is a hash with multiple
: associated values.  I've got the hashes created, but am having a total
: brain meltdown on figuring out how to run through all combinations of
: these variables.  Can anyone help?

Maybe this could help:

sub get_comb
{
    my($i,@combinations);
    $i = $_*2 and 
         push @combinations,
             [ grep {($i>>=1)&1} @_ ] for 0..2**@_-1;

    return @combinations;
}

print join ' ', @$_, "\n" foreach get_comb( 'A', 'B', 'C', 'D' );


Joy,
Yanick

-- 
($_,$y)=("Yhre lo  .kePnarhtretcae\n",   '(.) (.)'  );
$y=~s/\(/(./gwhile s/$y/$2$1/xg;print;       @      !; 
                                     "     `---'    ";


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

Date: Tue, 31 Oct 2000 11:35:57 -0800
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Help with regex / parsing
Message-Id: <39FF1F1D.1317C695@ipac.caltech.edu>

Martin Fischer wrote:
> I'm trying to solve a parsing problem for a simple macro language.
> 
> The language basically has two constructs:
> 
> 1. <VAR="value"> to assign values, and
> 2. <FUNCTION( "value" )> to call a subroutine.
> 
> I'd like to parse these statements with PERL but wasn't completely
> successful. I need the first keyword eg. FUNCTION in one variable and
> the value or parameters in another.
> 
> The best I came up with is
> 
> /^<([A-Z]*)(=|\()([\w\"]*)\)?>$/
[...snip...]
> But this regex doesn't recognize ill-behaved source like
> 
> <VAR="value")> or <FUNCTION( "value">

How 'bout something like (untested)

m/^<([A-Z]+)(?:=("\w*")|\((\w*)\))>$/;
if   (defined $2) { ... a variable assignment ... }
elsif(defined $3) { ... a function call ... }
else              { ... neither ... }
 
You might want to spiff that up to allow whitespace in various places, and a
comma separated parameter list in your function call.

BTW, CPAN has a large number of template modules. Perhaps there's something
there you could either use or draw examples from?

--

-- Tim Conrow         tim@ipac.caltech.edu                           |


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

Date: Tue, 31 Oct 2000 15:27:18 -0600
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: I am learning Perl. Help, please.
Message-Id: <39FF3936.84B48A25@rac.ray.com>

Bart Lateur wrote:
> 
> zhong9999@my-deja.com wrote:
> 
> >1). If I want to hide my perl scripts,
> >so nobody can look at my scripts.
> 
> This makes me wonder what you could possibly find so marvelous about
> your own scripts that you really want to prevent others from stealing
> them from you.
> 




Maybe his code is as ugly as mine and he's just ashamed for anyone to
see it.




-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Tue, 31 Oct 2000 20:32:17 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: In case you were wondering
Message-Id: <39ff2c50.33b5$1@news.op.net>

At http://use.perl.org/features/00/10/31/0311229.shtml, Nat Torkington says:

   We dined at a Lebanese restaurant. Mark ordered food based purely
   on the reaction the menu listing gave him. If he went "wow, that
   sounds like a really unlikely combination" then he'd order it.

For the record, the dish I ordered was chicken livers sauteed in
pomegranate molasses.



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

Date: Tue, 31 Oct 2000 21:00:34 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: In case you were wondering
Message-Id: <SpGL5.195$v37.180435@news.uswest.net>

mjd@plover.com (Mark-Jason Dominus) elucidates:

> For the record, the dish I ordered was chicken livers sauteed in
> pomegranate molasses.

And what was the final verdict? 

-- 
"Civilization rests on two things: the discovery that fermentation 
produces alcohol, and the voluntary ability to inhibit defecation.  
And I put it to you, where would this splendid civilization be without 
both?" --Robertson Davies "The Rebel Angels" 


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

Date: Tue, 31 Oct 2000 22:13:36 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: In case you were wondering
Message-Id: <39ff4410.361e$235@news.op.net>
Keywords: arrogate, button, deus, trailblaze


In article <SpGL5.195$v37.180435@news.uswest.net>,
Jerome O'Neil <jerome.oneil@360.com> wrote:
>mjd@plover.com (Mark-Jason Dominus) elucidates:
>
>> For the record, the dish I ordered was chicken livers sauteed in
>> pomegranate molasses.
>
>And what was the final verdict? 

It was tasty, but disappointingly mundane.  I would not have had any
idea that it had been cooked in pomegranate molasses if I had not been
told.

Despite his assertion to the contrary, ("I ordered something vaguely
meat-like and safe") Nat ordered a dish of braised dandelion greens.
I liked them; he didn't.



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

Date: Tue, 31 Oct 2000 20:35:29 GMT
From: Everton <evertonm@my-deja.com>
Subject: Large numbers with Perl
Message-Id: <8tnaeg$c14$1@nnrp1.deja.com>

Hello.

I need to do arithmetics with 32+ bit numbers.
According the following output, it seems to me that my
perl has "longlong" compiled in. Any clue on how to use it?

$  perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.7, archname=sun4-solaris
    uname='sunos 5.7 generic_patch sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.8.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Built under solaris
  Compiled at Jun 27 1999 20:12:35
  @INC:
    /usr/local/lib/perl5/5.00503/sun4-solaris
    /usr/local/lib/perl5/5.00503
    /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.005


Thanks,
--
Everton


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 22:26:06 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Large numbers with Perl
Message-Id: <2GHL5.66$Bf7.171120640@news.frii.net>

In article <8tnaeg$c14$1@nnrp1.deja.com>,
Everton  <evertonm@my-deja.com> wrote:
>Hello.
>
>I need to do arithmetics with 32+ bit numbers.
>According the following output, it seems to me that my
>perl has "longlong" compiled in. Any clue on how to use it?
>

The actual maximum size of an integer in perl is platform dependent.
If you want to be unrestricted by platform then use the Math::BigInt
module.

chris
-- 
    This space intentionally left blank


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

Date: Tue, 31 Oct 2000 14:35:03 -0800
From: Jim Cook <jcook@strobedata.com>
Subject: Re: Large numbers with Perl
Message-Id: <39FF4917.E3304AA6@strobedata.com>

> I need to do arithmetics with 32+ bit numbers.

Have you considered use Math::BigInt?

"This module allows you to use integers of arbitrary length...."

--------------------
#! perl -w
use strict;

use Math::BigInt;

my $big1 =
Math::BigInt->new("1234567890123456789012345678901234567890");
my $big2 = $big1->bmul("99999999");
my $big3 = $big1->bmul($big1);

print "$big1\n$big2\n$big3";
--------------------

OUTPUT
+1234567890123456789012345678901234567890
+123456787777777788777777778877777777887765432110
+1524157875323883675049535156256668194500533455762536198787501905199875019052100

--
jcook@strobedata.com  Live Honourably  4/1 - 4/3 + 4/5 - 4/7 + . . .
2000 Tue: Feb/last 4/4 6/6 8/8/ 10/10 12/12 9/5 5/9 7/11 11/7 3/14
Strobe Data Inc. home page   http://www.strobedata.com
My home page    O-           http://jcook.net


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

Date: Tue, 31 Oct 2000 19:39:31 -0000
From: "Aidan" <Aidan.Finn@ucd.ie>
Subject: Re: LWP::UserAgent & loading images?
Message-Id: <newscache$ndrw2g$h2a$1@weblab.ucd.ie>


Maybe I've misunderstood the question but as far as I can remember the get
method of LWP::UserAgent just retrieves the actual page that you point it
to. E.g. If you call get on http://www.perl.com/index.html it just retrieves
the html page. Any images that are linked to in that page are not retrieved
unless you call get with the link to the image.



----- Original Message -----
From: <joekind@my-deja.com>
Newsgroups: comp.lang.perl.misc
Sent: Monday, October 30, 2000 7:57 PM
Subject: LWP::UserAgent & loading images?


> Hi, I have a script that connects to a few sites and just extracts
> certain text.  I was wondering if there was a way when using
> LWP::UserAgent to connect to the sites and make sure that it does not
> load any images in order to speed my script up?
> Do I have to add something like:
> $response->header('Accept' => 'text/html');
>
> Here is my code:
> my $ua = new LWP::UserAgent;
> $ua->timeout ($FORM{'timeout'});
> $ua->agent("AgentName/0.1 " . $ua->agent);
> my $request = new HTTP::Request 'GET', $search;
> my $response = $ua->request ($request);
> $response_body = $response->content();
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



<joekind@my-deja.com> wrote in message news:8tkjr0$36t$1@nnrp1.deja.com...
> Hi, I have a script that connects to a few sites and just extracts
> certain text.  I was wondering if there was a way when using
> LWP::UserAgent to connect to the sites and make sure that it does not
> load any images in order to speed my script up?
> Do I have to add something like:
> $response->header('Accept' => 'text/html');
>
> Here is my code:
> my $ua = new LWP::UserAgent;
> $ua->timeout ($FORM{'timeout'});
> $ua->agent("AgentName/0.1 " . $ua->agent);
> my $request = new HTTP::Request 'GET', $search;
> my $response = $ua->request ($request);
> $response_body = $response->content();
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Tue, 31 Oct 2000 20:39:33 GMT
From: joekind@my-deja.com
Subject: Re: LWP::UserAgent & loading images?
Message-Id: <8tnam5$c3t$1@nnrp1.deja.com>

ok.  That is kind of what I thought, but I wasn't sure.
What about if I wanted to extract some data from a certain URL and the
source code from this URL was really big.  Is there any way I can speed
this process up because due to the fact that there is so much code, it
slows my script down.

In article <newscache$ndrw2g$h2a$1@weblab.ucd.ie>,
  "Aidan" <Aidan.Finn@ucd.ie> wrote:
>
> Maybe I've misunderstood the question but as far as I can remember
the get
> method of LWP::UserAgent just retrieves the actual page that you
point it
> to. E.g. If you call get on http://www.perl.com/index.html it just
retrieves
> the html page. Any images that are linked to in that page are not
retrieved
> unless you call get with the link to the image.
>
> ----- Original Message -----
> From: <joekind@my-deja.com>
> Newsgroups: comp.lang.perl.misc
> Sent: Monday, October 30, 2000 7:57 PM
> Subject: LWP::UserAgent & loading images?
>
> > Hi, I have a script that connects to a few sites and just extracts
> > certain text.  I was wondering if there was a way when using
> > LWP::UserAgent to connect to the sites and make sure that it does
not
> > load any images in order to speed my script up?
> > Do I have to add something like:
> > $response->header('Accept' => 'text/html');
> >
> > Here is my code:
> > my $ua = new LWP::UserAgent;
> > $ua->timeout ($FORM{'timeout'});
> > $ua->agent("AgentName/0.1 " . $ua->agent);
> > my $request = new HTTP::Request 'GET', $search;
> > my $response = $ua->request ($request);
> > $response_body = $response->content();
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> <joekind@my-deja.com> wrote in message news:8tkjr0
$36t$1@nnrp1.deja.com...
> > Hi, I have a script that connects to a few sites and just extracts
> > certain text.  I was wondering if there was a way when using
> > LWP::UserAgent to connect to the sites and make sure that it does
not
> > load any images in order to speed my script up?
> > Do I have to add something like:
> > $response->header('Accept' => 'text/html');
> >
> > Here is my code:
> > my $ua = new LWP::UserAgent;
> > $ua->timeout ($FORM{'timeout'});
> > $ua->agent("AgentName/0.1 " . $ua->agent);
> > my $request = new HTTP::Request 'GET', $search;
> > my $response = $ua->request ($request);
> > $response_body = $response->content();
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 21:04:37 -0000
From: "Aidan" <Aidan.Finn@ucd.ie>
Subject: Re: LWP::UserAgent & loading images?
Message-Id: <newscache$ibvw2g$8fb$1@weblab.ucd.ie>

I you're checking the URL for the first time and youre using LWP then I
reckon you have to download the whole page. If youre checking the URL
regularly, you can use LWPs mirror function to only download it if its
changed since youre last check.
If speed is a serious issue for you, you could write you're program using
the socket library instead of LWP. You would have to construct and process
the http requests yourself. This would allow you to do something like
retrieve the first 10 lines of the file before you decide whether to
retrieve the rest of it.
For more info on socket and http  programming check out
http://www.oreilly.com/openbook/webclient/


<joekind@my-deja.com> wrote in message news:8tnam5$c3t$1@nnrp1.deja.com...
> ok.  That is kind of what I thought, but I wasn't sure.
> What about if I wanted to extract some data from a certain URL and the
> source code from this URL was really big.  Is there any way I can speed
> this process up because due to the fact that there is so much code, it
> slows my script down.
>
> In article <newscache$ndrw2g$h2a$1@weblab.ucd.ie>,
>   "Aidan" <Aidan.Finn@ucd.ie> wrote:
> >
> > Maybe I've misunderstood the question but as far as I can remember
> the get
> > method of LWP::UserAgent just retrieves the actual page that you
> point it
> > to. E.g. If you call get on http://www.perl.com/index.html it just
> retrieves
> > the html page. Any images that are linked to in that page are not
> retrieved
> > unless you call get with the link to the image.
> >
> > ----- Original Message -----
> > From: <joekind@my-deja.com>
> > Newsgroups: comp.lang.perl.misc
> > Sent: Monday, October 30, 2000 7:57 PM
> > Subject: LWP::UserAgent & loading images?
> >
> > > Hi, I have a script that connects to a few sites and just extracts
> > > certain text.  I was wondering if there was a way when using
> > > LWP::UserAgent to connect to the sites and make sure that it does
> not
> > > load any images in order to speed my script up?
> > > Do I have to add something like:
> > > $response->header('Accept' => 'text/html');
> > >
> > > Here is my code:
> > > my $ua = new LWP::UserAgent;
> > > $ua->timeout ($FORM{'timeout'});
> > > $ua->agent("AgentName/0.1 " . $ua->agent);
> > > my $request = new HTTP::Request 'GET', $search;
> > > my $response = $ua->request ($request);
> > > $response_body = $response->content();
> > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> > <joekind@my-deja.com> wrote in message news:8tkjr0
> $36t$1@nnrp1.deja.com...
> > > Hi, I have a script that connects to a few sites and just extracts
> > > certain text.  I was wondering if there was a way when using
> > > LWP::UserAgent to connect to the sites and make sure that it does
> not
> > > load any images in order to speed my script up?
> > > Do I have to add something like:
> > > $response->header('Accept' => 'text/html');
> > >
> > > Here is my code:
> > > my $ua = new LWP::UserAgent;
> > > $ua->timeout ($FORM{'timeout'});
> > > $ua->agent("AgentName/0.1 " . $ua->agent);
> > > my $request = new HTTP::Request 'GET', $search;
> > > my $response = $ua->request ($request);
> > > $response_body = $response->content();
> > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: 31 Oct 2000 14:34:37 -0800
From: lattice@cassandra.intergate.ca (blaine)
Subject: Mail::Send
Message-Id: <slrn8vui9c.vcl.lattice@cassandra.intergate.ca>

  I'm trying to use Mail::Send to send email, since I'd like to be at least a
/little/ more portable than writing to a pipe. However, I'm running into
problems with setting custom headers.

  My code is:

  <CODE>

    use Mail::Send;

    # prepare message

    %headers = (
                 to      => $to,
                 cc      => $cc,
                 bcc     => $bcc,
                 subject => $subject,
               );
  
    $msg = new Mail::Send %headers;
  
    $msg->add( 'From', 'my-address@here.com' );
  
    $mh = $msg->open;
  
    print $fh $message;
  
    $mh->close();

  </CODE>

Everything works, the message is sent, and the %headers are set properly.
Unfortunately, the 'From' header is not set. I've tried using $msg->set(),
as well as setting other headers (ie, $msg->set( 'X-Myheader', 'Mydata' ) )
to no avail. Is this a bug in Mail::Send, or am I just doing something wrong?

I've also tried sending mail with /usr/sbin/sendmail, and through a direct tcp
port 25 connection, both of which succeeded.

Any help is much appreciated. Thanks!

blaine cook.


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

Date: Tue, 31 Oct 2000 23:24:22 +0100
From: Thomas Ruedas <ruedas@geophysik.uni-frankfurt.de>
Subject: Re: Net::SMTP and subject?
Message-Id: <39FF4696.2096B596@geophysik.uni-frankfurt.de>

>$smtp->datasend("Subject: $subject\n");
Indeed, it's that easy. Thanks a lot for the hint.
>and also in the docs that comes with Net::SMTP.
hmm, must have missed it.

cu
-- 
Sign the Linux Driver petition:
http://www.libralinux.com/petition.english.html
------------------------------------------------------------------------
Thomas Ruedas
Institute of Meteorology and Geophysics, J.W.Goethe University Frankfurt
e-mail: ruedas@geophysik.uni-frankfurt.de
http://www.geophysik.uni-frankfurt.de/~ruedas/
------------------------------------------------------------------------


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

Date: Tue, 31 Oct 2000 22:01:56 -0000
From: "vertical.reality" <vertical.reality@ntlworld.com>
Subject: newbie again
Message-Id: <hmHL5.74195$sE.273339@news6-win.server.ntlworld.com>

I have a write to csv script
It uses a hidden field in the html form to specify the csv file to write to.
How can I embed the path to the file into the script, so remove the hidden
field,  as it will be the same file every time

Is it something to do with this section ?

$query_string=$ENV{QUERY_STRING};
if(($query_string=~/^file=([^&\b]+)/i)||($query_string=~/&file=([^&\b]+)/i))
{  
 $CSV_file=$+;
        $CSV_file=~s/%([\dA-Fa-f][\dA-Fa-f])/pack("C",hex($1))/eg;
        $CSV_file=~tr/+/ /;
        @line=&modify_CSV($CSV_file);

Tom






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

Date: 31 Oct 2000 19:19:07 GMT
From: haferman@server2.digital-web.net (Jeff Haferman)
Subject: openssl-0.9.6 perl compilation problems
Message-Id: <slrn8vu6pg.301a.haferman@server2.digital-web.net>


I'm having problems "making" the openssl-0.9.6 perl stuff,
specifically, make craps out when compiling openssl_digest:

/usr/bin/perl -I/usr/libdata/perl/5.00503/mach -I/usr/libdata/perl/5.00503 /usr/libdata/perl/5.00503/ExtUtils/xsubpp  -typemap /usr/libdata/perl/5.00503/ExtUtils/typemap -typemap typemap openssl_digest.xs >xstmp.c && mv xstmp.c openssl_digest.c
cc -c -I../include       -DVERSION=\"0.94\"  -DXS_VERSION=\"0.94\" -DPIC -fpic -I/usr/libdata/perl/5.00503/mach/CORE  openssl_digest.c
openssl_digest.xs: In function `XS_OpenSSL__MD_name':
openssl_digest.xs:48: invalid type argument of `->'
openssl_digest.xs:48: warning: assignment discards `const' from pointer target type
openssl_digest.xs: In function `XS_OpenSSL__MD_init':
openssl_digest.xs:57: warning: passing arg 2 of `EVP_DigestInit' makes pointer from integer without a cast
*** Error code 1

I tried using gcc also, same problem.
On FreeBSD 4.0, Perl 5.005_03


Any ideas?  Thanks,
Jeff



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

Date: Tue, 31 Oct 2000 19:54:01 GMT
From: ganchen@my-deja.com
Subject: Oracle connection
Message-Id: <8tn80m$9pm$1@nnrp1.deja.com>

I am trying to insert some data into an Oracle database. I installed
DBI and Oracle::DBD into Action Perl on Windows 98. Here is my code:

#! /perl/bin/perl.exe -w
use DBI;
use CGI;
use strict;

$ENV{ORACLE_HOME}='c:/orawin95';
$ENV{TNS_ADMIN}='c:/orawin95/net80/admin';
$ENV{TWO_TASK}='mydata';

my $ORACLE_PAR='dbi:Oracle:mydata';
my $ORACLE_USERID='oracle';
my $ORACLE_PASSWORD='oracle';

my $dbh=DBI->connect($ORACLE_PAR, $ORACLE_USERID, $ORACLE_PASSWORD);
my $add = "INSERT INTO myTable VALUES
('product1', '0000', '11111', '22222', '88888')";
my $sth = $dbh -> prepare($add);
$sth -> execute;
$sth -> finish;

$dbh -> disconnect;


I got error message:
install_driver(Oracle) failed: Can't
load 'C:/Perl/site/lib/auto/DBD/Oracle/Orac
le.dll' for module DBD::Oracle: load_file:One of the library files
needed to run
 this application cannot be found at C:/Perl/lib/DynaLoader.pm line 200.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at input.pl line 33

Could anyone find what is my problem? Thanks!!





Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 19:51:15 GMT
From: ganchen@my-deja.com
Subject: Oracle database connection
Message-Id: <8tn7rg$9gi$1@nnrp1.deja.com>

I am trying to insert some data into an Oracle database. I installed
DBI and Oracle::DBD into Action Perl on Windows 98. Here is my code:

#! /perl/bin/perl.exe -w
use DBI;
use CGI;
use strict;

$ENV{ORACLE_HOME}='c:/orawin95';
$ENV{TNS_ADMIN}='c:/orawin95/net80/admin';
$ENV{TWO_TASK}='mydata';

my $ORACLE_PAR='dbi:Oracle:mydata';
my $ORACLE_USERID='oracle';
my $ORACLE_PASSWORD='oracle';

my $dbh=DBI->connect($ORACLE_PAR, $ORACLE_USERID, $ORACLE_PASSWORD);
my $add = "INSERT INTO myTable VALUES
('product1', '0000', '11111', '22222', '88888')";
my $sth = $dbh -> prepare($add);
$sth -> execute;
$sth -> finish;

$dbh -> disconnect;


I got error message:
install_driver(Oracle) failed: Can't
load 'C:/Perl/site/lib/auto/DBD/Oracle/Orac
le.dll' for module DBD::Oracle: load_file:One of the library files
needed to run
 this application cannot be found at C:/Perl/lib/DynaLoader.pm line 200.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at input.pl line 33

Could anyone find what is my problem? Thanks!!





Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 20:13:05 GMT
From: allym@usa.net
Subject: Re: parsing a majordomo archive file
Message-Id: <8tn94b$aqj$1@nnrp1.deja.com>

In article <slrn8vt603.84.clay@panix3.panix.com>,
  clay@panix.com (Clay Irving) wrote:
>
> Check http://www.perl.com/reference/query.cgi?mail

Thanks for the resource; it looks like MHonArc might be of use to me

Cheers,

Ally


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 21:11:04 GMT
From: craber@my-deja.com
Subject: Re: Perl and Outlook
Message-Id: <8tnch2$dqd$1@nnrp1.deja.com>

I have found a little more about this. Apparently the security warnings
are part of MS's SR-1 security patch. The restrictions can be softened
by customizing exchange server policies. More here:
http://officeupdate.microsoft.com/2000/downloaddetails/Out2ksec.htm

By using Outlook as a quick and dirty solution I was hoping to avoid
Exchange server administration issues. I guess there's no avoiding
server issues when fiddling with email services. No free lunch.

Regards,

-Chris.

In article <8tmq4u$sev$1@nnrp1.deja.com>,
  craber@my-deja.com wrote:
> Sigvald,
>
> Thanks for the post. Works pretty good. Couple of points and q's:
>
> 1. I found that on my machine (Win 2k and Outlook 2000) I had to
> use 'Outlook.Application' instead of 'Outlook.Application.8'. Is this
> expected?
>
> 2. Under  win2k I get a dialog warning that a program is trying to
send
> mail from my system and may be a virus. I have to manually click a Yes
> button for it to continue. As I want to use this sort of script from a
> WEB application, I need to disable this security check. Does anyone
> know how to enable mail from perl in this fashion while still leaving
> that protection on for other possibly nefarious programs?
>
> Thanks again,
>
> -Chris.
> Get the mobile internet in the palm of your hand at
> http://www.avantgo.com/
>
> craber@avantgo.com
> cpraber@yahoo.com
>
> In article <39E1AA87.86AC682F@siemens.no>,
>   Sigvald Refsum <sigvald.refsum@siemens.no> wrote:
> > This is a multi-part message in MIME format.
> > --------------87FA89849BA7C8461994FE8E
> > Content-Type: text/plain; charset=us-ascii
> > Content-Transfer-Encoding: 7bit
> >
> > This may solve half your problem, as it sends a mail using outlook,
> > the second half I simply don't know. The server we use at Siemens
> > is an Exchange server, and I havent a clue to how it is accessed.
> >
> >     Best regards.
> >     Sigvald
> >
> > PS
> > The attached sample code is ment as an example and the code style
> > is perhaps not optimal.
> > DS
> >
> > vivi16@my-deja.com wrote:
> >
> > > In a Perl file I want to send the results of a form to the user
via
> E-
> > > mail.  Is it possible to use MS Outlook as the mail program?  And
> does
> > > the program have to reside on the server where the Perl program
is?
> > >
> > > I recall reading in this discussion group (though can't find it
now)
> > > someone saying that this might be possible (using Outlook and not
> > > having it reside on the local server).
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> > --------------87FA89849BA7C8461994FE8E
> > Content-Type: application/x-perl;
> >  name="outlookSend.pl"
> > Content-Transfer-Encoding: 8bit
> > Content-Disposition: inline;
> >  filename="outlookSend.pl"
> >
> > use Win32::OLE qw(in with);
> >
> > my $OutLook = Win32::OLE->new('Outlook.Application.8')
> >    or die "Couldn't connect to Outlook";
> >
> > my $NewMail;
> > # Create Mail object
> > $NewMail = $OutLook->CreateItem(0);
> >
> > # Address Mail Object, can be repeated for several recipients
> > $NewMail->Recipients->Add('sigvald');
> >
> > # CC Address Mail Object, can be repeated for several recipients
> > $NewMail->Recipients->Add('sigvald');
> > $NewMail->Recipients->Item('sigvald')->{Type} = 2;
> >
> > # Resolve addresses
> > $NewMail->Recipients->ResolveAll();
> >
> > # Categories string
> > $NewMail->{Categories} ="PVCS operation";
> >
> > # Voting option string
> > $NewMail->{VotingOptions} ="Pizza;Salat;China";
> >
> > # Originator Delivery Report Requested
> > $NewMail->{OriginatorDeliveryReportRequested} = 1;
> >
> > # Subject string
> > $NewMail->{Subject} ="hei";
> >
> > # Body
> > $NewMail->{Body} = "kåre heisan\n";
> >
> > #Attachments
> > $NewMail->Attachments->Add('H:\C_wrk\parser\outlookSend.pl');
> >
> > # Print
> > # $NewMail->PrintOut();
> >
> > # Reminder
> > my $hour   = (16 * 3600)*(1/86400);
> > my $minute = (20 * 60)*(1/86400);
> >
> > $NewMail->{FlagDueBy} = 36538+$hour+$minute;
> > $NewMail->{FlagRequest} = 'Review Tue 13.01.00 16:20';
> >
> > # Away it goes
> > $NewMail->Send;
> >
> > # Quit
> > $OutLook->Close();
> >
> > --------------87FA89849BA7C8461994FE8E--
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 31 Oct 2000 20:19:54 GMT
From: fallenang3l@my-deja.com
Subject: Re: Perl CGI
Message-Id: <8tn9h2$b0m$1@nnrp1.deja.com>

Here's the full solution that is going to redirect ALL warnings and
errors (compile and runtime) to the file you specify:


BEGIN {
	use CGI::Carp qw(carpout fatalsToBrowser);
	open ("LOG", ">cgilog.log") or die "Can't to open cgilog: $!\n";
	carpout("LOG");
}

In article <39D73A4A.80F8E340@cornell.edu>,
  Young Chi-Yeung Fan <yf32@cornell.edu> wrote:
> Hi,
>
> I have these lines at the beginning of my Perl CGI scripts:
>
> #!/usr/bin/perl -w
>
> use CGI::Carp qw(fatalsToBrowser);
>
> Is there anything else I can put in there to help me debug easier? I
> think I saw a post about that last week, but I'm having trouble
finding
> it.
>
> Thanks!
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 31 Oct 2000 21:04:27 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Permutations (was Re: Having a brain fade)
Message-Id: <973026266.700078@hpvablab.cup.hp.com>


[Please in the future, try to pick a more informative subject header...]

dottiebrooks@my-deja.com writes:
>Hi,
>  I need to do some work on all combinations of a variable number of
>fields.  For example, if the current run has 3 variables (A, B, C), I
>need to pull input for analysis of A, AB, AC, ABC, ACB, B, BA, BC,
>BAC,...  The next run could have 4 variables, for example.  To make it

If I remember my statistics class what you really want is the
permutations (since you've included both ABC and ACB.  In combinations
order doesn't matter.)

http://engineering.uow.edu.au/Courses/Stats/File2417.html supports my
memory.

There's a permutation implementation in perlfaq4 and there are at least
two modules at www.cpan.org.

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Tue, 31 Oct 2000 22:01:49 +0100
From: Oliver =?iso-8859-1?Q?S=F6der?= <soeder@ai-lab.fh-furtwangen.de>
Subject: Pfff
Message-Id: <39FF333D.A47D26BF@ai-lab.fh-furtwangen.de>

Hey lazy boy read any manual, yor question is too stupid and simple.

Oliver S=F6der


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4778
**************************************


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