Re: Remove Newlines from String

2016-09-06 Thread Kenneth Wolcott
On Tue, Sep 6, 2016 at 9:11 AM, Matt wrote: > I am receiving log entries as a string and then writing them to a file > with the date tacked on beginning. Problem is that sometimes the > string I receive contains \n and it makes parsing the file with grep > more difficult. Looking for a simple wa

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-20 Thread Kenneth Wolcott
On Mon, Jun 20, 2016 at 10:40 AM, Shlomi Fish wrote: > Hi Chris, > > On Mon, 20 Jun 2016 11:28:57 -0600 > Chris Fedde wrote: > >> Kenneth, >> >> Below the cut is my example implementation as I understand your >> requirements. >> Note that the "compare" routine uses $a and $b which are "special" t

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-17 Thread Kenneth Wolcott
On Fri, Jun 17, 2016 at 2:33 PM, Kenneth Wolcott wrote: > Hi; > > I'm having trouble understanding the built-in Perl sort with regards > to mixed numbers and strings > > I'm looking at http://perldoc.perl.org/functions/sort.html > > I have an array that I w

having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-17 Thread Kenneth Wolcott
Hi; I'm having trouble understanding the built-in Perl sort with regards to mixed numbers and strings I'm looking at http://perldoc.perl.org/functions/sort.html I have an array that I want to have sorted numerically and descending. The array is composed of elements that look like the fo

how to perform file and directory metadata tests/queries in Perl with elevated privs?

2016-04-21 Thread Kenneth Wolcott
Hi; I try not to run my scripts with elevated privilege. But sometimes files, directories and filesystems need to be accessed via elevated privilege. So how to do this? If I'm logged in as an ordinary user and run a script (manually or under crontab), the "-d", "-f", "-r" type of file m

Re: how to install WWW::Salesforce::Simple on a Mac? cpanm refuses to install Crypt::SSLeay

2016-04-14 Thread Kenneth Wolcott
On Sat, Apr 9, 2016 at 5:39 AM, Shlomi Fish wrote: > Hi Ken, > > welcome aboard. > > please reply to all recipients. > > On Fri, 8 Apr 2016 17:36:47 -0700 > Kenneth Wolcott wrote: > >> Hi; >> >> How to install WWW::Salesforce::Simple on a M

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
On Wed, Apr 13, 2016 at 7:13 PM, Ken Slater wrote: > > On Wed, Apr 13, 2016 at 9:29 PM, Kenneth Wolcott > wrote: >> >> Hi; >> >> I have the following output from Data::Dumper and I want to extract >> the first string that the "Id" n

