Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Matching hyphens in file path to extract zip code

by Anonymous Monk
on Feb 05, 2020 at 23:24 UTC ( [id://11112466]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Matching hyphens in file path to extract zip code
in thread Matching hyphens in file path to extract zip code

Path::Tiny
#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; my $pdf = path( '-/xy/-/02239_04_04_1989_PkW.pdf' ); print $pdf->basename, $/; print $pdf->basename =~ m{^(\d+)_}, $/; __END__ 02239_04_04_1989_PkW.pdf 02239

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found