Just a couple of questions!
Posted: Sat Jun 21, 2003 1:22 pm
a) is there a function in perl that can get the names of the tables of a mysql database??
b) do u know how can i colorize this text that i want to display and display it char by char??
Here is the code i was able to do so farmod_edit: adder
b) do u know how can i colorize this text that i want to display and display it char by char??
Here is the code i was able to do so far
Code: Select all
#!/usr/bin/perl
use Term::ANSIColor;
use Term::ReadKey;
$|++;
@colors = (RED, GREEN, YELLOW);
print "Enter the log name you wish to view => ";
$filename = <STDIN>;
chomp ($filename);
open (LOGFILE, $filename) || die $!;
while (<LOGFILE>) {
($user) = /^<(ї^>]*)>/;
if (!$userhash{$user}) {
$userhash{$user} = $colorsї0];
push(@colors, shift(@colors));
}
print $userhash{$user};
for $foo (split(//, $_)) {
for(1..300000) {};
print $foo;
}
$line++;
if ($line == 22) {
print "--more--$/";
<STDIN>;
system("clear");
$line = 0;
}
}
close (LOGFILE);Code: Select all
tags[/size]
i can get colors to work in windows and i dont know why. neither i can to display one char immediately after another dont know why....
i also got this starnge thing
print "Enter the log name you wish to view => ";
$filename = <STDIN>;
in those two lines of my script perl first waits and then prompts the user for an entry do u know why is seh doeing that? it happens to all of my win32 perl scripts when i ask user for an input.
c) any idea how can i be sms notificated when someones hit my page on his web browser? i tried netsms and stuff liek that but no good!
d) Thanks for your patience!
and something else that i forgot to ask is this:
is there a way that a webpage can read tha pc name of the visitor?? like we do with $ENV{'SERVER_NAME'}?
but this is only works for the server the cript is running on, can we somehow use it to get the pc name of he visitor?
Thanks again guys....