Re: Fwd: Re: [MacPerl-WebCGI] well split!! (Solved)
[email protected] Thu, 8 Mar 2001 10:30:55 -0500
| Newsgroups | perl.macperl.webcgi |
|---|---|
| Message-ID | <p05010405b6cd54f47909@[64.194.142.225]> |
>Adam's right - the while{} loop works according to the value of $/, which
>is usually '¥n' unless as Bruce pointed out, you change it to something
>else or something is messing with the returns - probably they're not being
>converted when you transfer the file onto the Linux box (presumably you
>made the DB source file on another OS). So to get round this problem, and
>have a script that will work as expexted on anything running perl add this
>"s/¥015¥012|¥012|¥015/¥n/g;"
>
>here:
>while (<DATA>)
> {
> s/¥015¥012|¥012|¥015/¥n/g;
> next if /^$/; # skip empty lines
>
>
>and take out :
>
>for (split(/¥r/)) # find returns
Robin:
Okay, while Bruce's solution ( local $/ = "\r"; ) worked, the above
code didn't for me. I did:
while (<DATA>)
{
s/\015\012|\012|\015/\n/g;
next if /^$/; # skip empty lines
But, it didn't do it.
tedd
--
http://sperling.com/