Re: how to get references from imbricated capturing parenthesis ?

2007-06-29 Thread Dr.Ruud
marin schreef: > I'm trying to get references from a simple regular > exepression like this : > > "a40d7412" =~ /(([[:xdigit:]]{2})*)/; > print "$1: <$2><$3><$4><$5>\n"; > > This prints : > a40d7412: <12><><><> > > How to get all references Verbose variant: #!/usr/bin/perl use strict; u

Re: Adding a line in a file inside many directories

2007-06-29 Thread John W. Krahn
[EMAIL PROTECTED] wrote: On Jun 28, 12:00 pm, [EMAIL PROTECTED] (Ved) wrote: Now I have to print a single line at say line number 20 in each of 150 number of kat.s file. Hey, another chance to show off my favorite Perl module, IO::All. Situation is bit complex (atleast for a beginer like me

Test::Class fixture problem

2007-06-29 Thread Ovid
I've just spent quite a bit of time debugging a problem where a Test::Class setup method was misbehaving. My tests passed, but mysql was spitting out errors directly to STDERR and quite a bit of tracing led me to the following: sub setup : Tests(setup) { my $test = shift; $test->S

Re: how to get references from imbricated capturing parenthesis ?

2007-06-29 Thread Tom Phoenix
On 6/29/07, marin <[EMAIL PROTECTED]> wrote: I'm trying to get references from a simple regular exepression like this : "a40d7412" =~ /(([[:xdigit:]]{2})*)/; print "$1: <$2><$3><$4><$5>\n"; How to get all references and not the last one in the second parenthesis pair ? I don't think you'r

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Tom Phoenix
On 6/29/07, Alex Jamestin <[EMAIL PROTECTED]> wrote: Well, i tried both the options - > system("perl vplan_all.pl", "5.6", "24.0") == 0 > or die "blah"; > > or > > system( "perl", "vplan_all.pl", "5.6", "24.0") == 0 > or die "blah"; I think when perl -> shell -> perl . Here perl doe

Re: Adding a line in a file inside many directories

2007-06-29 Thread usenet
On Jun 28, 12:00 pm, [EMAIL PROTECTED] (Ved) wrote: > Now I have to print a single line at say line number 20 in each of 150 > number of kat.s file. Hey, another chance to show off my favorite Perl module, IO::All. > Situation is bit complex (atleast for a beginer like me). Actually it is so si

how to get references from imbricated capturing parenthesis ?

2007-06-29 Thread marin
Hi everyone! I'm trying to get references from a simple regular exepression like this : "a40d7412" =~ /(([[:xdigit:]]{2})*)/; print "$1: <$2><$3><$4><$5>\n"; This prints : a40d7412: <12><><><> How to get all references and not the last one in the second parenthesis pair ? I'm STFW for 2 hours

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Alex Jamestin
Tried that but it still won't work. Doh! Stupid bug :\ I'd run this test script below - #! /usr/bin/perl use strict; use warnings; my $vplan_parent_path = "\/pdd\/qes\/vsuites\/vplan"; system("perl $vplan_parent_path\/vplan_all.pl") == 0 or die "perl blew up: $!"; And the o/p got is - vp

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Alex Jamestin
Thanks Chas, This does work. So there's no problem with perl itself. I guess now, i'll have to take a look at vplan_all.pl. The sucky thing is that road is too much of pain to go down. (Though now i don't think ill be able to sleep without thinking about this :)) Oh well, Bug begets bug :) Anywa

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Alex Jamestin
Okay, system returns a 0 if it executes successfully. So then, die is called only if system returns anything other than a 0. And in the old code system would return a 0 after calling perl. This would short-circuit and call die. Makes sense :) Will try out and reply. Thx, Alex On 6/29/07, Chas

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Alex Jamestin
Well, i tried both the options - system("perl vplan_all.pl", "5.6", "24.0") == 0 or die "blah"; or system( "perl", "vplan_all.pl", "5.6", "24.0") == 0 or die "blah"; I think when perl -> shell -> perl . Here perl doesn't seem to understand that vplan_all.pl is the script name and

Re: Adding a line in a file inside many directories

2007-06-29 Thread Tom Phoenix
On 6/28/07, Ved <[EMAIL PROTECTED]> wrote: open (VEDIN, 'list_of_dir.txt') or die "Cannot open 'File.txt' $!"; Why does the error message mention the wrong file name? my @rgstr=; foreach my $file_list (@rgstr) { print $file_list ;#printing list of dir The items in this list haven't

Re: CPU/Memory usage of a process on Windows machine

2007-06-29 Thread oryann9
You have to add UserModeTime and KernelModeTime then divide by 10,000,000. See: http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0922.mspx use Win32::Process::Info; use Data::Dumper; my $pi = Win32::Process::Info->new (); my @process_information = $pi->GetProcInfo(3692);

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Chas Owens
On 6/29/07, Alex Jamestin <[EMAIL PROTECTED]> wrote: snip my $vplan_parent_path = "\/pdd\/qes\/vsuites\/vplan"; snip You don't need to escape those slashes. snip system("perl $vplan_parent_path\/vplan_all.pl") == 0 or die "perl blew up: $!"; snip Same thing here. snip And the o/p got i

Re: CPU/Memory usage of a process on Windows machine

2007-06-29 Thread oryann9
> #!c:/perl/bin/perl.exe > # This is a test scrip > use Win32::Process::Info; > use warnings; > use strict; > my $pi = Win32::Process::Info->new (); > my @process_information = $pi->GetProcInfo(4488); > ## 4488 is pid of a > particular process. > foreach $info (@process_information) { >

Adding a line in a file inside many directories

2007-06-29 Thread Ved
Hi all, I am a beginer in PERL. What I am trying to do is this: I have a 150 directories, each having a file "kat.s" in them. I have names of all these directories in a text file "list_of_dir.txt". I have to open the each of "kat.s" in all the 150 directories and add a line(say "ABCD" at line numb

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Chas Owens
On 6/29/07, Alex Jamestin <[EMAIL PROTECTED]> wrote: Thanks Chas, This does work. So there's no problem with perl itself. I guess now, i'll have to take a look at vplan_all.pl. The sucky thing is that road is too much of pain to go down. (Though now i don't think ill be able to sleep without thi

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Chas Owens
On 6/29/07, Alex Jamestin <[EMAIL PROTECTED]> wrote: Sorry forgot about that.. I'm running it on FreeBSD/i386 accessed via. a terminal prog. I have a FreeBSD box handy, but I cannot reproduce your error. Do the two scripts below work for you? /home/cowens>uname -smr FreeBSD 4.11-STABLE i386 /

Re: Splitting a CSV file at a variable number

2007-06-29 Thread Chas Owens
On 6/28/07, sum_duud <[EMAIL PROTECTED]> wrote: in essence I would like the perl script to output all the fourth column "0" values to a file called phase_0.csv and all the "1" values to phase_1.csv etc. snip use an array of file handles (warning, untested): use strict; use warnings; open my $

Re: parse help

2007-06-29 Thread [EMAIL PROTECTED]
> >http://search.cpan.org/author/DCONWAY/Parse-RecDescent-1.94/lib/Parse... > > Hope this helps! > > . I am still at the beginner level. I am afraid this would help me at this stage. Thanks anyway. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Chas Owens
> Hmm, what OS are you using? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Chas Owens
On 6/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip I've tried bypassing the shell [ system(xxx,xxx,xx)] but that doesn't seem to help. snip Hmm, what OS are you using? And by system(xxx,xxx,xx) do you mean system("perl vplan_all.pl", "5.6", "24.0") == 0 or die "blah"; or syst

Re: exit code

2007-06-29 Thread Martin Barth
I just googled a bit: http://www.hiteksoftware.com/knowledge/articles/049.htm it seems that windows has more exit codes than linux. On Fri, 29 Jun 2007 13:15:18 +0200 "Tatiana Lloret Iglesias" <[EMAIL PROTECTED]> wrote: > And why i windows I get exit value 777? > > On 6/29/07, Martin Barth <[

Splitting a CSV file at a variable number

2007-06-29 Thread sum_duud
I have a large CSV file of the format x,y,z,number (a coordinate file) that I need to parse and output as individual files based on the fourth field (column 3). The file looks like the sample below, and the fourth field can be from zero to 20, so in essence I would like the perl script to output a

pp utility

2007-06-29 Thread kusu
Hi Can any one help me in analizing this code system(pp -o abc.exe --icon=icon.ico --xyz xyz_bootsvr) Thanks in advance, Kusuma -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: pp utility

2007-06-29 Thread Chas Owens
On 6/28/07, kusu <[EMAIL PROTECTED]> wrote: Hi, Can any one help me in analyzing this code system(pp -o abc.exe --icon=icon.ico --xyz xyz_bootsvr) Thanks in advance, Kusuma looks like PAR::Packer tool to me: http://search.cpan.org/~smueller/PAR-Packer-0.975/lib/pp.pm -- To unsubscribe, e

Re: Net::SFTP functions

2007-06-29 Thread julien . laffitte
On 27 juin, 16:38, [EMAIL PROTECTED] (Oryann9) wrote: > --- Octavian Rasnita <[EMAIL PROTECTED]> wrote: > > > Hi, > > > You need to use: > > > $ftp->get("/path/to/remote/file", > > "/path/to/local/destination_file"); > > > Octavian > > Also you can use > > $remotedir = qq(/path/to/remoteserver/dir/

CPU/Memory usage of a process on Windows machine

2007-06-29 Thread jeevs
Greetings I am trying to find CPU and memory usage on a windows machine and i was able to get through memory usage using Win32::Process::Info module's GetProcInfo function. This code may be helpfull to others which calculate the memory usage of a particular process on windows #!c:/perl/bin/p

Spreadsheet IO::Scalar v. PerlIO::Scalar confusion

2007-06-29 Thread [EMAIL PROTECTED]
I'm trying to install Spreadsheet-ParseExcel-0.32 from CPAN. It claims to require IO::Scalar, but when I make it, it says (reasonably): $Config{useperlio} is defined, removing requirement of IO::Scalar But then immediately: Warning: prerequisite IO::Scalar 0 not found. Writing Makefile for

pp utility

2007-06-29 Thread kusu
Hi, Can any one help me in analyzing this code system(pp -o abc.exe --icon=icon.ico --xyz xyz_bootsvr) Thanks in advance, Kusuma -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Adding a line in a file inside many directories

2007-06-29 Thread Ved
Hi All, Situation is bit complex (atleast for a beginer like me). Directory structure is somewhat like this: testcases--> 150 Directories (names starting with mixed or green.) --- > kat.s i.e. a directrory named testcases has 150 number of directories in it and each of those 150 number of director

Re: parse help

2007-06-29 Thread Chas Owens
On 6/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I would suggest splitting each record on "\n", looping > over the results checking to see if the first character is a space, > and appending that line to the last field if it is or creating a new > key/value pair if it isn't. thank you.

Re: How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread Steve Bertrand
[EMAIL PROTECTED] wrote: > Hi all, > > Any help on this would be appreciated :) > > Currently I have a perl program thats required to call another perl > program. The second one takes arguments and can be called as: > > perl vplan_all.pl 5.6 24.0 ajtest > > Here 5.6, 24.0 and ajtest

How can i make a perl program lauch another perl program that takes options

2007-06-29 Thread [EMAIL PROTECTED]
Hi all, Any help on this would be appreciated :) Currently I have a perl program thats required to call another perl program. The second one takes arguments and can be called as: perl vplan_all.pl 5.6 24.0 ajtest Here 5.6, 24.0 and ajtest are all command line options. I have to cal

Re: parse help

2007-06-29 Thread [EMAIL PROTECTED]
> I would suggest splitting each record on "\n", looping > over the results checking to see if the first character is a space, > and appending that line to the last field if it is or creating a new > key/value pair if it isn't. thank you. Would you mind posting sample code that does this trick?

Re: using a homemade perl module

2007-06-29 Thread Mumia W.
On 06/28/2007 10:22 PM, Mathew Snyder wrote: I'm getting a strange bit of behaviour. I have everything set up right and my dates are getting made up properly however, one sub which creates the searchDate array isn't being called. I have to enter the full module path (Reports::Dates::searchD

Re: exit code

2007-06-29 Thread Tatiana Lloret Iglesias
And why i windows I get exit value 777? On 6/29/07, Martin Barth <[EMAIL PROTECTED]> wrote: exit codes are stored in 1 byte. so you can only exit with 2^8 == 256 different values. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl

Re: exit code

2007-06-29 Thread Martin Barth
exit codes are stored in 1 byte. so you can only exit with 2^8 == 256 different values. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: exit code

2007-06-29 Thread Tatiana Lloret Iglesias
Sorry.. but I don't understand what do you mean ... On 6/29/07, Paul Johnson <[EMAIL PROTECTED]> wrote: On Fri, Jun 29, 2007 at 11:08:19AM +0200, Tatiana Lloret Iglesias wrote: > Hi all, > > when I execute my perl script in my local machine and I get to a controlled > error situation i've go

Re: exit code

2007-06-29 Thread Paul Johnson
On Fri, Jun 29, 2007 at 11:08:19AM +0200, Tatiana Lloret Iglesias wrote: > Hi all, > > when I execute my perl script in my local machine and I get to a controlled > error situation i've got as exit value 777 > > if(!$test){ >$failed_times =$failed_times +1; > >if($failed_times ==3) >

exit code

2007-06-29 Thread Tatiana Lloret Iglesias
Hi all, when I execute my perl script in my local machine and I get to a controlled error situation i've got as exit value 777 if(!$test){ $failed_times =$failed_times +1; if($failed_times ==3) { exit(777); } sleep 15; }# if $test but when i execute the same script with th

delete from java temporary file generated from PERL

2007-06-29 Thread Tatiana Lloret Iglesias
Hi all! From my Java application I call a PERL process which generates some files. When I come back to the Java part and I process these files I try to delete them and some of them are deleted correctly but other not... Any idea? I've checked that I call CLOSE methods everytime I create a fi