Re: Query on Qunatifiers

2010-07-15 Thread Jim Gibson
On 7/15/10 Thu Jul 15, 2010 12:24 PM, "Chandan Kumar" scribbled: > Hi guys, >   > I could able to understand the quantifiers. But still stuck with one > confusion.if dot operator is used with quantifiers. >   > ex: my string is $_="ths is my first regular expression"; >   > please explain t

Re: Query on Qunatifiers

2010-07-15 Thread Chandan Kumar
Hi guys,   I could able to understand the quantifiers. But still stuck with one confusion.if dot operator is used with quantifiers.   ex: my string is $_="ths is my first regular expression";   please explain the  below  questions with answer. 1)thi.*? 2)thi.+? 3)thi.+?s 4)thi.*?s     Thanks

Re: unary not?

2010-07-15 Thread Dr.Ruud
Chas. Owens wrote: On Thu, Jul 15, 2010 at 09:52, Dr.Ruud wrote: perl -wle ' print --$| for 1..4; ' 1 0 1 0 snip Interesting behavior. That isn't documented in perlvar. see perlgolf :) -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: b

Re: unary not?

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 14:04, Shawn H Corey wrote: snip >> Yeah, I am an idiot.  My only excuse is that I had just woken up. snip > I find it best not to answer questions before the first cup of coffee.  ;) snip I haven't had any caffeine for over two years now. That may explain some things. -

Re: unary not?

2010-07-15 Thread Shawn H Corey
On 10-07-15 12:47 PM, Chas. Owens wrote: On Thu, Jul 15, 2010 at 11:50, Uri Guttman wrote: "CO" == Chas Owens writes: CO> No, you can say CO> $a = !a; CO> or CO> $a != $a; that is a no-op. ! isn't a binary op so it can't be used as an assignment op. != is just the numeric com

Re: unary not?

2010-07-15 Thread Uri Guttman
> "CO" == Chas Owens writes: CO> On Thu, Jul 15, 2010 at 11:50, Uri Guttman wrote: >>> "CO" == Chas Owens writes: >> >>  CO> No, you can say >> >>  CO> $a = !a; >> >>  CO> or >> >>  CO> $a != $a; >> >> that is a no-op. ! isn't a binary op so it can't be used

Re: checking a directory in a remote system using perl

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 06:12, Sooraj S wrote: snip >> Opening a telnet connection does not mean that Perl code will run on >> the remote system.  You should also not be using telnet as it is very >> insecure.  Look up ssh, configure your ssh keys, and try something snip >  Thanks for your reply.

Re: unary not?

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 11:50, Uri Guttman wrote: >> "CO" == Chas Owens writes: > >  CO> No, you can say > >  CO> $a = !a; > >  CO> or > >  CO> $a != $a; > > that is a no-op. ! isn't a binary op so it can't be used as an > assignment op. != is just the numeric comparison not equal op. so that

Re: checking a directory in a remote system using perl

2010-07-15 Thread Jim Gibson
> Hi, > Thanks for your reply. Actually i need to login to a remote machine > and do some series of steps including creating,editing and taring some > files and executing some other scripts..The remote machine is in our > local network itself..so there is no security issues and thats why i > am us

Re: unary not?

2010-07-15 Thread Uri Guttman
> "CO" == Chas Owens writes: CO> No, you can say CO> $a = !a; CO> or CO> $a != $a; that is a no-op. ! isn't a binary op so it can't be used as an assignment op. != is just the numeric comparison not equal op. so that last line is always false and doesn't change $a. uri -- Uri G

