Help for this page

Select Code to Download


  1. or download this
    my $line = "1!2!3!4!5!6!7!8!9";
    my @arr = split /!/, $line;
    ...
    print "\n";
    print join(" : ", @arr[@indices]);#predefined
    
  2. or download this
    1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9
    3 : 6 : 7 : 8 : 9
    3 : 6 : 7 : 8 : 9
    
  3. or download this
    my $line = "1!2!3!4!5!6!7!8!9";
    my @arr = split /!/, $line;
    ...
    #set the elements to nothing and then filter them out.
    @arr[@exclude] = ();
    @arr = grep $_, @arr;