Re: [perl #46019] Documentation for 'srand' has a problem in code snippet  
Quoth qtog3-epoawmh@perl.org:
> "perldoc -f srand" (and consequently, perlfunc.pod) contains the following:
> 
> ``
>   Note that you need something much more random than the default
>   seed for cryptographic purposes. Checksumming the compressed
>   output of one or more rapidly changing operating system status
>   programs is the usual method. For example:
> 
>       srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
> ''
> 
> The problem is that 'ps axww | gzip' returns the same output every time, at
> least on my system:
> 
> ``
> ben@Tyr:~$ ps axww|gzip
> gzip: compressed data not written to a terminal. Use -f to force compression.
> For help, type: gzip -h
> ''

This is only the case if gzip's stdout is a terminal (as it says). If
gzip is writing to a pipe (as it is in the srand docs) it is perfectly
happy, at least on my system:

    ~% ps axww | gzip | cat
    # gzip output

Ben


