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';
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:
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:
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
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
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
;
!-- 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
. 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
'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
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
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(.);
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
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
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 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
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
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
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 =
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
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
, 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
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
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
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
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
... 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
... 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
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
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
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:
30 matches
Mail list logo