Download and post in web page pdf file(s)

2005-07-16 Thread Roberts Mr Richard L
Hi,
Does anyone know how/where I can resolve scp pdf files (user selected) and
display in a web page?
thanks
-r

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




RE: simple open file

2005-05-31 Thread Roberts Mr Richard L
try:
open(LOGS, ">>$filename") or die "msg";
print LOGS "$subscriber \n";
close(LOGS);


-Original Message-
From: Manav Mathur [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 31, 2005 9:20 AM
To: lance w; beginners@perl.org
Subject: RE: simple open file




|-Original Message-
|From: lance w [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, May 31, 2005 6:42 PM
|To: beginners@perl.org
|Subject: simple open file
|
|
|Hello,
|I'm trying to open (create if necessary) a file for APPEND, that will
|serve as a log. The script I'm using will open a file, but fails to
|print anything to it. Any advice?
|
|
|
|my $filename = "open_file.txt";
|open(APPEND, ">> $filename")
|   or die "Couldn't open $filename for appending: $!\n";
|   write "$subscriber\n";
|close APPEND;
|
|--
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
| 
|

You havent specified the FILEHANDLE to write to in 'write'. 'write' will
write to the default filehandle (STDOUT by default, can be changed by
'select'ing any other valid filehandle).

Also, APPEND may be a bad choice of filehandle name.

my $filename = "open_file.txt";
open(LOGFILE, ">> $filename")
or die "Couldn't open $filename for appending: $!\n";
write LOGFILE "$subscriber\n";
close LOGFILE;


*
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or
attachment(s) if any) are privileged and confidential material of MBT and
should not be disclosed to, used by or copied in any manner by anyone other
than the intended addressee(s).   In case you are not the desired addressee,
you should delete this message and/or re-direct it to the sender.  The views
expressed in this E-mail message (including the enclosure(s) or
attachment(s) if any) are those of the individual sender, except where the
sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free
of any virus.  However, it is the responsibility of the recipient to ensure
that it is virus free and MBT is not responsible for any loss or damage
arising in any way from its use

*

-- 
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 strict/warnings

2005-03-23 Thread Roberts Mr Richard L
My superior and I are debating where 'use strict/warnings' should be placed:
prior to any use module statement or after?
Anyone?

-Original Message-
From: Atul Vohra [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 23, 2005 1:44 PM
To: Felix Geerinckx; beginners@perl.org
Subject: Re: Web Service Client


Thanks
- Original Message -
From: "Felix Geerinckx" <[EMAIL PROTECTED]>
To: beginners@perl.org
Subject: Re: Web Service Client
Date: 22 Mar 2005 17:41:59 -

> 
> On 22/03/2005, Atul Vohra wrote:
> 
> [Top-posting fixed]
> 
> > > > Does anybody have a Web Service client in perl (SOAP stuff) to
> > > > consume a Web Service.
> > > > I have created Web Services using Remedy (ARS) and now need to
> > > > write a cleint for the external customer.
> 
> [...]
> 
> > I was hoping somebody actually handing me code snippets :-)
> 
> This wasn't too hard to find (where did you look yourself?):
> 
>   http://www.perl.com/pub/a/2001/01/soap.html
> 
> --
> felix
> 
> --
> 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]
 


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




RE: using Calendar.pm

2004-08-27 Thread Roberts Mr Richard L
Generate a online calendar w/ input/edit abilities based on day to day type
transactions.
thnx

