issue with Text::ParseWords

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I have a line like the following:
tcp_intranet ims-ms E 8
rfc822; jkg00b@ims-ms-daemon 20

When I do:

  my @ln=parse_line('\s+','1',$al);  # $al contains the line above,

I get nothing in @ln.  If I remove the "'" in Bloomingdale's, it works
fine.  Is there a way around this?


Re: issue with Text::ParseWords

Keith A. Clay wrote:
Quoted text here. Click to load it

Quotes, backslashes, etc are treated specially and need to be
backslash-escaped before passing $al to parse_line(). You could use a
regular expression. Or, if the strings are as simple as the example, why
not use:

my @ln = split /\s+/, $al;

HTH - keith

Site Timeline