easy module installation

2004-09-22 Thread ivan
Hi ,
Sorry but I never was used perl and do not know it.
Also I am not planing to use perl as language.
I need to have perl installed for spam assassin ans especialy I need to 
have perl with this modules installed:
DateTime::HiRes.

I am using a old RedHat 7.3 with standart install.
It have perl 5.6.1 installed, but do not have this module.
Ok, I readet the docs and found the tar.gz for this module, unzipped and 
try to install.

For my supprise the ne module needet Time::Locale.
Ok, I downloadet it, but the last one needet DateTime and so on.
It is very dificult to install all this modules.
My question:
Exists not any easy way to install this DateTime::HiRes with all modules 
it depend from?

Exists any rpm for redhat 7.3 ?
Many thanks in advance,
ivan.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



how to change values of @INC

2004-09-22 Thread Bernd Mueller
Hello,
I am trying to run a perl script under apache2 and the error_log tells me  
something about:
"Can't locate SiteDefs.pm in @INC (@INC contains:  
/usr/local/lib/perl5/5.8.5/x86_64-linux etc ...) at  
/usr/local/ensembl/perl/multi/unisearch line24., referer: http://localhost/
...
BEGIN failed--compilation aborted at ..."

Would someone be so nice to explain me how i change the values in @INC,  
because i know where to find this SiteDefs.pm.

Best Regards,
Bernd
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



FW: Overriding a method (HTTP::Daemon::product_tokens)

2004-09-22 Thread OK News
Hello,
This is my 2nd request on the below issue. I'm hoping someone out there
can help me out or point me in the right direction. I'm trying to learn
how to override a method so I can give my value rather than the one the
libwww package defaults to (see below).

Any help appreciated.
Thanks,
~jerry