How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
Hi; I have the following output from Data::Dumper and I want to extract the first string that the "Id" name points to. $VAR1 = [ bless( { 'Id' => [ '01tC003udXAIAY', '01tC003udXAIAY'

how to install WWW::Salesforce::Simple on a Mac? cpanm refuses to install Crypt::SSLeay

2016-04-08 Thread Kenneth Wolcott
Hi; How to install WWW::Salesforce::Simple on a Mac? cpanm refuses to install Crypt::SSLeay I need to use the WWW::Salesforce::Simple Perl module on an El Capitan Mac. I installed cpanm. I tried to install WWW::Salesforce::Simple, but cpanm bails out because of Crypt::SSLeay. Is ther

Perl sort for reverse numeric if numbers and text are in a string, numbers first

2016-03-08 Thread Kenneth Wolcott
Hi; How do I call the built-in Perl sort function on an array of strings where the string is composed of one or more digits, followed by a tab which is followed by a string and I want the results to be sorted in reverse numeric order? I looked at http://perldoc.perl.org/functions/sort.html an

What is the Perl equivalent of "net user username \domain" if I am on Linux or Mac?

2016-03-07 Thread Kenneth Wolcott
Hi; What is the Perl equivalent of "net user username \domain" if I am on Linux or Mac? None of our Linux or Mac machines are a member of the specific domain in question. Do have to obtain the name of the AD/LDAP server and obtain some kind of credentials for me to inquire about a specific

Can the Perl module Date::Calc be added to Cygwin please?

2016-02-28 Thread Kenneth Wolcott
Hi; Can the Perl module Date::Calc be added to Cygwin please? Thanks, Ken Wolcott -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: preventing concurrency between five different perl scripts

2016-02-24 Thread Kenneth Wolcott
On Wed, Feb 24, 2016 at 9:10 AM, Shawn H Corey wrote: > On Wed, 24 Feb 2016 18:47:09 +0200 > Shlomi Fish wrote: > >> Hello Kenneth, >> >> On Tue, 23 Feb 2016 18:34:54 -0800 >> Kenneth Wolcott wrote: >> >> > Hi; >> > >> >

preventing concurrency between five different perl scripts

2016-02-23 Thread Kenneth Wolcott
Hi; This seems like a very simple concept, but I'm not getting it, so I'd like some help. So part of this is perl (not understanding readdir and/or glob well enough) and part of it is not getting the logic right. I have five perl scripts. I do not want any of them running concurrently a

bash file completion seems to fail for perl -d but works for perl -wc

2016-02-19 Thread Kenneth Wolcott
Hi; bash file completion seems to fail for perl -d but works for perl -wc This seems to be the case for Cygwin, Debian and Mac. Does anyone know how to add support for this or am I missing something simple? Thanks, Ken Wolcott -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addi

Re: sure would be nice if Perl had trace command built-in

2015-12-07 Thread Kenneth Wolcott
MJD/Devel-Trace-0.12/Trace.pm > > --Brock > > On Mon, Dec 7, 2015 at 9:39 PM, Kenneth Wolcott > wrote: >> >> On Mon, Dec 7, 2015 at 6:33 PM, Brock Wilcox >> wrote: >> > Give devel::trace or devel::tracemore a try :) >> >> Is it possible to install

Re: sure would be nice if Perl had trace command built-in

2015-12-07 Thread Kenneth Wolcott
On Mon, Dec 7, 2015 at 6:33 PM, Brock Wilcox wrote: > Give devel::trace or devel::tracemore a try :) Is it possible to install this from Active State repository without having an-up-date ActiveState Perl DevKit license? Thanks, Ken Wolcott -- To unsubscribe, e-mail: beginners-unsubscr...@perl.

Re: sure would be nice if Perl had trace command built-in

2015-12-07 Thread Kenneth Wolcott
On Mon, Dec 7, 2015 at 6:31 PM, Kenneth Wolcott wrote: > Hi; > > I've inherited a lot of Perl [mostly ActiveState] (and bash) scripts > were the former writers and maintainers did not use "use strict" and > "use warnings" and have other "less tha

sure would be nice if Perl had trace command built-in

2015-12-07 Thread Kenneth Wolcott
Hi; I've inherited a lot of Perl [mostly ActiveState] (and bash) scripts were the former writers and maintainers did not use "use strict" and "use warnings" and have other "less than Best Practices". Most of the scripts are executed on Windows and some of them are executed on a Mac and some are

Re: Will Strawberry Perl installation cause any conflicts with pre-existing Actoive State Perl on W2008 server?

2015-11-17 Thread Kenneth Wolcott
On Sat, Nov 14, 2015 at 11:54 AM, Kenneth Wolcott wrote: > On Fri, Nov 13, 2015 at 3:57 PM, wrote: >> -Original Message----- From: Kenneth Wolcott >> Sent: Saturday, November 14, 2015 6:11 AM >> To: Perl Beginners >> Subject: Will Strawberry Perl installation caus

Re: Will Strawberry Perl installation cause any conflicts with pre-existing Actoive State Perl on W2008 server?

2015-11-14 Thread Kenneth Wolcott
On Fri, Nov 13, 2015 at 3:57 PM, wrote: > -Original Message- From: Kenneth Wolcott > Sent: Saturday, November 14, 2015 6:11 AM > To: Perl Beginners > Subject: Will Strawberry Perl installation cause any conflicts with > pre-existing Actoive State Perl on W2008 server? >

Will Strawberry Perl installation cause any conflicts with pre-existing Actoive State Perl on W2008 server?

2015-11-13 Thread Kenneth Wolcott
Hi; Can I install Strawberry Perl on a W2008 Server without adversely affecting a currently installed Active State Perl? Thanks, Ken Wolcott -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Looking for introductory to advanced examples of RESTful programming in Perl

2015-08-11 Thread Kenneth Wolcott
Hello again; > take a look at > > http://www.todobackend.com/ > > you can port the mojolicious one to Dancer as a learning experience. Thank you for the tips... > You'd have to try any of the web framework for creating RESTful API > You can try Mojolicious > http://mojolicio.us/perldoc > Or you

Looking for introductory to advanced examples of RESTful programming in Perl

2015-08-11 Thread Kenneth Wolcott
Hello; I'm looking for introductory to advanced examples of RESTful programming in Perl preferably with some good explanations and best practices. Thanks, Ken Wolcott -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://lear

Re: Looking for the online example code that goes with Network Programming with Perl

2015-08-04 Thread Kenneth Wolcott
On Tue, Aug 4, 2015 at 2:14 PM, Kenneth Wolcott wrote: > Hi; > > I'm looking for the online example code that goes with Network > Programming with Perl. > > I purchased the book a long time ago and now I have time to go into > learning sockets in Perl, but I'd

Looking for the online example code that goes with Network Programming with Perl

2015-08-04 Thread Kenneth Wolcott
Hi; I'm looking for the online example code that goes with Network Programming with Perl. I purchased the book a long time ago and now I have time to go into learning sockets in Perl, but I'd sure like to have access to the example code that was originally placed on www.modperl.com/perl_netwo

Re: parsing string output that isn't CSV, but similar; what module would parse these kind of key-value pairs?

2014-12-16 Thread Kenneth Wolcott
On Tue, Dec 16, 2014 at 12:18 PM, Tiago Hori wrote: > Have you tried Text::CSV_XS? It allows you to set both the separatist and eol > and it also lets you use complex separators. > > T. > > Sent from my iPhone > >> On Dec 16, 2014, at 4:05 PM, Kenneth Wolcott >

parsing string output that isn't CSV, but similar; what module would parse these kind of key-value pairs?

2014-12-16 Thread Kenneth Wolcott
Hi; I've got some strings that I need to parse the value(s) off of the key. The key is (possibly) space-separated and terminate by a colon, and the value is delimited by single quotes. But there are (potentially) additional values for the key. Here is one real-world example (excerpt from th

how to create a text progress status line that updates on the same line in Perl?

2014-06-10 Thread Kenneth Wolcott
Hi All; how to create a text progress status line that updates on the same line in Perl? I know that this questions is probably not well-posed, but I hope you get what I'm after. I'd like to do what application installers do, describing the status, updating the status occasionally, but on the sa

Re: about open with pipe '-|', '|-'

2014-05-09 Thread Kenneth Wolcott
On Fri, May 9, 2014 at 1:41 PM, Harry Putnam wrote: > I guess I need a mnemonic device to trick myself into remembering > which way the pipe with dash symbol goes. Think of it as "producer" and "consumer". You could use your file handle variable to remind yourself instead of using just "$ch". H

Re: trying to get line-by-line output of a command pipe in perl

2013-12-26 Thread Kenneth Wolcott
On Thu, Dec 26, 2013 at 5:34 PM, John W. Krahn wrote: > Kenneth Wolcott wrote: >> >> Hello; > > > Hello Kenneth, > > > >>I'm trying to obtain line-by-line output from a command pipe in perl. >> >>Unfortunately, I am firmly h

trying to get line-by-line output of a command pipe in perl

2013-12-23 Thread Kenneth Wolcott
Hello; I'm trying to obtain line-by-line output from a command pipe in perl. Unfortunately, I am firmly held to 5.8.8 version of perl on this specific machine :-( Apparently, creating an array for my command prevents me from including the final pipe symbol when trying to use the three-argu

Re: Not following the action here.

2013-10-02 Thread Kenneth Wolcott
On Wed, Oct 2, 2013 at 9:23 PM, Harry Putnam wrote: > Why is this script showing uninitialized variable warnings? > > - -----=----- - > #!/usr/local/bin/perl > > use strict; > use warnings; > use File::Find; > > my $exe = 33261; > my $eperm; > my $f = shift; > > fin

Re: Perl file and STDERR

2013-07-10 Thread Kenneth Wolcott
On Wed, Jul 10, 2013 at 9:21 AM, Shawn H Corey wrote: > On Wed, 10 Jul 2013 10:49:37 -0500 > Andy Bach wrote: > >> On Wed, Jul 10, 2013 at 7:08 AM, Shawn H Corey >> wrote: >> >> > Auto-flush is a de-optimization. Don't set it. >> >> >> >> More "Best Practices" on autoflush (note, the original boo

Running into dependency hell with Cygwin when trying to install Excel-Writer-XLSX-0.65 and have all tests pass and not skipped

2013-03-08 Thread Kenneth Wolcott
Hi; I'm Running into dependency hell with Cygwin when trying to install Excel-Writer-XLSX-0.65 and have all tests pass and not skipped I wanted to experiment with Excel-Writer-XLSX-0.65 under Cygwin. During the: perl Makefile.PL + make + make test + make install install process, during make test

Re: Help in Perl

2012-05-07 Thread Kenneth Wolcott
On Sat, May 5, 2012 at 2:42 AM, S Peter wrote: > Hi > > I am S. Peter, a beginner in Perl program, working in XML files. I have a xml > files with the following coding. > > "$N$" > > I require a small script in perl to open any xml file and just copy and write > only the command starts with " in

Re: Help in finding group of text

2011-12-23 Thread Kenneth Wolcott
On Fri, Dec 23, 2011 at 21:34, Saravanan Murugaiah wrote: > Dear All, > > In my text file, the following occurrence are there: > > begin > some of group of text some of group of text some of group of text > some of group of text some of group of text some of group of text > some of group of text s

Re: module is installed but getting error

2011-11-22 Thread Kenneth Wolcott
On Tue, Nov 22, 2011 at 12:47, Rajeev Prasad wrote: > thanks, that was the quickest resolve for me on this LIST ever. thank you! > > From: Kenneth Wolcott > To: Rajeev Prasad > Cc: perl list > Sent: Tuesday, November 22, 2011 2:35 PM > S

Re: module is installed but getting error

2011-11-22 Thread Kenneth Wolcott
On Tue, Nov 22, 2011 at 12:31, Rajeev Prasad wrote: > getting this error: > > Can't locate Http/Cookies.pm in @INC (@INC contains: /etc/perl > /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 > /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 > /usr/local/lib/site_

Re: Sorting an extremely LARGE file

2011-08-07 Thread Kenneth Wolcott
On Sun, Aug 7, 2011 at 22:10, Ramprasad Prasad wrote: > [snip] > I guess there is a serious need for re-architecting , rather than > create such monstrous files, but when people work with legacy systems > which worked fine when there was lower usage and now you tell then you > need a overhaul be

Re: Rsync options not recognized by system function

2011-05-27 Thread Kenneth Wolcott
On Fri, May 27, 2011 at 12:10, Ezra Taylor wrote: > Hello All: >                My rsync options are not being recognized in the system > function.  I tried escaping the asterisks and single quotes to no avail. > Also, I do not want to install any rsync modules.  Your help will be much > appreciat

Re: proper syntax for command

2011-05-23 Thread Kenneth Wolcott
On Mon, May 23, 2011 at 23:17, Irfan Sayed wrote: > here is the actual code: > > use strict; > use warnings; > use Cwd; > chdir "L:\\Console"; > my $dir = getcwd(); > print "current dir is : $dir\n"; > my $res = system("dir"); > $res=system("devenv","/rebuild","release","abc.sln","/useenv"); > pri

Re: it told me that Can't open perl script " hello.p1" No such file or directory

2011-05-23 Thread Kenneth Wolcott
On Mon, May 23, 2011 at 00:20, Gang Cheng wrote: > hi, > >  I instaled my perl under the e:\r_software\perl. >  I wrote a hello world programme as below > > #! /usr/bin/perl > print “Hello,word!\n”; > > and save it under e:\ as perl.p1 > > but when I run it with the window commend line as > > > E:

Re: Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Kenneth Wolcott
Rob, buy a one-way express train ticket to hell. On Wed, May 18, 2011 at 15:53, Rob Dixon wrote: > On 18/05/2011 22:37, Kenneth Wolcott wrote: > >> On Wed, May 18, 2011 at 14:25, Rob Dixon wrote: >> >>> >>> That looks fine, except that all you have pri

Re: Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Kenneth Wolcott
> :-) Guess it is getting late in England as well then :-) > > Anyway... > > use strict; > use warnings; > > use Ec; > use XML::XPath; > use Data::Dumper; > > my $ec = Ec->new or die "Can not create Ec object $!\n"; > my $xPath; > $xPath = $ec->findObjects('job'); > print Dumper($xPath); > #my $ha

