Re: simulating c structures in perl

2002-04-10 Thread Roy Peters
How do I simulate an array of structures in perl? eg. struct { int a; int b; int c } STRUCT1; int STRUCT1 s[5]; s[1].a =1; s[1].b =2; s[1].c =3; How would I write this in perl? Thanks. The information contained in this message may

simulating c structures in perl

2002-04-10 Thread Roy Peters
How would you define c type structures in perl? eg. struct { int a; int b; int c } STRUCT1; int STRUCT1 s; s.a =1; s.b =2; s.c =3; How would I write this in perl? Thanks. The information contained in this message may be privileged

simple assignment

2002-04-02 Thread Roy Peters
gurus, OK, shoot me for asking a dumb question. I have a string of the following $str = "X1=1,Y1=2,Z1=3"; I want to assign the values to the right hand side of the "=" to 3 new variables so the final result is $a=1 $b=2 $c=3 How do I get those values assigned to $a, $b, $c Thanks =

calling another perl program and printing output in real time

2002-04-01 Thread Roy Peters
Hello, I have 2 independent perl programs p1 and p2. p1 calls p2 (using either the system() or `` operators, and p2 will print out status information every 2 seconds or so. How do I set it up such that whenever p2 prints out data, it is printed out by p1 also IN REAL TIME? Thanks. =

executing filename with ~ in perl

2002-03-27 Thread Roy Peters
I have the following $x = ~rambo/bin/script1; (where script1 is an executable shell script) $ret = `x`; The above will not work. However if I define $x = /home/apple/rambo/bin/script1; (ie I give a full pathname) $ret = `x`; This will work. How do I make the first example work? By the way,

difference between 2 dates

2002-03-27 Thread Roy Peters
What is the best way to get the difference betwen 2 dates that I obtain from localtime I want to do something like $t1=localtime(); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

send arguments to a tcl script

2002-03-22 Thread Roy Peters
I am writing a perl script. In it, I need to call another script that happen to be written in tcl. I need to pass arguments to that tcl script. Also, I need to get some return values from that tcl script. What is the best way for me to do that? Thanks. ==

time function

2002-01-16 Thread Roy Peters
I need someone to tell me the function that will convert time in this format to epoch time: 1/17/2002 11:15 AM -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

need a "reminder" program

2002-01-14 Thread Roy Peters
I am looking for a perl program to keep track of appointments and send me a reminder via email 5 minutes before the appointment. I am sure this has been done before and dont want to reinvent the wheel. Any help is appreciated. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

diffs of mirror files in 2 directories

2001-12-05 Thread Roy Peters
I have 2 directories: x/y/z and a/b/c within both directories, I have the same files say a1.c thro a10.c I would like to write a perl script to go through all the files in each directory and print out the filename if there is a difference between the corresponding files. I know of many ways

other mailing lists?

2001-11-14 Thread Roy Peters
Hello, This forum is a really good way to learn a new language. Can anyone suggest a mailing list like this for C, C++, Java programming? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

expect interface in perl

2001-11-08 Thread Roy Peters
Is there any way to imbed expect commands in perl like you could in Tcl? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: imbed c programs in a perl script and vice versa

2001-11-02 Thread Roy Peters
hello, Thanks. For the info. Now, how about if I want to get a return value from the called c or perl program? On Fri, 2 Nov 2001, Pete Emerson wrote: > Yes, you can do it. Here's four files. First, Perl calling a C program: > > chelloworld.c gcc -o chelloworld chelloworld.c > > #

imbed c programs in a perl script and vice versa

2001-11-02 Thread Roy Peters
hi, How do I imed a c program in a perl script. For example I would like to have a perl script call a "hello world" executable file what was compiled in unix. Can I do the reverse? IE have a C program call a perl script that just prints "hello world". I don't have a specific problem to solve.

good online reference for perl/tk

2001-11-01 Thread Roy Peters
hello, can anyone suggest a good online resource for perl/tk. One that has graphical examples of all the possible widgets. The "Learning Perl/TK" book is not very helpful. It doesn't show the widgets. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

returning more than 1 scalar from a subroutine

2001-10-31 Thread Roy Peters
hi, Is there any way to return 2 or 3 scalar variables from a subroutine (like passing a variable by reference in C)? I would like to avoid returning an array, if possible, because it makes the script very non-intuitive. Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional com

sorting by data

2001-10-29 Thread Roy Peters
hi, I have the following string $a = "buy 10/23/01 100 12.625 50 25.25 \n buy 10/25/01 100 12.625 50 25.25 \n buy 09/1/01 100 12.625 50 25.25 \n buy 1/23/01 100 12.625 50 25.25 \n"; I would like to sort this by the date (ie the second field) in the above string. So it looks like this: $

modifying strings that contains numbers

2001-10-28 Thread Roy Peters
hi I have an variable of the following format $i = "buy 10/23/01 50 25.25 50 25.25" Now, I would like to multiply the 3 and 4th fields by a factor (say 2) so I get the following $i = "buy 10/23/01 100 50.50 50 25.25" How do I do this? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

mailing list for C?

2001-06-19 Thread Roy Peters
hi, Sorry to bother everyone. But I am learning a lot from this daily Perl mailing list. Can someone recommend a good mailing list to subscribe for C programming? Thanks.