-Original Message-
From: OK News [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 18, 2004 6:45 PM
To: [EMAIL PROTECTED]
Subject: Overriding a method (HTTP::Daemon::product_tokens

Hello,
I've read a lot of docs today and searched the web high and low but
cannot get past this problem.

I'm trying to override the product_tokens value in HTTPD::Daemon. I'm
creating a webserver and would like the 'Server' header to show my user
agent. I found the following code should be able to do this:

# my version of HTTP::Daemon with a different server name
@HTMLF::Daemon::ISA = qw(HTTP::Daemon);
sub HTMLF::Daemon::product_tokens {
  return "My Agent Name";
}

And this appears before any real script logic begins. Each time the
server starts up and I get the headers by doing 'HEAD
http://localhost:8080', I keep getting the default header 'Server:
libwww-perl-daemon/1.25'. The docs say I should be able to override
this.

Any help truly appreciated...
~jerry




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




use perl to inquire database and send email automatically

2004-09-22 Thread Franklin
Hello:

I have a database which refresh every minutes according to the
information on Internet and I provide users to predefine some
condition. When these conditions are matched, my sytem will send them
email to inform them. How can I use perl to realize these
functionalities?

Thank you very much in advance.

Bestwishes
Franklin

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




use perl to inquire database and send email automatically

2004-09-22 Thread Franklin
Hello:

I have a database which refresh every minutes according to the
information on Internet and I provide users to predefine some
condition. When these conditions are matched, my sytem will send them
email to inform them. How can I use perl to realize these
functionalities?

Thank you very much in advance.

Bestwishes
Franklin

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: how to change values of @INC

2004-09-22 Thread Raymond Raj

you can add new search path  using 
use lib 'path List';

for delete 

no lib 'path list';


Raymond

-Original Message-
From: Bernd Mueller [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 22, 2004 8:04 PM
To: [EMAIL PROTECTED]
Subject: how to change values of @INC 



Hello,

I am trying to run a perl script under apache2 and the error_log tells me  
something about:
"Can't locate SiteDefs.pm in @INC (@INC contains:  
/usr/local/lib/perl5/5.8.5/x86_64-linux etc ...) at  
/usr/local/ensembl/perl/multi/unisearch line24., referer: http://localhost/
...
BEGIN failed--compilation aborted at ..."

Would someone be so nice to explain me how i change the values in @INC,  
because i know where to find this SiteDefs.pm.

Best Regards,
Bernd

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Antwort: use perl to inquire database and send email automatically

2004-09-22 Thread Manfred . Beilfuss
   
   
Franklin   
   
<[EMAIL PROTECTED]An: [EMAIL PROTECTED]
   
il.com>  Kopie:
   
 Thema:  use perl to inquire database and send 
email automatically
22.09.2004 
   
10:36  
   
Bitte  
   
antworten an   
   
Franklin   
   
   
   
   
   







Hello:

I have a database which refresh every minutes according to the
information on Internet and I provide users to predefine some
condition. When these conditions are matched, my sytem will send them
email to inform them. How can I use perl to realize these
functionalities?

Thank you very much in advance.

Bestwishes
Franklin

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Hello Franklin ,

I use  DBI and the DBD::DB2 for my database ( DB2 ) to do the db-related
part and Mail::Sender for sending email in my scripts ! For your database
you would need the specific DBD or just DBD::ODBC !

HTH!

 Best regards

Manfred Beilfuss






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: how to change values of @INC

2004-09-22 Thread Thomas Bätzler

Bernd Mueller <[EMAIL PROTECTED]> asked:
> Would someone be so nice to explain me how i change the 
> values in @INC, because i know where to find this SiteDefs.pm.

You could use the "use lib" pragma, like

use lib qw(/path/to/my/modules);

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Encrypting an in script password and wxperl

2004-09-22 Thread Gavin Henry
Dear all,

My next program is to help out my wife. It will resize some jpg's, upload
them via ftp to a website and email her the links of where they are. She
will use these for ebay listings. I also want a wee pop up box to ask for
the file or directory of the pictures.

I might have two version of this. One which will be stuck in gnome script
folder so she can just right-click the jpg and upload it. The other will
have the gui and an icon on the desktop.

This is all done apart form 2 bits:

1. How can I encrypt an in place password? (I know it will be sent plain
text)

2. Can I use wxperl for the dialog box and how hard would this be?

Thanks,

Gavin.

-- 
Just getting into the best language ever...
Fancy a [EMAIL PROTECTED] Just ask!!!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: [Perl Downloads for Windows OS: IA64 and AMD64]

2004-09-22 Thread Chris Devers
On Wed, 22 Sep 2004 [EMAIL PROTECTED] wrote:

> I am in need of PERL for Windows OS for IA64 and AMD64 bit Machines. Can
> anyone of you let me know where I can get the links for downloading?

ActivePerl is the standard version of Perl for Windows -- searching 
Google for "perl windows" brings their site up as the very first hit:



I don't see anything there about 64-bit versions though. Will software 
compiled for 32-bit platforms not work on these chips, or are you just 
hoping that a specially compiled version will run faster?


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: easy module installation

2004-09-22 Thread Chris Devers
On Wed, 22 Sep 2004, ivan wrote:

> Exists not any easy way to install this DateTime::HiRes with all 
> modules it depend from?

There is a tool called "the CPAN shell" which automates the process of 
finding modules, downloading & unpacking them, checking dependencies, 
then building, testing, and installing everything. This is much, much 
easier than building everything by hand.

To run this tool, you need to run this command:

$ sudo perl -MCPAN -e shell

or as root, simply

# perl -MCPAN -e shell

The first time you run it, you will be asked a series of questions. For 
most of these questions, the defaults are fine, but skim them over. The 
setup process should take around five minutes.

When setup is done, you get a prompt like this:

cpan>

You can hit "?" for help here, or you can just plunge in with:

cpan> install DateTime::HiRes

This will download, build, and install DateTime::HiRes, and it will also 
find, download, and build any needed dependencies. 


 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: use perl to inquire database and send email automatically

2004-09-22 Thread Chris Devers
On Wed, 22 Sep 2004, Franklin wrote:

> I have a database which refresh every minutes according to the 
> information on Internet and I provide users to predefine some 
> condition. When these conditions are matched, my sytem will send them 
> email to inform them. How can I use perl to realize these 
> functionalities?

By writing code.

Give it a try and let us know if you hit any snags.

 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: [Perl Downloads for Windows OS: IA64 and AMD64]

2004-09-22 Thread suresh.pasupula

Hi Chris,

Thanks for the prompt response.

Yeah I have tried that before I sent the mail to the perl group. I am
not able install perl using the package available in Active State. The
package that is available there is only for X86 Platform. It does not
allow you to install in 64 bit Platforms.

I tried copying the same X86 Perl Binaries into IA64 machine. I am not
able to see the results as expected in IA64 when I am trying to install
the printers using rundll32 command I am unable. The command is fine but
the program hangs in IA64 and is working fine in X86 Platform.

That is the reason I was searching for the installable Perl for 64 bit
platform.

--
Thanks and Regards
Suresh




Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: [Perl Downloads for Windows OS: IA64 and AMD64]

2004-09-22 Thread Chris Devers
On Wed, 22 Sep 2004 [EMAIL PROTECTED] wrote:

> Yeah I have tried that before I sent the mail to the perl group.

That would have been worth mentioning then :-)

> I am not able install perl using the package available in Active 
> State. The package that is available there is only for X86 Platform. 
> It does not allow you to install in 64 bit Platforms.

I thought AMD64 was compatible with 32-bit x86, but I could be wrong. In 
any case, IA64 is indeed a different instruction set. 

This may be worth contacting ActiveState about. They're probably waiting 
to support the new 64-bit chips until there is enough demand to support 
the development effort. If you make it clear to them that you want to 
run their product on these platforms, they might speed things up a bit.
 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: FW: Overriding a method (HTTP::Daemon::product_tokens)

2004-09-22 Thread Jenda Krynicky
From:   "OK News" <[EMAIL PROTECTED]>
> Hello,
> I've read a lot of docs today and searched the web high and low but
> cannot get past this problem.
> 
> I'm trying to override the product_tokens value in HTTPD::Daemon. I'm
> creating a webserver and would like the 'Server' header to show my
> user agent. I found the following code should be able to do this:
> 
> # my version of HTTP::Daemon with a different server name
> @HTMLF::Daemon::ISA = qw(HTTP::Daemon);
> sub HTMLF::Daemon::product_tokens {
>   return "My Agent Name";
> }
> 
> And this appears before any real script logic begins. Each time the
> server starts up and I get the headers by doing 'HEAD
> http://localhost:8080', I keep getting the default header 'Server:
> libwww-perl-daemon/1.25'. The docs say I should be able to override
> this.

Can you show us more of the script? It looks OK so far, but we need 
to see how do you create the object. Are you sure the created object 
is a HTMLF::Daemon and not HTTP::Daemon? What does

print "And the object's type is: ", ref($daemon), "\n";

print?

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: :Oracle installation Woes

2004-09-22 Thread Bob Showalter
[EMAIL PROTECTED] wrote:
> Ok here is the deal, our admin is trying to install DBD::Oracle for
> me to access one of our affiliates databases. The oracle "instant
> basic client" and "sqlplus" has been installed as well as
> GetOpt::Long. 
> 
> The installations all went well except for DBD::Oracle, it fails to
> install, I am pretty sure because Oracle is NOT installed on this
> machine, and will NOT be installed on this machine.

Hmmm, I would think if SQL*Plus is working that you would have enough stuff
on the client side. But the Linux client software for Oracle should be
available on Oracle's web site to give you whatever you need. You don't need
the Oracle server installation.

Another more radical approach would be to use DBD::Proxy. But you would need
to install Perl and DBD::Oracle on the database server. You wouldn't need
anything but Perl on the client.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: easy module installation

2004-09-22 Thread ivan
Chris Devers wrote:
On Wed, 22 Sep 2004, ivan wrote:
 

Exists not any easy way to install this DateTime::HiRes with all 
modules it depend from?
   

There is a tool called "the CPAN shell" which automates the process of 
finding modules, downloading & unpacking them, checking dependencies, 
then building, testing, and installing everything. This is much, much 
easier than building everything by hand.

To run this tool, you need to run this command:
   $ sudo perl -MCPAN -e shell
or as root, simply
   # perl -MCPAN -e shell
The first time you run it, you will be asked a series of questions. For 
most of these questions, the defaults are fine, but skim them over. The 
setup process should take around five minutes.

When setup is done, you get a prompt like this:
   cpan>
You can hit "?" for help here, or you can just plunge in with:
   cpan> install DateTime::HiRes
This will download, build, and install DateTime::HiRes, and it will also 
find, download, and build any needed dependencies. 


 

Hi Chris,
Thanks for the answer.
It helped me and I solved this problem.
I have one more question ):.
I need also suidperl.
As I readet it exists separate rpm for redhat and I downloadet it.
But it is only src rpm and I do not know how to install it.
Exists any binary for download that I can use to install this suidperl?
many thanks,
ivan.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: starting position of RE match