Re: Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Kenneth Wolcott
On Wed, May 18, 2011 at 14:25, Rob Dixon wrote: > On 18/05/2011 21:37, Kenneth Wolcott wrote: > >> >> A colleague claims that he made no changes, code worked yesterday >> and doesn't today. >> >> He is not using OO Perl. >> > > You say late

Re: Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Kenneth Wolcott
> Hi Kenneth, > > I think the error is clear on what is going wrong: *Error: Can't call > method "findnodes" on unblessed reference at line . > * > * > * > When you colleague calls: $xPath->findnodes('//job'); > > Perl tels him that $xPath is not an blessed reference. In human speak it > means he

Can't call method "findnodes" on unblessed reference; not using OO Perl

2011-05-18 Thread Kenneth Wolcott
Hi; A colleague claims that he made no changes, code worked yesterday and doesn't today. He is not using OO Perl. I have asked him for a small code snippet that reproduces the error (I'm sure he is unwilling to show the entire code!). We have rules requiring the standard use of "use str

Re: Help with regular expressions

2011-05-09 Thread Kenneth Wolcott
On Mon, May 9, 2011 at 12:04, Sandip Bhattacharya < sand...@foss-community.com> wrote: > On Mon, May 9, 2011 at 11:44 PM, Tiago Hori wrote: > > I am trying to write a small script to parse bibliographic references > like > > this: > > > > Morgan, M.J., Wilson, C.E., Crim, L.W., 1999. The effect o

