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!

Search results for query: *

  • Users: moroshko
  • Content: Threads
  • Order by date
  1. 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 !
  2. 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 =~...
  3. 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 !!
  4. 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 !
  5. 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...
  6. 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)?/) {...
  7. 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