By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,536 Members | 2,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,536 IT Pros & Developers. It's quick & easy.

Colored line in the output file using perl

P: 1
Hi Guys ,
Can u help me out in Pel Coding as i'm new to perl . Can any one of them say whether it to print a line in a colored way in the output file using Filehandler ..


Codin is :::
Open(OUTFILE, ">$curDir/file2.out");
print OUTFILE "$result1\n\n";
close(OUTFILE);
Jul 6 '07 #1
Share this Question
Share on Google+
4 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
Perl can output text to a file for you, sure, but as far as providing color to that line? I don't have any clue about that. I would think that that would be up to the program being used to view the files as to whether or not to color a line, if it had that capability. If you think about it, viewing a file in notepad would only display the text, without formatting because it cannot.

Regards,

Jeff
Jul 6 '07 #2

KevinADC
Expert 2.5K+
P: 4,059
Hi Guys ,
Can u help me out in Pel Coding as i'm new to perl . Can any one of them say whether it to print a line in a colored way in the output file using Filehandler ..
Short answer is no. If you are using a specific file format you would supply whatever code the file format recognizes to produce colored output. For example, if you were writing to an html file:

Expand|Select|Wrap|Line Numbers
  1. print OUTFILE "<span color=\"red\">$result</span>";
Jul 6 '07 #3

miller
Expert 100+
P: 1,089
Short answer is no.
The slightly longer answer is "hell no". Stay away from the pretty colors. They seduce you but they are a waste of time.

- Miller
Jul 6 '07 #4

KevinADC
Expert 2.5K+
P: 4,059
The slightly longer answer is "hell no". Stay away from the pretty colors. They seduce you but they are a waste of time.

- Miller

I pretty much agree with you here. It's 99.99% a bad idea from the get-go (from the beginning).
Jul 6 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.