Re: Net::SFTP causes script to exit if connection can't be made

2002-12-12 Thread Mark Goland
how about #/usr/bin/perl -w > > use strict; > use Net::SFTP; > my ($sftp) = Net::SFTP->new("10.25.3.150", user=>"administrator", password=>"suite100") || warn "connection failed $!"; > if (!$sftp) { > print "I can't connect!"; > } else { > print "SUCCESS!"; > } > - Or

RE: Regex question

2002-12-12 Thread Johnstone, Colin
Thanks Mate, worked like a treat. Colin -Original Message- From: Aman Thind [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 16:39 To: Johnstone, Colin Subject: RE: Regex question Just add another backslash to the "Substitute With" part of the expression as in : $paragraph =

Regex question

2002-12-12 Thread Johnstone, Colin
Gidday all, I have a paragraph of text, I want to convert any double quotes around quoted text to \" is this the correct reg ex $paragraph =~ s{\"}{\\"}g; Thanking you in anticipation Colin Johnstone

Re: [mail_lists] RE: Perl Cgi/ Why?

2002-12-12 Thread Jim
On Thursday 12 December 2002 11:35, Paul Kraus wrote: I can think of a few things to say to these comments: | So its more of a cost justification then it is for functionality. Not for everyone. I will *never* use an m$ product for cgi...ever. Using an m$ product for cgi at this point and time

declaring variables

2002-12-12 Thread Mariusz
In one of my scripts I have lots of variables to declare. I wanted to type them in groups instead of one long line but I think dividing my lines trough the use of the ENTER key stops the script from working. (Although when I check the syntax through "perl - c script.cgi" it gives me OK). Basica

RE: stripping characters from a variable

2002-12-12 Thread Mark Anderson
> Hello. I have a logfile in which every message begins with a timestamp (ex. - 20012091500). I would like to be able to remove the last 4 characters (1500) off each of these to derive the date only (2001209). It works by chopping of each character individually, but I would like to know if there is

RE: stripping characters from a variable

2002-12-12 Thread Timothy Johnson
You can try something like this: if($ts =~ /^(\d{8})/){ #get eight sequential digit chars print "$1\n"; }else{ print "Time stamp format invalid!\n"; } -Original Message- From: Jose Malacara [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 4:26 PM To: [EMAIL PR

Re: stripping characters from a variable

2002-12-12 Thread Wiggins d'Anconia
perldoc -f substr http://danconia.org Jose Malacara wrote: Hello. I have a logfile in which every message begins with a timestamp (ex. - 20012091500). I would like to be able to remove the last 4 characters (1500) off each of these to derive the date only (2001209). It works by chopping of each

stripping characters from a variable

2002-12-12 Thread Jose Malacara
Hello. I have a logfile in which every message begins with a timestamp (ex. - 20012091500). I would like to be able to remove the last 4 characters (1500) off each of these to derive the date only (2001209). It works by chopping of each character individually, but I would like to know if there i

Net::SFTP causes script to exit if connection can't be made

2002-12-12 Thread Ian Zapczynski
All, I just pulled down the latest Net::SFTP from CPAN and am using it w/ Perl 5.6.1. I've used the module before and don't *think* I've seen this problem, but I can't say for sure and have only one machine to test it on. What happens is that if an SFTP connection is refused to the specified

RE: Perl Cgi/ Why?

2002-12-12 Thread Peter Kappus
Good points everyone! And while this IS more of a beginners-cgi question, here's my two cents anyway... Lately, I have myself have been re-evaluating my use of perl in a CGI context since, PHP is so ideally suited towards perl-like tasks and already has a vast library of prebuilt functions for e

Re: Perl Cgi/ Why?

2002-12-12 Thread Wiggins d'Anconia
Paul Kraus wrote: So its more of a cost justification then it is for functionality. It seem Perl and cgi would generate a greater overhead. I have no lover of Microsoft but in my business I have to choose the right tool not necessarily the "Moral" tool :) That would be putting words in my mouth,

Re: error with external command

2002-12-12 Thread John W. Krahn
Sam Harris wrote: > > I am having hard time figuring out why one of my lines is not working: > > system"find . -ctime -1 -exec cp {} > /opt/WWW/web_stats/logs/daily/newfiles \"; > > the error is that : > Unquoted string "opt" may clash with future reserved word at > ./process_web_log_files.pl li

Re: obtaining a process ID.

2002-12-12 Thread John W. Krahn
Be Gomes wrote: > > I am familiar with ps, this is how I am currently getting the process ID: > > #!/usr/bin/perl -w > use strict; > my $pid = `ps -axo pid,ucomm |grep proxyd|cut -f 1 -d \"p\"`; > > But I was wondering if anyone new another means of doing so. If you have the pgrep command: my

RE: disk stats

2002-12-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Did a search of old messages and found this one. I pasted it in a file as is and ran it from my computer and worked fine. A possible starting point for you. Wags ;) == - Original Message ---

disk stats

2002-12-12 Thread Thomas Browner
Is there away that I can get disk stats from a windows machine using perl? Thomas Browner

Spreadsheet::ParseExcel Problem

2002-12-12 Thread Balint, Jess
Hi all. I send this today to ask what in the world is going on with my program. I am getting the following error: Argument "" isn't numeric in le at (eval 4099) line 2. Argument "" isn't numeric in le at (eval 4100) line 2. Argument "" isn't numeric in le at (eval 4101) line 2. Line 2 of my progr

RE: Perl Cgi/ Why?

2002-12-12 Thread NYIMI Jose (BMB)
You can even eat both apple and orange :) Then you gain the *Power*? of .NET and the Flexibility of Perl. See this archive : ==ARCHIVE From: Yevgeny Menaker ([EMAIL PROTECTED]) Subject: Perl inside .NET This is the only article in this thread View: Original Format Newsgroups: perl.beginners

RE: Perl Cgi/ Why?

2002-12-12 Thread NYIMI Jose (BMB)
==ARCHIVE From: Todd Wade ([EMAIL PROTECTED]) Subject: Re: Perl X ASP View this article only Newsgroups: perl.beginners Date: 2002-06-20 13:45:17 PST Joao Silva wrote: > >Why should use CGI with Perl instead of ASP??? > This is sort of like asking why should I eat an apple instea

Re: error with external command..

2002-12-12 Thread Sam Harris
The way how it is in my code is on one line, the slash at the end has to be there on unix command line for it to work !!??? so the line is : system"find . -ctime -1 -exec cp {} /opt/WWW/web_stats/logs/daily/newfiles \"; Sam Harris, Internet Services Franklin University 201 S. Grant Avenue Colum

Re: obtaining a process ID.

2002-12-12 Thread zentara
On Wed, 11 Dec 2002 18:38:31 -0500, [EMAIL PROTECTED] (B-E-G Gomes) wrote: > >Looking for a simple method of getting a single process ID (for a >process such as syslogd) and store it in a scalar. > >I've found a few methods of doing so but they haven't been pretty. > >I'm taking suggestions :) ##

Re: checksum implementation in perl

2002-12-12 Thread Mystik Gotan
perldoc -f stat -- Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTECTED] From: <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: checksum implementation in perl Date: Thu, 12 Dec 2002 10:48:46 -0500 Hello, How do I compute the checksum of a binar

Re: Perl Cgi/ Why?

2002-12-12 Thread Mystik Gotan
I am running on Windows and don't have much to automate for my own. I am trying to write Perl scripts on the Internet for all the things I need. I could've choose PHP, but I began learning Perl and it wasn't a bad choice. I am sure everything done with PHP can be done with Perl. And Perl has muc

Re: Perl Cgi/ Why?

2002-12-12 Thread Dennis G. Wicks
Greetings; Mainly because of flexibility, but also because it is a technology that is widely and freely available and not proprietary. I commonly use one of several different platforms; Win-ME with Apache & ActiveState Perl, WinNT w/Apache & cygwin Perl, WinNT w/Apache & ActiveState Perl, one ISP

RE: Indexed man pages?

2002-12-12 Thread Beau E. Cox
Hi - There is plenty of perl documentation as html files with contents and hyperlinks. I don't know of any M$ help format documentation. Won't the html pages work for you? If you really really want them in help format, why don't you tackle the job as a perl project? :) Aloha => Beau. -Origi

RE: Perl Cgi/ Why?

