Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!decwrl!ogicse!intelhf!agora!markb From: markb@agora.uucp (Mark Biggar) Newsgroups: comp.lang.perl Subject: Re: $/ Message-ID: <1990Sep30.020008.24595@agora.uucp> Date: 30 Sep 90 02:00:08 GMT References: <1990Sep7.170029.16710@uvaarpa.Virginia.EDU> Organization: Open Communication Forum Lines: 20 In article <1990Sep7.170029.16710@uvaarpa.Virginia.EDU> frech@mwraaa.army.mil writes: >I am working on a mailbox conversion routine and would like to use >^A^A^A^A\n^A^A^A^A\n as $/, slurp the whole file and process each message >as $_. The problem is when I set $/ it only takes the first ^A as the >record seperator (this is what the manual also indicates should happen). >Is there a way to overide this convention and specify $/ to longer than >one character? If you are going to slurp in the whole file anyway, just undef $/, slurp it in as one string and wrap the following around your code: foreach (split(/^A^A^A^A\n^A^A^A^A\n/,>) { ... } Inside the foreach $_ will be set to each message in turn. -- Perl's maternal uncle Mark Biggar