Re: [perl implemn] Re: history of remotely issued CLI programs and related info

2011-10-28 Thread p sena
Actually the password is needed for the program which runs on machineB (progB). 
Well, we can prompt for passwd when the first program (progA) runs on machineA 
and then pass it to the progB. But in this method we will have to pass it as 
cli option to machineB prog which I do not want to. Hence there remains another 
method of feeding this passwd to that progB. What is/are that/they ?
So instead of of all these I let the progB prompt for passwd. This specific 
passwd asking external/separate prog I exec internally from within that progB. 
From machineA when I do ssh machineB prog_in_machineB. So that prompt 
appears to me here in machineA.
This way the password is not being captured  stored in any variable in progA 
at least. Actually only progB requires that password for it's task.

--- On Thu, 10/27/11, claus.k...@googlemail.com claus.k...@googlemail.com 
wrote:
Why Not prompt for the password on machine a at the beginning?

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [perl implemn] Re: history of remotely issued CLI programs and related info

2011-10-27 Thread p sena
What I did is, removed the facility of taking passwords as CLI options totally. 
I just have to prompt for it and user will supply it in the prompt. So I 
construct the command in machineA and push that command to machineB via ssh. 
Then machineB actually run one program and from it exec's another one 
credentials accepting program which propagates and appear in my terminal (in 
machineA). Here I supply the credentials and it goes Ok
Should this be Ok? Any advice pls?

THanks.
--- On Sun, 10/23/11, claus.k...@googlemail.com claus.k...@googlemail.com 
wrote:
Why Not just use ssh options? Ssh Server 'docommand' check Password on machine 
a and then sudo to a generic user who has ssh Keys for machine b and executes 
then. 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[perl implemn] Re: history of remotely issued CLI programs and related info

2011-10-22 Thread p sena
Adding to the original below. Even of in the history it doesn't show up 
depending on the setup  type. But it will definitely show up in the 'ps aux 
|grep command_name' output. So this command having some where option value as 
'--passwd someabcxyz' and run in machineB how will it be done in a way so that 
it is not reflected ?
One way will be to prompt for it which is already there. But in that case I may 
need the prompt of machineB to propagate down and appear as prompt in machineA. 
Not like now, which is machineA prompts, captures and pass it on as cli option 
and run in machineB. 

Hi,



This basically might not only be a programming related question but Unix one. I 
am issuing commands programatically remotely by executing a program 
from machineA which login to machineB and issues various commands there.
 These commands issued in machineB some of them holds sensitive info 
