in reply to Picking Random Lines from a File

call to rand is actually fine

Replies are listed 'Best First'.
Re^2: Picking Random Lines from a File
by ikegami (Patriarch) on Oct 09, 2008 at 17:27 UTC

    If so, his perl is broken. Quote rand,

    Automatically calls srand unless srand has already been called.

    >perl -e"print rand 1" 0.83843994140625 >perl -e"print rand 1" 0.795257568359375 >perl -e"print rand 1" 0.84637451171875
Re^2: Picking Random Lines from a File
by de2425 (Sexton) on Oct 09, 2008 at 17:38 UTC
    Is there another way I can put the rand arguement in there? I have a text file with about 90000 lines and I just need to pick 300 lines randomly from it. Sorry for all the questions. I'm truly still a novice at this.