Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The code is pretty straight forward I think but let me know if you need me to clear something up. Also, I know regexes like this aren't pretty since the data is read from an HTML email so maybe you can think of ways to make it work BETTER?
I'm posting this because I'm having difficulties sometimes with data not being parsed correctly and I can't pinpoint it. Usually it works just fine but sometimes unexplainable data gets parsed.
my ($title, $tags, $content, $cat, $status); $stored_post =~ m/\[:title\](.+)\[:title\]/is; $title = $1; $stored_post =~ m/\[:tags\](.+)\[:tags\]/is; $tags = $1; $stored_post =~ m/\[:categories\](.+)\[:categories\]/is; $cat = $1; $stored_post =~ m/\[:post\](.+)\[:post\]/is; $content = $1; $stored_post =~ m/\[:status\](.+)\[:status\]/is; $status = $1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reduce amount of duplicated code
by AnomalousMonk (Archbishop) on Aug 31, 2011 at 21:10 UTC | |
|
Re: Reduce amount of duplicated code
by ikegami (Patriarch) on Aug 31, 2011 at 20:40 UTC | |
|
Re: Reduce amount of duplicated code
by Anonymous Monk on Sep 01, 2011 at 07:15 UTC |