like passwd passed to the command as command line option values. However
 when i run the program in machineA i prompt for the passwd (it's not 
passed in as cli option value's). Then i capture this in a variable in 
the program, construct the cmd and fire it in machineB. So I wonder 
whether this is safe ? Will the history or some logging info in machineB
 will get to know this ?

Can someone pls throw some light. Any alternatives ?



TIA.___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex like option *values*

2011-03-04 Thread p sena
  __DATA__
  abc0[1-9].ctr.[pad,spd].set.in
  abc[01-22].ctr.[pad,spd].set.in
  abcL[1,2,3].ctr.[pad,spd].set.in
  abcL[1,2,3].ctr.[pad,spd].set.in
  abcL[1,2,3].ctr.[70,001].set.in
 
 ---
 
  It should work for lists of ranges, and ranges of
 strings as well as
  numbers.
 
  Regarding incorporating into Getopt::Long, see the
 Tips and Tricks
  section of the doco.

Brian,

Can this solution be generalized in a way to support
--option_value=abc0[1-9].ctr.[pad,spd].set.in,xxx0[2-8].mmm.[rst,spd].afr.org 
types?
Means those _DATA_ lines all appear in one line separated by comma as above 
(instead of newline separated). Should it be efficient to do in the 
expand_string() or from the main while iteration just before calling 
expand_string.


  
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex like option *values*

2011-03-04 Thread p sena
   __DATA__
   abc0[1-9].ctr.[pad,spd].set.in
   abc[01-22].ctr.[pad,spd].set.in
   abcL[1,2,3].ctr.[pad,spd].set.in
   abcL[1,2,3].ctr.[pad,spd].set.in
   abcL[1,2,3].ctr.[70,001].set.in
  
  ---
  
   It should work for lists of ranges, and
 ranges of
  strings as well as
   numbers.
  
   Regarding incorporating into Getopt::Long,
 see the
  Tips and Tricks
   section of the doco.
 
 Brian,
 
 Can this solution be generalized in a way to support
 --option_value=abc0[1-9].ctr.[pad,spd].set.in,xxx0[2-8].mmm.[rst,spd].afr.org
 types?
 Means those _DATA_ lines all appear in one line separated
 by comma as above (instead of newline separated). Should it
 be efficient to do in the expand_string() or from the main
 while iteration just before calling expand_string.

Replying back with a solution I can see. In case of such option value supplies 
it becomes difficlut to do the similar thing as below-
GetOptions (library=s = \@libfiles);
   @libfiles = split(/,/,join(',',@libfiles));

Such mixed strings can be parsed and returned as a list as below. In our 
context, to be called from the main before the while iteration. After that this 
list's elems can be passed on to the expand_xxx routine(s) one by one.

# Arg- A string which is the option value like
#abc0[1-9].ctr.[pad,spd].set.in,xxx0[2-8].mmm.[rst,spd].afr.org,some more 
values...
sub parse_mix_strings {
my @x = split (//, $_[0]);
my $bracket_close;
my $bracket_open;
my @elems;
my @hstrings;
for (@x) {
push @elems, $_;
if ($_ eq '[') {
$bracket_open = 1;
}
if ($_ eq ']') {
if ($bracket_open == 1) {
$bracket_close = 1;
$bracket_open = 0;
}
}
if ($_ eq ','  !$bracket_open  $bracket_close) {
$elems[$#elems] =~ s/,//;
push @hstrings, join(,@elems);
@elems = ();
}

}
push @hstrings, join(, @elems);
return@hstrings;
}

On *another note* leveraging use of the Getopts::Long can be this way I think ?

my %list;
GetOptions('list=s%' =
  sub { print 1 = $_[1] 2 = $_[2]\n; 
push(@{$list{$_[1]}}, expand_string($_[2])) });

print Elems = , scalar @{$list-{add}}, \n; # debug
print  , @{$list{add}}, \n; # debug
skip

And program can be called as - prog_name.pl --list add=abc0[1-2].src.spd.in 
--list add=volvo[1-5].jeep.sch.edu


~TIA


  
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex like option *values*

2011-03-03 Thread p sena
 __DATA__
 abc0[1-9].ctr.[pad,spd].set.in
 abc[01-22].ctr.[pad,spd].set.in
 abcL[1,2,3].ctr.[pad,spd].set.in
 abcL[1,2,3].ctr.[pad,spd].set.in
 abcL[1,2,3].ctr.[70,001].set.in
 ---
 
 It should work for lists of ranges, and ranges of strings
 as well as numbers.
 
 Regarding incorporating into Getopt::Long, see the Tips and
 Tricks section of the doco.
 
 HTH 
 --
 Brian Raven

Thanks Brian,

This solution should work only for brackets irrespective of numbers or strings 
inside them right? The curly braces are not required it seems.

This feature is not there in Getopt::Long and can this be implemented in it or 
it is configurable from it?

Thanks.



  
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


regex like option *values*

2011-03-02 Thread p sena

Hi,

I want to use option and values like:-

--option_name abc0[1-9].ctr.{pad,spd}.set.in

or --option_name abc[01-22].ctr.{pad,spd}.set.in
 
or --option_name abcL{1,2,3}.ctr.{pad,spd}.set.in

or --option_name abcL[1,2,3].ctr.{pad,spd}.set.in

or --option_name abcL{1,2,3}.ctr.{70,001}.set.in

etc possibilities. This should in fact expand those option values into the 
right number of values/quantities i,e; --option_name will hold multiple values. 
Instead of supplying values one after another I just want to club them in a 
regex like style. I am already using Getopt::Long.

What could be best way to handle this type of passing option values? Is there 
any existing module for this ?

~TIA


  
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


open -| issue

2010-10-21 Thread p sena

I have an issue seen from the below piece of code i a program-

In some iteration below code is there in a program
skip
open OUT, '-|', 'program001.pl', '--field=4,5', '--match=3,80', --host=$host
or die Couldn't run program001.pl: $!;
   ## if some print of $?  $?8 done here...
if ($?8 != 0) { close OUT; print STDERR FAILED!!\n; exit 1; }
...
skip
When i send wrong argumnts to the program001.pl it prints to STDERR and exit 1.
Now, from the above piece of code for the first time when the program001.pl is 
called and when i print the $? and $?8 i can see 0 and 0 respectively and the 
immediate next ones are printed as 256 and 1 and again 256 and 1 and 
againThese are ok. But why the first set is 0,0 ?


Thanks,
ciao


  
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: .pl to DLL creation

2010-03-24 Thread p sena
could this be solved by converting the .pl to an exe.



--- On Wed, 3/24/10, Kprasad kpra...@aptaracorp.com wrote:


From: Kprasad kpra...@aptaracorp.com
Subject: .pl to DLL creation
To: perl-win32-users@listserv.ActiveState.com
Date: Wednesday, March 24, 2010, 11:09 AM





Hi All
 
Could anyone tell me that what is process to create DLL file from perl script 
(.pl) file?
 
Kanhaiya Prasad
-Inline Attachment Follows-


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



  ___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


long lasting command execution from cgi

2008-12-04 Thread p sena

Hi,

I wonder whether I can query on Unix Perl here. However I would appreciate if 
someone please try to shed some light on-

I want to execute a command/program almost 160-200 times supplying it set of 
arguments each time and will gather the output so that I can display all of 
them in the browser to the user.
Now this program when executed by hand takes 4-5 minutes to complete and when i 
redirect the o/p to a file i gather those required info which i wish to display 
in the browser.
My question is what is the best idea(design) to achieve a solution assuming 
that this problem is a Perl-CGI application on solaris with apache.

Cheers~

  Regards  Thanks


  

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


query on dynamic

2008-12-02 Thread p sena
Hi,

Could someone pls explain me behind the hood thing for --
$x = 041
$y = 12
then $z = $x + $y, how this comes to be numeric addition. This will also be 
seen for any number of those initial zeros in $x and may also exist in similar 
way in $y too. I believe this comes for dynamic languages prop ? If this is so 
then can one do arithmetic(inclusive of comparison tests) freely on such 
situations, without taking into concern whether the $x (for example) above 
comes with zero perpended (for cases of digits from 0-9) or is a two digit 
number itself (like numbers  10) ? I mean I can do 04 + 12, 00104 + 01, 0101 + 
2.50, 044.25 + 02.50 etc..

Cheers-

  Regards  Thanks


  

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Reading hash arrays in the order it was written

2008-11-19 Thread p sena

Hi, 

I think the key's of the midtlinfo hash are not seen/get in the order you have 
populated it before, if iam not wrong. If so then a customized compare func 
could applied (on same terms when ordering by certain columns from tbl was 
done) while reading from the hash.


Cheers/


--- On Wed, 11/19/08, Fish, David [EMAIL PROTECTED] wrote:

 From: Fish, David [EMAIL PROTECTED]
 Subject: Reading hash arrays in the order it was written
 To: [EMAIL PROTECTED], perl-win32-users@listserv.ActiveState.com, [EMAIL 
 PROTECTED]
 Date: Wednesday, November 19, 2008, 9:27 PM
 Hello!  The problem I am having is I am pulling data from a
 table in a
 certain order and loading it into the hash array but when I
 read the
 hash array it comes out in a different order than it is
 written.  What I
 have done as a work around, is the read the data from a
 file that has it
 in the correct order.  Is there away to build the hash so
 that it reads
 in the order it was created?  
 
  
 
 Key creation and hash build:
   select statement ordering by certain columns
   ..
   
   $key =
 sprintf(%04d%07d%07d,$chk_num,$trans_seq,$dtl_seq);
   $midtlinfo{$key} =
 sprintf(%d|%d|%s|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%s|%s|%d|%d|%0.2f|%0.
 2f|%0.2f,
   $se_chk_mi_seq,
   $obj_num,
   $business_date,
   $chk_num,
   $trans_seq,
   
   );
 
 Reading of the hash:
 foreach $mk (keys %midtlinfo)
  @mrec = split(/\|/,$midtlinfo{$mk});
 

 
 }
 
 David Fish
 Senior Systems Analyst
 Property Systems Services
 Work (301) 380-3331
 Fax (301) 644-7521
 BlackBerry (301) 646-8985
 [EMAIL PROTECTED]
 ___
 ActivePerl mailing list
 [EMAIL PROTECTED]
 To unsubscribe:
 http://listserv.ActiveState.com/mailman/mysubs


  

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: info on Perl IDE and debugger in WindowsXP

2008-09-24 Thread p sena

Thanks everybody. I opted for vim and plain debugger in my XP. Works great for 
me;)


  Regards  Thanks  Prabir Senapati  mailto: [EMAIL PROTECTED]


--- On Tue, 9/23/08, Mary [EMAIL PROTECTED] wrote:

 From: Mary [EMAIL PROTECTED]
 Subject: Re: info on Perl IDE and debugger in WindowsXP
 To: Brian Raven [EMAIL PROTECTED]
 Cc: perl-win32-users@listserv.activestate.com 
 perl-win32-users@listserv.activestate.com
 Date: Tuesday, September 23, 2008, 11:18 PM
 Brian Raven wrote:
  Angelos Karageorgiou  wrote:
 
  Brian Raven wrote:
 
  Personally I just use an editor that I like
 (xemacs), and the
  command line debugger.
 
  HTH
 
 
 
  Dunno about you , but I have found the syntax
 highlighting abilities
  of vim wonderful, it even has a windows version (
 gvim )
 
 
  There's no accounting for taste. Oh well, each to
 their own :-)
 
 
  As for debugging , any suggestions for threads
 debugging are welcome.
 
 
  The good old print statement. Likely to be less
 intrusive in the face of
  timing related issues than an interactive debugger.
 
 I use Perl Express. It makes mistakes in colour coding
 regexes but
 appart from that I found it OK,
 after setting the colour code to my liking.
 
 Mary
 
 
 
 
 Vinsamlega athugið að upplýsingar í tölvupósti
 þessum og viðhengi eru eingöngu ætlaðar þeim sem
 póstinum er beint til og gætu innihaldið upplýsingar sem
 eru trúnaðarmál. Sjá nánar: http://www.ru.is/trunadur
 
 Please note that this e-mail and attachments are intended
 for the named addresses only and may contain information
 that is confidential and privileged. Further information:
 http://www.ru.is/trunadur
 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe:
 http://listserv.ActiveState.com/mailman/mysubs


  

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


info on Perl IDE and debugger in WindowsXP

2008-09-23 Thread p sena
Hi All,

Could someone please suggest me the good Perl IDE for Windows XP and a debugger 
to use. I have been using same for long time in Unix OS's and have been 
sticking to it, untill now on a specific work demand.

Cheers.

  Regards  Thanks  Prabir Senapati  mailto: [EMAIL PROTECTED]


  

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs