Writing text string so that it is a hyperlink to a file

Posted on 2006-04-21
Last Modified: 2008-03-10
I'm am writing summary information about input files to an output file (currently a text file). I'd like to allow a user to click on information of interest in the output file and have it hyperlink to the file the information refers to.

I guess I have to change my output file to an HTML file? What is the least painful way to create such an output file? Is there a way to easily write a string of text to the output file and declare it as a hyperlink to a file (or to anything I want)?
Question by:jobhelp
    1 Comment
    LVL 51

    Accepted Solution

    use CGI;
    my $q=new CGI;
    print $q->header, $q->start_html, "your text", $q->a({href=>"http://you.tld/lpath/link"}, "click me"), end_html;
    exit (0);

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
    A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now