in reply to Re^2: Replacing an entire line if a substring is found
in thread Replacing an entire line if a substring is found
Thanks for the help but how would i set up that while statement to iterate through a scalar variable rather than a file handle? I have all my data stored in a scalar variable called $fileContent. So in other words how would i set up the while block using $fileContent rather than <DATA>
#This is how I read in the file my $fileContent = do { open(my $fileHandle, $inputFile) or die "Could not open file '$inp +utFile' $!"; local $/; <$fileHandle>; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Replacing an entire line if a substring is found
by huck (Prior) on Apr 26, 2017 at 06:56 UTC | |
|
Re^4: Replacing an entire line if a substring is found
by 1nickt (Canon) on Apr 26, 2017 at 15:23 UTC |