-Original Message-
From: Chris Devers [mailto:[EMAIL PROTECTED]
Sent: Friday, August 27, 2004 11:21 AM
To: Roberts Mr Richard L
Cc: perl beginners
Subject: Re: using Calendar.pm


On Fri, 27 Aug 2004, Roberts Mr Richard L wrote:

> All,
> does anyone have any experience w/ calendar.pm? Usage and or examples.
Cpan
> is very vague in showing the actual calendar(s) and functionality.

I can't find a "Calendar.pm" in CPAN -- where did you get this from?

There are a number of modules related to calendars in CPAN --

 <http://search.cpan.org/search?query=calendar&mode=all>

-- but which to use depends on what you're trying to do.

So -- what are you trying to do?



-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




using Calendar.pm

2004-08-27 Thread Roberts Mr Richard L
All,
does anyone have any experience w/ calendar.pm? Usage and or examples. Cpan
is very vague in showing the actual calendar(s) and functionality.

thanks
Richard

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




RE: Helpful Regular Expression Tool

2004-06-16 Thread Roberts Mr Richard L
URL?


thanks in advance

Richard L. Roberts
Systems Integrator
Marine Corps Community Services
3044 Catlin Ave.
Quantico, Va. 22134
Phone: 703.432.0109
Fax: 703.784.1249
Email: [EMAIL PROTECTED]


-Original Message-
From: Ciemny, Jessica [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 9:01 AM
To: [EMAIL PROTECTED]
Subject: Helpful Regular Expression Tool


I am not sure if anyone has ever mentioned this before, but I wanted to
share something with you that I have recently found that might be of great
assistance with many of your "RegEx" issues. 

The name of this program is, "The Regex Coach". I have found it to be an
invaluable tool to any regular expression building that I attempt to create.
Input the information you are attempting to match in one pane of the window,
then build your regular expression in the other pane, and watch how your
expression matches up as you build it. 

Keep in mind that you still have to know the rules of regular expressions to
build them. "The Regex Coach" does not build them for you; it just shows you
how your regular expressions match up with the data that you supply it. 

Try it, it may or may not be helpful for you. 

Jessica Ciemny  
Sr. Unix System Administrator
 
Global Information Technology

LSG Sky Chefs International, L.L.C. 
Global Information Services, Americas Data Center
1950 N Stemmons Fwy.
Suite 2023
Dallas, TX 75027 
United States of America 
Phone: +1 972 793 9492 
Fax: +1 972 793 9401 
Mobile: +1 817 822 2395 
E-mail: [EMAIL PROTECTED] 

http://www.lsg-skychefs.com
 
 
This electronic message transmission contains information from the Company
LSG Sky Chefs or one of its affiliates which may be confidential or
privileged. The information is intended to be for the use of the individual
or entity named above. Any views or opinions presented are solely those of
the author and do not necessarily represent those of LSG Sky Chefs.  
 
If you are not the intended recipient, be aware that any disclosure,
copying, distribution or use of the contents of this information is
prohibited.
 
If you have received this electronic transmission in error, please notify us
by telephone or by electronic mail immediately.


-- 
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]
 




Need help in building a pl to a pm

2004-05-26 Thread Roberts Mr Richard L
first, sorry for top post. Second, I am trying to convert my html/pm files
to oop (pm). Can anyone give me some understanding of perl modules and some
examples. Specifically to 'bless()' and a general over view. I have searched
cpan/perl monks etc.

thanks in advance
R.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 2:34 PM
To: [EMAIL PROTECTED]
Subject: Re: array population from system app call


ok so now I can get all elements printed using

my @ftapes = ( );
my @ftapes = `evmvol -w label_state=3|grep barcode`;
 
foreach $_  (@ftapes) {
print $_ , "\n";
}

so now I want to use multidimensional arrays using print $ftapes[0,1]
does print $ftapes [0,1] mean print element 0 and element 1 or address 0,1
am I confusing a normal array with a MDarray?

where 

[0] is a subscript address so to get the first element I would say print 
$ftapes [0]

thanks

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams


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




RE: %ENV?

2004-03-16 Thread Roberts Mr Richard L
is there any 'refresh' (in the browser) variable set in the ENV hash? 

sierrasurf

-Original Message-
From: Randy W. Sims [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 10:56 PM
To: Mike Ni
Cc: [EMAIL PROTECTED]
Subject: Re: %ENV?


On 03/15/04 22:25, Mike Ni wrote:
> Hey Randy, 
> 
> Am I right to think that each hasing pair are made of 
> "name of environment variable" such as "PATH" 
> and the "value" of the env variable?

Yes, the environment variable names are the keys in the hash, and the 
value of each hash element is the value of the respective environment 
variable. You can change the environment by changing the hash, but the 
changes can only be seen in the current process and any child processes.

Randy.


-- 
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]
 




RE: Frustrated newbie question

2003-12-05 Thread Roberts Mr Richard L
does anyone know how to generate a java script alert window in perl? Or
better a alert window generated by perl. Its for a field validation in a
form...html

-Original Message-
From: david [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 2:06 PM
To: [EMAIL PROTECTED]
Subject: Re: Frustrated newbie question


Stuart Clemons wrote:

> 
> I have a file whose format looks like this:
> 
> name1  name2  name3
> name4  name5  name6, etc.
> 
> The names are separated by spaces.   I need the names to be one name per
> line, like this:
> 
> name1
> name2
> name3, etc.

try:

[panda]# perl -i -pe 's/\s+/\n/g' names.file

this will make names.file look like:

name1
name2
name3
...

> 
> I currently use a macro with a text editor to clean up the file into the
> one name per line format.  I can do this very quickly in contrast to the
> the last two hours I've spent trying to figure out how to get Perl to do
> this very simple task.  Arrggh !
> 
> To simply things, I just tried to take the following string and print it
> out one name per line.
> 
> my $x = "name1 name2 name3";
> 
> I've tried various schemes using regex's and the ///s operator.  Most of
> the time I get syntax errors and the few times I get anything to work,
> it's not what I want.

you can use split, s/// or m//. for your purpose, they are bascially the 
same:

#!/usr/bin/perl -w
use strict;

while(<>){

chomp;

#--
#-- $names[0] = name1
#-- $names[1] = name2
#-- ... etc
#--
my @names = split(/\s+/);

#--
#-- you can even rewrite the above like:
#--
#-- my @names = split;
#--
#-- when you become more familiar with Perl
#--

#--
#-- prints the name out like:
#--
#-- name1
#-- name2
#-- name3
#-- ...
#--
print join("\n",@names),"\n";
}

__END__

you can also use m// like:

my @names = /\S+/g;

which search for one or more none space characters that are stick together 
and put each of them into @names.

or you can use s/// like:

s/\s+/\n/g; print "$_\n";

which search for one or more continueous spaces and translate them into a 
newline.
 
> Anyway, any help at this point will be appreciated.  I'm hoping that in
> the long run the time I spend learning Perl will pay off, 

i think so.

david
-- 
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.sss.s.ss
s.s.s...s...s..s
...s.ss..s.sss..ss.sss.s
s.s.s...ss.sss.s
..s..sss.s.ss.sss...
..ssss.sss.sss.s

,{4},"|?{*=}_'y!'+0!$&;"
,ge,y,!#:$_(-*[./<[EMAIL PROTECTED],b-t,
.y...,$~=q~=?,;^_#+?{~,,$~=~
y.!-&*-/:[EMAIL PROTECTED] ().;s,;,
);,g,s,s,$~s,g,y,y,%,,g,eval

-- 
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]
 




