Re: How do I control a C programme from perl?

2010-05-14 Thread robert Key
thanks so much for your help. I will check it out. I have been progaming for a long time in fortran, PL/M, c, c++,perl but there is always more to learn, great! I should try this under windows instead of linux and see what happens. Thanks Eitan. I have also downloaded the Expect modules and ch

Re: How do I control a C programme from perl?

2010-05-14 Thread robert Key
Hi I have downloaded the modules and will give use them. Thanks for your help, Rob Key On 13/05/2010 14:13, Robert Wohlfarth wrote: On Thu, May 13, 2010 at 1:21 AM, robert Keywrote: Hi, I want to capture UNBUFFERED output from a C programme and then control it depending on its output. Prob

Strange compilation error.

2010-05-14 Thread Meghanand Acharekar
Hello, I have written following perl code to sort file in subfolders according to regex matching its giving me following error while compiling the code. Global symbol "@i" requires explicit package name at sortfiles.pl line 21. Global symbol "@i" requires explicit package name at sortfiles.pl lin

Re: Strange compilation error.

2010-05-14 Thread Shlomi Fish
On Friday 14 May 2010 11:58:36 Meghanand Acharekar wrote: > Hello, > > I have written following perl code to sort file in subfolders according to > regex matching its giving me following error > while compiling the code. > > Global symbol "@i" requires explicit package name at sortfiles.pl line 2

Re: Strange compilation error.

2010-05-14 Thread John W. Krahn
Meghanand Acharekar wrote: Hello, Hello, I have written following perl code to sort file in subfolders according to regex matching I don't see any regular expressions in the code you provided? its giving me following error while compiling the code. Global symbol "@i" requires explicit pa

Re: How do I control a C programme from perl?

2010-05-14 Thread C.DeRykus
On May 12, 11:21 pm, robertgordon...@yahoo.com (robert Key) wrote: > Hi, >   I want to capture UNBUFFERED output from a C programme and then > control it depending on its output. Problem is nothing seems to > unbufferd the output from the C programme. Only when the child has > finished executing do

Re: fork, parallel and global values

2010-05-14 Thread Dr.Ruud
raphael() wrote: I want to do work on all elements of an array simultaneously. What kind of data/reality does your array represent? I tried Parallel::ForkManager. It works well when you don't need to update global value like downloading multiple files at the same time. I want something like

Re: hashes + use constant - weird behavior

2010-05-14 Thread Dr.Ruud
Stanisław T. Findeisen wrote: use constant { SOME_CONSTANT => 'some value' }; $hash{SOME_CONSTANT} = 'value 1'; Not weird at all, just works as documented. So change to either: $hash{ +SOME_CONSTANT } = 'value 1'; or: $hash{ SOME_CONSTANT() } = 'value 1'; -- Ruud -- To uns

Re: Merging YAML nodes/streams

2010-05-14 Thread Tom
On Fri, May 07, 2010 at 12:44:01PM -0400, Bob McConnell wrote: > From: Tom > > > I'm having trouble merging YAML streams. > > > > Basic premise is that I load multiple YAML files and I want to combine > > the result. There may be common elements within subsequent YAML files > > and I would want t

Re: perl in Makefile

2010-05-14 Thread Peter Daum
On 2010-05-13 19:00, Patrick Dupre wrote: > How can I execute the following command in a Makefile ? > > CORE_INC=`perl -MConfig -MFile::Spec::Functions -le 'print > catfile($Config{archlib},"CORE")')` > > The problem is with the $Config ! CORE_INC=`perl -MConfig -MFile::Spec::Functions -le 'prin

ExtUtils

2010-05-14 Thread Patrick Dupre
Hello, The comand: perl -MExtUtils::Embed -e ccopts gives me: -D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi/CORE

Re: How do I control a C programme from perl?

2010-05-14 Thread wizetux
On May 13, 1:44 pm, li...@eitanadler.com (Eitan Adler) wrote: > > The C programme looks like this (very simple) > > #include > > int main() > > { > >        int i; > >        char s[20] = "hello from c"; > >        for (i = 0; i < 15; i++) { > >                sleep(1); > >                printf("

Re: How do I control a C programme from perl?

2010-05-14 Thread robert Key
Hi Eitan, I have just used fflush and it works. The real problem is that C programme was just a test programme. I am using someone else's programme and I only have the binary! This makes life complicated. The only way will be to try and unbuffer output and then launch the c binary so that it in

Re: Merging YAML nodes/streams

2010-05-14 Thread Jay Savage
On Fri, May 14, 2010 at 7:26 AM, Tom wrote: > On Fri, May 07, 2010 at 12:44:01PM -0400, Bob McConnell wrote: >> From: Tom >> >> > I'm having trouble merging YAML streams. >> > >> > Basic premise is that I load multiple YAML files and I want to combine >> > the result. There may be common elements

Re: How do I control a C programme from perl?

2010-05-14 Thread C.DeRykus
On May 14, 8:15 am, robert...@telkomsa.net (robert Key) wrote: > Hi Eitan, I have just used fflush and it works. > The real problem is that C programme was just a test programme. I am > using someone else's programme and I only have the binary! This makes > life complicated. The only way will be to