Sorin Marti wrote:
> 
> Hi all,

Hello,

> I've written a very simple script which puts xml-documents together...
> Now I want to add a root node at the beginning and one at the end.
> 
> <root>
> [....content....]
> </root>
> 
> How do I do that?
> 
> #/usr/bin/perl
> 
> while( @ARGV ){
>   $filename=shift @ARGV;
>   open( DATEI, "<$filename" );
>   while( <DATEI> ){
>     print unless ( m/^<\?xml / || m/^<!DOCTYPE/ );
>   }
> }


#!/usr/bin/perl -w
use strict;

while ( <> ) {
    print "<root>\n" if $. == 1;
    print;
    print "</root>\n" and close ARGV if eof;
    }



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to