Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: formatting DB records Keywords: text processing records db split Message-ID: <1991Feb12.121833.5151@convex.com> Date: 12 Feb 91 12:18:33 GMT References: <905@ticnj.UUCP> <906@ticnj.UUCP> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 17 Nntp-Posting-Host: pixel.convex.com From the keyboard of srs@ticnj.UUCP (Scott Strool): :After further experimentation I have found that the split function is :appropriate. The one problem that I have come across is the pattern :character. I was using the pipe char |. split seemed to ignore this, :actually it returned just one character of the field i.e if the field :was SCORE it returned SC. When I changed the delimeter in my file to a :colon, the script worked as ecpected. : :What is wrong with the | character, does it have to be escaped? Sure enough -- perl uses egrep-style regexps, meaning that this like (, |, and ) are not escaped for their special meanings. In this case /|/ just said "match nothing or nothing". You want /\|/ instead. --tom -- "All things are possible, but not all expedient." (in life, UNIX, and perl)