How can I copy a directory to another place?

2003-11-22 Thread pagoda
How can I copy a directory to another place? I just know how to copy a file to another place, use File::Copy qw/cp mv/; cp aaa/a.file bbb/b.file; Thanks a lot. a beginner -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

POD, Faq and tradition - Re: extracting email addys.

2003-11-22 Thread drieux
On Saturday, Nov 22, 2003, at 16:18 US/Pacific, Randal L. Schwartz wrote: [..] It's just that we keep seeing this over and over again. That's the point of the FAQ. What happened to the ethic of even ATTEMPTING to look for a local FAQ before posting to a list. {sigh} I think a part of the probl

Re: search

2003-11-22 Thread Douglas Lentz
Eric Walker wrote: I am trying to search a string for a "[]". I want to count the amount of "[]" in the string. Any IDeas re my first post on this, here is a better (well, Lazier) way: $string = "a4r[]qy78[]x]y[114[[|]]t"; $count = $string =~ s/(\[])/$1/g; print "$count\n"; #

Re: dereferencing a list from a class

2003-11-22 Thread drieux
On Saturday, Nov 22, 2003, at 08:17 US/Pacific, James Edward Gray II wrote: On Nov 21, 2003, at 3:19 PM, Rajesh Dorairajan wrote: I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1', '2', '3', '4' ]; I think/hope you meant: $self->{a}

Re: Can I improve the performance of script by using constant?

2003-11-22 Thread R. Joseph Newton
pagoda wrote: > Can I improve the performance of script by using constant? > > Which is the better one? > > use constant const => 1e-12 > > or > > my $const = 1e-12 > > Thanks. > just another perl beginner I would think that use constant would be faster. Declaring a scalar would still require th

Re: Rounding off

2003-11-22 Thread Daniel Staal
--As off Saturday, November 22, 2003 4:27 PM -0600, Mike Blezien is alleged to have said: Hello, I need the ability to round off dollar amounts to the nearest 100th of a dollar amount, IE $14.9564 to $14.96 or $132.1123 to $113.11 what is the best way to accomplish this ?? --As for the rest, it

Re: Strange characters

2003-11-22 Thread R. Joseph Newton
"LoBue, Mark" wrote: > P.S. My company tells me that our internet mail connector now gets a long > disclaimer on the end of the message. I haven't seen it, but if it is true, > I will stop posting and just lurk until I figure out a way around it. > > Important Warning: This message is intended f

Re: Can a regex match numbers?

2003-11-22 Thread R. Joseph Newton
Jabez Wilson wrote: Hi Jabez, Please don't top-post. That makes it harder to follow the flow of converstation. Inseat, move to the end of the material you are addressing. Cut out anything that doesn't relate to your response, andf then write following the material you are responding to. > W

Re: dereferencing a list from a class

2003-11-22 Thread R. Joseph Newton
Rajesh Dorairajan wrote: > I've a class (blessed, of course :)) that has variables like: > > $self->a = "1"; > $self->b = "2"; > $self->c = [ '1', '2', '3', '4' ]; > > Now, I want to write a foreach loop to iterate through $self->c and print > the values. However: > > foreach my $foo ( $self->c )

Re: search

2003-11-22 Thread R. Joseph Newton
Eric Walker wrote: > I am trying to search a string for a "[]". I want to count the amount > of "[]" in the string. > > Any IDeas Are the brackets nested, or are they discrete. This makes a big difference in how you go about this. If they are not nested, I would recommend Rob's solution ab

RE: OLE Hash problem getting AD lastLogon

2003-11-22 Thread Tim Johnson
"Groups and Users" is the name of the OU in this case. It turned out later that my problem was that for some reason AD uses an 8-byte long integer for the date, and it does have methods associated with it, HighPart and LowPart, which aren't used in this case. I think that's why it was showing up

Rounding off

2003-11-22 Thread Mike Blezien
Hello, I need the ability to round off dollar amounts to the nearest 100th of a dollar amount, IE $14.9564 to $14.96 or $132.1123 to $113.11 what is the best way to accomplish this ?? TIA -- MikeBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet

Re: Ticked Off..

2003-11-22 Thread R. Joseph Newton
Eric Walker wrote: > I got it thanks. I see my mistake.. > wow this list is nice.. > > Thanks again > newbie Great. Would you care to tell us what you came up with that worked? Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sh: bad number

