M
Michele Dondi
I apologize in advance for posting this question that I feel is most
probably OT (if it actually is OT). I have this small script:
#!/usr/bin/perl
use strict;
use warnings;
$/=\0x100_000;
open my $fh, '<:raw', '/dev/urandom' or die $!;
print scalar <$fh>;
__END__
If I run it I get:
# ./foo.pl | wc -c
1048576
# ./foo.pl | wc -c
1048576
# ./foo.pl | wc -c
1048576
# ./foo.pl | wc -c
1048576
[ad libitum]
If I change /dev/urandom to /dev/random, then I get:
# ./foo.pl | wc -c
89
# ./foo.pl | wc -c
89
# ./foo.pl | wc -c
89
# ./foo.pl | wc -c
82
# ./foo.pl | wc -c
^[[A
["hangs", had to press CTRL-C]
FWIW I'm running a 2.6.3 kernel. May something be wrong with my system
or am I doing this *in perl* the wrong way?!?
TIA,
Michele
probably OT (if it actually is OT). I have this small script:
#!/usr/bin/perl
use strict;
use warnings;
$/=\0x100_000;
open my $fh, '<:raw', '/dev/urandom' or die $!;
print scalar <$fh>;
__END__
If I run it I get:
# ./foo.pl | wc -c
1048576
# ./foo.pl | wc -c
1048576
# ./foo.pl | wc -c
1048576
# ./foo.pl | wc -c
1048576
[ad libitum]
If I change /dev/urandom to /dev/random, then I get:
# ./foo.pl | wc -c
89
# ./foo.pl | wc -c
89
# ./foo.pl | wc -c
89
# ./foo.pl | wc -c
82
# ./foo.pl | wc -c
^[[A
["hangs", had to press CTRL-C]
FWIW I'm running a 2.6.3 kernel. May something be wrong with my system
or am I doing this *in perl* the wrong way?!?
TIA,
Michele