Page 1 of 1

Just a couple of questions!

Posted: Sat Jun 21, 2003 1:22 pm
by Nik
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 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>) &#123;
   ($user) = /^<(&#1111;^>]*)>/;

   if (!$userhash&#123;$user&#125;) &#123;
      $userhash&#123;$user&#125; = $colors&#1111;0];
      push(@colors, shift(@colors));
   &#125;

   print $userhash&#123;$user&#125;;

   for $foo (split(//, $_)) &#123;
      for(1..300000) &#123;&#125;;
      print $foo;
   &#125;

   $line++;

   if ($line == 22) &#123;
      print "--more--$/";
      <STDIN>;
      system("clear");
      $line = 0;
   &#125;
&#125;
close (LOGFILE);
mod_edit: adder

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....