writing to a notepad in perl

R

rajendra

Hello All,

Whenever we want to write some content to a text file, we open that file and
write in that file as shown below:

open(f,">test.txt");
print f "This is test";

But there a way I can write a text file in fonts i.e some content in BOLD
letters and some in italised etc using perl functions.
 
J

Jürgen Exner

rajendra said:
But there a way I can write a text file in fonts i.e some content in
BOLD letters and some in italised etc using perl functions.

Sure. You can output HTML or TeX or PostSript or RTF or PDF or whatever
format you are thinking about. Do you have something specific in mind? Then
just do a search on CPAN and chances are pretty good that you will find a
module that supports that format.

jue
 
S

sanjeeb

Sure. You can output HTML or TeX or PostSript or RTF or PDF or whatever
format you are thinking about. Do you have something specific in mind? Then
just do a search on CPAN and chances are pretty good that you will find a
module that supports that format.

jue

Check Win32::OLE in capn to suit most of the formatting stuffs.
 
R

RedGrittyBrick

hymie! said:
In our last episode, the evil Dr. Lacto had captured our hero,

First you have to choose a system for representing the formatting
information. There are many.
#!perl
use strict; use warnings;
print "plain *bold* _italic_ in some viewers \n";

I'd search CPAN for more useful approaches.
The whole concept of a text file is based on it being text (that is,
unformatted).

I know what you mean, and it's pertinent since the OP mentions notepad,
but I'd say "plain text" where you say "text". To me, Rich Text Format
(RTF) is text too, though only just :). Widely used MIME types like
"text/plain", "text/rtf" and "text/html" tend to reinforce this idea.
If you include formatting information, then it is no longer a text file.

IKWYM but http://c2.com/cgi/wiki?TextFilter
--hymie! http://lactose.homelinux.net/~hymie (e-mail address removed)
------------------------ Without caffeine for 395 days ------------------------

Just a thought: if you change your "signature" separator to hyphen
hyphen space newline then most newsreaders will recognise it as a
"signature", display it differently and automatically omit it from replies.

Although minus minus space newline is (arguably) formatting information,
your posting is still recognisably "text" :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top