Using Perl to add hyperlink to html files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using Perl to add hyperlink to html files
# 1  
Old 10-29-2007
Using Perl to add hyperlink to html files

Hi ,

I have written a csh script which will output file named " myoutput.html " displayed below. I am tried to ftp this html file into a local web server so that it can be displayed to public sharing this server and i would want to add a hyperlink to " XX " , " YY " , " ZZ ". Can this be done using perl ? Can anybody show me an example of the code to perform this ?

XX 20 $50
YY 30 $60
ZZ 40 $70
# 2  
Old 10-29-2007
It doesn't look like HTML to me.

I thought you would want to generate

Code:
<html>
    <head>
          <title>My webpage</title>
    <head>
    <body>
        <a href="some-url">XX</a> 20 $50<br>
        <a href="some-url">YY</a> 30 $60<br>
        <a href="some-url">ZZ</a> 40 $70<br> 
    </body>
</html>

# 3  
Old 10-30-2007
Hi Porter,

Can i use perl to create your HTML code before i ftp ?
I would want to perform everything in my Solaris OS that is

1) generate the .html extension file using csh
2) create hyperlink in the html file ( using perl maybe or html ? )
3) ftp to the server
# 4  
Old 10-30-2007
Quote:
Originally Posted by Raynon
Can i use perl to create your HTML code before i ftp ?
Certainly.
# 5  
Old 10-30-2007
But Porter,

Can you show me the perl code using this example which is able to create the html and ftp to the server?
I am a novice in this area . Thanks
# 6  
Old 10-30-2007
Code:
#!/usr/bin/perl

print "<html>\r\n";
print "\t<head>\r\n";
print "\t\t<title>My webpage</title>\r\n";
print "\t<head>\r\n";
print "\t<body>\r\n";
print "\t\t<a href=\"some-url\">XX</a> 20 \$50<br>\r\n";
print "\t\t<a href=\"some-url\">YY</a> 30 \$60<br>\r\n";
print "\t\t<a href=\"some-url\">ZZ</a> 40 \$70<br>\r\n";
print "\t</body>\r\n";
print "</html>\r\n";

# 7  
Old 10-30-2007
Quote:
Originally Posted by porter
Code:
#!/usr/bin/perl

print "<html>\r\n";
print "\t<head>\r\n";
print "\t\t<title>My webpage</title>\r\n";
print "\t<head>\r\n";
print "\t<body>\r\n";
print "\t\t<a href=\"some-url\">XX</a> 20 \$50<br>\r\n";
print "\t\t<a href=\"some-url\">YY</a> 30 \$60<br>\r\n";
print "\t\t<a href=\"some-url\">ZZ</a> 40 \$70<br>\r\n";
print "\t</body>\r\n";
print "</html>\r\n";

Hi Porter,

How about the ftp part ? How can i ftp this whole portion over?
I tried to copy everything into a file named webfile by using print "<html>\r\n"; > webfile but it's showing syntax error.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to add code to hundreds of .html files

Need assistance to add code to hundreds of .html Code will look like below and needs to be added below <html> tag: <script> Some .js code here </script> This will be used in Fedora release 7 (Moonshine). I will appreciate any type of help and/or orientation. Thank you! (4 Replies)
Discussion started by: Ferocci
4 Replies

2. UNIX for Dummies Questions & Answers

Writing an HTML file in perl

I'm writing a perl script that writes an html file. use Tie::File; my ($dir) = @ARGV; open (HTML,">","$dir/file.html") || die $!; #-----Building HTML file--------------------------- print HTML "<!DOCTYPE html> <html> <head> <title>Output</title> <link... (3 Replies)
Discussion started by: jrymer
3 Replies

3. Web Development

Dynamic Hyperlink

Hi Guys/ Gals, I am trying to create a link based on the current date however it doesnt seem to work. Could someone please point me in the right direction. Here is what i have so far.. <html> <head> <script type="text/javascript" language="JavaScript"> function... (2 Replies)
Discussion started by: robfwauk
2 Replies

4. AIX

hyperlink settings

Does anyone know the hyperlink settings to look at an AIX5L box? (1 Reply)
Discussion started by: vbagwell
1 Replies

5. Shell Programming and Scripting

Perl + Korn + HTML

I have a perl script that prints up the html code and executes a few korn scripts to populate the web code. Disclaimer === I can throw together some korn scripts pretty quick. This code changes pretty frequently. I don't know enough about perl to do everything I need. One day maybe I'll get... (4 Replies)
Discussion started by: i9300
4 Replies

6. UNIX for Dummies Questions & Answers

Create Hyperlink

Hi Everybody, I am new to this forum. I need help. Here is the details: I have a .csv file in unix server which is 2MB size I am attaching this file and sending to all users who are in my team thru Microsoft outlook. All users requested me to send the link where we can click and open... (1 Reply)
Discussion started by: utham1
1 Replies

7. Shell Programming and Scripting

HTML parsing by PERL

i have a HTML report file..its in attachment(a part of the whole report is attached..name "input html.doc").also its source is attached in "report source code.txt" i just want to seperate the datas like in first line it should be.. NHTEST-3848498958-NHTEST-10.2-no-baloo a and so on for whole... (3 Replies)
Discussion started by: avik1983
3 Replies

8. Shell Programming and Scripting

How to add Hyperlink with shell script(using mail client)

Hi ! plz let me suggest ..... By using of mail client methods I am trying to send mails through shell script. like.... To: From: Sub: Body: some sample text..... <my requirement is how to add hyper link to some text(click me) ... (0 Replies)
Discussion started by: rsukumar
0 Replies

9. Shell Programming and Scripting

perl and html

hi. im very new to perl. is it possible to fill up a web form and submit it using perl? example, i would like to sign up for a yahoo account though a perl script (ofcourse, granting the "type the characters as shown in imgage" is absent)? (8 Replies)
Discussion started by: marcpascual
8 Replies

10. UNIX for Dummies Questions & Answers

Moving .html files while preserving hyperlink integrity?

Hi, I use a Windows-based program called <a href="http://www.coast.com">Coast Webmaster</a> for moving large numbers of HTML files in one directory to another directory. As you drag and drop each file or entire directory of files to new locations in the web root directory tree, this utility... (1 Reply)
Discussion started by: Buddy123
1 Replies
Login or Register to Ask a Question