Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    and the true file extension would b: extensionelarocko
    
    =cut
    
  2. or download this
    ## AND IF YOU WANNA CHECK FOR A VALID URL, YOU REALLY NEED A MODULE (U
    +RL::URI)
    ## BUT substr and rindex are still the best for the job
    my $url = 'proto://domain.something/dir/file.extension';
    my $protocol = substr $url, 0, index($url, '://'),'';
    ## yada yada yada, you get the point
    
  3. or download this
    my $url = 'ptoto://foo.combarz.erk/file.ext?query';
    my ($proto, $domain, $filedirquery) =
    ...
    
    print "($proto, $domain, $filedirquery)\n";