2004-09-22 Thread Jenda Krynicky
From: Robert Citek <[EMAIL PROTECTED]>
> On Tuesday, Sep 21, 2004, at 17:17 US/Central, Jenda Krynicky wrote: 
> >
> > How about this: 
> > $s = "sasas dfgfgh asasas asedsase"; 
> > while ($s =~ /\G.*?(?=sas)./g) { 
> > print "pos=",pos($s)-1, " = '",substr($s,pos($s)-1,3),"'\n"; 
> > }
> 
> Thanks.  Seems to work, although I'm still trying to grok it.  I'll
> probably have questions later.

Let me try again then :-)

If you use the /g option with a match evaluated in the scalar 
context, the match finds the first match only on the first round, 
then the next one next time it's evaluated and so forth:

$s = "foo brkshr frt ty fgh fss";
while ($s =~ /f(..)/g) {
print "$1\n";
}

Each time it starts looking for the next match where the last one 
left off:

$s = "foo brkshr fftr ty fgh fss";
while ($s =~ /f(..)/g) {
print "$1\n";
} 

As you can see it found. foo, fft, fgh and fss, but skipped ftr 
because it starts before the end of the previous match.

That's why I need the (?=). This instructs the regexp engine to check 
that the regexp inside the braces matches at the point but keep the 
pointer at the same place:

