Re: non-root module install

2006-10-19 Thread Mike Blezien
Prefect! :) thx's Mike - Original Message - From: "Tom Phoenix" <[EMAIL PROTECTED]> To: "Mike Blezien" <[EMAIL PROTECTED]> Cc: "Perl List" Sent: Thursday, October 19, 2006 9:42 PM Subject: Re: non-root module install On 10/19/06, Mike Blezien <[EMAIL PROTECTED]> wrote: I need to

Re: non-root module install

2006-10-19 Thread Tom Phoenix
On 10/19/06, Mike Blezien <[EMAIL PROTECTED]> wrote: I need to install a perl module, Crypt::SSLeay, for a client in their local folder, /home/ it's been quiet some time since I've installed a module in this manner, to use to using either cpan or direct root installs. What is the correct procedu

non-root module install

2006-10-19 Thread Mike Blezien
Hello, I need to install a perl module, Crypt::SSLeay, for a client in their local folder, /home/ it's been quiet some time since I've installed a module in this manner, to use to using either cpan or direct root installs. What is the correct procedure to installing modules in this manner, as

Re: reading a file

2006-10-19 Thread xavier mas
A Divendres 20 Octubre 2006 00:34, Gerald Host va escriure: > I'm trying to read a text file line-by-line. > > open IN, shift; > my @lines=split("\n",); > foreach my $line (@lines) { > print OUT "QQQ $line QQQ\n

Re: reading a file

2006-10-19 Thread Jenda Krynicky
From: "Gerald Host" <[EMAIL PROTECTED]> > I'm trying to read a text file line-by-line. > > open IN, shift; > my @lines=split("\n",); Did you ever read the docs??? my @lines=; The <> operator returns the list of lines in the file if called in the

Re: reading a file

2006-10-19 Thread Gerald Host
I tried both, and they typically do work for me, but right now they just aren't... QQQ line1 line2 line3 ... lineX QQQ any ideas? Ryan On 10/19/06, Helliwell, Kim <[EMAIL PROTECTED]> wrote: Another way: foreach $line () { ... } if you don't want to slurp all the lines into an array (to

reading a file

2006-10-19 Thread Gerald Host
I'm trying to read a text file line-by-line. open IN, shift; my @lines=split("\n",); foreach my $line (@lines) { print OUT "QQQ $line QQQ\n"; } The problem is that it always gives me th

Re: Non-blocking child process

2006-10-19 Thread Dr.Ruud
Jeff Pang schreef: > for (my $i=0;$i<2;++$i) { Alternative: for my $i (0 .. 1) { > my $pid = open CHILD,"|-"; One should always check the return value of open(). > select CHILD;$|++;select STDOUT; Alternative: select((select(CHILD),$|=1)[0]); (from perldoc -q flush) --

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Paul Johnson
On Thu, Oct 19, 2006 at 09:56:58AM -0700, Tom Phoenix wrote: > On 10/19/06, Rob Dixon <[EMAIL PROTECTED]> wrote: > > >so the final values of $a and $b are the same regardless and Perl is > >definitely doing something wrongly in the single-line version. > > I would argue that the programmer did s

Re: Non-blocking child process

2006-10-19 Thread Tom Phoenix
On 10/19/06, Helliwell, Kim <[EMAIL PROTECTED]> wrote: I would like the parent to continue independently of the child. It sounds as if you want to use the double-fork trick. The first fork produces a child process; this child forks a grandchild process, then quits. The grandchild process does

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread lawrence
> > Did this come up in a real-world situation, or were you specifically > > seeking to test the limits of Perl? In other words, what problem, if > > any, are you trying to solve? > > Teaching Perl to students, and to get them to understand the difference > between pre and post increment. > So,

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Norbert Preining
Hi Tom! On Don, 19 Okt 2006, Tom Phoenix wrote: > >$b = (++$a) + ($a++); > > I'm not sure whether C does so, but I believe that Perl does NOT No, also C does not guarantee any predescribed order. It depends on the compiler. BUT: Even if we consider *both* ways of evaluation the expression tree,

RE: Non-blocking child process

2006-10-19 Thread Helliwell, Kim
-Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 2:10 AM To: Helliwell, Kim; beginners@perl.org Subject: Re: Non-blocking child process Hello, I changed your codes like below: use strict; for (my $i=0;$i<2;++$i) { my $

Re: Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Tom Phoenix
On 10/19/06, Rob Dixon <[EMAIL PROTECTED]> wrote: so the final values of $a and $b are the same regardless and Perl is definitely doing something wrongly in the single-line version. I would argue that the programmer did something wrongly by abusing the auto-increment. But don't let that stop y

Re: Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Tom Phoenix
On 10/19/06, Norbert Preining <[EMAIL PROTECTED]> wrote: BUT: Even if we consider *both* ways of evaluation the expression tree, we arrive at 8: There's more than both ways to do it. I suspect that this is a result of an optimization that assumes that no variable will appear at in multiple au

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Taha Hafeez Siddiqi
On Thu, 2006-10-19 at 15:20 +0200, Jenda Krynicky wrote: > To: beginners@perl.org > Date sent:Thu, 19 Oct 2006 13:55:45 +0200 > From: Norbert Preining <[EMAIL PROTECTED]> > Copies to:Elisa Mori <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Subje

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Rob Dixon
Tom Phoenix wrote: On 10/19/06, Norbert Preining <[EMAIL PROTECTED]> wrote: $b = (++$a) + ($a++); I'm not sure whether C does so, but I believe that Perl does NOT promise that auto-increments will be executed in the "expected" left-to-right order. Thus, if a single expression includes more th

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread lawrence
Tom writes: > I'm not sure whether C does so, but I believe that Perl does NOT > promise that auto-increments will be executed in the "expected" > left-to-right order. Thus, if a single expression includes more than > one auto-increment working on the same variable, generally you can't > be sure

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Norbert Preining
Derek B. Smith wrote: Lessons learned always initialize your variables to zero. : ) As I wrote, this is not the lesson. Even with initialization we have the same! Ciao Norbert -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: More Info About $| = 1;

2006-10-19 Thread Derek B. Smith
--- Andreas Puerzer <[EMAIL PROTECTED]> wrote: > Derek B. Smith schrieb: > > > -- Andreas Puerzer <[EMAIL PROTECTED]> wrote: > > > > [snipped for brevity] > > >> > >>So, to the OP, if you want to take input from > your > >>program when run > >>inside Eclipse, you will need to fiddle with $|,

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Tom Phoenix
On 10/19/06, Norbert Preining <[EMAIL PROTECTED]> wrote: $b = (++$a) + ($a++); I'm not sure whether C does so, but I believe that Perl does NOT promise that auto-increments will be executed in the "expected" left-to-right order. Thus, if a single expression includes more than one auto-incremen

Re: IF statement and multiple options

2006-10-19 Thread Tom Phoenix
On 10/19/06, Robert Hicks <[EMAIL PROTECTED]> wrote: I am currently building the IF statement like: if ($project_name eq 'Proj1' || $project_name eq '' && $task_name eq '') Because logical-and is higher precedence than logical-or, that condition is the same as this: $project_name eq 'Proj

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Derek B. Smith
--- Rob Dixon <[EMAIL PROTECTED]> wrote: > Derek B. Smith wrote: > > --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > > > >> Norbert Preining schreef: > >> > >>> The Perl Book says: Auto increment and decrement > >> work as in > >>> C. So if I take this C program: > >>> #include > >>> #include > >>>

Re: Perl Script as a Cron Job

2006-10-19 Thread Mazhar
On 10/12/06, Paul <[EMAIL PROTECTED]> wrote: On Wed, October 11, 2006 7:03 am, Mazhar wrote: > Dear All, > > My Code is to ping a range of IP reading from a text file and if they are > not reachable then just write the IP's to a file. Regarding permissions i > am running the same script using

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Norbert Preining
Dr.Ruud wrote: $ perl -wle ' $a = 3; $b = 0 + (++$a) + ($a++); print "b=$b\n"; ' b=8 :) Nup, this is not the solution: $a = 3; $b = 0; $b = 0 + (++$a) + ($a++); $c = 3; $d = 0; $d = (++$c) + ($c++); print "b=$b\n"; print "d=$d\n"; prints: b=8 d=9 Don't tell me that in perl 0 + so

Re: More Info About $| = 1;

2006-10-19 Thread Andreas Puerzer
Derek B. Smith schrieb: > -- Andreas Puerzer <[EMAIL PROTECTED]> wrote: > [snipped for brevity] >> >>So, to the OP, if you want to take input from your >>program when run >>inside Eclipse, you will need to fiddle with $|, due >>to that >>extra-buffering-layer. If you run it outside >>Eclipse,

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Rob Dixon
Derek B. Smith wrote: --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: Norbert Preining schreef: The Perl Book says: Auto increment and decrement work as in C. So if I take this C program: #include #include int main() { int a; int b; a=3; b=(++a)+(a++);

Re: IF statement and multiple options

2006-10-19 Thread Rob Dixon
Robert Hicks wrote: > I am currently building the IF statement like: > > if ($project_name eq 'Proj1' || $project_name eq '' && $task_name eq '') > > > That works but I was wondering if I can do this: > > if ($project_name eq ('Proj1' || '') && $task_name eq '') > > Less typing... : ) No. Because

IF statement and multiple options

2006-10-19 Thread Robert Hicks
I am currently building the IF statement like: if ($project_name eq 'Proj1' || $project_name eq '' && $task_name eq '') That works but I was wondering if I can do this: if ($project_name eq ('Proj1' || '') && $task_name eq '') Less typing... : ) Robert -- To unsubscribe, e-mail: [EMAIL PROT

Re: Sort uniq

2006-10-19 Thread Dr.Ruud
Rob Dixon schreef: > $uniq{$_} = 1 foreach @holdArr; I prefer "foreach" to "for", mainly because it is shorter. Alternative: @[EMAIL PROTECTED] = (1) x @holdArr; Test-1: perl -MData::Dumper -wle' @keys = qw(a b c) ; @hash{ @keys } = (1) x @keys ; print Dumper \%hash ' $VAR1 = {

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Derek B. Smith
--- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > Norbert Preining schreef: > > > The Perl Book says: Auto increment and decrement > work as in > > C. So if I take this C program: > > #include > > #include > > int main() { > > int a; > > int b; > > a=3; > > b=(++a)+

Re: More Info About $| = 1;

2006-10-19 Thread Chris Share
Thanks to all who responded. The "Suffering from Buffering?" article explains everything. Cheers, Chris Derek B. Smith wrote: --- "Derek B. Smith" <[EMAIL PROTECTED]> wrote: -- Andreas Puerzer <[EMAIL PROTECTED]> wrote: Tom Phoenix schrieb: On 10/18/06, Chris Share <[EMAIL PROTECTED]

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Dr.Ruud
Norbert Preining schreef: > The Perl Book says: Auto increment and decrement work as in > C. So if I take this C program: > #include > #include > int main() { > int a; > int b; > a=3; > b=(++a)+(a++); > printf("b=%d\n",b); > } > it prints b=8. > > Wh

Re: More Info About $| = 1;

2006-10-19 Thread Derek B. Smith
--- "Derek B. Smith" <[EMAIL PROTECTED]> wrote: > -- Andreas Puerzer <[EMAIL PROTECTED]> wrote: > > > Tom Phoenix schrieb: > > > On 10/18/06, Chris Share <[EMAIL PROTECTED]> > > wrote: > > > > > >> I've got a question about $| = 1; > > > > > > > > > > > >> If I add $| = 1; at the top of

Re: More Info About $| = 1;

2006-10-19 Thread Derek B. Smith
-- Andreas Puerzer <[EMAIL PROTECTED]> wrote: > Tom Phoenix schrieb: > > On 10/18/06, Chris Share <[EMAIL PROTECTED]> > wrote: > > > >> I've got a question about $| = 1; > > > > > > > >> If I add $| = 1; at the top of the program this > fixes the problem and > >> the program runs as expect

Re: Evaluation of ++ different in C and perl?

2006-10-19 Thread Jenda Krynicky
To: beginners@perl.org Date sent: Thu, 19 Oct 2006 13:55:45 +0200 From: Norbert Preining <[EMAIL PROTECTED]> Copies to: Elisa Mori <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject:Evaluation of ++ different in C and perl?

Re: Hide the Window

2006-10-19 Thread Jenda Krynicky
> I have created a small program which will open notepad > and write something to it > .. infinitely . The > program will die if somebody closes the window . To cut > jokes with my friends I want

Evaluation of ++ different in C and perl?

2006-10-19 Thread Norbert Preining
Hi all! Maybe this has been answered before, but my searching didn't show up anything: The Perl Book says: Auto increment and decrement work as in C. So if I take this C program: #include #include int main() { int a; int b; a=3; b=(++a)+(a++); printf("b=

Re: remote login using perl

2006-10-19 Thread Mumia W.
On 10/19/2006 01:11 AM, Sayed, Irfan (Irfan) wrote: I need to login on remote machine which is windows , and i think windows doesent support ssh login unless ssh server installed. Either i have to use VNC , remote desktop shairing etc. I need to automate this using script. Please help. Re

Re: Non-blocking child process

2006-10-19 Thread Jeff Pang
>I'm not even sure the title is the appropriate terminology. What I am >trying to do is fork a process that receives data from the parent, but, >once the data is received, the parent can go on and do whatever it wants >(and likewise the child). How do I arrange for the child process to be >detach

Non-blocking child process

2006-10-19 Thread Helliwell, Kim
I'm not even sure the title is the appropriate terminology. What I am trying to do is fork a process that receives data from the parent, but, once the data is received, the parent can go on and do whatever it wants (and likewise the child). How do I arrange for the child process to be detached once

Re: More Info About $| = 1;

2006-10-19 Thread Andreas Puerzer
Tom Phoenix schrieb: > On 10/18/06, Chris Share <[EMAIL PROTECTED]> wrote: > >> I've got a question about $| = 1; > > > >> If I add $| = 1; at the top of the program this fixes the problem and >> the program runs as expected. > > > Normally, output is buffered for efficiency; instead of w