Re: Password reset for unix

2011-05-02 Thread Kenneth Wolcott
On Mon, May 2, 2011 at 08:17, Jim Gibson wrote: > > At 10:46 PM -0400 5/1/11, shawn wilson wrote: >> >> jim, you setup your boxes a certain way to make sure this doesn't fail? > > > No. The systems are plain vanilla Red Hat Linux (old versions because they > run proprietary software). > >> >> so,

Re: perl call fortran

2011-05-01 Thread Kenneth Wolcott
On Sun, May 1, 2011 at 14:36, Patrick Dupre wrote: > > Hello, > > Is perl able to load a fortran subroutine ? > > I have no problem to make a c code callable by gcc (xs) > I can call a fortran routine from a c program. > But perl fails to load a so library linked with a piece of fortran. > > The e

Re: Password reset for unix

2011-05-01 Thread Kenneth Wolcott
On Sat, Apr 30, 2011 at 17:22, dolphin wrote: > Hi, > > To reset password in unix, the system will prompt 2 times for entering > the new password. The first time is to enter the new password and the > second time is to confirm the new password of the account. It is > tedious to perform this when

Re: devices without division

2011-04-20 Thread Kenneth Wolcott
On Wed, Apr 20, 2011 at 03:58, Saran wrote: > Here is the program > > use strict; > use warnings; > > my ($div,$reminder) = ÷_now(20,4); > print "Dividend: $div\nReminder: $reminder\n"; > > sub divide_now { >        my ($a,$b) = @_; > >        my ($s,$n); >        for($n=1;;$n++) { >              

Re: Locking NFS files using File::NFSLock

2011-04-11 Thread Kenneth Wolcott
On Mon, Apr 11, 2011 at 23:37, Parag Kalra wrote: > Hi, > > I was just exploring File::NFSLock to lock files on the NFS server but seems > like its not working. It ends up creating stale files and only option left > is to abort the script. I am testing it on NFSv3 > > Anybody had any success in us

how do make certain that no input (keyboard + mouse paste) is outside of 7-bit ASCII in a perl script?

2011-02-01 Thread Kenneth Wolcott
Hi; how do make certain that no input (keyboard + mouse paste) is outside of 7-bit ASCII in a perl script? Since I have no intention of correctly or completely handling input that is outside of 7-bit ASCII, I thought it would be best to prevent any characters outside of 7-bit ASCII from being inp

Re: doubt in substring

2011-01-15 Thread Kenneth Wolcott
On Sat, Jan 15, 2011 at 03:20, Dr.Ruud wrote: > On 2011-01-15 08:52, Emeka wrote: > >> rmicro@RMICRO-PC C:\Program Files\xampp >> # perl -le '$str =  "the cat sat on the mat";print substr( $str, 4, -4 )' >> Can't find string terminator "'" anywhere before EOF at -e line 1. > > On Windows it should

Re: Determining current function name

2010-12-30 Thread Kenneth Wolcott
On Thu, Dec 30, 2010 at 20:18, Parag Kalra wrote: > Thanks Shawn and Jim. caller(0) did the trick. > > Cheers, > Parag Did you even look at the output of "perldoc -f caller"? Apparently not. So when others tell you the same thing, then you thank them. Nice. Ken Wolcott -- To unsubsc

Re: Determining current function name

2010-12-30 Thread Kenneth Wolcott
On Thu, Dec 30, 2010 at 18:30, Parag Kalra wrote: > Hi, > > Just like $0 reveals the current script name is there any variable > using which I can find the current sub-routine I am currently in. > > Snippet of what I am looking for: > > use strict; > use warnings; > > sub foo_bar () { >    print "

Re: Split function

2010-11-29 Thread Kenneth Wolcott
Hi; >>   The reason one should use File::Basename and File::Spec is that you >> can become platform-independent instead of Windoze-worshipping :-) > > What does the operating system have to do with this? > > OP asked how to split a string, I gave an example how to do it character by > character.

Re: Split function

2010-11-28 Thread Kenneth Wolcott
Hi; On Sun, Nov 28, 2010 at 12:31, Dr.Ruud wrote: > On 2010-11-28 10:54, Chaitanya Yanamadala wrote: > >> How do i split a value like this >> F:\test\test123\test1233 > > For example: > > ruud$ perl -wle 'print for split //, q{F:\test\test123\test1233}' > F > : > \ > t > e > s > t > \ > t > e > s

Re: script for shutdown remote machine

2010-09-03 Thread Kenneth Wolcott
On Fri, Sep 3, 2010 at 23:18, Jyoti wrote: > yes > > On Sat, Sep 4, 2010 at 11:47 AM, Kenneth Wolcott > wrote: >> >> On Fri, Sep 3, 2010 at 23:11, Kenneth Wolcott >> wrote: >> > On Fri, Sep 3, 2010 at 22:40, Jyoti wrote: >> >> Dear All, &g

Re: script for shutdown remote machine

2010-09-03 Thread Kenneth Wolcott
On Fri, Sep 3, 2010 at 23:07, Jyoti wrote: > > Dear All, > Please Give me name of CPAN modules to write down perl script for shudown > remote >  machines. > > > On Sat, Sep 4, 2010 at 11:36 AM, Kenneth Wolcott > wrote: >> >> On Fri, Sep 3, 2010 at 22:40, Jy

Re: script for shutdown remote machine

2010-09-03 Thread Kenneth Wolcott
On Fri, Sep 3, 2010 at 23:11, Kenneth Wolcott wrote: > On Fri, Sep 3, 2010 at 22:40, Jyoti wrote: >> Dear All, >> Give me name of CPAN modules to write down perl script for shudown remote >> machines. >> > > You could buy one or more of Dave Roth's books.

how to sort in perl where the key is the 2nd of 3 components of a string where a dash is the separator?

2010-07-22 Thread Kenneth Wolcott
Hi; I have a legacy Perl script that I need to modify. The current output is a set of zero or more space separated strings where each substring is a string of of three dash-separated substrings. I want to sort these space separated strings based on the middle of the dash-separated substring.

Re: gsl/XS

2010-07-16 Thread Kenneth Wolcott
Hi Uri; Could you be a little more helpful and suggest just one of those many places to post a more advanced question that is too advanced for this mailing list? Perhaps perlmonks.org? Thanks, Ken Wolcott On Fri, Jul 16, 2010 at 19:17, Uri Guttman wrote: > > i have to say, segment faults, g

Re: Fork ssh

2010-06-18 Thread Kenneth Wolcott
Hi; I've been using IPC::Run3 from CPAN for about six months and it works great! Ken Wolcott

Re: Nested if and elsif and else

2010-04-13 Thread Kenneth Wolcott
Hi; On Tue, Apr 13, 2010 at 19:54, Uri Guttman wrote: >> "JG" == Jim Gibson writes: > >  JG> On 4/13/10 Tue  Apr 13, 2010  4:35 PM, "Mimi Cafe" > >  JG> scribbled: > >  >> I think this will work, but is it elegant.? > >  JG> Yes, it will work, and yes, it is elegant, as long as it encapsul

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Kenneth Wolcott
Hi Uri; On Mon, Mar 22, 2010 at 15:50, Uri Guttman wrote: > >>>>> "KW" == Kenneth Wolcott writes: > > KW> Hi Harry; > KW> On Mon, Mar 22, 2010 at 12:25, Harry Putnam > wrote: > > >> Harry Putnam writes:But even then I still got &g

Re: filter script read STDIN from named pipe >file

2010-03-22 Thread Kenneth Wolcott
Hi Harry; On Mon, Mar 22, 2010 at 12:25, Harry Putnam wrote: > Harry Putnam writes:But even then I still got what I > needed... or until someone tells me > its better to in this case not to use IO::Handle but stick with Jim > Gs' suggestion: > > select LOGNAME; > $|++; > select STDOUT; >

Re: Any Good SCM tool to manage Perl Code locally

2010-03-14 Thread Kenneth Wolcott
Hi; On Sun, Mar 14, 2010 at 23:12, Dan Fish wrote: > You might want to have a look at Seapine Surround. It's not opensource, > but you can get a free single-user license and it's a very good SCM program. > It's also available on a variety of platforms. > http://www.seapine.com/scmlicensing.h

would like "pure" Perl solution to count of files in directory (nested subdirectories too)

2010-03-13 Thread Kenneth Wolcott
Hi; Re: would like "pure" Perl solution to count of files in directory (nested subdirectories too) I would like to have a "pure" Perl solution to "find dir | wc -l" find2perl x * #! /usr/bin/perl -w eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; #$ru

Best Practices: define variables at the top or just prior to when they are referenced?

2010-02-04 Thread Kenneth Wolcott
Hi; Re: Best Practices: define variables at the top or just prior to when they are referenced? We don't have a formal Coding Standard in the CM/Build team I'm a part of. We have Solaris, Linux and Windoze platforms, but (gratefully!) most of the scripting is with the UNIX/Linux side rather

Re: listing all modules

2010-01-29 Thread Kenneth Wolcott
Hi; I must have found this somewhere on this mailing list or somewhere else. I wish I could give credit to who derived it. perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' Hope it helps, Ken Wolcott On Fri, J

Re: How to open a prorgam and stay in it until done..

2008-09-16 Thread Kenneth Wolcott
On Tue, Sep 16, 2008 at 4:40 PM, Sweet J <[EMAIL PROTECTED]> wrote: > > This is on a windows environment.. But we will be doing the same thing on > Linux as well... > > Hi; Please send your responses to the list, not just to me. I don't think I'm able to assist you further. I'm sorry that

Re: How to open a prorgam and stay in it until done..

2008-09-16 Thread Kenneth Wolcott
>wrote: > > Thats what I thought you might say. I have been told that we cannot ask > for that module.. so is there another way to go about doing this? > > > On Tue, Sep 16, 2008 at 11:14 AM, Kenneth Wolcott < > [EMAIL PROTECTED]> wrote: > > > Use the Expect m

Re: How to open a prorgam and stay in it until done..

2008-09-16 Thread Kenneth Wolcott
gt; Thats what I thought you might say. I have been told that we cannot ask > for that module.. so is there another way to go about doing this? > > > On Tue, Sep 16, 2008 at 11:14 AM, Kenneth Wolcott < > [EMAIL PROTECTED]> wrote: > >> >> Use the Expect module i

Re: How to open a prorgam and stay in it until done..

2008-09-16 Thread Kenneth Wolcott
Use the Expect module if the password is being handled below the tty layer. Ken Wolcott On Tue, Sep 16, 2008 at 6:29 AM, JMJ <[EMAIL PROTECTED]> wrote: > On Sep 15, 10:15 pm, [EMAIL PROTECTED] (Jeff Pang) wrote: > > 2008/9/15 JMJ <[EMAIL PROTECTED]>: > > > > > I need to open a program which I dec

Re: script to SFTP without NET::SFTP module

2008-09-12 Thread Kenneth Wolcott
On Fri, Sep 12, 2008 at 1:21 PM, kscott <[EMAIL PROTECTED]> wrote: > Does any one have a simple script to retrieve a file from a remote > server using SFTP? > > I can not use the net::stp module because I do not have the required > authority to add modules to our Perl interpeter. > > > -- > To uns

Re: Checking to see if file exists.

2008-07-29 Thread Kenneth Wolcott
On Tue, Jul 29, 2008 at 2:32 PM, tvadnais <[EMAIL PROTECTED]> wrote: > I am totally confounded by what appears to be a bug in the "does file > exist" > functionality. > > > > Here is the code as it stands now: > > my $tmpfile = substr ($file, 0, index($file, ".pgp")); > > print cwd(); ## d

Re: File and perl

2008-05-02 Thread Kenneth Wolcott
Now *THAT* is helpful! Descriptive yet succinct w/ references. Methodical. Awesome. --Ken Wolcott On Thu, May 1, 2008 at 6:13 PM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Thu, May 1, 2008 at 8:45 PM, Richard Lee <[EMAIL PROTECTED]> wrote: > snip > > ls -ltr | tail -100 | cut -d' ' -f13 > sni

Fwd: setting unix command through perl script

2008-04-16 Thread Kenneth Wolcott
Oops -- did reply and instead of reply-all :-( -- Forwarded message -- From: Kenneth Wolcott <[EMAIL PROTECTED]> Date: Wed, Apr 16, 2008 at 11:33 AM Subject: Re: setting unix command through perl script To: [EMAIL PROTECTED] Agreed that the parent process in which pe

What is the perl equivalent of a bash -xv? Verbose and expand while executing?

2008-03-13 Thread Kenneth Wolcott
Hi; What is the perl equivalent of a #!/bin/bash -xv? I'd like to have verbose (print each line prior to execution) and expand each variable prior to execution while executing? How do I run perl in debug mode non-interactively, dumping every variable when it gets modified? How do I get

Re: how to print " time " ???

2005-11-08 Thread Kenneth Wolcott
OTECTED]> wrote: > > i am with windows 2000advance server.. > and now iam downloading the "Activeperl" > what is the difference b\w AS package and MSI ??> > > *Kenneth Wolcott <[EMAIL PROTECTED]>* wrote: > > It works on my machine (Windows XP, S

Re: how to print " time " ???

2005-11-08 Thread Kenneth Wolcott
It works on my machine (Windows XP, SP2)... I wonder why perldoc works on my installation of Activestate perl when it doesn't on yours... C:\ perl -version This is perl, v5.8.7 built for MSWin32-x86-multi-thread (with 7 registered patches, see perl -V for more detail) Copyright 1987-2005, Larry