$s = "faaf bar fbbfccf";
while ($s =~ /f(..)(?=f)/g) {
print "$1\n";
} 
vs.
$s = "faaf bar fbbfccf";
while ($s =~ /f(..)f/g) {
print "$1\n";
} 

The regexp I gave you was unnecessarily complex. With /g the regexp 
starts automaticaly where it left off the last time so I do not need 
the \G.*? so I can write it as:

while ($s =~ /(?=sas)./g) { 
print "pos=",pos($s)-1, " = '",substr($s,pos($s)-1,3),"'\n"; 
}

and it will mean exactly the same.

And it seems the . at the end of the regexp and the -1 subtracted 
from the pos($s) is not needed either.

Which means it's actually much easier than I had you believe:

$s = "sasas dfgfgh asasas asedsase"; 
while ($s =~ /(?=sas)/g) { 
print "pos=",pos($s), " = '",substr($s,pos($s),3),"'\n"; 
}

With the \G.*? I had to use the . at the end of the regexp to make 
sure the pointer gets moved just after the first character matched by 
the regexp, without it the pointer gets moved automaticaly.

Try

$s = "sasas dfgfgh asasas asedsase"; 
while ($s =~ /\G.*?(?=sas)/g) { 
print "pos=",pos($s), " = '",substr($s,pos($s),3),"'\n"; 
}

As you can see it returns most matches twice. The reason is that Perl 
moves the pointer by as many characters as matched by the complete 
regexp or by one character is the match was zero size (keep in mind 
that the stuff in (?=) doesn't count!).

So in the string it first match was "" at the very beginning of the 
string and the pointer was moved one char:
s^asas dfgfgh asasas asedsase
next match was "a" preceding the second "sas" and the pointer was 
moved one character to
sa^sas dfgfgh asasas asedsase
next match was empty and the pointer was moved one char:
sas^as dfgfgh asasas asedsase
the next match was "as dfgfgh a" and the pointer was moved to:
sasas dfgfgh a^sasas asedsase
the next match is again empty and the pointer is moved to:
sasas dfgfgh as^asas asedsase
and so forth.

If we do not include the \G.*? we do not match the strings in between 
so the match is always empty, just before the searched stuff, we 
always move the pointer just after the first character of the stuff 
we looked for.

Humpf, not sure I'm still making sense.

HTH, Jenda





= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to change values of @INC

2004-09-22 Thread JupiterHost.Net

Bernd Mueller wrote:
Hello,
Hello,
I am trying to run a perl script under apache2 and the error_log tells 
me  something about:
"Can't locate SiteDefs.pm in @INC (@INC contains:  
/usr/local/lib/perl5/5.8.5/x86_64-linux etc ...) at  
/usr/local/ensembl/perl/multi/unisearch line24., referer: http://localhost/
...
BEGIN failed--compilation aborted at ..."

Would someone be so nice to explain me how i change the values in @INC,  
because i know where to find this SiteDefs.pm.
use lib '/dir/you/want';
HTH :)
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: use perl to inquire database and send email automatically

2004-09-22 Thread JupiterHost.Net

Franklin wrote:
Hello:
Hello,
I have a database which refresh every minutes according to the
information on Internet and I provide users to predefine some
condition. When these conditions are matched, my sytem will send them
email to inform them. How can I use perl to realize these
functionalities?
Perl can do this for sure, but this list is to help beginners int he 
process of programming, not a free custom script service.

So you'll need to post the code you're having trouble with and what the 
problem is so we can help.

If you're interested, email me off list and I'd be happy to be hired to 
assist you :)

Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Inline Edit -- File name

2004-09-22 Thread RArul
How will I get the file name when I do an inline edit like this:

perl -i.orig -pe '$_ =  $_' filename

How would I get the file name in ?

Thanks,
Rex

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Mime Lite attachments

2004-09-22 Thread DBSMITH
This works great, thnaks! 

I was missing the $msg->attach(
   Type => 'image/gif',
   Id => 'InternalFileNameA.gif',
   Path => 'FileNameA.gif'
);
block.  Prior I was doing this in one full swoop.

derek





"Josimar Nunes de Oliveira" <[EMAIL PROTECTED]>
09/21/2004 01:10 PM

 
To: "Wiggins d Anconia" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, 
<[EMAIL PROTECTED]>
cc: 
Subject:Re: Mime Lite attachments


Hello everybody,

I have used something like this to send e-mail with three parts: one is an
html code that internally refers to other two files to compose the final
design. This code may be adaptable to other needs.

May be this help somebody.

Josimar Nunes de Oliveira


==

$msg = MIME::Lite->new(
   From => $from_id,
   To => $to_id,
   Cc => $cc_id,
   Subject => $subject_text,
   Type => 'multipart/related',
);

