tej has asked for the wisdom of the Perl Monks concerning the following question:
I am working on a project in which i have to work on txt file and want to edit few things like tables in it and save as new file.
I am saving whole data in a variable (scalar)
from it i am extracting table with regex and because of which my original data is getting modified.
To extract table i am using
$wholefile=~s/(pattern for table)/sub($&)/segx;
I want to save table in different scalar without modifying $wholefile, can anybody please tell me how to do it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting data from file and modifying without making change in file.
by Utilitarian (Vicar) on Aug 26, 2010 at 07:51 UTC | |
|
Re: Extracting data from file and modifying without making change in file.
by locked_user sundialsvc4 (Abbot) on Aug 26, 2010 at 13:37 UTC | |
|
Re: Extracting data from file and modifying without making change in file.
by Anonymous Monk on Aug 26, 2010 at 07:32 UTC | |
|
Re: Extracting data from file and modifying without making change in file.
by suhailck (Friar) on Aug 26, 2010 at 07:45 UTC | |
|
Re: Extracting data from file and modifying without making change in file.
by Marshall (Canon) on Aug 27, 2010 at 10:23 UTC | |
|
Re: Extracting data from file and modifying without making change in file.
by tej (Scribe) on Aug 26, 2010 at 08:16 UTC |