In article <[EMAIL PROTECTED]> wrote "Zentara"
<[EMAIL PROTECTED]>:
> Is it possible to have multiple __DATA__
> entries in a program. I can seem to find
> a way to end __DATA__, and @array is
> getting everything. How to I end __DATA__?
>
>
> Like:
>
> @array = <DATA>;
> @array1 = <DATA1>;
>
> __DATA__
> stuff
> more stuff
>
> __DATA1__
> stuff
> more stuff
As I know, there is no builtin-possibility.
But it's simple to simulate.
my @data;
my $nr = 0;
while (<DATA>) {
/^__DATA__/ ? $nr++ : push $data[$nr], $_;
}
Now assuming this data ending:
__DATA__
content 1
__DATA__
content 2
__END__
@{$data[0]} contains the first Data,
@{$data[1]} the second, and so on.
Best Wishes,
Andrea
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]