RE: pydoc-like tool to generate html from uncommented perl cgi so urce code

2003-11-19 Thread Roberts Mr Richard L
anyone know anything about installing ModSurvey?

thanks in advance
Richard

-Original Message-
From: Jeff Kowalczyk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 19, 2003 11:14 AM
To: [EMAIL PROTECTED]
Subject: pydoc-like tool to generate html from uncommented perl cgi
source code


I'm trying to find a simple tool to run over a CGI perl application and
output hyperlinked index of source code at the function level, preferably
syntax-colored.

None of the files are formally commented at this point, so tools like
NaturalDocs are not going to give anything back. robodoc isn't outputting
anything but blank html files either, although I'm still working out why.

There is one directory of proper .pm perl modules (pdoc does very well
here) and a bunch of other .pl scripts representing the functions that
output the html UI.

Every search leads me back to the perldoc web site or the perldoc utility,
which AFAICT is a (POD) documentation browser, not a generator using code
parsing or introspection.

Any links to tools suitable for documenting CGI perl would be greatly
appreciated, thanks.


-- 
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]



RE: Training in the Middle and Far East

2003-11-05 Thread Roberts Mr Richard L
come on people, lets keep it to 'code' questions not stupid statements...

-Original Message-
From: George Schlossnagle [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 12:07 PM
To: [EMAIL PROTECTED]
Subject: Re: Training in the Middle and Far East


DO NOT FEED THE TROLLS.


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

This message has been scanned by the New MCCS-NET VirusWall Configuration. The 
opinions expressed in this message belong to the sender alone. There is no de facto 
endorsement by Widgets.

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

RE: cgi mail script anyone?

2003-10-07 Thread Roberts Mr Richard L
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'
Cc: 'Dan Muey'; [EMAIL PROTECTED]; 'Teresa Raymond'; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


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
To: 'Dan Muey'; [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


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 $ssh->cmd("cd $site); #does not change directory tested using
"cmd("pwd")" print $ssh->cmd("cp $filename");

etc...

Any help would help.

thanks in advance
Richard

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


> 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 use the data in the format you specify.

I love Mail::Sender and I'm actually in the middle of a module that 
simplifies even using that (if you can imagine),

Once done it will look like this:


#/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 $Error";

You can even make it html and add attachment inline or attached with one
simple hash entry.
ht => $htmlversionhere,
at => ...
Much easier to read and you can use it on any server. There's even a 
way to ammke the smtp ip address automaytic so you don'tr have to put 
a different one in each script, via the Mail::Sender default data.


For those interested kepp watching here: http://search.cpan.org/~dmuey/

HTH

DMuey

> with only one exception. I needed to use the -t option. Here
> is the revised version which worked for
> me:
> 
> #/usr/bin/perl
> use strict;
> use warnings;
> 
> my $mailprog = '/usr/sbin/sendmail -t'
> my $empemail='[EMAIL PROTECTED]';
> my $inquirer='[EMAIL PROTECTED]';
> 
> #EMAIL
> open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
> print MAIL "To: $empemail\n"; print MAIL "Reply-To: 
> $inquirer\n"; print MAIL "From: $inquirer\n"; print MAIL 
> "Subject: Inquiry Response Request\n\n"; print MAIL 
> <<"PrintTag"; Please respond to the following inquiry: blah 
> blah blah, message here PrintTag close(MAIL);
> 
> --end code--
> 
> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
> print MAIL
> > "To: $empemail\n"; print MAIL "Reply-To: $inquirer\n"; print MAIL 
> > "From: $inquirer\n"; print MAIL "Subject: Inquiry Response 
> > Request\n\n"; print MAIL <<"PrintTag";
> > Please respond to the following inquiry:
> > blah blah blah, message here
> > PrintTag
> > close(MAIL);
> >
> >
> > At 07:14 PM 10/3/2003, you wrote:
> >>I need to send a mail from the cgi. It must be able to have
> a reply or
> >>sender as someone different from the local web owner (apache). My
> >>configuration:
> >>  redhat 9/qmail/vpopmail
> >>
> >>  The example below will be typically what I want:
> >>
> >>To: [EMAIL PROTECTED]
> >>From: [EMAIL PROTECTED]
> >>Subject: "hello support test"
> >>this is a test
> >>with all your 

RE: Holding File handles in a {} anonymous hash

2003-10-07 Thread Roberts Mr Richard L
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 $ssh->cmd("cd $site); #does not change directory tested using
"cmd("pwd")"
print $ssh->cmd("cp $filename");

etc...

Any help would help.

thanks in advance
Richard

-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 3:44 PM
To: [EMAIL PROTECTED]
Subject: Re: Holding File handles in a {} anonymous hash


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"," }
>
> This is in the main body of my package (and thus, I assume, accessible
> by all functions).  Is it better to use tighter encapsulation (i.e. a
> closure or throwing it into an anonymous hash) or just to leave it in
> the body?

I think you'd be safe like this, except that if you have a lot of them
then you dont' know what the filehandle is going to be called. Here
you've used *Package::FILE, but there's no general way of getting to
that package name from any given filename. How about a hash of glob
references?

Here's a closure with a subroutine which keeps a list of handles for
each file it has already opened. The program just uses it to print
the next line from alternate files.

I hope this helps.

Rob


  use strict;
  use warnings;

  line_from ('filea');
  line_from ('fileb');

  line_from ('filea');
  line_from ('fileb');

  line_from ('filea');
  line_from ('fileb');

  {
my %filehandle;
my $fh;

sub line_from {

  my $file = shift;

  $fh = $filehandle{$file};

  unless (defined $fh) {
open $fh, $file or die $!;
$filehandle{$file} = $fh;
  }

  print scalar <$fh>;
}
  }




-- 
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]



RE: cgi mail script anyone?

2003-10-07 Thread Roberts Mr Richard L
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.e. no file is copied.

Does that makes sence?

sierrasurf

-Original Message-
From: TN [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L'
Cc: 'Dan Muey'; [EMAIL PROTECTED]; 'Teresa Raymond'; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


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
To: 'Dan Muey'; [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


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 $ssh->cmd("cd $site); #does not change directory tested using
"cmd("pwd")" print $ssh->cmd("cp $filename");

etc...

Any help would help.

thanks in advance
Richard

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


> 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 use the data in the format you specify.

I love Mail::Sender and I'm actually in the middle of a module that 
simplifies even using that (if you can imagine),

Once done it will look like this:


#/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 $Error";

You can even make it html and add attachment inline or attached with one
simple hash entry.
ht => $htmlversionhere,
at => ...
Much easier to read and you can use it on any server. There's even a 
way to ammke the smtp ip address automaytic so you don'tr have to put 
a different one in each script, via the Mail::Sender default data.


For those interested kepp watching here: http://search.cpan.org/~dmuey/

HTH

DMuey

> with only one exception. I needed to use the -t option. Here
> is the revised version which worked for
> me:
> 
> #/usr/bin/perl
> use strict;
> use warnings;
> 
> my $mailprog = '/usr/sbin/sendmail -t'
> my $empemail='[EMAIL PROTECTED]';
> my $inquirer='[EMAIL PROTECTED]';
> 
> #EMAIL
> open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
> print MAIL "To: $empemail\n"; print MAIL "Reply-To: 
> $inquirer\n"; print MAIL "From: $inquirer\n"; print MAIL 
> "Subject: Inquiry Response Request\n\n"; print MAIL 
> <<"PrintTag"; Please respond to the following inquiry: blah 
> blah blah, message here PrintTag close(MAIL);
> 
> --end code--
> 
> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
> print MAIL
> > "To: $empemail\n"; print MAIL "Reply-To: $inquirer\n"; print MAIL 
> > "From: $inquirer\n"; print MAIL "Subject: Inquiry Response 
> > Request\n\n"; print MAIL <<"PrintTag";
> > Please respond to the following inquiry:
> > blah blah blah, message here
> > PrintTag
> > close(MAIL);
> >
> >
> > At 07:14 PM 10/3/2003, you wrote:
> >>I need to send a mail from the cgi. It must be able to have
> a reply or
> >>sender as someone different from the local web owner (apache). My
> >>configuration:
> >>  redhat 9/qmail/vpopmail
> >>
> >>  The example below

RE: cgi mail script anyone?

2003-10-07 Thread Roberts Mr Richard L
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 $ssh->cmd("cd $site); #does not change directory tested using
"cmd("pwd")"
print $ssh->cmd("cp $filename");

etc...

Any help would help.

thanks in advance
Richard

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


> 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 use the data in the format you specify.

I love Mail::Sender and I'm actually in the middle of a module that 
simplifies even using that (if you can imagine),

Once done it will look like this:


#/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 $Error";

You can even make it html and add attachment inline or attached with one
simple hash entry.
ht => $htmlversionhere,
at => ...
Much easier to read and you can use it on any server. There's even a 
way to ammke the smtp ip address automaytic so you don'tr have to put 
a different one in each script, via the Mail::Sender default data.


For those interested kepp watching here:
http://search.cpan.org/~dmuey/

HTH

DMuey

> with only one exception. I needed to use the -t option. Here 
> is the revised version which worked for
> me:
> 
> #/usr/bin/perl
> use strict;
> use warnings;
> 
> my $mailprog = '/usr/sbin/sendmail -t'
> my $empemail='[EMAIL PROTECTED]';
> my $inquirer='[EMAIL PROTECTED]';
> 
> #EMAIL
> open (MAIL, "|$mailprog") || die "Can't open mailprog.\n"; 
> print MAIL "To: $empemail\n"; print MAIL "Reply-To: 
> $inquirer\n"; print MAIL "From: $inquirer\n"; print MAIL 
> "Subject: Inquiry Response Request\n\n"; print MAIL 
> <<"PrintTag"; Please respond to the following inquiry: blah 
> blah blah, message here PrintTag close(MAIL);
> 
> --end code--
> 
> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n"; 
> print MAIL 
> > "To: $empemail\n"; print MAIL "Reply-To: $inquirer\n";
> > print MAIL "From: $inquirer\n";
> > print MAIL "Subject: Inquiry Response Request\n\n";
> > print MAIL <<"PrintTag";
> > Please respond to the following inquiry:
> > blah blah blah, message here
> > PrintTag
> > close(MAIL);
> >
> >
> > At 07:14 PM 10/3/2003, you wrote:
> >>I need to send a mail from the cgi. It must be able to have 
> a reply or 
> >>sender as someone different from the local web owner (apache). My
> >>configuration:
> >>  redhat 9/qmail/vpopmail
> >>
> >>  The example below will be typically what I want:
> >>
> >>To: [EMAIL PROTECTED]
> >>From: [EMAIL PROTECTED]
> >>Subject: "hello support test"
> >>this is a test
> >>with all your support
> >>
> >>I see alot of parts but can't get it working.
> >>can someone put a little script together that does this?
> >>
> >>thanks,
> >>-rkl
> >>
> >>--
> >>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]
> 
> 

-- 
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]