Help for this page

Select Code to Download


  1. or download this
    $filename =~ /^(\d+)-(\d+)-(.*)/;
    my $year = $1;
    my $mon = $2;
    
    print("$year-$mon");
    
  2. or download this
    my $filename = "2010-7-this-is-an.html";
    my ($year, $mon) = split('-', $filename);
    print("$year-$mon");