fork(1) download
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. sub random_element {
  6. local $[ = int(rand($#_));
  7. $_[0];
  8. }
  9.  
  10. for (1..50) {
  11. print random_element qw(a b c d e f g h i j k);
  12. }
Runtime error #stdin #stdout #stderr 0s 6204KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
That use of $[ is unsupported at prog.pl line 6.