Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to I add CGI::small()?

Posted on 1997-09-10
9
Medium Priority
?
554 Views
Last Modified: 2013-12-25
Most html tags can be generated by CGI.pm methods. The <SMALL></SMALL> tag is missing, however, How can I add it, without creating a derived class.

Max.
0
Comment
Question by:dwater
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1830215
You could always just
print "<SMALL>...</SMALL>";

0
 

Author Comment

by:dwater
ID: 1830216
Yes, this is what I've done, but it doesn't fit in with the rest of the script which uses the CGI:: methods. I wanted to make it all clean. I'm sure there are other html tags which aren't in the module but this is the only one I need which isn't.

Max.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1830217
You could also just add it to the module.
(even submit it to L. Stein so you'll be portable when he adds it)
0
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 

Author Comment

by:dwater
ID: 1830218
OK. I may well do this. I'm guessing this is the only way of doing it.

Thanks.

Max.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1830219
In Perl?  Surely not the "only way of doing it":-)

use CGI;
sub CGI::small {
          my $self = shift;
          print "<SMALL>@_</SMALL>\n";
}

0
 

Author Comment

by:dwater
ID: 1830220
Great! Just what I'm after.

Although, I guess I don't want it to print the string, just return it. Correct?

Thanks.

Max.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1830221
Yes, return instead of print would fit in better with the other methods.
I only wanted to illustrate that it was possible, and got careless.
I'll check the CGI.pm source to if it wants a prototype to fit in, then post it as an answer.
0
 
LVL 84

Accepted Solution

by:
ozo earned 200 total points
ID: 1830222
One way to do it:

sub CGI::small {
          my($self,@p) = CGI::self_or_default(@_);
          return "<SMALL>@p</SMALL>\n";
}

0
 

Author Comment

by:dwater
ID: 1830223
Actually, I found a preferable solution, which is documented in the CGI.pm file and read using the command 'pod2text CGI.pm' - pod2text is one of a family supplied with CPAN which consists of pod2html, pod2latex, pod2man, pod2text.

The relevant part of the text is :-

  Generating new HTML tags

    Since no mere mortal can keep up with Netscape and Microsoft
    as they battle it out for control of HTML, the code that
    generates HTML tags is general and extensible. You can create
    new HTML tags freely just by referring to them on the import
    line:

            use CGI shortcuts,winkin,blinkin,nod;

    Now, in addition to the standard CGI shortcuts, you've
    created HTML tags named "winkin", "blinkin" and "nod". You
    can use them like this:

            print blinkin {color=>'blue',rate=>'fast'},"Yahoo!";
            # <blinkin COLOR="blue" RATE="fast">Yahoo!</blinkin>

I supplied this information, just for the record.

Max.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

721 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