Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    my $string = 'One bright day in the middle of the night';
    my ($char) = $string =~ /($rand_char)/;
    print "$char\n";
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
    tie my $rand_char, "Random_Char";
    my ($char) = 'One bright day in the middle of the night' =~ /($rand_ch
    +ar)/;
    print "$char\n";