in reply to Pattern Matching problem

Please use code tags!

Your problem lies in the line

my $content =~ m/(\/$string\/a-z*)/g;

This tries to match your pattern against the string in $content which is not defined at this point in time. You could try something like:

my @content = $_ =~ m/(\/$string\/a-z*)/g;

which captures all matches into the array @content.

What is also funny about your code is the loop foreach(@daten){. You do not seem to be using the elements of @daten anywhere. Should this not be something like foreach my $daten (@daten){?

Replies are listed 'Best First'.
Re^2: Pattern Matching problem
by auhakim (Novice) on Jun 04, 2013 at 12:46 UTC

    can i just post my whole code? so you can analyze my problem? ive tried the whole solution but it still does not work

      If it is not tons of lines...
      It would also be good if it runs standalone without requiring any extra inputs, files etc.

        I hope you dont considered those code as ton of lines codes. and the input file is just the list of directory which should be scanned