Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Define regex substitution $1,$2,... from a string

by ablanke (Monsignor)
on May 24, 2016 at 07:25 UTC ( [id://1163936]=note: print w/replies, xml ) Need Help??


in reply to Define regex substitution $1,$2,... from a string

If your parameter is always an URI, you could use the CPAN Modules URI and File::Basename.
use File::Basename; use URI::Split qw(uri_split uri_join); my @uri = uri_split('https://www.domain.com/aaa/bbb/file.zip'); $uri[3] = 'file='.basename($uri[2]); $uri[2] = 'file_publish'; my $uri = uri_join(@uri); print $uri."\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1163936]
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: (8)
As of 2024-04-18 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found