dee’s blog

expressions of my experience

About Me

    I live in Molfetta BA, Italy.
    I study computer science at Bari.
    I have more friend and a beautiful girlfriend.
    I like play football and fight to kick boxing.
    I love my grandmother's lasagna.

    ArchLinux User
    Dario `dax` Vilardi
    Public Key @ www.deelab.org/dax.asc
    7A94 51B8 9E37 8518 D71D 1C72 6272 6C18 27F1 81B0

    sticker-arch

February 22, 2008

perl: ln-s url redirector

Tonight was a sleepless night and i was reading perl scripts.
this one redirect url with one shorter, it was ln-s.net, my fav <3
script was almost usefull, just a weak: it use *always* a page :-/
not to bad, i have edited it using ARGV parameter:
die "Usage: ln-s.pl $url" if $#ARGV > 0 && $#ARGV < -1;
$url = $ARGV[0];

this lines instead of
$url = 'http://web.morons.org/article.jsp?sectionid=1&id=1';

this is a nopaste of my script.
this is how it work:
$ perl ln-s.pl http://www.deelab.org/
status: 200
message: http://ln-s.net/1_w$

greetings :)

Leave a Reply