Re: Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
2013/8/15 Brian Fraser : > On Wed, Aug 14, 2013 at 6:09 PM, Alexey Mishustin >> I'm sorry only that there is no built-in option with which one could >> enable/disable easily assignments inside `if'. (E.g., like re 'eval'/ >> no re 'eval'). It wo

Re: Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
2013/8/15 Uri Guttman : > On 08/14/2013 04:22 PM, Jim Gibson wrote: >> >> >> On Aug 14, 2013, at 12:30 PM, Alexey Mishustin wrote: >> >>> Testing a value and assigning it - I have never done this at the same >>> time... >> >> >> >&

Re: Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
Thanks to all, 2013/8/14 Jim Gibson : > The problem is that the construct > > if( $foo = $bar ) { > ... > > is not always a typo. It means: "assign value of $bar to variable $foo and > test if the result is logically true", which is perfectly valid. If that were > not allowed, then you wo

Re: Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
Hi Jing, Thanks for the reply. So, there is no built-in way to catch these typos? -- Regards, Alex -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
Hello all, If I make a typo and write a single "equals" operator here: #!/usr/bin/perl use strict; use warnings; my $foo = 1; my $bar = 2; if ($foo = 2) { print "yes\n"; } else { print "no\n"; } ...then the "warnings" pragma works OK and tells me "Found = in conditional, shoul

Re: it told me that Can't open perl script " hello.p1" No such file or directory

2011-05-23 Thread Alexey Mishustin
5/23/2011, "Gang Cheng" вы писали: >hi, > > I instaled my perl under the e:\r_software\perl. > I wrote a hello world programme as below > >#! /usr/bin/perl >print “Hello,word!\n”; > >and save it under e:\ as perl.p1 > >but when I run it with the window commend line as > > >E:\ perl hello.p1

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, "Uri Guttman" вы писали: >>>>>> "AM" == Alexey Mishustin writes: > > AM> 1/18/2011, "Uri Guttman" РІС‹ писали: > > >>>>>>> "AM" == Alexey Mishustin writes: > >> &

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, "Uri Guttman" вы писали: >>>>>> "AM" == Alexey Mishustin writes: > > AM> I used brackets not for storing but for combining in order to use the > AM> combined patterns in alternation. > >the point is parens >(the cor

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, "Uri Guttman" вы писали: >>>>>> "AM" == Alexey Mishustin writes: > AM> /(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/ > >> > >> {0,1} is just ? by itself. > > AM> Yes, I know. But I like the

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, "Alexey Mishustin" вы писали: >I meant > >(imgres) > >OR > >(images) > >OR > >(products) Uri wrote the correct alternation for that: (imgres|images|products) So, I should write /(www\.){0,1}(google\.).*\/(imgres|images|products)\?{0,1

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, "John W. Krahn" вы писали: >Alexey Mishustin wrote: >> >> 1/18/2011, "Grant" вы писали: >> >>> I came up with these but they don't seem to work reliably: >>> >>> /\.google\..*\/imgres\?/ >>>

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
1/18/2011, "Uri Guttman" вы писали: >>>>>> "AM" == Alexey Mishustin writes: > > AM> /(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/ > >{0,1} is just ? by itself. Yes, I know. But I like the {a,b} syntax more :) It's mo

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
1/18/2011, "Alexey Mishustin" вы писали: > >1/18/2011, "Grant" вы писали: > >>> I'm trying to come up with a regex that will match any Google Images >>> URL such as these: >>> >>> www.google.com/imgres >&

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
1/18/2011, "Grant" вы писали: >> I'm trying to come up with a regex that will match any Google Images >> URL such as these: >> >> www.google.com/imgres >> www.google.com/images >> google.com/imgres >> www.google.co.uk/imgres >> www.google.nl/imgres >> >> and a second regex for Google Products UR

Re: Managing two versions of Perl

2010-11-19 Thread Alexey Mishustin
11/19/2010, "Chap Harrison" вы писали: >Hi folks, > >The current version of Ubuntu Linux I'm using comes with Perl 5.10.1, but I >want to install and develop under 5.12.2. From what I've read in Perlmonks >and Stackoverflow, it's not difficult to install a separate version - all it >needs is

Re: perl net::ssh module

2010-10-13 Thread Alexey Mishustin
10/13/2010, "han sun" you wrote: >Math::BigInt::couldn't load specified math lib(s), fallback to >Math::BigInt::FastCalc at C:/Program Files/Perl/Site/site/lib/Crypt/DH.pm >line 6 > >I have google the problem,but still haven't worked it out. >It's too late, I have to go to sleep. >If somebody kn

Re: perl net::ssh module

2010-10-13 Thread Alexey Mishustin
10/13/2010, "han sun" you wrote: >2010/10/12 Irfan Sayed > >> now getting following error: >> >> Key class 'Net::SSH::Perl::Key::RSA' is unsupported: Cannot find current >> script >> './igor_tar.pl' at /home/y/lib/perl5/5.8/FindBin.pm line 188 >> BEGIN failed--compilation aborted at /home/y/lib

Re: perl net::ssh module

2010-10-12 Thread Alexey Mishustin
10/12/2010, "Irfan Sayed" you wrote: >i am using this code : > >my $host = "abc.data.com"; > my $user = "ybici1"; > my $id_file = "/home/ybici1/.ssh/openid"; > my $ssh = Net::SSH::Perl->new($host,$user,$id_file); > my($stdout, $stderr, $exit) = $ssh->cmd("ls /homes/ybici1"); > print "$stdout\n";

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread Alexey Mishustin
2.10.2010, 15:22:03, Alexey Mishustin wrote: > 2.10.2010, 13:57:54, "jobst müller" wrote: >> #!/usr/bin/perl >> use strict; >> use warnings; >> use diagnostics; >> use File::Find::Rule; >> my @files = File::Find::Rule->file() >> ->

Re: path names in a perl-script: a newbie-question regarding I-O convertions on OpenSuse Linux 11.3

2010-10-02 Thread Alexey Mishustin
2.10.2010, 13:57:54, "jobst müller" wrote: > #!/usr/bin/perl > use strict; > use warnings; > use diagnostics; > use File::Find::Rule; > my @files = File::Find::Rule->file() > ->name('*.html') > ->in( 'home/usr/perl/html.files' ); ->in( '/home/usr/perl/html.files' ); > foreach my $file(@files

Re: mbtomh in perl?

2009-09-23 Thread Alexey Mishustin
9/23/2009, "Shlomi Fish" вы писали: >> Is there a perl tool for converting mbox files to MH directories? [snip] >Try the Mail::Box module: > >http://search.cpan.org/dist/Mail-Box/ > >It seems to still be the best of breed in this regard from what some >authoritative sources in the Perl Email Pr