Hi all,
I know to use the Net::SMTP module, but I would like to send an email which
has a fiew file attached and to be an HTML type because I want to include an
image in it.
Do you know which perl module can help me doing that?
Thank you.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Octavian Rasnita wrote:
I know to use the Net::SMTP module, but I would like to send an email which
has a fiew file attached and to be an HTML type because I want to include an
image in it.
Do you know which perl module can help me doing that?
Try Mail::Sender.
-- Greg
--
To unsubscribe,
On Tue, 07 Oct 2003 13:32:02 +0100, Greg Bolshaw [EMAIL PROTECTED] wrote:
Octavian Rasnita wrote:
I know to use the Net::SMTP module, but I would like to send an email which
has a fiew file attached and to be an HTML type because I want to
Hi,
I can't seemed use different colors for each bar. Instead of different colors
according to @datacolor, only blue is printed for all the bars. Can you tell me
what's wrong with this code? And, wanting to delete a file that contains the
following graph (to avoid accumulation), what can I
1 - What is the best char to use in a file template?
Also, please give me a good regex?
I will have a formatted html page with some keys that I want to replace.
For example,
...
!-- here my token is a ! --
tdFirst Name:/tdtd!fname!/td
tdLast Name:/tdtd~!lname!/td
...
2 - Can I read in the
I understand what you are saying but I would have to include the path, the
@INC thing, to the use WhateverTheHeckICallTheModule qw(emailx);.
This would affect command line and mod_perl. If I put the
WhateverTheHeckICallTheModule in the current dir, it works fine for the
command line. For
Great, I got the use lib to work but where is the directory for these
modules you mentioned (on linux):
No you wouldn't not if you install it via cpan (IE it's in a standard
directory already in @INC)
Same with any other module, Net::SMTP, Mail::Sender,
I did a find but it did not find it.
[EMAIL PROTECTED] wrote:
Great, I got the use lib to work but where is the directory for these
modules you mentioned (on linux):
No you wouldn't not if you install it via cpan (IE it's in a standard
directory already in @INC)
Same with any other module, Net::SMTP, Mail::Sender,
I did a
Thanks, you just help me out greatly. I can now plan out my modules
instead of ... with this location of the module files.
thanks,
-rkl
[EMAIL PROTECTED] wrote:
Great, I got the use lib to work but where is the directory for these
modules you mentioned (on linux):
No you wouldn't not if
#/usr/bin/perl
use strict;
use warnings;
use WhateverTheHeckICallTheModule qw(emailx);
emailx({
ip = '1.2.3.4',
to = '[EMAIL PROTECTED]',
fr = '[EMAIL PROTECTED]',
sb = 'Inquiry Response Request',
ms = $emailmessagehere
}) or die No sendy mial
Thanks, you did good with this code for me. I did not want to
load more library as most suggested. This works just fine
Why not? One simple use statement and you're done. Platform independent,
No relying on an external program to be at the path you specify, use the switches you
specify,
Or
I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
try to pass a local file to remote host to copy file to newly created
directory, it fails:
code:
use Net::SSH::Perl
my $ssh = Net::SSH::Perl-new($host);
$ssh-login($user, $pass);
print $ssh-cmd(mkdir $site);
print
Is the $site directory actually created? What are it's permissions?
Maybe you can
$ssh-cmd(cp $site/$filename);
But I thought cp required at least two args.
-tristram
-Original Message-
From: Roberts Mr Richard L [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:48 PM
the code:
$ssh-cmd(mkdir $direct);
functions as directory '$direct' is created,
yet my next line of code:
$ssh-cmd(cd $direct); chokes as I run next line to confirm:
$ssh-cmd(pwd); shows no directory change, still in parent directory
thus when I run:
$ssh-cmd(cp $file1 $file2);
gets no responce
I have full permissions as earlier code creates new dir: $site, yet when I
try to 'cd' or even 'cwd' notta thus when I try to cp $ssh-cmd(cp $file
20020922); it bombs.
-Original Message-
From: TN [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L'
I have a file that I want to run multiple actions on. First, the file is
read in as one long string. I want to
substitute some words with others so I run a substitution. That seems to
change the data in the first
while, HOWEVER, when I run the second while loop on the same data to parse
my
Trina Espinoza wrote:
I have a file that I want to run multiple actions on. First, the file is
read in as one long string. I want to
substitute some words with others so I run a substitution. That seems to
change the data in the first
while, HOWEVER, when I run the second while loop on the
Hello,
I am trying to embed perl in my C++ program. My application needs to
evaluate different very simple perl programs. These perl programs will be
created on the fly. So they can't be in any file on the disk. I read up
perlembed and tried to execute the statements using eval_pv. This
Hi
Hope someone can help with this. I used to be able to do it, but now have
forgotten. I want to prepend some text to every line in a file. The program
below:
#!/usr/bin/perl
# prepend.pl - adds line number to beginning of every line in a file
use strict;
use warnings;
while () {
Chris Charley [EMAIL PROTECTED] wrote in message news:...
[snip]
while () {
s/^/Line: $. /;
}
Should be (works correctly):
while () {
s/^/Line: $. /;
print;
}
Then the command could be:perl prepend.pl somefile.txt somefile.new
which would correctly print to the
You're reading in the file, but not changing it. You're only changing it in
memory. Check out the responses to the other post called make changes to a
file, then reading in those changes
-Original Message-
From: Chris Charley [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003
John W. Krahn wrote:
perldoc -q password
Found in /usr/lib/perl5/5.6.0/pod/perlfaq8.pod
How do I ask the user for a password?
(This question has nothing to do with the web. See a
different FAQ for that.)
There's an example of this in the crypt entry in the
Chris Charley wrote:
Chris Charley [EMAIL PROTECTED] wrote in message news:...
[snip]
while () {
s/^/Line: $. /;
}
Should be (works correctly):
while () {
s/^/Line: $. /;
You don't need a regular expression to do this. This should suffice
$_ = Line: $. $_;
I hope you
Hi,
Chris Charley [EMAIL PROTECTED] wrote:
Should be (works correctly):
while () {
s/^/Line: $. /;
print;
}
Then the command could be:perl prepend.pl somefile.txt
somefile.new
which would correctly print to the 'new' file the
somefile.txt file with the line
Hi!
I am trying to change some text from:
if ( (fabs(log(im[ii]/im[ii-1])/vstep)
fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) ((im[ii] ifr[x]) ||
(im[ii-1] ifr[x])) ) {
to
if ( (fabs(log(im[ii]/im[ii-1])/vstep) fabs(3 *
log(im[ii-1]/im[ii-5])/(4 * vstep)) ) ((im[ii] ifr[x]) ||
Hi,
Jerry Preston [EMAIL PROTECTED] asked:
I am trying to change some text from:
if ( (fabs(log(im[ii]/im[ii-1])/vstep)
fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) ((im[ii] ifr[x]) ||
(im[ii-1] ifr[x])) ) {
to
if ( (fabs(log(im[ii]/im[ii-1])/vstep) fabs(3 *
Again, you MUST send these to the Perl Beginner's List, if you want
answers.
On Monday, October 6, 2003, at 10:48 PM, vaishali wrote:
thanks my problem is solved
I am having another query.
I am having mysql and the table is sms_log. In that my sender field
format is
xyz abc [EMAIL PROTECTED]
In article
[EMAIL PROTECTED],
Nyimi Jose wrote:
If you are tired typing my $self = shift;
There are modules out there that can build class for you.
http://search.cpan.org/search?query=Class%3A%3AStructmode=module
I'm using Class::Struct module coming with perl.
It's probably good for me to
Hello everyone,
I've seen several postings over the past few weeks about Regular
Expressions and just thought I'd share a couple of tools that I use when
building regular expressions.
I have been using Visual Regexp
http://freshmeat.net/projects/visualregexp
But have recently stumbled upon
Suggest you install and use cygwin including its perl package. It
includes Term::Readkey and the other core packages. I just did a cygwin
installation on win2k yesterday and it went smoothly. Note that emacs
and midnight commander are the only default editors, but nano and vim
are selectable as
Saikatranjan Parida wrote:
I am trying to embed perl in my C++ program. My application needs to
evaluate different very simple perl programs. These perl programs will be
created on the fly. So they can't be in any file on the disk. I read up
perlembed and tried to execute the statements using
Jerry Preston wrote:
I am trying to change some text from:
if ( (fabs(log(im[ii]/im[ii-1])/vstep)
fabs(3*log(im[ii-1]/im[ii-5])/(4*vstep)) ) ((im[ii] ifr[x]) ||
(im[ii-1] ifr[x])) ) {
to
if ( (fabs(log(im[ii]/im[ii-1])/vstep) fabs(3 *
log(im[ii-1]/im[ii-5])/(4 * vstep)) )
On Oct 7, Jerry Preston said:
s/(?=[A-z|0-9]+)\*(?=[A-z]+)/' * '/g;
You want to change 3*foo to 3 * foo, right? Well then, there are a
couple problems with your regex.
First, the (?=...) at the beginning is a look-AHEAD. You want a
look-BEHIND, and you only need to look behind for one
Jerry Preston wrote:
[snip]
s/(?=[A-z|0-9]+)\*(?=[A-z]+)/' * '/g;
It's also worth noting that /[A-z]/ isn't what you think
it is. Look:
use strict;
use warnings;
for (map chr, 0x00 .. 0x7F) {
print if /[A-z]/;
}
OUTPUT
I want to create a doc file that will contain my text, fonts, sizes as if i wrote
manually.
Can i do that thing?
Hi Trina.
Trina Espinoza wrote:
I have a file that I want to run multiple actions on. First, the file is
read in as one long string. I want to
substitute some words with others so I run a substitution. That seems to
change the data in the first
while, HOWEVER, when I run the second while
Good place to ask. Jenda and some others are great with perl and M$. One
thing I've done in the past is to write HTML but save it as a *.doc.
Example:
Open a file and write:
htmlh1test/h1br/pbtest/b itest/i utest/u/p/html
Save it as test.doc.
Open it in Word. It show the formatting. The
John wrote:
I want to create a doc file that will contain my text,
fonts, sizes as if i wrote manually.
You can use Win32::OLE drive MSWord itself to generate a document,
but I think that's an awful way to do things. Why not look at
RTF::Generator which will let you create an RTF file which
The M$ Word .doc creation has just been answered. What about excel - .xls ?
I have done comma and tab seperated .csv files which is just writing a normal text
file and open in Excel but some versions mess it up and show all the comma seperated
fields in one.
Suggestions appreciated!
Thanks
Spreadsheet::WriteExcel
You can also play with the OLE module if you on a windows only machine.
Spreadsheet::Writeexcel works on anything. I use it on our sco and Linux
boxes.
-Original Message-
From: Aman Raheja [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 11:43 AM
To:
On Tuesday, October 7, 2003, at 10:42 AM, Aman Raheja wrote:
The M$ Word .doc creation has just been answered. What about excel -
.xls ?
Spreadsheet::WriteExcel is available from the CPAN.
James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Have you got the code to test if you concept is what i need?
- Original Message -
From: Stout, Joel R [EMAIL PROTECTED]
To: 'John' [EMAIL PROTECTED]; Perl Beginners [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 6:32 PM
Subject: RE: Microsoft Word Creation
Good place to ask. Jenda
On Tue, 2003-10-07 at 11:42, Aman Raheja wrote:
The M$ Word .doc creation has just been answered. What about excel - .xls ?
I have done comma and tab seperated .csv files which is just writing a normal text
file and open in Excel but some versions mess it up and show all the comma seperated
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Friday, October 03, 2003 4:19 AM
To: [EMAIL PROTECTED]
Subject: Re: Validate String w/required period
[EMAIL PROTECTED] wrote:
I'm trying to validate if a string contains \w and required
atleas one
Tn wrote:
Suggest you install and use cygwin including its perl package. It
includes Term::Readkey and the other core packages. I just did a cygwin
installation on win2k yesterday and it went smoothly. Note that emacs
and midnight commander are the only default editors, but nano and vim
Rob Dixon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
John wrote:
I want to create a doc file that will contain my text,
fonts, sizes as if i wrote manually.
You can use Win32::OLE drive MSWord itself to generate a document,
but I think that's an awful way to do things.
:) The problem is that i want to use Fonts and Different Sizes, bold,italic
in my text. Not just a simple text.
Rob's answer may be better for you but remember - HTML can handle your
fonts, sizes, yada, yada. Google CSS.
Using perl, write the text below to a file, name it test2.doc and then
Dan Muey wrote:
[EMAIL PROTECTED] wrote:
I'm trying to validate if a string contains \w and required
atleas one
period (.)
By \w do you mean just whitespace or '\\w'?
Isn't \w a-zA-Z0-9_ ??
And whitespace \s ??
Yes. Getting muddled up for some reason - thanks Dan.
At least the rest
Well, in that case, should i open the HTML fileas a filehandler an resave it
as a word doc by using the Win32::OLE module?
- Original Message -
From: Stout, Joel R [EMAIL PROTECTED]
To: 'John' [EMAIL PROTECTED]; Perl Beginners [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 8:00 PM
On Mon, 06 Oct 2003 14:20:05 -0400, Chris Charley wrote:
Then, on the command line I type: perl prepend.pl somefile.txt, but
somefile.txt does not have the changes(Line: linenumber).
Try writing 'perl prepend.pl somefile.txt newfile.txt' instead.
--
Tore Aursand [EMAIL PROTECTED]
--
To
I have a module that works with a couple of different file handles. Is
it possible to hide them within an anonymous hash? {} (i.e. the objects
data). Right now I have:
if (condition_is_met()) {
open(FILE,file);
}
This is in the main body of my package (and thus, I assume, accessible
by all
John wrote:
Rob Dixon wrote:
John wrote:
I want to create a doc file that will contain my text,
fonts, sizes as if i wrote manually.
You can use Win32::OLE drive MSWord itself to generate a document,
but I think that's an awful way to do things. Why not look at
On Tue, 07 Oct 2003 15:22:34 -0400, Dan Anderson [EMAIL PROTECTED] wrote:
I have a module that works with a couple of different file handles. Is
it possible to hide them within an anonymous hash? {} (i.e. the objects
data). Right now I have:
Dan Anderson wrote:
I have a module that works with a couple of different file handles. Is
it possible to hide them within an anonymous hash? {} (i.e. the objects
data). Right now I have:
if (condition_is_met()) {
open(FILE,file);
}
This is in the main body of my package (and thus, I
I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
try to pass a local file to remote host to copy file to newly created
directory, it fails:
code:
use Net::SSH::Perl
my $ssh = Net::SSH::Perl-new($host);
$ssh-login($user, $pass);
print $ssh-cmd(mkdir $site);
print
On Tue, 7 Oct 2003 15:43:00 -0400 , Roberts Mr Richard L [EMAIL PROTECTED] wrote:
I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
try to pass a local file to remote host to copy file to newly created
directory, it
Wiggins D'Anconia wrote:
Dan Anderson wrote:
I have a module that works with a couple of different file handles. Is
it possible to hide them within an anonymous hash? {} (i.e. the objects
data). Right now I have:
if (condition_is_met()) {
open(FILE,file);
}
This is in the
Kevin Old wrote:
Hello everyone,
Hello,
I've seen several postings over the past few weeks about Regular
Expressions and just thought I'd share a couple of tools that I use when
building regular expressions.
I have been using Visual Regexp
http://freshmeat.net/projects/visualregexp
On Tue, 7 Oct 2003 16:09:44 -0400 , Roberts Mr Richard L [EMAIL PROTECTED] wrote:
Please start a new thread when appropriate.Sorry, new to discussion group
yet thanks for the advice.
Also remember to group reply so others can help and be
John W. Krahn wrote:
Kevin Old wrote:
I have been using Visual Regexp
http://freshmeat.net/projects/visualregexp
But have recently stumbled upon RegExplorer which has a cleaner
interface.
http://regexplorer.sourceforge.net
Another one - regexEvaluater:
Hi,
Silly question, is there an equal but opposite function to chop in Perl?
I'd like to remove the first and last character of a string and am looking
for a simple way to do it. So far I have:
# 1234567 - 23456
chop($string); # 123456
$string = reverse($string); # 654321
chop($string); # 65432
On Mon, Oct 06, 2003 at 07:52:31PM -0500, Wiggins d'Anconia wrote:
Richard Fernandez wrote:
On Fri, Oct 03, 2003 at 09:24:01PM -0400, TN wrote:
Based on your delete criteria, it would be much easier to filter out
unwanted mail messages on an incoming relay mailer in your DMZ. You
could
You could just use a regex...
$string =~ s/.//;
Or even substr()...
substr($string, 0, 1, '');
Both look equally efficient.
Rob
-Original Message-
From: Li, William [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:57 PM
To: [EMAIL PROTECTED]
Subject: Chopping off
On Tuesday, October 7, 2003, at 11:56 AM, Li, William wrote:
Hi,
Howdy.
Silly question, is there an equal but opposite function to chop in
Perl?
I'd like to remove the first and last character of a string and am
looking
for a simple way to do it. So far I have:
# 1234567 - 23456
$string =~ s/^.(.*).$/$1/;
It's prettier, but it's very inefficient. It's probably 20+ times slower
then doing it in two steps.
It has to do with how Perl internally handled string data. When you s/// or
substr() all it does is move a pointer. With your version it would need to
rewrite the
1 - What is the best char to use in a file template?
Also, please give me a good regex?
I will have a formatted html page with some keys that I want to replace.
For example,
...
!-- here my token is a ! --
tdFirst Name:/tdtd!fname!/td
tdLast Name:/tdtd~!lname!/td
...
2 - Can I read in the
In article [EMAIL PROTECTED],
Stephen Hardisty wrote:
Afternoon,
you could use Term::ReadKey, for example:
use Term::ReadKey;
# if you hit ctrl-c you still want to return to 'normal'
$SIG{INT} = sub{ReadMode('normal')};
ReadMode('cbreak');
# 'ord' returns the ASCII value of a
my $return = do_wrap('hello');
Doesn't this have to be MyCommon::do_wrap('hello'); ?
When running it, the error: Undefined subroutine main::do_wrap
thanks,
-rkl
[EMAIL PROTECTED] wrote:
How can I reuse a subroutine?
My environment is redhat 9, apache2, perl-5.8.0-88, mod_perl-1.99_07-5.
Rob Hanson wrote:
$string =~ s/^.(.*).$/$1/;
It's prettier, but it's very inefficient. It's probably 20+ times slower
then doing it in two steps.
It has to do with how Perl internally handled string data. When you s///
or substr() all it does is move a pointer.
this is an over
Rob Hanson wrote:
You could just use a regex...
$string =~ s/.//;
Or even substr()...
substr($string, 0, 1, '');
Both look equally efficient.
except they are different and they don't work the same way:
[panda]$ perl -le '$_=\n1234; s/.//; print'
234
[panda]$ perl -le '$_=\n1234;
On Tue, 07 Oct 2003 12:56:50 -0400, Li, William wrote:
Silly question, is there an equal but opposite function to chop in Perl?
No.
I'd like to remove the first and last character of a string and am looking
for a simple way to do it.
The most elegant way to do it, IMO, is to use a regular
[EMAIL PROTECTED] wrote:
my $return = do_wrap('hello');
Doesn't this have to be MyCommon::do_wrap('hello'); ?
No. You do not have to prepend the package name when Exporter is properly
invoked. That proper invocation can be a bit tricky, though. That is why it
sat for a few days, while I
Thanks, you did good with this code for me. I did not want to
load more library as most suggested. This works just fine
Why not? One simple use statement and you're done. Platform independent,
No relying on an external program to be at the path you specify, use the switches you
specify,
Or
I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
try to pass a local file to remote host to copy file to newly created
directory, it fails:
code:
use Net::SSH::Perl
my $ssh = Net::SSH::Perl-new($host);
$ssh-login($user, $pass);
print $ssh-cmd(mkdir $site);
print
Is the $site directory actually created? What are it's permissions?
Maybe you can
$ssh-cmd(cp $site/$filename);
But I thought cp required at least two args.
-tristram
-Original Message-
From: Roberts Mr Richard L [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:48 PM
the code:
$ssh-cmd(mkdir $direct);
functions as directory '$direct' is created,
yet my next line of code:
$ssh-cmd(cd $direct); chokes as I run next line to confirm:
$ssh-cmd(pwd); shows no directory change, still in parent directory
thus when I run:
$ssh-cmd(cp $file1 $file2);
gets no responce
I have full permissions as earlier code creates new dir: $site, yet when I
try to 'cd' or even 'cwd' notta thus when I try to cp $ssh-cmd(cp $file
20020922); it bombs.
-Original Message-
From: TN [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L'
I am sending the email to the [EMAIL PROTECTED] and I am sending to you
also as this is urgent. Using your previous help I can able to solve my
problems.
sorry.
I am having following code and this prints the report in following format
sender: xyz.abc
department: xxx
branch: yyy
78 matches
Mail list logo