Re: unary not?

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 09:52, Dr.Ruud wrote: > Bryan R Harris wrote: > >> Out of curiosity, is there a unary not operator in perl? >> >>  i.e.  "$a = $a+1"   is the same as   "$a++" >> >> Is there a similarly short form of "$a = !$a"?  Like "$a!!"?  (tried it >> and >> it didn't work.) > > perl -

Re: unary not?

2010-07-15 Thread Dr.Ruud
Bryan R Harris wrote: Out of curiosity, is there a unary not operator in perl? i.e. "$a = $a+1" is the same as "$a++" Is there a similarly short form of "$a = !$a"? Like "$a!!"? (tried it and it didn't work.) If it was there it should be ^^, not !!. $a += 1 <=> $a++ $a

Re: checking a directory in a remote system using perl

2010-07-15 Thread Sooraj S
On Jul 15, 4:57 am, chas.ow...@gmail.com ("Chas. Owens") wrote: > On Wed, Jul 14, 2010 at 10:16, Sooraj S wrote: > >  Hi I am very new to perl. I want to login to a remote machine and > > check a directory exists or not. > > > my code: > > > > > using Net::Telnet; > > > $t = new Net::Teln

Re: Track user login status

2010-07-15 Thread Brandon McCaig
On Sat, Jul 10, 2010 at 11:13 PM, Jeff Pang wrote: > Session or Cookie is a general way for this purpose. > Are you programming under mod_perl? > Even under mod_perl CGI::Session is better than Apache::Session from my > experience. > Or you could try CGI::Cookie instead. Though a cookie is only

Re: unary not?

2010-07-15 Thread Dr.Ruud
Bryan R Harris wrote: Out of curiosity, is there a unary not operator in perl? i.e. "$a = $a+1" is the same as "$a++" Is there a similarly short form of "$a = !$a"? Like "$a!!"? (tried it and it didn't work.) perl -wle ' print --$| for 1..4; ' 1 0 1 0 -- Ruud -- To unsubscribe,

Re: unary not?

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 02:32, Bryan R Harris wrote: > > > Out of curiosity, is there a unary not operator in perl? > >  i.e.  "$a = $a+1"   is the same as   "$a++" > > Is there a similarly short form of "$a = !$a"?  Like "$a!!"?  (tried it and > it didn't work.) snip No, you can say $a = !a; o

Re: Query on Qunatifiers

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 03:22, Thomas Bätzler wrote: snip > In RE, a "." by itself is the atom that matches any one character. > > The quantifiers mean: > > "?" 0 or 1 occurences of the previous expression. > "+" 1 or more occurrences of the previous expression (greedy match). > "*" 0 or more occu

Re: unary not?

2010-07-15 Thread Jeff Pang
2010/7/15 Bryan R Harris : > > > Out of curiosity, is there a unary not operator in perl? > >  i.e.  "$a = $a+1"   is the same as   "$a++" > > Is there a similarly short form of "$a = !$a"?  Like "$a!!"?  (tried it and > it didn't work.) > I dont think that's helpful much for the actual programmin

unary not?

2010-07-15 Thread Bryan R Harris
Out of curiosity, is there a unary not operator in perl? i.e. "$a = $a+1" is the same as "$a++" Is there a similarly short form of "$a = !$a"? Like "$a!!"? (tried it and it didn't work.) - Bryan -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-m

Re: AW: Query on Qunatifiers

2010-07-15 Thread Chandan Kumar
Hi ,   Thanks guys for your quick response.   I will try it out combinations and get back to you if i have issues.       Regards, chandan. --- On Thu, 15/7/10, Thomas Bätzler wrote: From: Thomas Bätzler Subject: AW: Query on Qunatifiers To: "Beginners Perl" Cc: "Chandan Kumar" Date: Thursday

Re: \1 in character class?

2010-07-15 Thread C.DeRykus
On Jul 14, 2:59 pm, chas.ow...@gmail.com ("Chas. Owens") wrote: > On Wed, Jul 14, 2010 at 00:50, C.DeRykus wrote: > > snip>> s/(\w+)\s/$1 /g; > snip > > Neat.  Using the \K construct available in 5.10, you can even > > eliminate the need for the capture: > > >   s/  \w+  \K \s / /gx; > > snip > >

AW: Query on Qunatifiers

2010-07-15 Thread Thomas Bätzler
Chandan Kumar asked: > I have query over quantifiers. > > Could you please explain the combination of operators Question mark > (?),dot(.),star(*),plus(+). > > Say this is my string: > > $_ = " this is my first pattern ,quite confused with quantifiers" > > ex: (thi.*?) or (thi.+?) etc > >

Re: Query on Qunatifiers

2010-07-15 Thread Shlomi Fish
On Thursday 15 Jul 2010 09:51:32 Chandan Kumar wrote: > Hi , > > I have query over quantifiers. > > Could you please explain the combination of operators Question mark > (?),dot(.),star(*),plus(+). > Say this is my string: > > $_ = " this is my first pattern ,quite confused with quantifi