in reply to How to take only maximum directory name by using its digits using perl?

Why is rev1.html in rev2 folder ?

| `-- rev1 | | `-- rev1.html | `-- rev2 | `-- rev1.html

Run this Short, Self Contained, Compilable, Example and see if you can spot the error in your posted code.

#!/usr/bin/perl use strict; while (<DATA>) { if (/rev_(\d)+/) { # what does this match ? print "'$1' matched in $_"; } } __DATA__ `-- added |-- add.txt `-- added1 |--action | |-- action.txt | `-- rev1 | | `-- rev1.html | `-- rev2 | `-- rev1.html `-- add.html
poj

Replies are listed 'Best First'.
Re^2: How to take only maximum directory name by using its digits using perl?
by Anonymous Monk on Mar 29, 2017 at 06:19 UTC
    I'm not sure what's in the OP's log file. Based on his previous questions, I'm guessing it's actually the result of running something like find . -print on the directory structure he posted an ASCII picture of. Asking finddata rhetorical questions never produces any useful result.
Re^2: How to take only maximum directory name by using its digits using perl?
by finddata (Sexton) on Mar 29, 2017 at 05:57 UTC
    rev1.html can appera in any folders i should filter the folders names by using its digits .No need to consider about the files inside those folders.
Re^2: How to take only maximum directory name by using its digits using perl?
by finddata (Sexton) on Mar 29, 2017 at 06:13 UTC
    The above does not print anything.It looks empty ?
      It's empty because the code expects an underscore between "rev" and the number.