So I have a file. Let’s say it looks like this (it's actually longer):
1234
2134
3124
4123
What is the best way to shuffle the lines in that file?
So I have a file. Let’s say it looks like this (it's actually longer):
1234
2134
3124
4123
What is the best way to shuffle the lines in that file?
#!/usr/bin/env perl
use strict;
use warnings;
use List::Util qw/shuffle/;
my @arr = shuffle <>;
print @arr;
Usage :
./script file.txt