2003-11-22 Thread R. Joseph Newton
but however wrote: > Hi, > I compiled a simple program with perl. But I ran into some problems. > > sh: campusUnderAttack.out: bad number > > I try to execute a program and input the result to antother file > "campusunderAttack.out" > like this: > > #!/usr/bin/perl > # > # Run campus scenario and

Re: how to send mail using Perl

2003-11-22 Thread R. Joseph Newton
liuxu wrote: > I want to send mail using perl,the following is my code. > There are not any error or warning when the program run. > But i can not receive the mail. Please help me ! thanks! > > use Net::SMTP; Are you asking for strict compilation or warnings? That is really the first step: use

Re: OLE Hash problem getting AD lastLogon

2003-11-22 Thread R. Joseph Newton
Tim Johnson wrote: > I'm having trouble getting the lastLogon property of a user in AD using > Perl and LDAP. Below is my code. The problem is that I keep getting a > blessed Win32::OLE hash returned instead of a number when returning the > value of lastLogon. This is the first issue, and it lo

Re: search

2003-11-22 Thread Douglas Lentz
Eric Walker wrote: I am trying to search a string for a "[]". I want to count the amount of "[]" in the string. Any IDeas $string = "a4r[]qy78[]x]y[114t"; $count = $string =~ s/\[]/\[]/g; print "$count\n" # $count will equal 2 Notice that this is not, (I repeat, not) the same as vari

Re: How does perl compile functions

2003-11-22 Thread R. Joseph Newton
Dan Anderson wrote: > I'm curious how perl "compiles" functions internally. When the actual C > code (or ASM equivalent or bytecode or whatever Perl uses) for a > function is run, is there overhead to the function? Are functions > inlined? Does perl lazy compile functions? (i.e. functions neve

Re: What is this called: ($myvar->{otherid}) ? 'stringA' : 'stringB';

2003-11-22 Thread R. Joseph Newton
Jeff Kowalczyk wrote: > I'm not yet able to read certain parts of perl code. What is this > comparison/alternation after the hash lookup on 'otherid' called, and what > does the code do? > > $myvar->{id} = ($myvar->{otherid}) ? 'stringA' : 'stringB'; > > Thanks. That is the conditional operator.

Re: perl plot using

2003-11-22 Thread James Edward Gray II
On Nov 22, 2003, at 2:05 PM, but however wrote: HI, I use the command plot in Perl to draw a graph: I'm not familiar with 'plot', so I'll leave that part of the question for others. But... I am not vey clear with the variables $1 and $2. I did not define them in my file, what are they? $1, $2

Re: perl undef

2003-11-22 Thread James Edward Gray II
On Nov 22, 2003, at 2:10 PM, but however wrote: Hi, James: Hello again. Please keep your replies on the list so we can all learn from and help each other. Thank you very much! Now, I am clear about the question. Do you mean the outmost parenthesis captures the value assigned to variable? Then

perl plot using

2003-11-22 Thread but however
HI, I use the command plot in Perl to draw a graph: plot "data.txt" using (\$1/3600):(\$2) with lines, "data2.txt" using (\$1/3600):0 with points lt 3 I am not vey clear with the variables $1 and $2. I did not define them in my file, what are they? "with points lt 3" how can find more informati

Re: perl undef

2003-11-22 Thread James Edward Gray II
On Nov 22, 2003, at 12:54 PM, but however wrote: Hi, there is a clause in perl program which assigns two variables with values from a file. my ($t, undef, $i)=/t: ((\d|\.)+)\s.*?i=((\d|\.)+)/; What does "undef" mean in the above clause? Using undef on the left side of the assignment like this

perl undef

2003-11-22 Thread but however
Hi, there is a clause in perl program which assigns two variables with values from a file. my ($t, undef, $i)=/t: ((\d|\.)+)\s.*?i=((\d|\.)+)/; What does "undef" mean in the above clause? Which value will be assigned to $t and $i? in the place \d? or some value? Thanks, Wenpeng

Re: Pointers

2003-11-22 Thread Wiggins d'Anconia
Eric Walker wrote: wow ok then I will try and use the -> notation. No need to stay behind the times. Just a couple of notes, someone already pointed out perlref, there is also: perldoc perllol perldoc perlreftut perldoc perldsc Which should give you a better handle on references. Depending on

