in reply to Splitting up file
use strict; use warnings;
To address your problem it looks like you are comparing against the wrong variable in your if statements:
if($string =~ /# __START_CONFIG__/i) { $action=2; }
Should be:
(I substituted your space for the \s pattern instead, I like it better though if you strictly need a space, I prefer [ ] instead, that's a matter of style, I just like to be very explicit, and it tells me later that I meant to put a space in the pattern. See if these things help.if($value =~ /#\s__START_CONFIG__/i) { $action = 2; }
|
|---|