my $var = '
cid:InternalFileNameA.gif";>...

cid:InternalFileNameB.jpg";>

';

$msg->attach(
   Type => 'text/html',
   Data => $var
 );

$msg->attach(
   Type => 'image/gif',
   Id => 'InternalFileNameA.gif',
   Path => 'FileNameA.gif'
);

$msg->attach(
   Type => 'image/jpeg',
   Id => 'InternalFileNameB.jpg',
   Path => 'FileNameB.jpg'
);

==

- Original Message - 
From: "Wiggins d Anconia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, September 21, 2004 10:33 AM
Subject: Re: Mime Lite attachments


>
> All,
>
> Was hoping for some advise b/c I cannot seem to get this to work.
> My problem is that it attaches the path name when I need to actual data
> attached.  So my goal is as if it would be
>
> cat test |uuencode test | mailx -s test [EMAIL PROTECTED]
>
> thanks,
>
> my $scratchtps = "/usr/local/log/filename";
>
> code snippet <
> there is a process that may/may not populate this file.
> >
>
>
>
> if ( -s $scratchtps ) {
> &mailme;

The above is usually better written as:

mailme();

> }
>
> sub mailme {
> my $msg = MIME::Lite->new(
> From=> 'EDM01 <[EMAIL PROTECTED]>',
> To  => 'Derek Smith 
<[EMAIL PROTECTED]>',
> Subject => "Return EDM Tapes",
> Type=> 'TEXT',
> Data => "$scratchtps",

'Data' is for the body, you need to either use the separate C
method, or provide the filename as the 'Path' argument.

You really should start reading the docs thoroughly, you have asked a
number of questions that are pretty simple if you just pay attention to
the API, and MIME::Lite has very thorough and simple documentation,

http://search.cpan.org/~yves/MIME-Lite-3.01/lib/MIME/Lite.pm#Create_a_simple_message_containing_just_an_image


> Disposition => 'attachment');
> $msg->send;
> }
>

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 









Re: Inline Edit -- File name

2004-09-22 Thread Jose Alves de Castro
On Wed, 2004-09-22 at 15:24, [EMAIL PROTECTED] wrote:
> How will I get the file name when I do an inline edit like this:
> 
> perl -i.orig -pe '$_ =  $_' filename

That won't compile, but I believe you're posting something like a proof
of concept rather then code...

If I get this correctly, you're looking for the $ARGV variable. Check
out:

perldoc perlvar

> How would I get the file name in ?
> 
> Thanks,
> Rex
-- 
José Alves de Castro <[EMAIL PROTECTED]>
  http://natura.di.uminho.pt/~jac


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Run a process in the background

2004-09-22 Thread Errin Larsen
Hi Perlers,

I know that questions like this get asked all the time, but I guess
it's just my turn to ask 'em!

I need to kick of some processes in my script.  However, the script
needs to kick them all off at once and then stick around to do some
other things.  I'm kinda new to Perl, but in my OS's shell, I'd do
this (actually, I DO do this ... this Perl script will be replacing
this shell script):

#!/bin/sh
nohup /path/to/process/one/bin/server.sh >/dev/null 2>&1 &
nohup /path/to/process/two/bin/server.sh >/dev/null 2>&1 &
nohup /path/to/process/three/bin/server.sh >/dev/null 2>&1 &

I figure I can pass that string directly to system() in Perl, 

  system "nohup /path/to/process/one/bin/server.sh >/dev/null 2>&1 &";
  system "nohup /path/to/process/two/bin/server.sh >/dev/null 2>&1 &";
  system "nohup /path/to/process/three/bin/server.sh >/dev/null 2>&1 &";

but that invokes the shell, right?  Also, I'd like to capture the
Process ID of those 3 servers.

So I tried the above and it works, but I'd still like to be able to
leave the shell out of this.  And what about those process IDs?

One last question.  If I do the above, does the OS consider those 3
servers my scripts "children"?  I know that comes with some
responsibility (I've been looking at some things about the SIGCHLD
signals). oh, and btw, this is Solaris I'm talking about here.

Thanks guys and gals,

--Errin

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to change values of @INC

2004-09-22 Thread Johannes Lichtenberger
Bernd Mueller wrote:
I am trying to run a perl script under apache2 and the error_log tells 
me  something about:
"Can't locate SiteDefs.pm in @INC (@INC contains:  
/usr/local/lib/perl5/5.8.5/x86_64-linux etc ...) at  
/usr/local/ensembl/perl/multi/unisearch line24., referer: 
http://localhost/
...
BEGIN failed--compilation aborted at ..."

Would someone be so nice to explain me how i change the values in 
@INC,  because i know where to find this SiteDefs.pm.
perldoc lib
perldoc FindBin
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Perl and DHCP

