Re: Win32 script cannot read command line argument.

2007-05-02 Thread Vladimir Lemberg
Hi David, Thanks a lot! It works -) My association was "C:\Perl\bin\perl.exe" "%1" Vladimir - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]

Win32 script cannot read command line argument.

2007-05-02 Thread Vladimir Lemberg
Hi All, My script is unable to read argument when I'm executing it as: script.pl . However, when I'm running it as: perl script.pl - it works fine. I did associate perl scripts with Perl as explained in ActivePerl-Winfaq4.htm All my scripts, which doesnt require any arguments works file. I

Re: Capturing an external program return code

2007-05-01 Thread Vladimir Lemberg
Hi Tom, That was very helpful. Thanks a lot, Vladimir - Original Message - From: "Tom Phoenix" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]> Cc: Sent: Tuesday, May 01, 2007 5:36 PM Subject: Re: Capturing an external program return cod

Capturing an external program return code

2007-05-01 Thread Vladimir Lemberg
Hi All, My script is executing external program, which returns code i.e 0, -1, -2, -3 etc In case of error, I need to create log file according to error code. For example code -3 means missing input file use strict; use warnings; use Win32; system ( "$program -f $program.cfg" ); if ($? ==

Re: Win32::OLE packages

2007-03-27 Thread Vladimir Lemberg
eezePanes} = 1; ----- Original Message - From: "Vladimir Lemberg" <[EMAIL PROTECTED]> To: Sent: Tuesday, March 27, 2007 4:49 PM Subject: Re: Win32::OLE packages Hi to all, Sorry for asking the same question.. I beleave sombody have used win32:OLE module. From th

Re: Win32::OLE packages

2007-03-27 Thread Vladimir Lemberg
t;A2:B2"); Thanks in advance, Vladimir - Original Message - From: "Vladimir Lemberg" <[EMAIL PROTECTED]> To: Sent: Monday, March 26, 2007 4:22 PM Subject: Win32::OLE packages Hello All, Does anybody know which package in Win32:OLE will Freeze Panes and ca

Win32::OLE packages

2007-03-26 Thread Vladimir Lemberg
Hello All, Does anybody know which package in Win32:OLE will Freeze Panes and call Format Report method in excel document? Thanks in advance, Vladimir

Re: list of lists

2007-03-22 Thread Vladimir Lemberg
Hello Jeff, Your solution is perfectly working. Thanks a lot! BTW I've solved my as well. I had to put } $y++; } $y = $x; <- Here $x++; } I agree my code looks ugly -) Thanks, Vladimir - Original Message - From: "Jeff Pang" <[EMAIL PROTECTED]> To: &q

Re: list of lists

