On 11/21/05, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Brian Volk wrote:
> > Hi All~
>
> Hello,
>
> > I'm trying to get my head around local $/ = ''; #enable paragraph mode.
>
> Did you read the documentation for it in perlvar.pod?
>
> perldoc perlvar
>
> Is there anything in the documentation that you don't understand?
>
>
> > If I have a tab delimited file that looks like this:
> >
> > 1311001
> > Aed Motorsports
> > 5373 W 86th St
> > Indianapolis, Indiana 46268 U.S.A.
> >
> > 7069210
> > Bird Electronic
> > 30303 Aurora Rd
> > Solon, Ohio 44139 U.S.A.
> >
> > 1020700
> > Charis Disk Golf
> > Ste 160-135
> > 4000 W 106th St
> > Carmel, Indiana 46032 U.S.A.
> >
> > and code that looks like this:
> >
> >     local $/ = '';
> >     while (<OLD>) {
> >
> >     my @rows = split /\n/;
> >
> >     print SAVESTDOUT join("\t", @rows), "\n";
>
> You don't have to split() and join() the data, this would be more efficient:
>
>       chomp;
>       tr/\n/\t/;
>       print SAVESTDOUT "$_\n";
>
>
> >     }
>
>
> John

John,

Can you explain a little better how this is working in this situation,
though?  His data looks like

1311001

Aed Motorsports

5373 W 86th St

Indianapolis, Indiana 46268 U.S.A.



7069210

Bird Electronic

30303 Aurora Rd

Solon, Ohio 44139 U.S.A.



1020700

Charis Disk Golf

Ste 160-13

4000 W 106th St

Carmel, Indiana 46032 U.S.A.


Or at least that's how it came across in my email.  In that case I
don't see how $/=''; is producing the output he describes, unless
there's something strange going on with line endings.

Or is this just some strange line wrapping arifact gmail is inflicting on me?

Thanks,

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.dpguru.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to