2004-09-22 Thread Prasanna Kothari
Hi,
I have Perl program in which I have if condition as "if( -e $hostname) { 
# do something} else { # do something else}"
I use Sys::Hostname::hostname() to get the host name.
If my Windows machine is DHCP enabled ,the if condition turns out be 
false and vice versa for Static IP address.

Any pointers in this regard will be highly appreciated.
--Prasanna

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



file upload with Perl

2004-09-22 Thread Maxipoint Rep Office


I have few questions regarding file uplad:

1) I am try do next tutorial: http://www.redantigua.com/upload.html

but what is "use lib qw(/home/redanti/perl);" here:
http://www.redantigua.com/UploadApp.txt



2) What is my path instead: '/home/redanti/perl'



3) what is modul lib?

Is it above lib modul:
http://search.cpan.org/~nwclark/perl-5.8.5/lib/lib_pm.PL








-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Run a process in the background

2004-09-22 Thread Wiggins d Anconia
> Hi Perlers,
> 
> I know that questions like this get asked all the time, but I guess
> it's just my turn to ask 'em!
> 
> I need to kick of some processes in my script.  However, the script
> needs to kick them all off at once and then stick around to do some
> other things.  I'm kinda new to Perl, but in my OS's shell, I'd do
> this (actually, I DO do this ... this Perl script will be replacing
> this shell script):
>
> #!/bin/sh
> nohup /path/to/process/one/bin/server.sh >/dev/null 2>&1 &
> nohup /path/to/process/two/bin/server.sh >/dev/null 2>&1 &
> nohup /path/to/process/three/bin/server.sh >/dev/null 2>&1 &
>

Shell is considerably different than Perl when it comes to this stuff...
 
> I figure I can pass that string directly to system() in Perl, 
> 
>   system "nohup /path/to/process/one/bin/server.sh >/dev/null 2>&1 &";
>   system "nohup /path/to/process/two/bin/server.sh >/dev/null 2>&1 &";
>   system "nohup /path/to/process/three/bin/server.sh >/dev/null 2>&1 &";

A good figure, though I would expect this to fail, since system blocks,
but maybe not because the shell should be returning control.

> 
> but that invokes the shell, right?  Also, I'd like to capture the
> Process ID of those 3 servers.
> 

Yes it does.

> So I tried the above and it works, but I'd still like to be able to
> leave the shell out of this.  And what about those process IDs?
> 

In this case you should look at the fork/exec model instead. It allows
you to start a separate process without blocking the parent which you
can then use to do other things while the forked process is running. The
best place to start is with the IPC (InterProcess Communication) docs under,

perldoc perlipc
perldoc -f fork
perldoc -f exec
perldoc -f wait
perldoc -f waitpid

This will cover forking/execing, signals, etc.

> One last question.  If I do the above, does the OS consider those 3
> servers my scripts "children"?  I know that comes with some
> responsibility (I've been looking at some things about the SIGCHLD
> signals). oh, and btw, this is Solaris I'm talking about here.
> 

Sort of, in the case of C the function manages the stuff you are
talking about automatically itself.  In the lower level you will have to
manage it, but the docs listed above should provide enough info to get
you through that.

> Thanks guys and gals,
> 
> --Errin
> 

Per usual this is where I will jump in and suggest POE if you are doing
anything that is not trivial. It makes managing all of this type of
multi-tasking garbage simple.

http://poe.perl.org

HTH,

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: file upload with Perl

2004-09-22 Thread Wiggins d Anconia
> 
> 
> I have few questions regarding file uplad:
> 
> 1) I am try do next tutorial: http://www.redantigua.com/upload.html
> 
> but what is "use lib qw(/home/redanti/perl);" here:
> http://www.redantigua.com/UploadApp.txt
> 
> 

perldoc lib

C is a pragma (similar to a module, but affects the perl
interpreter during compile time).  It allows you to munge the @INC
special var to include non-default paths for Perl modules. So in the
example the tutor is including a new path that has his Perl modules
installed in it.

> 
> 2) What is my path instead: '/home/redanti/perl'
> 
> 

No idea, only you can tell us that. If you have modules installed in a
place that is not in the main Perl library locations then you should
know where you installed them to, if you don't then you shouldn't need
the line at all.

> 
> 3) what is modul lib?
> 
> Is it above lib modul:
> http://search.cpan.org/~nwclark/perl-5.8.5/lib/lib_pm.PL
> 
> 

Yes those are the docs for it, though it is a 'pragma' instead of a
'module', which I only really mention because this is a beginners list
where we want people to be specific, and learn specifically, the
vocabulary used.

HTH,

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Inline Edit -- File name

