New Novice has asked for the wisdom of the Perl Monks concerning the following question:
I want to extract a piece of information from a string. I know that the bit I am interested in is always preceded by a certain sequence of characters. However, the position of the characters changes.
Substr asks for a precise position, which I do not have as it is changing for each string. Using $` to read out the remaining string following the given sequence (as part of an if-clause) is not working either. This seems to pick up a part of my count variable instead of the substring I am interested in.
What wisdom can you offer your humble novice, honoured monks?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Alternative to Substr?
by tachyon (Chancellor) on Sep 29, 2004 at 11:59 UTC | |
|
Re: Alternative to Substr?
by JediWizard (Deacon) on Sep 29, 2004 at 11:58 UTC | |
by New Novice (Sexton) on Sep 29, 2004 at 12:18 UTC | |
by davorg (Chancellor) on Sep 29, 2004 at 12:25 UTC | |
by tachyon (Chancellor) on Sep 29, 2004 at 12:35 UTC | |
by davorg (Chancellor) on Sep 29, 2004 at 13:12 UTC | |
by tachyon (Chancellor) on Sep 29, 2004 at 12:31 UTC | |
|
Re: Alternative to Substr?
by TheEnigma (Pilgrim) on Sep 29, 2004 at 12:07 UTC | |
by tachyon (Chancellor) on Sep 29, 2004 at 12:17 UTC | |
by TheEnigma (Pilgrim) on Sep 29, 2004 at 13:14 UTC | |
|
Re: Alternative to Substr?
by Anonymous Monk on Sep 29, 2004 at 12:34 UTC |