On Tue, Mar 3, 2009 at 14:56, Karyn Stump <ka...@calarts.edu> wrote: > I need to split a string on " or '. > > I have tried following lines in my script: > > my @fields = split(/["']/,$_); snip > Is it possible the missed " is a unicode char or something like that ? snip
split /["']/ should work. It is possible that your data only contains something that looks like ". Try running this on the file: #!/usr/bin/perl use strict; use warnings; while (<>) { for my $char (grep { $_ > 127 } map ord, split //) { printf "%d is %c\n", $char, $char; } } It will print out any characters that are not in the ASCII set. If one of them turns out to look like " then that is your culprit. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/