Re: regular expression - ?(foo.*)?

2010-03-02 Thread Durairaj Muthusamy
Thanks very much for clearing my doubts. Regards, Durai On Tue, Mar 2, 2010 at 7:44 PM, Johann Markl wrote: > Hello > > Durairaj Muthusamy wrote: >>  I am a newbie and need your help. The following script doesn't >> display the first print statement like the second one. >>  Why? > >>         pri

Re: Script runs fine when passed args directly, not as stdin

2010-03-02 Thread Shlomi Fish
On Tuesday 02 Mar 2010 22:07:28 Joseph L. Casale wrote: > >I'm commenting on your code below with some general remarks. Not sure if > >this will fix your problem. > > Shlomi, > I greatly appreciate your time going through this, I have undergone > rewriting it from scratch with your suggestions. It

RE: Script runs fine when passed args directly, not as stdin

2010-03-02 Thread Joseph L. Casale
>I'm commenting on your code below with some general remarks. Not sure if this >will fix your problem. Shlomi, I greatly appreciate your time going through this, I have undergone rewriting it from scratch with your suggestions. It was a script I copied from an existing one which was a bad idea:)

Re: regular expression - ?(foo.*)?

2010-03-02 Thread Johann Markl
Hello Durairaj Muthusamy wrote: > I am a newbie and need your help. The following script doesn't > display the first print statement like the second one. > Why? > print "First: $&" if ?(foo.*)?; > print "Second: $&" if /(foo.*)/; The delimiters for the regular expressions behav

Re: regular expression - ?(foo.*)?

2010-03-02 Thread raphael()
On Tue, Mar 2, 2010 at 5:45 PM, Durairaj Muthusamy wrote: > Hi, > > I am a newbie and need your help. The following script doesn't > display the first print statement like the second one. > Why? > > @str = qw(NEW food foosball newstr foobasefoot); > > $\ = "\n"; > > foreach(@str) > { >pr

regular expression - ?(foo.*)?

2010-03-02 Thread Durairaj Muthusamy
Hi, I am a newbie and need your help. The following script doesn't display the first print statement like the second one. Why? @str = qw(NEW food foosball newstr foobasefoot); $\ = "\n"; foreach(@str) { print "First: $&" if ?(foo.*)?; print "Second: $&" if /(foo.*)/; } Output

Re: how to open folder in win explorer using perl script

2010-03-02 Thread Simphiwe Mkhize
I didnt put all code is too big just need function or module to use On Tue, Mar 2, 2010 at 2:08 PM, raphael() wrote: > > > On Tue, Mar 2, 2010 at 4:40 PM, Simphiwe Mkhize wrote: > >> Hi all >> >> can you please I need script to open existing *folder* in my document. I >> don't want to read any f

how to open folder in win explorer using perl script

2010-03-02 Thread Simphiwe Mkhize
Hi all can you please I need script to open existing *folder* in my document. I don't want to read any file just to open window explorer. the following coding sample thing will lead solution $cur_dir ="D:\ecco\data"; system (Explorer.exe, $cur_dir); or opendir(Explorer.exe, $cur_dir ) Kind r

Re: Script runs fine when passed args directly, not as stdin

2010-03-02 Thread Shlomi Fish
Hi jlc! On Tuesday 02 Mar 2010 06:38:09 Joseph L. Casale wrote: > Hi, > I should state first I don't have the luxury of using Perl often > and am super rusty:) > > I have a script that sends snmp commands to a switch either by passing > args directly or as stdin. It works when passing them direct

Re: mech->content match regex howto

2010-03-02 Thread raphael()
On Tue, Mar 2, 2010 at 1:46 PM, John W. Krahn wrote: > raphael() wrote: > >> >> Cool! I have to admit that is a "detailed" answer. >> Also thanks for clearing out the differences between these two.. >> >> ( my $ip = $last_page ) =~ m/([\d+\.]+)/; >> ( my $ip ) = ( $last_page ) =~ m/([\d+\.]+)/; >

Re: mech->content match regex howto

2010-03-02 Thread John W. Krahn
raphael() wrote: Cool! I have to admit that is a "detailed" answer. Also thanks for clearing out the differences between these two.. ( my $ip = $last_page ) =~ m/([\d+\.]+)/; ( my $ip ) = ( $last_page ) =~ m/([\d+\.]+)/; Just to clear out any misunderstanding "by above one" I meant ( my $ip =