- or download this
$string = "foo bar";
@match = $string =~ m/(f(oo)) (b(ar))/
...
print "$match[1]\n"; # prints "oo" (captured by /(oo)/
print "$match[2]\n"; # prints "bar" (captured by /(b(ar))/
print "$match[3]\n"; # prints "ar" (captured by /(ar)/
- or download this
use Data::Dumper;
...
test1.cpp 0.00% of 21 0.00% of 16
test2.c None 16.53% of 484
test3.h 0.00% of 138 None
- or download this
[... snip ...]
test1.cpp 0.00% of 21 0.00% of 16
...
undef,
undef
[... snip ...]
- or download this
/(.*\.(?:c|cpp|h))\s+/ # Use (?:...) to create a non-capturing group
+.
- or download this
# I always start my script with these two lines.
# They prevent you from making various mistakes
...
test1.cpp 0.00% of 21 0.00% of 16
test2.c None 16.53% of 484
test3.h 0.00% of 138 None
- or download this
test1.cpp 0.00% of 21 0.00% of 16
Title: test1.cpp
...
Title: test3.h
Percent2: 0.00% of 138
Percent3: None