Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems
More details link to reveal a data column

Posted by abdul (abdul), 21 March 2006
Hi, I wander if anyone can help please:

I am trying to link to a sub routine which will print another field of data from the flat file related to the record.

open (FILE,"../../etl/data/register.txt");
while ($mfile=<FILE>){ if($mfile=~/$plats/){
print "<tr>
   <td width='70' valign='top'><b>Position:</b></td>
   <td><font size='3'>$position </font></td>
   <td width='45' valign='top'><b>Description:</b></td>
   <td valign='middle'><font size='2'>$description </font></td>
   <td width='150' align='center' valign='middle'><font size='2'>&raquo; <********a href='more_details();*******'>View more details </a></font></td>
**********sub more_details {
  print "<tr>
   <td width='70' valign='top'><b>More details:</b></td>
   <td><font size='3'>$details </font></td>

I have searched everywhere but cannot find out how I could possibly use the href tag to link to a sub routine.  Could you help please?

I have marked the areas of attention with **** to help identify the areas in questions.  I would appreciate any help.

Thank you.

Posted by admin (Graham Ellis), 21 March 2006
Abdul ... I'm teaching a different language and also on the road at the moment ... my head just didn't click into gear when I looked.  I'll be back in 24 hours or so on this one.

Posted by admin (Graham Ellis), 22 March 2006
Abdul, I thing the immediate answer is that you need your code to read something like ...

......< a href="  .more_details(). "> more details ....

and have the more_details subroutine use the return statement to pass back a URL that you want to link to.

If you want to re-run the same page but have the more_details subroutine provide extra text in the new page, then you'll need to add something onto the URL (perhaps a  parameter such as ?details=1 ) which you can check for in the subsequent page, and so provide the extra information requested.

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: • WEB: • SKYPE: wellho