2007-03-22 Thread Vladimir Lemberg
I_Count (@list); $table[$x][$y] = [ $poi_num ]; } $y++; } $x++; } I have nothing when I print "$table[1][1]\n"; :-((( - Original Message - From: "Jeff Pang" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; Sent: Thu

list of lists

2007-03-22 Thread Vladimir Lemberg
Creating list of lists. Hi All, Could you help me to come up with idea how to generate list of lists on fly as follows: @LoL = ( ["state", "value", "value"], ["state", "value", "value"], ["state", "value", "value"],); State should be taken from hash

Re: capture stdin and stderr

2007-03-20 Thread Vladimir Lemberg
Hi David, Would you please send this portion to me? Thanks, Vladimir - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; Sent: Tuesday, March 20, 2007 3:54 P

capture stdin and stderr

2007-03-20 Thread Vladimir Lemberg
Hi All, My script is calling a Win32 program with two arguments: system ( "$ARGV[0]\\program.exe", $File::Find::name, "$ARGV[0]\\source"); I want to capture STDOUT and STDERR from the program to log file system ( "$ARGV[0]\\program.exe", $File::Find::name, "$ARGV[0]\\source", 1>"$ARGV

Re: pattern match

2007-02-12 Thread Vladimir Lemberg
David, Thanks you very much! It works -) - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; Sent: Monday, February 12, 2007 12:46 PM Subject: RE: pattern

pattern match

2007-02-12 Thread Vladimir Lemberg
Hi, I have a script, which suppose to find all *.xml files under the specified directory then process them. I'm facing the pattern match problem: use strict; use warnings; use Win32; use File::Find; @ARGV = Win32::GetCwd() unless @ARGV; my @dirs; find (\&FindXml, $ARGV[0]); sub FindXml {

Re: problem with assigning a value

2005-06-07 Thread Vladimir Lemberg
Thanks David! Works perfect with regex. -) - Original Message - From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: "Perl Beginners"

Re: problem with assigning a value

2005-06-07 Thread Vladimir Lemberg
works ok If I'll define them inside while loop, it wont work either. Vladimir - Original Message - From: <[EMAIL PROTECTED]> To: "Vladimir Lemberg" <[EMAIL PROTECTED]> Cc: "Perl Beginners" Sent: Tuesday, June

problem with assigning a value

2005-06-07 Thread Vladimir Lemberg
Hi, I have a problem with assigning value to string. I'll be really grateful if someone will help me. use strict; use warnings; use Cwd; use Term::ANSIColor qw(:constants); $Term::ANSIColor::AUTORESET = 1; code fragment foreach (@dirs){ chdir $_; my $curdir = cwd(); my $vsn = glob ("*.

perl grep vs unix grep

2005-02-14 Thread Vladimir Lemberg
Hi All, I have a script which works with text file over 1,5 - 2 GB. It takes me over 10 minutes to grep it and populate a list while unix shell is able to egrep it for 45 sec. open (LOGFILE,"$_[1]") or die "Cannot open LogFile file\n"; local $/ = ''; @list = grep {/\|$pattern/} < LOGFI

search engine for beginners.perl.org

2005-01-25 Thread Vladimir Lemberg
Hi, Is there any way so search old posts via web? For example I want to ask some trivia question and I'm pretty sure that this question has been asked so many times. So before posting a new topic, I'd rather search the old ones regarding my problem. thanks in advance, Vladimir

calling Tcl script with ato arguments

2005-01-17 Thread Vladimir Lemberg
Hi All, Could you help me to solve following problem: I need to execute tkl script with two arguments (input file and output file) within my Perl script: #!/usr/bin/perl -w use strict; use File::Basename; my @gdflist = `find . -name *.gdf`; my $gdf_number = scalar(@gdflist); my $counter = 0;

date subtraction

2004-11-16 Thread Vladimir Lemberg
Hi All, Could you advise me how can I subtract two dates? I have script: open FILE, "; foreach (@records){ ($segID,@time) = (split) [2,4,6,7,9]; print "$segID @time\n"; } It produces these lines: Seq:1 Sat Nov 13 21:57:34 PST 2004 Seq:2 Sat Nov 13 22:05:17 PST 2004 Seq:3 Sun Nov 14 03:42:01 P

Re: Comparing two directories

2004-10-27 Thread Vladimir Lemberg
Actually, this is my script: foreach $filename(readdir DIR1) { next if $filename =~/^\./; while (readdir DIR2){ print "$filename\n" if (-e $filename); last; } } - Original Message - From: "Vladimir Lemberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECT

Comparing two directories

2004-10-27 Thread Vladimir Lemberg
Hi, Could you help me to find what's wrong in my script? I need to compare two directories and if file exists in both - print it. die "Usage: 2 arguments must be passed i.e. file1 file2\n" if @ARGV != 2; opendir DIR1, $ARGV[0] or die "couldn't open $ARGV[0] for reading.\n"; opendir DIR2

Re: previous element

2004-10-21 Thread Vladimir Lemberg
Gunnar, thank you so much! - Original Message - From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 21, 2004 4:40 PM Subject: Re: previous element > Vladimir Lemberg wrote: > > I need to access previous elemen

previous element

2004-10-21 Thread Vladimir Lemberg
I need to access previous element in array. File example: 1. SEG|2961|4| |B|N|000| | |91506|91506|Z|06| 37|0|1|Z|06|37|0|8954| 2. NAME|PARKSIDE AVE| | | |O|E|1399|1301|1398|1300|N|Y|Y| 3. 4. SEG|2962|4|A|B|N|000| | |91506|91506|Z|06| 37|0|1|Z|06|37|0|8954| 5. NAME|RIVERSIDE DR| | | |O|E|17

hash. removing duplicates

2004-10-18 Thread Vladimir Lemberg
Hi All, Could you help me resolve following problem. I have file: John Creamer: 123 345 123 678 345 Erick Morillo: 123 432 876 123 432 Cris Fortier: 678 123 987 123 345 I need to remove duplicated numbers from each line. The output file would be: John Creamer: 123 345 678 Erick Mo

global matching

2004-10-08 Thread Vladimir Lemberg
Hi, Could you help me to solve this problem? I have this file: foobar-45whatever-37hello16goodbye9#!!! snafu23skidoo---+30-50 I need to store all digits into list. As you can see there is no any obvious delimiter, so I'm using global matching open (INFILE, "$ARGV[0]") || d