Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by moroshko

  1. moroshko

    What's wrong with my program (2 short lines!!) ?

    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...
  2. moroshko

    Interpolation in regex

    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...
  3. moroshko

    Interpolation in regex

    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 !
  4. moroshko

    What's wrong with my program (2 short lines!!) ?

    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 =~...
  5. moroshko

    2 little questions about lists and hashes

    Thanks !
  6. moroshko

    2 little questions about lists and hashes

    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 !!
  7. moroshko

    Create a list of files (recursively)

    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 !
  8. moroshko

    Double Quotes Vs Single Quotes

    Thanks a lot !!
  9. moroshko

    Double Quotes Vs Single Quotes

    Oh.. now it makes sence ! Thank you ! Where I can read about the interpolation of special characters like '\b', '\n' and so on.... ?
  10. moroshko

    Double Quotes Vs Single Quotes

    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...
  11. moroshko

    Double Quotes Vs Single Quotes

    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...
  12. moroshko

    A question about groups in regular expressions

    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)?/) {...
  13. moroshko

    A little question about "print"

    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...
  14. moroshko

    A little question about "print"

    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 !

Part and Inventory Search

Back
Top