2002-12-12 Thread Paul Kraus
That's just it I have not even looked at any of the things perl/cgi can do. I wanted to make sure it was worth the effort before doing it. Which is actually the heart of the original message. > -Original Message- > From: Brent Michalski [mailto:[EMAIL PROTECTED]] > Sent: Thursday, Decembe

process managing in Perl

2002-12-12 Thread Olivier Moulene
I have the pid of one running process and i want to kill it and all its children. What can i do to know the pids of every children ?

RE: Perl Cgi/ Why?

2002-12-12 Thread Brent Michalski
but, by using mod_perl, you eliminate a ton of overhead. Also, don't forget about tools such as HTML::Mason (http://www.masonhq.com) Brent

RE: Perl Cgi/ Why?

2002-12-12 Thread Paul Kraus
So its more of a cost justification then it is for functionality. It seem Perl and cgi would generate a greater overhead. I have no lover of Microsoft but in my business I have to choose the right tool not necessarily the "Moral" tool :) > -Original Message- > From: [EMAIL PROTECTED] [mail

RE: Perl Cgi/ Why?

2002-12-12 Thread wiggins
Possibly better asked to beginners-cgi, but in any case. ASP -> $$, M$ (and not just that it is an evil empire ;-), but portability) MONO -> vaporware Sun -> $$, apples and oranges? I am sure I will right a on this later, but for now those seem like 3 good quick reasons. http://danconia.org -

Re: checksum implementation in perl

2002-12-12 Thread Larry Coffin
>How do I compute the checksum of a binary file (and for that matter any >file) in Perl? Look at the Digest:: modules. There are a few different "checksums" they can calculate. I don't think any of them are the same as the unix "cksum" program, but if they don't need to be, you should be a

Perl Cgi/ Why?

2002-12-12 Thread Paul Kraus
With ASP.net, MONO, and sun implication why would someone still use Perl for website design. This is not a flame but simply asking for advice. I use Perl for reports and linux/unix/windows scripting. However what is to gain by using it for the web over these other technologies? What are some of the

checksum implementation in perl

2002-12-12 Thread William.Ampeh
Hello, How do I compute the checksum of a binary file (and for that matter any file) in Perl? What I am trying to automate the download of a set of files. Now what I will love to do is to check if a file has been modified since my last download. I thought a checksum check will be the best way,

Re: Sound

2002-12-12 Thread Mystik Gotan
Using cgi.pm, I suggest you use HTML to provide this interactivity, As Perl has no function for this. -- Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTECTED] From: "Jose Vicente Paredes Loor" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: <[EM

RE: Searchable archive?

2002-12-12 Thread Mystik Gotan
Hiya, most mailing lists (especially perl) are accessible through News Groups. You can acces news groups with Outlook (or any other), however, many are accessible through the internet. If I'm correct, they also have a search function, which is exactly what you're looking for. You declared as typ

RE: Indexed man pages?

2002-12-12 Thread wiggins
> man man ;-) sorry every unix newbie must hear it at least once. perldoc perl perldoc perltoc As the other poster mentioned, the web interface to CPAN is handy. http://danconia.org On Thu, 12 Dec 2002 06:16:03 -0800 (PST), Rob Richardson <[EM

RE: Indexed man pages?

2002-12-12 Thread Kipp, James
> > Another question showing my heritage as a programmer in the world > according to Microsoft: > > Poking around in the man pages seems to me to be a slow process, > especially for one who is new to the world of Perl. Has anyone > converted the man pages into the same kind of indexed help files

Indexed man pages?

2002-12-12 Thread Rob Richardson
Greetings! Another question showing my heritage as a programmer in the world according to Microsoft: Poking around in the man pages seems to me to be a slow process, especially for one who is new to the world of Perl. Has anyone converted the man pages into the same kind of indexed help files th

Re: Spreadsheet::ParseExcel date problem (year is being reformatted)

2002-12-12 Thread Mystik Gotan
$var =~ s/.{2}$//; # ? or + should do the trick easier (instead of {2} # but this shouldn't be as bad either. It just deletes the last 2 characters, no matter what characters they are. -- Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTE

Re: obtaining a process ID.

2002-12-12 Thread Sudarshan Raghavan
On Thu, 12 Dec 2002, Ramprasad A Padmanabhan wrote: > No Mystik he did not mean own PID he meant PID of any process > > the only way you can do it is with ps or send a mail to a unix group > for better ideas > > I always do this > > chomp($PID = `ps -ax |grep -v grep |grep $PROCESS | awk

Re: obtaining a process ID.

2002-12-12 Thread Ramprasad A Padmanabhan
No Mystik he did not mean own PID he meant PID of any process the only way you can do it is with ps or send a mail to a unix group for better ideas I always do this chomp($PID = `ps -ax |grep -v grep |grep $PROCESS | awk '{print $1}'`); Mystik Gotan wrote: #!usr/bin/perl -wT use strict;

Re: Perl Manuals for Modules

2002-12-12 Thread wiggins
On Thu, 12 Dec 2002 11:02:46 -, "Rob Dixon" <[EMAIL PROTECTED]> wrote: > Narayan > > In general, on Unix: > > perl -MCPAN -eshell > > then use 'h' for help, 'm /regex/' for a list of modules matching the regex. This appears to give you

RE: Where to find missing examples

2002-12-12 Thread Bob Showalter
> -Original Message- > From: David Eason [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 11, 2002 8:32 PM > To: [EMAIL PROTECTED] > Subject: Where to find missing examples > > > The perl module docs, in particular HTML:Parser and > HTML:PullParser, mention > examples in the eg dir

Re: obtaining a process ID.

2002-12-12 Thread Mystik Gotan
#!usr/bin/perl -wT use strict; print("$$"); OR #!usr/bin/perl -wT use strict; use English; print "$PID"; # or $PROCESS_ID. English.Pm simply changes a system variable into an english word.. -- Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTECTED]

RE: formatting output

2002-12-12 Thread Mystik Gotan
And sprintf(), format(). -- Bob Erinkveld (Webmaster Insane Hosts) www.insane-hosts.net MSN: [EMAIL PROTECTED] From: "Paul Kraus" <[EMAIL PROTECTED]> To: "'Mariusz'" <[EMAIL PROTECTED]>, "'perl'" <[EMAIL PROTECTED]> Subject: RE: formatting output Date: Thu, 12 Dec 2002 07:59:54

RE: formatting output

2002-12-12 Thread Paul Kraus
Also look up function printf. > -Original Message- > From: Mariusz [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 12, 2002 12:46 AM > To: perl > Subject: formatting output > > > I'm outputting lots of text into an email message. I would > like to have some basic control over the

Re: obtaining a process ID.

2002-12-12 Thread be.gomes
I am familiar with ps, this is how I am currently getting the process ID: #!/usr/bin/perl -w use strict; my $pid = `ps -axo pid,ucomm |grep proxyd|cut -f 1 -d \"p\"`; But I was wondering if anyone new another means of doing so. Thanks. -gomes On Thu, 12 Dec 2002 13:24:20 +0530 Ramprasad A Pad

Weekly list FAQ posting

2002-12-12 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

RE: No DB::DB routine defined (Error).

2002-12-12 Thread NYIMI Jose (BMB)
Give a look to this archive: http://archive.develooper.com/beginners%40perl.org/msg37783.html HTH, José. > -Original Message- > From: andres finlandes [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 12, 2002 12:18 PM > To: [EMAIL PROTECTED] > Subject: No DB::DB routine defined (Er

Re: How to get the biggest integers from an array?

2002-12-12 Thread Paul Johnson
On Wed, Dec 11, 2002 at 08:44:00PM -0500, Jeff 'japhy' Pinyan wrote: > On Dec 11, Paul Johnson said: > > >On Wed, Dec 11, 2002 at 10:52:53PM +0100, Jenda Krynicky wrote: > > > >> From: Rob Richardson <[EMAIL PROTECTED]> > >> > > >> > > @website[ > >> > > map $_->[0], > >> > >

Re: error with external command

2002-12-12 Thread Rob Dixon
Hi Sam I'm a Windows person so I can help a lot, but I assume the command isn't broken over two lines as it arrived to me? Also your backslash at the end (it is part of the command I presume) should be \\". As it is you've just escaped the closing double-quote to include it in the command string,

No DB::DB routine defined (Error).

2002-12-12 Thread andres finlandes
Hello all When i try debugging my application, this error message is shown: No DB::DB routine defined at C:/Perl/lib/Cwd.pm line 151. BEGIN failed--compilation aborted at C:/Perl/lib/Cwd.pm line 151. Compilation failed in require at ..\IDE_PERL/perl5db.pl line 39. BEGIN failed--compilation abor

Re: Perl Manuals for Modules

2002-12-12 Thread Rob Dixon
Narayan In general, on Unix: perl -MCPAN -eshell then use 'h' for help, 'm /regex/' for a list of modules matching the regex. On Windows: ppm Then 'h' for help, 'search subject' for a list of modules containing 'subject' in the name. HTH, Rob - Original Message - From: "N

RE: Spreadsheet::ParseExcel date problem (year is being reformatted)

2002-12-12 Thread NYIMI Jose (BMB)
$oSheetCR->Value #formatted value $oSheetCR->{Val} #original value José. > -Original Message- > From: Max [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 10, 2002 4:50 PM > To: [EMAIL PROTECTED] > Subject: Spreadsheet::ParseExcel date problem (year is being > reformatted) > > > W

Re: error with external command

2002-12-12 Thread Ramprasad A Padmanabhan
Sam Harris wrote: I am having hard time figuring out why one of my lines is not working: system"find . -ctime -1 -exec cp {} /opt/WWW/web_stats/logs/daily/newfiles \"; try system("find .-ctime -1-exec cp{} /opt/WWW/web_stats/logs/daily/newfiles "); on a single line and do not escape the la

Re: Please help !! Locking mail before delivery

2002-12-12 Thread Ramprasad A Padmanabhan
There seems to be no real clean way of doing this, I can think of two ways. 1) Modify your smtp server ( sendmail ) not to process the queue automatically. If you are using sendmail you would the start up script would have sendmail -bd -q5m remove the -q5m after the end of the processing cl

Re: Spreadsheet::ParseExcel date problem (year is being reformatted)

2002-12-12 Thread Max
My e-mail was changed, I use bold to highlight yy (02) and (2002). Somehow the [EMAIL PROTECTED] mailing list changed this to *yy* (*02*) and ** (*2002*). So the problem isn't the asteriks but that ParseExcel converts a four character year: to a two character year: yy Anybody now h

Where to find missing examples

2002-12-12 Thread David Eason
The perl module docs, in particular HTML:Parser and HTML:PullParser, mention examples in the eg directory, which I seem to be missing, although I do have an eg folder or two Using ActiveState perl 5.8.0 Thanks in advance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: What is \000?

2002-12-12 Thread Kevin Meltzer
\000 is a null character. Cheers, Kevin On Wed, Dec 11, 2002 at 12:38:49PM -0600, Dr. Poo ([EMAIL PROTECTED]) said something similar to: > What/when/where/how might one come across the ?character? '\000' -> that's > backslash followed by three zero's. > > I ask because i've just come acress a

error with external command

2002-12-12 Thread Sam Harris
I am having hard time figuring out why one of my lines is not working: system"find . -ctime -1 -exec cp {} /opt/WWW/web_stats/logs/daily/newfiles \"; the error is that : Unquoted string "opt" may clash with future reserved word at ./process_web_log_files.pl line 25. thanks for your help in advan

Re: manual bless

2002-12-12 Thread Ruth Albocher
Nigel Wetters wrote: > On Wed, 2002-12-11 at 13:55, Ruth Albocher wrote: > > I need to "cast" a scalar reference (SCALAR0x) into a reference to > > an object that I can use. (in other words, bless it). > > How can I do it? > > my $object = bless $scalar_reference, 'Your::Class'; > well, it's

Perl Manuals for Modules

2002-12-12 Thread Narayan Kumar
I am too new perl. How do I see a list of all the modules that are supported by my perl, and what do I do to "man" those modules. Narayan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Opinions - First Perl Script.

2002-12-12 Thread Rob Dixon
- Original Message - From: "Paul Kraus" <[EMAIL PROTECTED]> To: "'Perl'" <[EMAIL PROTECTED]> Sent: Wednesday, December 11, 2002 7:33 PM Subject: Opinions - First Perl Script. > This is my first real Perl program outside of the learning to Perl > exercises. Any thoughts, opinions, or sug