2004-09-22 Thread RArul
Well, I did try that with $ARGV[0], but to no avail. Yes, I had posted a POC. Here is 
the true code that would not print the file-name. What am I doing wrong?

perl -pe '$_ = "$ARGV[0] \t $_"' trace.txt



-Original Message-
From: Jose Alves de Castro [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 22, 2004 12:40 PM
To: Arul, Rex
Cc: [EMAIL PROTECTED]
Subject: Re: Inline Edit -- File name

On Wed, 2004-09-22 at 15:24, [EMAIL PROTECTED] wrote:
> How will I get the file name when I do an inline edit like this:
> 
> perl -i.orig -pe '$_ =  $_' filename

That won't compile, but I believe you're posting something like a proof
of concept rather then code...

If I get this correctly, you're looking for the $ARGV variable. Check
out:

perldoc perlvar

> How would I get the file name in ?
> 
> Thanks,
> Rex
-- 
José Alves de Castro <[EMAIL PROTECTED]>
  http://natura.di.uminho.pt/~jac


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Inline Edit -- File name

2004-09-22 Thread RArul
Thanks for the help. 

This works: perl -pe '$_ = "$ARGV \t $_"' trace.txt  
This doesn't: perl -pe '$_ = "$ARGV[0] \t $_"' trace.txt  

perldoc perlvar says that $ARGV must be used for command-line processors
and in array-context as @ARGV for running scripts.

Thanks, once again.


-Original Message-
From: Arul, Rex 
Sent: Wednesday, September 22, 2004 1:27 PM
To: '[EMAIL PROTECTED]'
Cc: [EMAIL PROTECTED]
Subject: RE: Inline Edit -- File name

Well, I did try that with $ARGV[0], but to no avail. Yes, I had posted a
POC. Here is the true code that would not print the file-name. What am I
doing wrong?

perl -pe '$_ = "$ARGV[0] \t $_"' trace.txt

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl and DHCP

2004-09-22 Thread Wiggins d Anconia
> Hi,
> I have Perl program in which I have if condition as "if( -e $hostname) { 
> # do something} else { # do something else}"
> I use Sys::Hostname::hostname() to get the host name.
> If my Windows machine is DHCP enabled ,the if condition turns out be 
> false and vice versa for Static IP address.
> 
> Any pointers in this regard will be highly appreciated.
> 

Not sure how that is possible since C<-e> is a file test operator, it
tells us whether a file (the argument) exists or not.  See,

perldoc -f -e

For more.  Is it really getting to the true part?  Or is it passing or
dieing?  Something sounds fishy.

What does C<$hostname> contain in both cases, try printing the variable? 

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Run a process in the background

2004-09-22 Thread John W. Krahn
Errin Larsen wrote:
Hi Perlers,
Hello,
I know that questions like this get asked all the time, but I guess
it's just my turn to ask 'em!
I need to kick of some processes in my script.  However, the script
needs to kick them all off at once and then stick around to do some
other things.  I'm kinda new to Perl, but in my OS's shell, I'd do
this (actually, I DO do this ... this Perl script will be replacing
this shell script):
#!/bin/sh
nohup /path/to/process/one/bin/server.sh >/dev/null 2>&1 &
nohup /path/to/process/two/bin/server.sh >/dev/null 2>&1 &
nohup /path/to/process/three/bin/server.sh >/dev/null 2>&1 &
I figure I can pass that string directly to system() in Perl, 

  system "nohup /path/to/process/one/bin/server.sh >/dev/null 2>&1 &";
  system "nohup /path/to/process/two/bin/server.sh >/dev/null 2>&1 &";
  system "nohup /path/to/process/three/bin/server.sh >/dev/null 2>&1 &";
but that invokes the shell, right?  Also, I'd like to capture the
Process ID of those 3 servers.
So I tried the above and it works, but I'd still like to be able to
leave the shell out of this.  And what about those process IDs?
One last question.  If I do the above, does the OS consider those 3
servers my scripts "children"?  I know that comes with some
responsibility (I've been looking at some things about the SIGCHLD
signals). oh, and btw, this is Solaris I'm talking about here.
The perlipc man page has a lot of information on how to run a child process 
and how to capture/ignore signals like HUP.

perldoc perlipc
This might do what you want (UNTESTED!)
my @children;
for my $server (  ) {
local $SIG{ HUP } = 'IGNORE';
defined( my $pid = fork ) or die "Cannot fork: $!";
unless ( $pid ) {  # in child
open STDOUT, '>', '/dev/null' or die $!;
open STDERR, '>', '/dev/null' or die $!;
exec $server or die "Cannot exec $server: $!";
}
push @children, $pid;
}

John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: calling Perl Script from JSP?

2004-09-22 Thread Drue Reeves
Chris,
 
Thank you. This is starting to make more sense now. I may have more questions but, 
I'll go do some homework first. I'll start with the book you mentioned.
 
Thanks,
 
Drue

Chris Devers <[EMAIL PROTECTED]> wrote:
First of all, "Perl" is the language, "perl" is the program that runs 
programs written in Perl, and "PERL" isn't a word.

On Tue, 21 Sep 2004, Drue Reeves wrote:

> Why is it bad to mix JSP and Perl?

They are just much different frameworks. 

Most Java systems I'm aware of (and I'll plead guilty to some ignorance 
here) pretty much want you to do everything in Java, from the JSP 
scripts that display pages to the beans (or whatever) that implement the 
site logic to, sometimes, the database itself. 

