Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    
    my $str = "this is a string";
    print pop @{[split(/\s/, $str)]};
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    
    my $str = "this is a string";
    print $str =~ /\s(\w+)$/;