Tom Allison wrote:
>>>I ended up with something like:
>>>my $string = join('',(<DATA>));
>>>my ($sql1, $sql2) = split(/\nn\n/sm, $string);
>>                           ^^^^^^^^^
>>You probably meant /\n\n/.
> Yes, thanks
>>
>>>But I like the $/ idea.
>>You could set $/ to paragraph mode:
>>
>>my ( $sql1, $sql2 ) = do { local $/ = ''; <DATA> };
> 
> Could I also do:
> my ($sql1, $sql2) = do { local $/ = '\n\n'; <DATA>);
> ??

Yes that will work if you have exactly two newlines between each paragraph
while "$/ = '';" will work for any number of newlines between paragraphs.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to