Perl on the other hand is often the "glue" holding a heterogeneous 
system together. It's very good for getting a bunch of disparate pieces 
that are either old or maybe came from different places to play nicely 
together. 

I know nothing about your JSP system, but conventionally, shops that 
have decided to go with JSP seem to do everything in JSP, just because 
there's so much inertia behind getting everything locked in to Java. 


I seem to be talking about the cultures more than the languages.

Oh well.

> Maybe a better question is how do you call a Perl script from a web 
> page (and pass parameters)?

There is a lot of flexibility here.

Often, Perl *is* the web page, whether by a CGI script that runs perl 
and executes the script with each page view, or a mod_perl plugin that 
embeds perl into Apache so that scripts are persistent in memory (which 
is the approach that JSP and other languages seem to take, right?). 

But if you just have a static HTML document that needs to call Perl 
somehow, the usual way is either by a form's tag or just by 
following a link. In either case, this usually ends up being a GET or 
POST request to a Perl script that has been exposed as a web page with a 
URL. For POST requests, the parameters are sent to the script basically 
as a text document that is uploaded to the server, while for GET 
requests the data comes in following the script. Hence,

http://google.com/search?q=http%20protocol
^ ^ ^ ^-- parameters to the script
| | +--- the script / program / whatever
| + the domain
+- the protocol

And if this doesn't make sense, there's lots of documentation out there. 
This book may help clarify things -- it's old now, but the fundamentals 
haven't changed since it was published:



So, if you're working via HTTP -- as you're doing on the web -- then it 
just ends up being a URL that you GET from or maybe POST to. 

Make sense? More questions?


-- 
Chris Devers


SSI from script

2004-09-22 Thread Ramon Chavez
Hi everyone.

I'm trying to call a SSI from a page generated by a Perl script. Obviously the SSI 
can't be called because it is not an HTML file. But if I use the .htaccess parsing 
method, a with .shtml, (AddHandler server-parsed .pl) I got all the code of my script 
listed.

This SSI will call another .pl , a counter to be precise.
I could include the code of the counter in the main script, but I didn't wrote the 
counter and don't want to do anything wrong, I mean I respect other's work.
I was thinking in 'use' or 'require', but it's not about the functions in the counter, 
it's about the whole output.

Any advice on where to look now?
Thanks.
-rm-


Re: use perl to inquire database and send email automatically

2004-09-22 Thread Franklin
HI,guy:
I am in China. Can you imagine an engineer from developing country to
hire an expert in developed country?:)
I am planning to use DBD:mysql to inquire database and send the result
automatically. I will update my process and please kindly give me some
valuable suggestion in the future.


On Wed, 22 Sep 2004 08:19:43 -0500, JupiterHost.Net
<[EMAIL PROTECTED]> wrote:
> 
> 
> Franklin wrote:
> 
> > Hello:
> 
> Hello,
> 
> > I have a database which refresh every minutes according to the
> > information on Internet and I provide users to predefine some
> > condition. When these conditions are matched, my sytem will send them
> > email to inform them. How can I use perl to realize these
> > functionalities?
> 
> Perl can do this for sure, but this list is to help beginners int he
> process of programming, not a free custom script service.
> 
> So you'll need to post the code you're having trouble with and what the
> problem is so we can help.
> 
> If you're interested, email me off list and I'd be happy to be hired to
> assist you :)
> 
> Lee.M - JupiterHost.Net
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: use perl to inquire database and send email automatically

2004-09-22 Thread Chris Devers
On Thu, 23 Sep 2004, Franklin wrote:

> I am in China. Can you imagine an engineer from developing country to
> hire an expert in developed country? :)

Can you imagine a total stranger doing all your work for nothing?

Wait, don't answer that, I think I know the answer... :)

> I am planning to use DBD:mysql to inquire database and send the result 
> automatically. I will update my process and please kindly give me some 
> valuable suggestion in the future.

The suggestion is to read over the documentation, ask for help if any of 
it is unclear, then *write your own code*. If you get stuck, we'll be 
glad to help, but this list does not exist to do other peoples jobs or 
homework. You have to give it a try before you can expect others to try.
 


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]