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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With