Re: Single equals operator inside an if statement

2013-08-15 Thread Alexey Mishustin
2013/8/15 Brian Fraser frase...@gmail.com: On Wed, Aug 14, 2013 at 6:09 PM, Alexey Mishustin shum...@shumkar.ru 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 would provide choices

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, should be

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/

Re: Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
Thanks to all, 2013/8/14 Jim Gibson jimsgib...@gmail.com: 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,

Re: Single equals operator inside an if statement

2013-08-14 Thread Alexey Mishustin
2013/8/15 Uri Guttman u...@stemsystems.com: 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... Doing both in while statements is very common: while( my $line

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 chenggan...@gmail.com вы писали: 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

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, John W. Krahn jwkr...@shaw.ca вы писали: Alexey Mishustin wrote: 1/18/2011, Grantemailgr...@gmail.com вы писали: I came up with these but they don't seem to work reliably: /\.google\..*\/imgres\?/ /\.google\..*\/images\?/ /\.google\..*\/products\?/ /(www.){0,1}(google

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, Alexey Mishustin shum...@shumkar.ru вы писали: 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}/ -- Regards, Alex -- To unsubscribe

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, Uri Guttman u...@stemsystems.com вы писали: AM == Alexey Mishustin shum...@shumkar.ru 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 {a,b} syntax more :) It's more uniform than AM

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, Uri Guttman u...@stemsystems.com вы писали: AM == Alexey Mishustin shum...@shumkar.ru 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 correct term. brackets are []) Eh... Useful

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
1/18/2011, Uri Guttman u...@stemsystems.com вы писали: AM == Alexey Mishustin shum...@shumkar.ru writes: AM 1/18/2011, Uri Guttman u...@stemsystems.com РІС‹ писали: AM == Alexey Mishustin shum...@shumkar.ru writes: AM I used brackets not for storing but for combining in order

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
1/18/2011, Grant emailgr...@gmail.com вы писали: 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

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
1/18/2011, Alexey Mishustin shum...@shumkar.ru вы писали: 1/18/2011, Grant emailgr...@gmail.com вы писали: 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

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
1/18/2011, Uri Guttman u...@stemsystems.com вы писали: AM == Alexey Mishustin shum...@shumkar.ru 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 more uniform than ?,+,* etc. you

Re: Managing two versions of Perl

2010-11-19 Thread Alexey Mishustin
11/19/2010, Chap Harrison c...@pobox.com вы писали: 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

Re: perl net::ssh module

2010-10-14 Thread Alexey Mishustin
10/13/2010, han sun sunhan...@gmail.com 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

Re: perl net::ssh module

2010-10-13 Thread Alexey Mishustin
10/13/2010, han sun sunhan...@gmail.com you wrote: 2010/10/12 Irfan Sayed irfan_sayed2...@yahoo.com 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

Re: perl net::ssh module

2010-10-12 Thread Alexey Mishustin
10/12/2010, Irfan Sayed irfan_sayed2...@yahoo.com 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

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) { print

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() -name('*.html') -in( 'home/usr/perl/html.files' ); -in( '/home/usr/perl

Re: mbtomh in perl?

2009-09-23 Thread Alexey Mishustin
9/23/2009, Shlomi Fish shlo...@iglu.org.il вы писали: 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