in reply to Help on pattern match

You don't change $inc, so no surprise it contains the whole line.

if (my ($file) = $inc =~ /(FILE_INPUT_\w+)/) { print("$file\n"); }

Update: Replaced print("$inc\n"); as per reply.

Replies are listed 'Best First'.
Re^2: Help on pattern match
by CountZero (Bishop) on Mar 18, 2009 at 13:26 UTC
    Don't you mean:
    if (my ($file) = $inc =~ /(FILE_INPUT_\w+)/) { print("$file\n"); }

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^2: Help on pattern match
by Anonymous Monk on Mar 18, 2009 at 13:19 UTC
    Thanks ikegami. It solved my problem.