D
dmitriy
What wrong on this code (after compare diff1.txt and diff2.txt)?
=================begin====================
#!/usr/bin/perl -w
#part one
$count="\x00\x00\x00\x00\x00\x00\x01\x01\x01\x02\x02\x02";
open F, ">diff1.txt";
print F $count;
close F;
print $count,"\n";
#part two
$count='';
foreach my $i (qw{0 0 1 2}){
my $tt1;
$tt1 ="\x".sprintf '%.2x', $i;
$tt1 x= 3;
$count.=$tt1;
}
print $count,"\n";
open F, ">diff2.txt";
print F $count;
close F;
print length $count,"\n";
==================end===================
i need file diff2.txt==diff1.txt as in part one, i.e. with size of 12 bytes.
[vilfred@mobile100 img]$ ls -la
summ 792
drwxrwxr-x 3 vilfred vilfred 4096 May 31 11:40 .
drwxr-xr-x 5 vilfred vilfred 4096 May 31 02:33 ..
-rw-rw-r-- 1 vilfred vilfred 12 May 31 11:51 diff1.txt
-rw-rw-r-- 1 vilfred vilfred 36 May 31 11:51 diff2.txt
thank you!!
dmitriy
p.s. i use perl 5.8.0
p.p.s. sorry for my bad english...
=================begin====================
#!/usr/bin/perl -w
#part one
$count="\x00\x00\x00\x00\x00\x00\x01\x01\x01\x02\x02\x02";
open F, ">diff1.txt";
print F $count;
close F;
print $count,"\n";
#part two
$count='';
foreach my $i (qw{0 0 1 2}){
my $tt1;
$tt1 ="\x".sprintf '%.2x', $i;
$tt1 x= 3;
$count.=$tt1;
}
print $count,"\n";
open F, ">diff2.txt";
print F $count;
close F;
print length $count,"\n";
==================end===================
i need file diff2.txt==diff1.txt as in part one, i.e. with size of 12 bytes.
[vilfred@mobile100 img]$ ls -la
summ 792
drwxrwxr-x 3 vilfred vilfred 4096 May 31 11:40 .
drwxr-xr-x 5 vilfred vilfred 4096 May 31 02:33 ..
-rw-rw-r-- 1 vilfred vilfred 12 May 31 11:51 diff1.txt
-rw-rw-r-- 1 vilfred vilfred 36 May 31 11:51 diff2.txt
thank you!!
dmitriy
p.s. i use perl 5.8.0
p.p.s. sorry for my bad english...