Skip to content

Obviate.io

To anticipate and prevent

Quick Perl Script

Posted on 2005-02-13 By Jon No Comments on Quick Perl Script

So I wanted a way to quickly add links to my homepage(/website). Its 3 easy steps

1 — “links.html” — This file either needs to be chmod 777 or chown www-data (or what ever you apache user is).

2 — Bookmark Java. I created a new bookmark in firefox with the following as location: (as put it in my toolbar for ease of use).

javascript:win=open('http://www.mypage.com/bookmark.cgi?'+document.URL, '_new','width=600,height=100');history.go(-0);

3 — “bookmark.cgi” — 4 massive lines!

#!/usr/bin/perl<br />
open(URLOUT, ">> links.html");<br />
print URLOUT "<li><a href=\"$ENV{'QUERY_STRING'}\">$ENV{'QUERY_STRING'}</a></li>\n";<br />
close(URLOUT);<br />
print "Content-Type: text/html\n\n" . "<html>BOOKMARKED:<br>\n " . $ENV{'QUERY_STRING'};<br />

4 (optional) — As you can see from above, it puts the data in

  • tags for ease of use by me. I have my index.shtml using SSI’s to pull links.html

    `

    `

    Note/Warning! First the note, you can modify the print statement to do what ever you want (no need to stick to my example). WARNING!!! There is no security! No security at all. So anyone can add links if they knew the page name. So please, security through obscurity!

  • Linux

    Post navigation

    Previous Post: Password Chic?
    Next Post: Save the Archives!

    Related Posts

    Done! Linux
    Lets all NetMeeting! Linux
    Yay Firefox Linux
    Well, thats amazing Linux
    Fishing? Linux
    You have to love the IRS Linux

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Copyright © 2026 Obviate.io.

    Powered by PressBook Masonry Dark