Hi Kevin,
Thank you for the advice !
From now I will not use () in print.
But still, I want to understand why the warning appears.
I saw the link above but still don't understand.
All I'm trying to check is if "func(" can be found in $s.
I have noticed that if remove ( after "func" (even...
Kevin, Thank you very much anyway !
I appreciate your wish to help !!
By the way, I'm not a student.
I have a degree in Math+Computer Science, but I never learned Perl.
Now, I'm learning Perl from internet.
I must admit that I like it very much !!!
Tell me please, do you know another Perl...
I have the following program:
#!/usr/bin/perl
use warnings;
use strict;
my $_ = 'Hello$xWorld';
my $x = 'abc';
print /$x/;
The output is nothing :(
How can I ask Perl not to interpolate $x ?
Thanks in advance !
Hello experts !
When I run the program below I get the following:
print (...) interpreted as function at C:\perlscripts\hello.pl line 6.
1
Why is this warning appears and what is the meaning of it ?
Thanks !
#!/usr/bin/perl
use warnings;
use strict;
my $s = 'func(a,b)';
print ($s =~...
Hello !
I have 2 little questions:
1) How do I ask Perl if $x belongs to list @array ?
2) How do I ask Perl if $x is one of the keys of hash %h ?
Thanks !!
Hello experts !
What is the most efficient way to get a list of all file names (a full path) in a certain directory ?
This should work recursively and include only files (not directories).
Thanks in advance !
Thanks Steve,
So I understand that
.*(\bCAT\b).*
interpolates to
.*CA).*
i.e. I guess that
(\b
and
T\b
interpolates to empty string.
Is there some rule that any character followed by \b is interpolated to the empty string ?
Where I can find the full description of what exactly is...
Hi !
Can anyone tell me please why the following program does not found the word CAT ?
If I put the pattern in single quotes, it works.
Why ??
#!/usr/bin/perl
use warnings;
use strict;
$_ = 'laKJJlala AHAJJ--- CAT =-=-123 sad(!@*# xsaa KUKU ff';
my $pattern = ".*(\bCAT\b).*";
my @arr;
my...
Can someone tell me please why in the following program $1 is not defined ? I thought that every group (every pair of parentheses) is going to $1, $2, $3 and so on.
Where am I wrong ?
Which pairs of parentheses are going to $1, $2, $3, ... ?
Thanks in advance !!
$_ = "a bc";
if (/(bc)?/) {...
Hi Franco,
Thank you for the explanation.
I agree with what you said, but still cannot understand the issue.
What do you mean by "special false value" ? Does Perl has "false value" and "special false value" ?
As I understand, 3==4 evaluates as false, but "print" expect list, so 3==4 evaluated in...
Hello !
Can someone explain me please why
print 3==4;
prints nothing ?
I would expect 3==4, which is false, to be converted to 0, so I expect "print" to print "0". Where am I wrong ?
Thanks !
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.