Re: dereferencing a list from a class

2003-11-22 Thread James Edward Gray II
On Nov 21, 2003, at 3:19 PM, Rajesh Dorairajan wrote: I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1', '2', '3', '4' ]; I think/hope you meant: $self->{a} = '1';# any reason we're quoting integers? $self->{b} = '2'; $self

Re: piping problem

2003-11-22 Thread Bob Showalter
Ilkka Naulapää wrote: > hi all, > > I'm quite new with perl and so far i've managed to get all done i've > needed to. But now I have a problem i need some help with. I need to > pipe *huge* output from one program into my perl script and i want to > start processing it right away without waiting th

Re: search

2003-11-22 Thread Rob Dixon
Mark Anderson wrote: > > > From: Eric Walker [mailto:[EMAIL PROTECTED] > > Sent: Friday, November 21, 2003 1:34 PM > > Subject: search > > > > > > I am trying to search a string for a "[]". I want to count the amount > > of "[]" in the string. > > > > Any IDeas > > perldoc -q count > > gives y

Re: first steps with perl, a log reader

2003-11-22 Thread Rob Dixon
Guardian Angel wrote: > > R. Joseph Newton wrote: > > > > Guardian Angel wrote: > > > > But now... i want to be more precise with my script. > > > So i made 2 extra if loops, 1 is looking for errors, and if so, also > > > check if there is no 127.0.0.x adres in it anymore (works so far :D) > > > >

piping problem

2003-11-22 Thread Ilkka Naulapää
hi all, I'm quite new with perl and so far i've managed to get all done i've needed to. But now I have a problem i need some help with. I need to pipe *huge* output from one program into my perl script and i want to start processing it right away without waiting this 'source' finishing its job.

FW: dereferencing a list from a class

2003-11-22 Thread Rajesh Dorairajan
message bounced. retrying -Original Message- From: Rajesh Dorairajan Sent: Friday, November 21, 2003 1:19 PM To: '[EMAIL PROTECTED]' Subject: dereferencing a list from a class I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1'

dereferencing a list from a class

2003-11-22 Thread Rajesh Dorairajan
I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1', '2', '3', '4' ]; Now, I want to write a foreach loop to iterate through $self->c and print the values. However: foreach my $foo ( $self->c ) { print $foo; } gets me the whole

First steps?

2003-11-22 Thread Mac Intyre, Steven
Hi All, Please can someone, who also started stone cold new, advise me the easiest and cheapest option to learning PERL. Buying books and what not are not my scene, and online tutorials would be ok. I have a bit of PHP knowlegde and that's it. Does anyone have good links to tutorials, I searc

Re: Can I improve the performance of script by using constant?

2003-11-22 Thread John W. Krahn
Pagoda wrote: > > Can I improve the performance of script by using constant? You can use the Benchmark module to test the performance of different options. > Which is the better one? > > use constant const => 1e-12 > > or > > my $const = 1e-12 use works at compile time and replaces the const

Re: CGI Script Fork

2003-11-22 Thread James Taylor
The reason I need to run it in the background and just display the message is that the person that's going to be running this program wants to be able to close the window. The process running in the background can take up to 10 minutes and he's afraid that he may accidentally close the window

Re: sh: bad number

2003-11-22 Thread John W. Krahn
But However wrote: > > Hi, Hello, > I compiled a simple program with perl. But I ran into some problems. > > sh: campusUnderAttack.out: bad number > > I try to execute a program and input the result to antother file > "campusunderAttack.out" > like this: > > #!/usr/bin/perl > # > # Run campus

Re: buffered output?

2003-11-22 Thread John W. Krahn
Bryan Harris wrote: > > I have an odd problem... > > I have a perl script that execs another program: > > $cmd = "motuds t1.dat t2.dat t3.dat > out1"; > exec $cmd; > > Motuds takes awhile to run, though, and I often want to see how it's doing: > > % tail -f out1 > > The problem is, the output

CGI Script Fork

2003-11-22 Thread Robert Brown
If the only real purpose for the fork is so that the message can be displayed, why don't you just display the message in a form, and then go do the long operation single threaded. When the long operation finishes, continue to output to the same page and use some javascript to change the contents o