P is for Practical PerlMonks

### Re: A better way? Extracting filename from url

by archen (Pilgrim)
 on Jan 14, 2002 at 19:38 UTC ( #138587=note: print w/replies, xml ) Need Help??

in reply to A better way? Extracting filename from url

I've made a few programs which deal with filenames of URL's and I take the same approach as you, although I use a slightly different method. To me it's more important that you use what you're comfortable with since you're the one that will probably be reading the code later.

$subject="http://www.spied.co.nz/thinmailer.cgi";$filename = (split(/\//, $subject))[-1]; print$filename;

[download]

Create A New User
Node Status?
node history
Node Type: note [id://138587]
help
Chatterbox?
 [Corion]: thezip: If you want to open vim and can live with opening a second console window, use start "The results" vim.exe c:\path\to\logfile .log [thezip]: Ooops... I lied. I guess Cygwin is back. I'll just do a tail -f instead. Better. Sorry for the noise. [Corion]: Once more, I'm looking for a sane client-side framework, but I guess these don't exist. Everything I look at either uses a weirdo home-grown templating language (like Angular in all its incarnations) or uses weirdo Javascript incarnations (like ... [Corion]: ... Inferno.js, which uses ES2015) or uses some horrible amount of Javascript infrastructure before you can even render a single file. [Corion]: I'd really like to create a dynamic frontend for my Google Keep clone, but so far, all the templating solutions seem to bring their own template language or require me to hand-code everything in (their own flavour of) Javascript. I'd like something ...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2017-03-27 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (321 votes). Check out past polls.