AW: Interactive shell in Perl

2010-04-27 Thread Thomas Bätzler
Parag Kalra asked: > Wanted to know if Perl has any interactive shell (just like Python, > Bash, Ruby etc have) by any chance. And if yes how do we invoke > that. Since you mentioned bash, the zoidberg shell might be an option: http://search.cpan.org/~pardus/Zoidberg-0.96/man1/zoid.pod HTH, Thom

Re: Interactive shell in Perl

2010-04-27 Thread Jeff Pang
On Wed, Apr 28, 2010 at 2:38 PM, Parag Kalra wrote: > Hey All, > > Wanted to know if Perl has any interactive shell (just like Python, Bash, > Ruby etc have) by any chance. And if yes how do we invoke that. > > Cheers, > Parag > There is a Perl shell named as "psh" available on CPAN. -- Jeff Pa

Interactive shell in Perl

2010-04-27 Thread Parag Kalra
Hey All, Wanted to know if Perl has any interactive shell (just like Python, Bash, Ruby etc have) by any chance. And if yes how do we invoke that. Cheers, Parag

Re: get acl's of directory

2010-04-27 Thread Andreas Moroder
Andreas Moroder schrieb: Hello, is it possible to get the acl entrie of a directory on linux with perl ? Thanks Andreas Hello, probably I have found the module I need, it is File-ExtAttr but I when i start perl Makefile.pl I get this error "Can't build and link to 'attr'" Does anyone know

Re: When to use anonymous references

2010-04-27 Thread Peter Scott
On Mon, 26 Apr 2010 22:16:27 +0800, Tim Bowden wrote: > I've just realised I almost never use named arrays or hashes anymore. > It's almost always anonymous references instead. That lead me to wonder > what criteria experienced perl hackers have as to when to use a named > array or hash, and when

Re: about dispatch tables

2010-04-27 Thread Steve Bertrand
On 2010.04.26 15:24, Harry Putnam wrote: > I hope some of you will go along with this approach. > > I want to try to describe briefly what problem I'm having. > But not show any working code. > > I've made so much of a mess trying a lot of different things I'd like > to have some idea that at lea

Re: about dispatch tables

2010-04-27 Thread Steve Bertrand
On 2010.04.26 15:24, Harry Putnam wrote: > I want to try to describe briefly what problem I'm having. > But not show any working code. That's ok, but it isn't clear to me that you have really described a problem that you are stuck on. > I guess where I get stuck is how to make a dispatch table w

Re: Reg Exp: Extract from last appearance of A to first appearance B

2010-04-27 Thread HolyNoob
Thanks everyone, The solution of John W. Krahn works perfectly :) Incredible On Tue, Apr 27, 2010 at 1:41 PM, John W. Krahn wrote: > HolyNoob wrote: > >> Hi, >> > > Hello, > > > I'm trying to make a regexp to match the last appearance of a word (lets >> say >> 'abc') until the first appearance

Re: get path to linked directory

2010-04-27 Thread Shawn H Corey
Andreas Moroder wrote: Hello, I have a entry in my directory that is a soft-link to another directory. Is there a way in perl to get, starting from the link, the path of the real directory ? Thanks Andreas See: perldoc -f readlink http://perldoc.perl.org/functions/readlink.html perldoc -

AW: get path to linked directory

2010-04-27 Thread Thomas Bätzler
Andreas Moroder asked: > I have a entry in my directory that is a soft-link to another > directory. > Is there a way in perl to get, starting from the link, the path of the > real directory ? http://perldoc.perl.org/Cwd.html#abs_path-and-friends HTH, Thomas -- To unsubscribe, e-mail: beginners-

get path to linked directory

2010-04-27 Thread Andreas Moroder
Hello, I have a entry in my directory that is a soft-link to another directory. Is there a way in perl to get, starting from the link, the path of the real directory ? Thanks Andreas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@per

get acl's of directory

2010-04-27 Thread Andreas Moroder
Hello, is it possible to get the acl entrie of a directory on linux with perl ? Thanks Andreas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Reg Exp: Extract from last appearance of A to first appearance B

2010-04-27 Thread John W. Krahn
HolyNoob wrote: Hi, Hello, I'm trying to make a regexp to match the last appearance of a word (lets say 'abc') until the first appearance of another word (for ex: 'xyz'), and I still cannot do it. For example: with a string like this "abc abc abc toto toto xyz xyz xyz" , which regexp I have

Re: Reg Exp: Extract from last appearance of A to first appearance B

2010-04-27 Thread Erez Schatz
All this and more is available at http://perldoc.perl.org/perlre.html On 27 April 2010 12:39, Erez Schatz wrote: > You need to specify that the string you look for should not appear in > the part you try to extract, meaning instead of .*? you should be > looking for (not abc)*? In perl, we have t

Re: Reg Exp: Extract from last appearance of A to first appearance B

2010-04-27 Thread Erez Schatz
You need to specify that the string you look for should not appear in the part you try to extract, meaning instead of .*? you should be looking for (not abc)*? In perl, we have the negative lookahed for that: (?!...): m/abc((.(?!abc))*?)xyz/ However, this would fail if you have a string abc abcabc

Reg Exp: Extract from last appearance of A to first appearance B

2010-04-27 Thread HolyNoob
Hi, I'm trying to make a regexp to match the last appearance of a word (lets say 'abc') until the first appearance of another word (for ex: 'xyz'), and I still cannot do it. For example: with a string like this "abc abc abc toto toto xyz xyz xyz" , which regexp I have to use to get "abc toto toto

Re: Perl rounding errors?

2010-04-27 Thread Rob Coops
On Mon, Apr 26, 2010 at 8:04 PM, John W. Krahn wrote: > Rob Coops wrote: > >> >> Thank you all that replied, in the end I copied the rules I learned in >> elementary school about how to round a number to two decimals. I'm sure it >> is a horrible hack and can be done a lot faster, but with a coun