- or download this
#!/usr/bin/perl
...
close $outf;
close $inf;
- or download this
# file consisting of 50 0s
perl -le 'foreach my $i ( 1 .. 50 ) { print q{0}; }' > file_0.txt
- or download this
# file consisting of 50 1s
perl -le 'foreach my $i ( 1 .. 50 ) { print q{1}; }' > file_1.txt
- or download this
# file containing mix of 0s and 1s
perl -le 'srand(); my $f = 0; foreach my $i ( 1 .. 50 ) { if ( $i % 5
+== 0 ) { $f++; $f %= 2; } print $f; }' > file_mix.txt
- or download this
Character: 0 Count: 50
- or download this
Character: 1 Count: 50
- or download this
Character: 0 Count: 4
Character: 1 Count: 5
...
Character: 0 Count: 5
Character: 1 Count: 5
Character: 0 Count: 1