7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!perl
#perl write test 2 w/ xml
use strict;
use warnings;
use XML::Simple;
use Data::Dumper;
# xml creation
$xml = new XML::Simple;
# read XML file
$data = $xml->XMLin("data2.xml");
# creating the txt file
my $data_file = 'h:\\xmlreadingperl\data.txt';
# write directly to the file
open( FILE, ">", $data_file ) or die $!;
print FILE Dumper($data); # printing the final stuff to txt file
close(FILE);
Quoteh:\XMLReadingPerl>perl perlwrite.pl
Global symbol "$xml" requires explicit package name at perlwrite.pl line 10.
Global symbol "$data" requires explicit package name at perlwrite.pl line 13.
Global symbol "$xml" requires explicit package name at perlwrite.pl line 13.
Global symbol "$data" requires explicit package name at perlwrite.pl line 21.
Execution of perlwrite.pl aborted due to compilation errors.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!perl
#perl write test 2 w/ xml
use strict;
use warnings;
use XML::Simple;
use Data::Dumper;
# xml creation
my $xml = new XML::Simple; # hast hier das my vergessen gehabt
# read XML file
my $data = $xml->XMLin("data2.xml"); # hast hier das my vergessen gehabt
# creating the txt file
my $data_file = 'h:\\xmlreadingperl\data.txt';
# write directly to the file
open( FILE, ">", $data_file ) or die $!;
print FILE Dumper($data); # printing the final stuff to txt file
close(FILE);
7 Einträge, 1 Seite |