[Chicago-talk] Need help on a parsing that used to work
Steven Lembark
lembark at wrkhors.com
Tue Nov 25 10:12:09 CST 2003
-- Bernie Leung <bernieleung at mesatech.com>
>
> I have a strange Perl problem that I thought PM's can help. I have the
> following PERL script that is acting strange (actually not working at
> all) on Linux Perl5 (version 8 subversion 0), but is OK in Windows Perl5
> (version 8, suversion 1).
>
> /^([^\s]+):(.*)$/
>
> This is supposed to parse from $_ a line like
>
> RCPT FROM: bernie at mesatech.com
If all you really want to do is split the line in two on
the first ':' boundry why not just use split? For example:
my( $header, $value ) = split /:/, $_, 2;
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 888 359 3508
More information about the Chicago-talk
mailing list