From: "Ned Konz" <[EMAIL PROTECTED]>

> Since you're doing a split, why not just tack on "proper" line
endings?
>
> @{$DATA{$pkg}} = map { "$_\n" } (split /(?m)(__\S+?__)[\r\n]+/,
> <Inline::DATA>);

It's actually tougher than that.  Maybe you have data with \r\r in it,
and need it to stay that way for your language.  Then [\r\n]+ does the
wrong thing.

Also, I looked through Inline.pm a lot, and it plays lots of games with
$/, setting it to "\n" all over the place.  Why is that, Brian?

perlport claims that you can just use \n for pattern matches, and it
will magically match the right ending for you platform.  I think my
particular problem only cropped up because I'm using Cygwin which
supports both \r\n and \n for line endings, depending on how you "mount"
the drives.

Hold on, a quick test.  Hmm, this is even worse!

No source code in DATA section for Inline 'Foo' section.

 at y.pl line 0
INIT failed--call queue aborted, <DATA> line 1.
It appears that you have used the 'DATA' form of Inline.pm but one or
more
code sections were not processed. This is because the internal INIT
block
could not be invoked automatically. You need to do it manually by
placing the
following command after you Inline command(s).

    Inline->init;

We apologize for the inconvenience.

    - the Management

The error depends on my script.  That error goes with this script:

use Inline Foo;
use Inline C;

barble ("I am foo #", fred ( ));
__DATA__
__Foo__
sub barble (@) { foo-print @_, "\n"; }
__C__
int fred ( ) { return 3; }

But this error:

No source code in DATA section for Inline 'Foo' section.

 at y.pl line 0
INIT failed--call queue aborted, <DATA> line 1.

Goes with this script:

use Inline Foo;

barble ("I am foo #", fred ( ));
__DATA__
__Foo__
sub barble (@) { foo-print @_, "\n"; }

Poor Brian!

Cheers,
--binkley

P.S. -- On the positive side, WOW!  With Unix endings the first example
script really works.  Output:

I am a foo #3

This is too cool!


Reply via email to