Smart matching

2011-01-18 Thread Vladimir D Belousov
I'm trying to check whether the given key exists in the hash. The simple example: use feature ':5.10'; my %a = (a = 1, b = 2); say %a ~~ 'a' ? 'YES' : 'NO';# says NO -- why? say %a ~~ 'c' ? 'YES' : 'NO';# says NO say 'a' ~~ %a ? 'YES' : 'NO';# says YES say 'c' ~~ %a ? 'YES' : 'NO';

Re: Smart matching

2011-01-18 Thread Vladimir D Belousov
19.01.2011 0:09, Uri Guttman пишет: but why don't you just call exists on the hash key? there is no win to using smart matching for that. it is included for consistancy but it isn't needed for hash keys. I just want to understand how does it work :) -- To unsubscribe, e-mail:

Re: Smart matching

2011-01-18 Thread Vladimir D Belousov
19.01.2011 0:43, Brian Fraser пишет: The smart match is no longer commutative - That was removed after 5.10.1, I think. http://www.learning-perl.com/?p=32 http://perldoc.perl.org/perlsyn.html#Smart-matching-in-detail Brian. Thank you! -- To unsubscribe, e-mail:

Graphic files visual modofocation in Perl

2005-05-24 Thread Vladimir D Belousov
Hallo all! I beg your pardon for this question - the question more theoretical, rather than practical. Whether there is a modules for geometry transformation of the images? In particular, I need rotate and change geometry (perspective, resize)? Thanks a lot for any answers! -- Vladimir D

Re: Graphic files visual modofocation in Perl

2005-05-24 Thread Vladimir D Belousov
Chris Devers wrote: On Tue, 24 May 2005, Vladimir D Belousov wrote: Whether there is a modules for geometry transformation of the images? In particular, I need rotate and change geometry (perspective, resize)? Yes. ImageMagick is the most common way to do this. It's a toolkit

Re: MIME::Lite HTML email

2005-05-14 Thread Vladimir D Belousov
and how can I get rid of it: Content-type: text/html Content-transfer-encoding: binary Content-disposition: inline Content-length: 155 Thanks, Mark -- Vladimir D Belousov -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http

Re: Finding comment tags

2005-05-13 Thread Vladimir D Belousov
; !-- This is the comment. 53, Am I wrong? -- -- How do you protect mail on web? I use http://www.2pu.net [Flon's Law: There is not now, and never will be, a langua] -- Vladimir D Belousov HiTech solutions for business http://businessreklama.ru -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Number of Items in Array

2005-04-18 Thread Vladimir D Belousov
. Clarkson -- Vladimir D Belousov -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: last question on the switch statement ....

2005-04-18 Thread Vladimir D Belousov
'Unkopen' do { next; last SWITCH; }; $_ eq 'QCSSopen' do { $rep = Quest Central for SQL Server; last SWITCH; }; $_ eq 'QCSSDGopen' do { $rep = QCSS Data Generator; last SWITCH; }; $_ eq 'IWopen' do { $rep = I/Watch; last SWITCH; }; ##etc## -- Vladimir D Belousov

Re: Number of Items in Array

2005-04-18 Thread Vladimir D Belousov
John Doe wrote: Am Montag, 18. April 2005 10.53 schrieb Vladimir D Belousov: Charles K. Clarkson wrote: Aaron C. de Bruyn mailto:[EMAIL PROTECTED] wrote: : In the Perl documentation (perlintro) it says that you can find out : the number of elements in an array using the following syntax

MIME::Lite attachments encode

2005-04-10 Thread Vladimir D Belousov
Hallo all! I'm using MIME::Lite to create multipart/mixed messages. But I have the problem with attach() method - I have already encoded attachments and do this: use MIME::Lite; ... sub create_message { my $self=shift; $MIME::Lite::AUTO_ENCODE=0; . my $msg = MIME::Lite-new(.);

How can I take subarray without second array (drop other elements)?

2005-04-07 Thread Vladimir D Belousov
Hallo, all! I have a function which prints array: sub print_array { my $array_ref = shift; for(@$array_ref){ print $_\n; } } And I have a big array, for example named @array. I want to print @array elements from N to N+100 using this function, but don't want to use second array (they are

Re: How can I take subarray without second array (drop other elements)?

2005-04-07 Thread Vladimir D Belousov
John Doe wrote: Am Donnerstag, 7. April 2005 14.54 schrieb Vladimir D Belousov: Hallo, all! Hi Wim has already presented the solution for your problem; [...] I do this: $#array = $N+100; print_array($array[$N]); this should be print $array-[$N] I see, but $array here

Re: How can I take subarray without second array (drop other elements)?

2005-04-07 Thread Vladimir D Belousov
be very big and I wish to avoid excessive copying of data. Therefore I don't want use splice function. Jay Savage wrote: On Apr 7, 2005 8:54 AM, Vladimir D Belousov [EMAIL PROTECTED] wrote: Hallo, all! I have a function which prints array: sub print_array { my $array_ref = shift

Directory fastscan

2005-03-15 Thread Vladimir D Belousov
]directory found return 1 if (lstat)[1] 004 $_ !~ /^\.+/; } return 0; //No subdirs found. } And for example: chdir(/path/to/dir/); print /path/to/dir has .(is_node(./) ? : not). directory(s)\n; -- Vladimir D Belousov -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Directory fastscan

2005-03-15 Thread Vladimir D Belousov
Sorry, I mean sub is_node { my $cur_dir = shift; opendir(DIR, $cur_dir) || return 0; my @dirs = readdir(DIR); closedir(DIR); for(@dirs){ //Looking up directory until any [sub]directory found return 1 if (lstat)[2] 004 $_ !~ /^\.+/; } return 0; //No subdirs found. } Vladimir D Belousov

VFS_VGET(9) in perl

2005-03-14 Thread Vladimir D Belousov
Is it possible in perl to get the reference to object of file system, if I have inode? Equivalent VFS_VGET(9) for example? -- Vladimir D Belousov HiTech solutions for business http://businessreklama.ru -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Returning to my program after exiting vi.

2005-03-07 Thread Vladimir D Belousov
That's right, but you should better use my $viRetValue = system(command, string); In this case the command interpreter will not be used and that is more safe. Rathna N wrote: You should be able to do it, by waiting for the return value. Ex: viRetValue=system(Comnnad String); or viRetValue =

Re: Invalid data-time stamps

2005-03-07 Thread Vladimir D Belousov
Hallo! Try to change directory to $ARGV[0] before open: chdir($ARGV[0]) || die Cannot change dir: $!\n; opendir $DIRHANDLE, ./; . And (may be) It is better to use lstat(2) instead of stat(2) ? In this case there will be correct dates of symbolic links. Bret Goodfellow wrote: Hi all, I am

Re: encoding script pain

2005-03-04 Thread Vladimir D Belousov
in adv Saurabh -- Vladimir D Belousov HiTech solutions for business http://businessreklama.ru -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Perl script and mod_rewrite

2005-03-03 Thread Vladimir D Belousov
, the browser's address bar then changes to (e.g.) http://mysite.com/pages/1234?id=1234 The page is displayed correctly. But why is the query string added? The form's default method should be post, and the username/password are not displayed in the query string. Thanks, Jan -- Vladimir D Belousov

Re: Perl script and mod_rewrite

2005-03-03 Thread Vladimir D Belousov
Vladimir D Belousov wrote: just try: $q-start_form(-method=POST); I'm wrong, sorry. Can I see your .htaccess in part of ModRewrite directives? Jan Eden wrote: Hi, I use mod_rewrite to provide simpler URLs for my database-driven site. My document root's .htaccess contains the following line

Re: Perl script and mod_rewrite

2005-03-03 Thread Vladimir D Belousov
Jan Eden wrote: Vladimir D Belousov wrote on 03.03.2005: Vladimir D Belousov wrote: just try: $q-start_form(-method=POST); I'm wrong, sorry. Can I see your .htaccess in part of ModRewrite directives? Sure (abbreviated): RewriteEngine on RewriteBase / RewriteRule ^news/?$ cgi

Re: Verify that a directory exists.

2005-02-28 Thread Vladimir D Belousov
and other programming languages. I want to verify that a directory exists, but I don't know the way tho do it. Regards. -- Vladimir D Belousov HiTech solutions for business http://businessreklama.ru -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Case-operator

2005-02-28 Thread Vladimir D Belousov
Hallo! Is in the perl operator like C/C++ 'case' ? -- Vladimir D Belousov HiTech solutions for business http://businessreklama.ru -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: printing output of a command

2005-02-21 Thread Vladimir D Belousov
... But if you have enabled SuEXEC (see the `httpd -l` output), your CGI scripts will run as user/group you specify. Paul Archer wrote: This is a very common problem. When you run the script from the command line, you are running it with different privileges and a different path than when the

Re: printing output of a command

2005-02-21 Thread Vladimir D Belousov
... But if you have enabled SuEXEC (see the output `httpd -l`), your script will run as user/group you specify. Paul Archer wrote: This is a very common problem. When you run the script from the command line, you are running it with different privileges and a different path than when the web

Re: printing output of a command

2005-02-21 Thread Vladimir D Belousov
Why root? Just the user who has permissions to do something. Paul Archer wrote: Beware that this can be a fix that causes more problems. It's very tempting to let the web server run as root--which opens up a big can of security worms. Paul 11:25am, Vladimir D Belousov wrote: ... But if you

Re: Perl waits for while to finish before printing if on the same line, why?(countdown prog)

2005-02-21 Thread Vladimir D Belousov
Charles K. Clarkson wrote: Harold Castro [EMAIL PROTECTED] wrote: : my $countdown = 5; : while ($countdown 0){ : print \.; No need to escape the period in a double quoted string. : sleep 1; : $countdown--; : } : print Kaboom!! : : And the result.. : after waiting for 5 seconds, it displayed

Re: Cannot connect

2005-02-21 Thread Vladimir D Belousov
MySQL 4.1 and hiegher require different auth methods than older versions. You have to upgrade your DBI.pm DBD/mysql.pm. In the other way you may reset the password(s) to the old style: mysql SET PASSWORD FOR - '/|some_user|/'@'/|some_host|/' = OLD_PASSWORD('/|newpwd|/'); Follow this link: