I appreciate the suggestions from Mike, Michael and John around my log
parsing questions.
When attempting to match 'or' conditions using the the m!! and x pattern
match operators, would this construct be correct?
In other words, does this m// attempt :
# match lines begining with #, or lines that contain 'CommmunityID=399', or
lines that contain these paths
if (
m/^#|CommunityID\=399|\/developersupport\/testfiles|\/remotegadgets\/marks\/
gadget/ ) {
print NEWLOG;
equate to this m!!x attempt:
21 while ( my $line = <LOG> ) {
22 while ( m!
23 ^# # match lines that start with
'#'
24 CommunityID=399 # or lines that
contain
25 /developersupport/testfiles
26 /remotegadgets/marks/gadget/
27 !x)
28 print NEWLOG;
29 }
When running with strict and use diagnostics, I get this error.
syntax error at line 28, near ")
print"
(Might be a runaway multi-line !! string starting on line 22)
Execution aborted due to compilation errors (#1)
(F) The final summary message when a Perl compilation fails.
Uncaught exception from user code
Rob
|