Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Grabbing year and month from filename

by vinoth.ree (Monsignor)
on Aug 01, 2018 at 05:26 UTC ( [id://1219619]=note: print w/replies, xml ) Need Help??

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");
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1219619]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (9)
As of 2024-04-19 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found