Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm opening up a file, giving everything in the file to the variable $content, and now what I want to do is delete everything before and after the instance of a string. For example, if my file contained:
blahblahblahblahblahblah+_john+_blahblahblahblahblahblah, I want to go through the file and substitute everything before and after the +_ with white space, so that $content would only consist of "john".
Is this something I can do with substitute?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting everything before a string
by I0 (Priest) on Dec 21, 2000 at 07:04 UTC | |
by maverick (Curate) on Dec 21, 2000 at 09:07 UTC | |
by I0 (Priest) on Dec 21, 2000 at 19:19 UTC | |
by repson (Chaplain) on Dec 21, 2000 at 07:08 UTC | |
by I0 (Priest) on Dec 21, 2000 at 19:28 UTC | |
|
Re: Deleting everything before a string
by fundflow (Chaplain) on Dec 21, 2000 at 08:06 UTC | |
|
Re: Deleting everything before a string
by cat2014 (Monk) on Dec 21, 2000 at 09:28 UTC | |
|
Re: Deleting everything before a string
by Cybercosis (Monk) on Dec 21, 2000 at 15:05 UTC | |
|
Re: Deleting everything before a string
by snax (Hermit) on Dec 21, 2000 at 14:59 UTC |