What could go wrong with closing an FH ?

2002-07-04 Thread David vd Geer Inhuur tbv IPlib


Hi All,

After a couple of emails about opening a file with a lower case FH, I have a 
question. I see everyone opening a file with an "or die" statement, what I can
fully understand. But I see you also close the FH with an "or die" statement.

Why ? What can go wrong with closing an FH ?

Can anyone tell me the answer ? I am much interested.


Regs David

> Ok, thank you, but now I'm having another problem with this:
> 
> open(TEXT,"text.txt") or die ("error:  text.txt failed\n");
>   while () {
>   my $text = ;
>   }
> close(TEXT) or die("error:  close text.txt failed\n");
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: HTML contents into Perl CGI

2002-07-01 Thread David vd Geer Inhuur tbv IPlib


Hi,

$data = param('data');
$data =~ s/\/n//g;

...
..
print "";
print $data;
print "";

Regs David
# ---

> 
> Hi,
> 
> If this has been answered before please direct me there as I am at a loss as to 
>where to look as there is so much info to plow thru.
> 
> Situation:  I am reading into my script via param() a textarea called Job Duties.  
>When I print out that parameter in perl all of the new lines are ignored and it 
>prints as one long string.  
> 
> Q: How do I get the perl print statement to recognize the new lines so that the 
>printed output looks like the html input screen?
> 
> Perhaps the print statement is the wrong thing to use but.
> 
> I've been looking at regex's and the split function and have been able to determine 
>that there are infact newlines in the data but they are being ignore when I print out 
>the data.
> 
> Any assistance would be great.
> 
> Thanks.
> 
> Joe Pond
> 
> [EMAIL PROTECTED]
> 
> --=_NextPart_000_0005_01C21F92.BF99A900--
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: uninitialized value?

2002-06-26 Thread David vd Geer Inhuur tbv IPlib


Hi,

First check if your "$c" has arrived :
> my $c = param('c');
> my $content = "c";
print "Hello $c ";

If this works, you'dd better send some more code.
Else you know why he complains.

Actualy I prefer this :

if (($c eq "h") || ($c eq "eh") || ($c eq "hd") || ($c eq "p") || ($c eq "c")) { 
$content = qq{\n}; }

Don't know what is faster.

Regs David
-
> 
> Ok, here's more of my on-going saga.  All of a sudden the page stop loading so 
> I check the error logs and ran a perl -Tcw in the shell.  The syntax is fine 
> but these errors showed up on the log:
> 
> [Wed Jun 26 06:33:34 2002] [error] [client 209.245.115.253] Premature end of 
> script headers: /hsphere/local/home/kbabich2/imap.cc/cgi-bin/index.cgi
> Use of uninitialized value in string eq at index.cgi line 14.
> Use of uninitialized value in string eq at index.cgi line 14.
> Use of uninitialized value in string eq at index.cgi line 14.
> Use of uninitialized value in string eq at index.cgi line 14.
> Use of uninitialized value in string eq at index.cgi line 14.
> 
> Here is what (I believe) it is talking about:
> my $c = param('c');
> my $content = "c";
> 
> if ($c eq "h") {
>$content = qq{\n};
> } elsif ($c eq "eh") {
>$content = qq{\n};
> } elsif ($c eq "hd") {
>$content = qq{\n};
> } elsif ($c eq "p") {
>$content = qq{\n};
> } elsif ($c eq "c") {
>$content = qq{\n};
> }
> 
> But once again I don't know what I should change.
> 
> -
> This mail sent through IMP: http://horde.org/imp/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: AW: AW: param problem

2002-06-25 Thread David vd Geer Inhuur tbv IPlib


Hi Johan,

Let's tell you a secret.
I don't know what it means as well :)
Well some part then. This is just typicaly something I always re-use and
actualy never had the time to re-look at it.

Don't worry about the length by the way. Just give it a try, it never failed for
me. And maybe you might become one of the zombies (just like me), that now and
than just steals code and re-uses it without understanding what it does :)

Now let's at least give some info :

my $head = $ENV{QUERY_STRING};  ## Just read 1 of the Enironment vars and put it 
   into $head. In this case you request the query 
string.
   You might want to use google.com, look at :
   http://hoohoo.ncsa.uiuc.edu/cgi/env.html
   
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

Well This is where we have this mailinglist for. Regex is not my best part.
But as we all have to learn :)


my ${$name} = $value;

Just a way of craeting a scalar. We just found out for example : $name = "serie";
 $value = 10;

So what we do is : ${serie} = 10;
or $serie= 10;


Hhhm, relooking at the length($buffer). Could be taken out from what I can see.
Don't know what it does out there.


Regs David
--

> 
> Puh thats tought! So i have to go the hard way for it? What a pity!
> Lets see if i understand the code... Is there any source where I can read about 
>passing parameters to a perl script via the browser?
> 
> > One solution, when not using $value = param('value');
> > 
> > sub parse_form {
> > 
> >   read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> > 
>   [Theuerkorn Johannes]  so i have to give the length of the variable name and 
>value? And what if i don´t know it before?
> > if (length($buffer) < 5) {
> >   $head = $ENV{QUERY_STRING};
> >  }
>   [Theuerkorn Johannes]  No, i don´t understand the reading part at all ... :-(
> 
> >@pairs = split(/\?/, $head); # split vars using ? as delimitor
> > foreach $pair(@pairs) {
> >($name, $value) = split(/=/, $pair); # split var and value using = as delim.
> > 
>   [Theuerkorn Johannes]  Ok, so i got the name and values somehow into the pairs 
>array and now i put it into two variables $name and $value for further use, right? 
>But again i don´t know how the values got into $head...
> 
> >$value =~ tr/+/ /;
> >$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> > 
> > 
>   [Theuerkorn Johannes]  Ok, have to learn a lot as it seems, i definetely have 
>no clue what happens here,... OK, lets try: in the first line you change every + to a 
>blank, don´t you? And as far as I know from RegExp, in the second line you change 
>EVERYTHING to something. But to what?
> > 
> >${$name} = $value;
> > 
>   [Theuerkorn Johannes]  Hey thats cool, i definetely understand that! ;-)
> > }
> >  } # End sub parse_form
> >  
> >  
> >  
> >  Regs David
> >  -
> >  > From [EMAIL PROTECTED] Tue Jun 25 
>15:32:57 MET 2002
> > > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> > > Precedence: bulk
> > > List-Post: 
> > > List-Help: 
> > > List-Unsubscribe: 
> > > List-Subscribe: 
> > > Delivered-To: mailing list [EMAIL PROTECTED]
> > > Message-ID: 
> > > To: "'MECKLIN, JOE (ASI)'" <[EMAIL PROTECTED]>
> > > Cc: [EMAIL PROTECTED]
> > > Subject: AW: param problem
> > > Date: Tue, 25 Jun 2002 15:10:05 +0200
> > > MIME-Version: 1.0
> > > X-Mailer: Internet Mail Service (5.5.2653.19)
> > > Content-Type: text/plain;
> > charset="ISO-8859-1"
> > > Content-Transfer-Encoding: quoted-printable
> > > Content-Length: 1671
> > > Status: RO
> > > 
> > > Thanks, but this doesn´t work either, the problem with the + is that the 
>cgi:param method takes everything after the & sign as the next variable. As the 
>syntax for the param method is: 
>http://server/script.pl?variable1=value&variable2=value...etc
> > > 
> > > > -Ursprüngliche Nachricht-
> > > > Von:MECKLIN, JOE (ASI) [SMTP:[EMAIL PROTECTED]]
> > > > Gesendet am:Dienstag, 25. Juni 2002 15:05
> > > > An: 'Theuerkorn Johannes'
> > > > Betreff:RE: param problem
> > > > 
> > > > In place of the plus sign (+), try sending the html encoding +
> > > > The html on the receiving end should translate that to a plus sign.
> > > > 
> > > > 
> > > > 
> > > > -Original Message-
> > > > From: Theuerkorn Johannes [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, June 25, 2002 7:59 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: cgi:param problem
> > > > 
> > > > 
> > > > Hi there, 
> > > > 
> > > > i´ve got to pass a serial number to a perl.cgi. Doing it via 

Re: AW: param problem

2002-06-25 Thread David vd Geer Inhuur tbv IPlib


One solution, when not using $value = param('value');

sub parse_form {

  read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if (length($buffer) < 5) {
  $head = $ENV{QUERY_STRING};
 }

   @pairs = split(/\?/, $head); # split vars using ? as delimitor
foreach $pair(@pairs) {
   ($name, $value) = split(/=/, $pair); # split var and value using = as delim.

   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

   ${$name} = $value;
}
 } # End sub parse_form
 
 
 
 Regs David
 -
 > From [EMAIL PROTECTED] Tue Jun 25 
 >15:32:57 MET 2002
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> List-Post: 
> List-Help: 
> List-Unsubscribe: 
> List-Subscribe: 
> Delivered-To: mailing list [EMAIL PROTECTED]
> Message-ID: 
> To: "'MECKLIN, JOE (ASI)'" <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: AW: param problem
> Date: Tue, 25 Jun 2002 15:10:05 +0200
> MIME-Version: 1.0
> X-Mailer: Internet Mail Service (5.5.2653.19)
> Content-Type: text/plain;
charset="ISO-8859-1"
> Content-Transfer-Encoding: quoted-printable
> Content-Length: 1671
> Status: RO
> 
> Thanks, but this doesn´t work either, the problem with the + is that the 
>cgi:param method takes everything after the & sign as the next variable. As the 
>syntax for the param method is: 
>http://server/script.pl?variable1=value&variable2=value...etc
> 
> > -Ursprüngliche Nachricht-
> > Von:MECKLIN, JOE (ASI) [SMTP:[EMAIL PROTECTED]]
> > Gesendet am:Dienstag, 25. Juni 2002 15:05
> > An: 'Theuerkorn Johannes'
> > Betreff:RE: param problem
> > 
> > In place of the plus sign (+), try sending the html encoding +
> > The html on the receiving end should translate that to a plus sign.
> > 
> > 
> > 
> > -Original Message-
> > From: Theuerkorn Johannes [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, June 25, 2002 7:59 AM
> > To: [EMAIL PROTECTED]
> > Subject: cgi:param problem
> > 
> > 
> > Hi there, 
> > 
> > i´ve got to pass a serial number to a perl.cgi. Doing it via the cgi:param
> > funktion seems not to work.
> > 
> > 
> > >use strict;
> > >use CGI;
> > >use DBI;
> > >my $cgi_obj = new CGI;
> > >my $seriennummer = $cgi_obj->param("seriennummer");
> > 
> > Passing http://server/script4.pl?seriennummer=CN+/P422
> > 
> > results in a variable seriennummer=CN/P422
> > 
> > As i want to use the variable seriennummer for an SQL Query later, this
> > doesn´t work.
> > 
> > Any possibility passing the + to my cgi Script? (\+ doesn´t work, either '+'
> > or "+")
> > 
> > Johannes
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Running Modules

2002-06-25 Thread David vd Geer Inhuur tbv IPlib


Hi,

Don't forget to close the FH :

close();


Regs David
-

> 
> Greetings All,
>  
> I have the following code, from which I attempt to call the module
> “Test”
> #!/usr/local/bin/perl
> ###
> ### Program name:  demo.pl
> ### Created By:Theresa Mullin
>  
> require "cgi.lib";
>  
> ### Include the CGI stuff
> use CGI qw(:standard);
>  
> ### Include the database access stuff
> use DBI;
>  
> ### Push location of user created packages onto @INC array
> push(@INC,"/home/tmullin/perl/libs");  
>  
> use Test;
>  
> ### Force "no buffering" for output
> $| = 1;
>  
>  
> ### Parse the arguments sent in from the browser
> &ReadParse();
>  
> ### Open log file
> open DEMO_LOG, ">/home/tmullin/demo_log"||die "unable to open log file";
>  
> print DEMO_LOG "Begin processing...\n";
> print DEMO_LOG "array INC:  @INC\n";
> print DEMO_LOG "Database selected is:  $dbase\n";
>  
>  
>  
> …Here is module Test:
>  
> #!/usr/bin/perl
>  
> ###  Program Name:  Test.pm
> ###  Created By:Theresa Mullin
> ###  Date:  5/20/02
>  
> package Test;
>  
> $dbase = "TEST";
> print "And to all a good night \n";  
>  
> The code appears to execute, and no error messages are generated.
> However, the value of $dbase is never written to the log file.
> Any advice you can give would be helpful.
> Thanks,
> T.
>  
>  
> Theresa M. Mullin
> Programmer/Analyst
> Administrative Computing
> Northern Essex Community College
> 100 Elliott Way
> Haverhill, MA  01830
> (978) 556-3757
> [EMAIL PROTECTED]
>  
> 
> --=_NextPart_000_0003_01C21B8B.A3BFB810--
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: text problem

2002-06-24 Thread David vd Geer Inhuur tbv IPlib


Hi,

Multiple ways of doing this :

#!/usr/bin/perl

use strict;

my $logfile = "...";

open(FH, "<$file");
my @contents = ;
close ();

print " @contents ";

# -

or

print "USERPIDPPID ..  ";
foreach $line(@contents) {
  
  ##
  $line =~ s/\s+//g;
  print " $line ";  
  
  ## OR
($user, $pid, $ppid, $cpu, $time, $comm) = split(/\s+/, $line);
   print "$user.. ...  ";
 
}


Regs David

-
> 
> Hi everybody
> 
> I've got text file on the local machine and Apache too.
> 
> What I don't know is how can I display this file like html file using cgi.
> The file looks like:
> 
> USER   PID  PPID %CPUTIME COMMAND
>  user 26794 26002  0.00:00
>  user  4687  4685  0.00:00 -ksh
>  user 15120 15118  0.00:00 -ksh
>  user 18918 18821  0.00:00 -ksh
>  user 21894 21885  0.00:00 -ksh
>  user 26719 26716  0.10:00 -ksh
>  user 26795 26719  0.00:00 -ksh
> 
> I mean that the result of this cgi program is displayed the same like file
> text.
> 
> Can you help me?
> 
> Martin Pestun
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: changing user password

2002-06-24 Thread David vd Geer Inhuur tbv IPlib


Hi Pavel,

I know that perl mostly doesn't like the sticky-bits on files such as :

-r-sr-xr-x   1 root   bin  24576 Aug  6  1998 /usr/bin/su

He just doesn't executes them.
Personaly I haven't found a solution for this. I know a collegue of mine has written
a C-programm around it.
Maybe someone else in the group could tell you the details.

I probably don't have to tell you the gates you are opening for everyone, so I
won't :) Don't know about the rest of the people out here.


Regs David
--
> 
> I need to make CGI script for changing user password throught web
> browser. I have one, but doesn't work:
> 
> I'm using FreeBSD 4.6 & Apache 1.3.24
> 
> 
> #!/usr/bin/perl -w
> 
> use Expect;
> 
> $suexec = "/usr/bin/su";
> 
> print "Content-Type: text/html\n\n";
> 
> sub ChangeUnixPassword {
>   my ($account,$passwd) = @_;
>   
>   $command = "root -c 'passwd $account'";
>   $srp = "rootpassword";
>   
>   my $pobj = Expect->spawn($suexec, $command);
>   die "$suexec:$!\n" unless (defined $pobj);
> 
>   $pobj->log_stdout(0);
> 
>   $pobj->expect(10,"Password:");
>   sleep 1;
>   print $pobj "$srp\r";
> 
>   $pobj->expect(10,"New password:");
>   print $pobj "$passwd\r";
> 
>   $pobj->expect(10,"Retype new password:");
>   print $pobj "$passwd\r";
> 
>   $result = ...
> 
>   $pobj->soft_close(  );
> 
>   return $result;
> }
> 
> unless ($result = &ChangeUnixPassword("user","newpassword)) {
>   print "OK\n";
> } else {
>   print "failed\n";
> }
> 
> 
> 
> Pavel
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: cgi report from another server

2002-06-13 Thread David vd Geer Inhuur tbv IPlib


Hi Martin,

This is because you didn't use the back-tick's :

$stuff=`rsh server2 -l user /bin/uname -X`;

(Don't mix them up with the <'> );
This will actualy execute the command, currently you only set a var.
Also system() and exec() could help you out.

Regs David
> 
> Hi everybody,
> 
> I don't know to solve this CGI problem:
> My CGI script run on the one server1 and I want get the result from another
> server2 like this:
> 
> #!/usr/local/bin/perl -w
> 
> $delay = 10;
> $date = "/bin/date";
> $stuff="rsh server2 -l user /bin/uname -X";
> print "Refresh: ", $delay, "\n";
> print "Content-type: text/plain", "\n\n";
> print `$date`;
> print `$stuff`;
> exit(0);
> 
> but problem is that this script not show the result on the HTML site.
> 
> Can you help me?
> 
> Martin Pestun
> Slovakia
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Having problems with login

2002-06-12 Thread David vd Geer Inhuur tbv IPlib


I think this will work :

foreach $i(@access) {
  chomp $i;
  ($un,$pw) = split(/\|/, $i);
  $username = $FORM{'username'};
  $password = $FORM{'password'};

  if (($username ne $un) || ($password ne $pw)) {
print Multiplayer Medieval Frolic).  So far I've made an account creation screen that 
>writes the data to two flat file db's one of them holds the usernames & passwords, 
>while the other holds all the user information.
> Now I'm working on the login screen but I've run into some problems.  It only 
>lets the last user account I create gain access.  For any others it sends them to the 
>invalid username and password screen I created.  
>Here is the code I'm using right now.  I open up the file with the usernames and 
>passwords and throw it all into @access and then do this
> 
> foreach $i (@access) {
> chomp($i);
> ($un,$pw) =
> split(/\|/,$i);
> }
> 
> $username = $FORM{'username'};
> $password = $FORM{'password'};
> 
> if ($username ne "$un" or $password ne "$pw"){
> print < NoPass
> }
> else {
> print < YesPass
> } 
> 
> So what do I need to fix to be able to match any username and password and not just 
>the last one created? and by the way all the data is being written to the files and 
>each entry is a new line.
> If anyone is interested in hearing more about my game concept and helping out with 
>any more problems I run into (there will be many) then let me know.
> Thanks
> 
> 
> 
> -
> Sign up for ICQmail at http://www.icq.com/icqmail/signup.html
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help With Perl

2002-06-12 Thread David vd Geer Inhuur tbv IPlib


Ok, what is it that you want? It's hard to read when the code is split up over
the page.
Maybe it already answered your questions ??


#!/usr/local/bin/perl
#

$username = param('username');

open(USER, "< user.dat");
 while () {
  chomp;
  ($name, $site, $site_id, $des, $email, $pass) = split(/\|/, $_);
  if ( $site_id eq $username ) {
push my @usereq, $_;
.
  }
 }
close(USER);

# -


> 
> ---CODE---
> open(USER, "user.dat");
> @user = ;
> close(USER);
> -END CODE-
> 
> Ok thats my textfile and this is how I usually read
> through the lines
> 
> ---CODE---
> foreach $line (@user) {
>   chomp($line);
>   ($name, $site, $site_id, $des, $email,
> $pass) = split(/\|/,$line);
> }
> -END CODE-
> 
> Now what I want to do is search through each line and
> fine the line who's $site_id is equal too
> $q->param('username'); if it is then I need to store
> each
> 
> ---CODE---
> $name, $site, $site_id, $des, $email, $pass
> -END CODE-
> 
> In $user{'name'}, $user{'site'}, $user{'site_id'}
> Get what I mean, if you don't explain
> 
> =
> 
> 
> __
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: can some one help me out with this

2002-05-27 Thread David vd Geer Inhuur tbv IPlib


open(FH, "<$file");
  while  {
s/(/(\n/g
s/\n)/)/g
push @newoutput
  }
close FH;

open(HH, ">$file");
print HH @newoutput;
close HH;


It's untested, you might need to add some backslashes in front of the substitutions
but this should be it. There is probably someone else that does it faster, but
at least I tried :)

Regs David
--
> 
> My original line is:
> ci(abc...
> ..
> ..
> ..
> );
> 
> I want to change  this to
> 
> ci(   //This and the line next to it are new lines
>abc
> ..
> ..
> ..);
> 
> How to do this .?Can some one help me out.
> 
> Regards.,
> Avanish
> - Original Message -
> From: "inSite Internet Solutions" <[EMAIL PROTECTED]>
> To: "Avanish Pathak" <[EMAIL PROTECTED]>; "Troy May" <[EMAIL PROTECTED]>;
> "Bill Lyles" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Friday, May 24, 2002 8:12 PM
> Subject: RE: Can someone Help me out with this
> 
> 
> > Whoops, correction...
> >
> >  else
> >   {
> >$line =~ s/(\n)+(\r)+//g; # use $line instead of $_
> >($cmdline) = split(/,/,$line);
> >print OUT "$cmdline \n";
> >   }
> >
> >
> >
> > -Original Message-
> > From: inSite Internet Solutions [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 24, 2002 9:39 AM
> > To: Avanish Pathak; Troy May; Bill Lyles; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: RE: Can someone Help me out with this
> >
> >
> > I don't know if this is the most efficient way to do it, but it worked.
> >
> >
> > #!C:\Perl\bin\perl.exe -w
> >
> > use strict;
> > my $infile = qq(C\:\\cmd.txt);
> > my $outfile = qq(C\:\\cmdout.txt);
> > my $cmdline;
> >
> > open(IN,"<$infile") or die "Whoops! Look what happened. $! \n";
> > open(OUT,">$outfile") or die "Could not open \'cuz $! \n";
> >
> > while() {
> >  my $line = $_;
> >  if(($line =~ /cmd1/) or ($line =~ /cmd2/))
> >   {
> >next;
> >   }
> >  else
> >   {
> >$_ =~ s/(\n)+(\r)+//g;
> >($cmdline) = split(/,/,$line);
> >print OUT "$cmdline \n";
> >   }
> > }
> > close(OUT); # blue light special on aisle #6
> > close(IN); # we've got the suspect surrounded
> > 1;
> >
> >
> >
> > Scot R.
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Avanish Pathak [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 24, 2002 2:02 AM
> > To: Troy May; Bill Lyles; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: Can someone Help me out with this
> >
> >
> > Hi ,
> >  Can some one provide me with a perl script for this:
> >
> > Problem:
> > ci_cmd1="abcdef",  // line1
> > ci_cmd2="ghijk", // line2
> > ci_cmd3="lmnop",   // line3
> > ci_cmd4="pqrst", // line4
> >
> > I want to delete line 1 and 2 and the above should look like as shown
> below:
> >
> > ci_cmd1="lmnop",
> > ci_cmd2="pqrst",
> >
> > A prompt response will be highly appreciated.
> >
> > Regards.,
> > Avi
> >
> >
> > - Original Message -
> > From: "Troy May" <[EMAIL PROTECTED]>
> > To: "Bill Lyles" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Wednesday, April 17, 2002 8:52 AM
> > Subject: RE: Definition
> >
> >
> > > It just makes dealing with quotes alot easier.  And you don't need to
> > escape
> > > the extra quotes within it.  For example,
> > >
> > >
> > > print "value=\"true\"";
> > >
> > > print qq!value="true"!;
> > >
> > > print qq/value="true"/;
> > >
> > >
> > > are all the same.  The qq uses the next character instead of the "
> > > character.  Then you must end the line with the same character you
> started
> > > with.  (qq!!,  qq//, qq~~)
> > >
> > > Sorry, it's hard to explain in an email.
> > >
> > >
> > > -Original Message-
> > > From: Bill Lyles [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, April 16, 2002 7:31 PM
> > > To: [EMAIL PROTECTED]
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Re: Definition
> > >
> > >
> > > Ok, Sorry about that
> > >
> > > Anyway what do you mean perldoc -f qq?
> > >
> > > what does the ~qq mean?
> > >
> > > - Original Message -
> > > From: "fliptop" <[EMAIL PROTECTED]>
> > > To: "Bill Lyles" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, April 16, 2002 8:53 PM
> > > Subject: Re: Definition
> > >
> > >
> > > > Bill Lyles wrote:
> > > >
> > > > > href="file://C:\Program Files\Common Files\Microsoft
> > > Shared\Stationery\">
> > > > > As I am somewhat new to perl
> > > > >
> > > > > can someone tell me what this means
> > > > >
> > > > > $header = qq~
> > > > >
> > > > > I understand the header but what is the qq~ for?
> > > >
> > > >
> > > > perldoc -f qq
> > > >
> > > > btw, it's considered bad form to send html-ized email to the list.
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EM

Re: cisco log parsing

2002-05-27 Thread David vd Geer Inhuur tbv IPlib


Hi Hernan,

First I would like to say please start using perl instead of system calls.
This makes life a lot easier, I know I did it as well, but try to find solutions
for you system calls :

open (FH, "< logprueba.log")
@logprueba = ;
close FH;

Now you can start filtering :

foreach $pruebalog(@logprueba) {
  ($ip, $setuptime, disconnectime) = (split /\s+/ $pruebalog)[4,7,9]
  push @allips, $ip;
  ...
  ..
}

Of course you can also do this while you have your FH open :

open (FH, "< logprueba.log")
  while  {
($ip, $setuptime, disconnectime) = (split /\s+/ $_)[4,7,9] ## or leave $_
push @allips, $ip;
...
..
  }
close FH;

I think you were not waiting for such an answer, but I think you have to start
somewhere to get familiar with perl.

I don't get the real question excactly, but I think as soon as you use this method
you can easily find the solution yourself. If not please let us know and I will
definitly see if I can help. And else we have some real guru's who can solve
it all :)  (Come on Feelix)

Hope to have been of a little service. Feelix can adjust my $mistakes.


Regs David

> 
> Hello all i am parsing a cisco cdr log and i am having some problems to
> create the adecuate regexp
> 
> the log goes like this
> 
> May 16 08:03:58  10.0.0.1   38#0015556, SetupTime 11:06:31.062
> DisconnectTime 11:10:06.922
> May 16 08:03:58  10.0.0.1   38#0015556,SetupTime 11:06:31.062
> DisconnectTime 11:10:06.922
> May 17 08:03:58  10.0.0.1   38#0015556, SetupTime 11:06:31.062
> DisconnectTime 11:10:06.922
> May 17 08:03:58  10.0.0.1   38#0015556,SetupTime 11:06:31.062
> DisconnectTime 11:10:06.922
> 
> 
> The script goes like this
> 
> $VOIP = 'cat logprueba.log | egrep
> --regexp=%VOIPAAA-5-VOIP_CALL_HISTORY|cut -f6 -d " "';
> 
> system('cat log1.log | egrep --regexp=PeerAddress| cut -f10 -d " "| sed
> -e s/38#//g > /var/log/parsed');
> 
> $dialednumber='sed -e s/,//g /var/log/parsed';
> 
> 
> >From this script i get the dialed number,setup time and disconnect
> time,now i have got
> to repeat this to analize the entire log,i was thinking in a foreach
> loop to look for
> a repetitive pattern(like %VOIPAAA-5-VOIP_CALL_HISTORY) and repeat the
> parsing for
> each ocurrence of the pattern.
> 
> any sugestions?,any known script that does that?,maybe some software
> like mrtg,webmin allready does that(anyone knows)?
> 
> i am sorry for the long mail,thanks in advance
> Hernan
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to use crypt ??

2002-05-23 Thread David vd Geer Inhuur tbv IPlib


Hi,

Right now I am a little lost myself.

Trying to use crypt() to encrypt a given password.
I know how to compare a given password with an encrypted one, but to encrypt one
myself and save it, doesn't work for me for some reason.
You would say, Ah of course forgotten to give your encryption key. That's right
which one uses apache/Unix/etc ??

So what it is all about probably is this :

 my $crpw = crypt("$pw", "What key ");

Hope for your help !

Regs David


For giving you the overview, here is my program :

#!/usr/bin/perl

use CGI qw(:standard);
use strict;

print header,
start_html(-Title =>"Create external user", -BGCOLOR=>"#99"),
h1('Create external user'),
start_form, table,
Tr(td("Please enter userid"), td(textfield('userid') )),p,
Tr(td("Please enter password"), td(password_field('pw') )),p,
Tr(td("Please select group"), td(popup_menu('group', [ qw(iclab Philips All) 
]) )),p,
Tr(td(submit(-Value =>"Create")));
print "";
print end_form;


if (param('pw')) {

  my $pw = param('pw');
  my $userid = param('userid');
  my $group = param('group');

  my $crpw = crypt($pw);
  my $pwline = "${userid}:${crpw}";

  print $pwline;

}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to get REMOTE_GROUP

2002-05-22 Thread David vd Geer Inhuur tbv IPlib


Hi There,

I have a question about Perl in combination with Apache.
You can set restricted areas within Apache to force autentication.

Afterwards you can read the userid using :
my $user = ($ENV{'REMOTE_USER'});

But as you can see below, there also is a group called htuser in this case.
Does anyone know if there is a way to find out in what group they are, using ENV ?
So that $group in: "my $group = ($ENV{'REMOTE_GROUP'});" would work.
In this case it won't harm, but I intend to use multiple groups for access.


   AuthName "RESTRICTED ACCESS"
   AuthType Basic
   require group htuser
   AuthUserFile /path/to/users
   AuthGroupFile /path/to/groups


Thanks for you help in advance !!!

Regs David

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: convert date value into text value..

2002-05-22 Thread David vd Geer Inhuur tbv IPlib


Hi Sven,

I think you have to do it on another way.
Better to let perl find your date.

#!/usr/bin/perl

use Time::localtime

$tijd = localtime;
$year = $tijd->year+1900
print $tijd->sec;
print "Wir leben heute am jahr: $year";

In this order we have :

sec Seconds
min Minutes
hours   hours
mdayday of month
month   Month
yearYear since 1900 ( So $year + 1900)
wdayDay of week
ydayDay of year
isdst   True if Daylight savings is in effect


No you can print it in any order you want. If you got your time remote and realy 
want to split the date you could do it like :

$tijd = "Wed May 22 11:06:34 METDST 2002"

($dow, $month, $day, $tm, $tz, $year) = split(/ /, $tijd);
($hour, $min, $sec) = split(/:/, $tm);

Hope you have enough info. Good Luck !!


Regs David

> 
> Hi !
> 
> How can I convert a date value (I get via /bin/date) into a text value?
> 
> Thanks for your help.
> 
> Sven
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




which character did not meet the requirements of the regex

2002-05-20 Thread David vd Geer Inhuur tbv IPlib


Hi,

I have an if-statement for checking the value of a variable :

 if (!($icname =~ /^[A-Za-z0-9_.]+$/)) {
print "Sorry your IP-Block name cannot contain special 
characters${submit}";
$exit ="on";
  }


Is there a way to find out which character did not meet the requirements ?
I would like to tell the user which character he has entered and cannot be used.

So;
$icname = "123qwerty&";

In the if statement a variable "$specch" needs to contain the "&" character.
Is there any easy way for this ?

Thanks in advance !!


Regs David

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: pass values to another scipt

2002-05-14 Thread David vd Geer Inhuur tbv IPlib


Hi Sven,

Sorry, I thought you knew that one.

But how to proceed if you don't want those ugly/insecure params in your location bar ?


Regs David

> 
> Ok, i found out how to pass a few arguments to the other script:
> 
>   href="collectformdata.cgi?action=fetch&f_name=$f_name&f_surname=$f_surname"
>  > Update> 
> The only problem I have left is that the variables are not passed on. 
> Once I put names in there, it works just fine, but I do need those 
> variables to work.
> if I would get  any tips on this I'd really appreciate it....
> 
> Sven
> On Tuesday, May 14, 2002, at 04:36 PM, David vd Geer Inhuur tbv IPlib 
> wrote:
> 
> >
> > Hi All,
> >
> > I am currently having the same problems as Sven. I tried to get some 
> > info on it as
> > wel, but it seems a difficult one.
> > I have made a simple example to explain it a little :
> >
> > HTML-CODE:
> > ---
> > 
> > 
> > 
> >
> > 
> > 
> > please enter your First name  > name=userid>
> > Please enter your Last name  > name=pw>
> > Please try this one
> > 
> >
> > 
> > 
> > --
> >
> > Perl-script:
> > ---
> > #!/user/cadiclab/bin/perl
> >
> > use CGI qw(:standard);
> >
> > $first = param('userid');
> > $last = param('pw');
> > $hide1 = param('hide1');
> > $hide2 = param('hide2');
> >
> > print header,
> > start_html(-BGCOLOR=>"#99"),
> > start_form;
> >
> > print "Hallo userid: $first with password: $last ";
> > print "Hidden fields are; Field1: $hide1 Field2: $hide2 
> > ";
> >
> > print   end_form,
> > hr;
> > --
> >
> > Ones I hit the submit button the cgi-script does it all for me.
> > He tells me who I am and he prints the hidden fields.
> >
> > Ones I hit the  the params are not read within my cgi-script ?
> > Not the input type=text and not the input type=hidden.
> >
> > Is there a way to get this working ?
> >
> > Any other solutions to a more secure way of solving this are welcome 
> > too !
> >
> >
> > P.S.: I need the links to browse through directory's and do stuff with 
> > it.
> > A submit button instead of a  does not look very fancy :)
> > 
> > 
> > Best Regards,
> >
> > David van der Geer
> >
> >>
> >> Hi!
> >>
> >> I am using one script to secure the members area and offer several
> >> search functions for am mysql database. another script offers the
> >> possibility to update data in this database. Botth scripts require the
> >> user to ennter name, lastname and password.
> >> Now I want to enable the user to get straight to the update function
> >> without having to enter name, lastname and password (he already entered
> >> one time) again.
> >>
> >> How can I pass those already collected values on to another script 
> >> using
> >> a link (a href)?
> >> Or how can i do that at all?
> >>
> >> Thanks for your help,
> >>
> >> Sven
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




pass values to another scipt

2002-05-14 Thread David vd Geer Inhuur tbv IPlib


Hi All,

I am currently having the same problems as Sven. I tried to get some info on it as
wel, but it seems a difficult one.
I have made a simple example to explain it a little :

HTML-CODE:
---






please enter your First name 
Please enter your Last name 
Please try this one




--

Perl-script:
---
#!/user/cadiclab/bin/perl

use CGI qw(:standard);

$first = param('userid');
$last = param('pw');
$hide1 = param('hide1');
$hide2 = param('hide2');

print header,
start_html(-BGCOLOR=>"#99"),
start_form;

print "Hallo userid: $first with password: $last ";
print "Hidden fields are; Field1: $hide1 Field2: $hide2 ";

print   end_form,
hr;
--  

Ones I hit the submit button the cgi-script does it all for me.
He tells me who I am and he prints the hidden fields.

Ones I hit the  the params are not read within my cgi-script ?
Not the input type=text and not the input type=hidden.

Is there a way to get this working ?

Any other solutions to a more secure way of solving this are welcome too !


P.S.: I need the links to browse through directory's and do stuff with it.
A submit button instead of a  does not look very fancy :)


Best Regards,

David van der Geer 

> 
> Hi!
> 
> I am using one script to secure the members area and offer several 
> search functions for am mysql database. another script offers the 
> possibility to update data in this database. Botth scripts require the 
> user to ennter name, lastname and password.
> Now I want to enable the user to get straight to the update function 
> without having to enter name, lastname and password (he already entered 
> one time) again.
> 
> How can I pass those already collected values on to another script using 
> a link (a href)?
> Or how can i do that at all?
> 
> Thanks for your help,
> 
> Sven

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Accessing form elements before submit..

2002-05-07 Thread David vd Geer Inhuur tbv IPlib


Hi Onkar,

Yes there is a solution, Javascript :)

Maybe you'dd take a look at : http://codepunk.hardwar.org.uk/bjs.htm
Believe me, it's easier than you think.

Good luck. David

> 
> Hi ,
>  I badly need ur help regarding to the CGI scripts.
>  i have written one perl script to design a tree ,with
> recursive function in it. I am accepting parameters
> from the user () and then splicing the
> array.The things are fine.
>  But when i want to put it in the web page,there will
> be a text-box fot input. But how can i access the
> values entered by the user in the same script before
> submit. Because after each input the array is
> reforming.
>  So is it possible to access the values of form
> element before pressing submit button ??
>  I really want this problem to be solved,
>  please do help me.
> Onkar
> 
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Vs Form post

2002-05-06 Thread David vd Geer Inhuur tbv IPlib


Hi,

I am strugling with my program that list the contents of a directory.
Ones the directory contains files and you have permission it shows you a doc icon
else it will show a directory-map followed by it's name as an ""

The problem I have now is that using the  command will have to show
all important variables in the browsers Location. Of course, you would say.
But is there a nice possibility to keep using the  statement without 
defining the variables in the href, So I can work with the :

use CGI qw(:standard);
$userid = param("userid");
...


And get the variables without all users seeing what I need ?

Using the , always generates a button, (I believe), that is
what I don't like to have, 20 dirs, with 20 different submit buttons.
Does anyone have an idea ?

Many Thanks in advance !!!

Location example: 
http://stage-www/cgi-bin/david/index.cgi?base=/user/web/apache/stage/htdocs/david/IPlab?header=IPlab?pwuser=gaard?group=icgrp

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: history.back() does not work in IE

2002-04-25 Thread David vd Geer Inhuur tbv IPlib


Thanks 

Both Bob and Scot are right !!

You can only use it in an , not in a submit.
I will create my own "Back" button as an immage now :)


Regs David
> 
> I have always just used the history.back action 
> ( e.g.,  ) 
> as part of a hyperlink to return to the previous page, 
> not as a submit action of the form. This seems to work
> fine in IE, Netscape, and Opera. When you use a submit
> button, you are either posting data or getting data,
> that's why it exists. Using a hyperlink reference, you
> can simply link to the last page instance in your 
> browser's history, which may be static HTML or the 
> results of a CGI call. Worst case scenario is that 
> your browser asks to repost the data and you have to 
> click OK.
> 
> Scot Robnett
> inSite Internet Solutions
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
> 
> 
> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 11:43 AM
> To: 'David vd Geer Inhuur tbv IPlib'; [EMAIL PROTECTED]
> Subject: RE: history.back() does not work in IE
> 
> 
> > -Original Message-
> > From: David vd Geer Inhuur tbv IPlib
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 25, 2002 12:32 PM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]
> > Subject: RE: history.back() does not work in IE
> > 
> > ..
> > Here is what I did in the script :
> > 
> > $submit = " > Onclick=\"javascript:history.back();\">";
> 
> I'm no HTML expert, but aren't type="submit" and
> onclick="javascript:history.back()"
> mutually exclusive? I mean, do you want the button to submit the form, or
> go back?
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.350 / Virus Database: 196 - Release Date: 4/17/2002
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.350 / Virus Database: 196 - Release Date: 4/17/2002
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: history.back() does not work in IE

2002-04-25 Thread David vd Geer Inhuur tbv IPlib


Hi,

Looked good, but wasn't effective unfortunetly :(
Here is what I did in the script :

$submit = "";
# As I used it frequently

Here is where I use it :

#---
sub check_input {

  if (!($icname)) {
print "You have to choose an IC-name, else I cannot create a new IC 
for you
${submit}";
$exit ="on";
  }
  if (!($icname =~ /^[A-Za-z0-9_]+$/)) {
print "Sorry your IC-name cannot contain special 
characters${submit}";
$exit ="on";
  }
  if (!($feature)) {
print "You did not fill in a feature !! ${submit}
  ";
$exit ="on";
  }

  if ( "$exit" eq "on" ) {
print ""; exit; }

} # End sub check_input

# ---


And this is the source of my final page with my history.back(); button :


You did not fill in a feature !! 

  


I know it's a lot, but thanks for your help in advance !!


Regs David
--
> 
> The javascript function should br written like so:
> 
>  Onclick="javascript:history.back();">
> 
> -Original Message-
> From: David vd Geer Inhuur tbv IPlib
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 11:18 AM
> To: [EMAIL PROTECTED]
> Subject: history.back() does not work in IE
> 
> 
> 
> Hi there,
> 
> I am writing a CGI-script (using Perl of course! :).
> 
> Ones the submit button is hit I check if some specific var's are set.
> If not I give them some output and a back button
> {  
> This works on Netscape, but not on IE. IE looses all of it's params,
> while Netscape remembers them. The application needs to work on both
> browsers,
> does anyone have an idea ?
> 
> I searched the web for a difference in syntax, but couldn't find it.
> Is it IE in combination with Perl ??
> 
> 
> Thanks for your help in advance !!
> 
> 
> Regs David
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




history.back() does not work in IE

2002-04-25 Thread David vd Geer Inhuur tbv IPlib


Hi there,

I am writing a CGI-script (using Perl of course! :).

Ones the submit button is hit I check if some specific var's are set.
If not I give them some output and a back button 
{ 


Re: http headers

2002-04-24 Thread David vd Geer Inhuur tbv IPlib


Hi There,

Here is another one I always use :

sub parse_form {

  read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if (length($buffer) < 5) {
  $head = $ENV{QUERY_STRING};
 }

   @pairs = split(/\?/, $head); # split vars using ? as delimitor
foreach $pair(@pairs) {
   ($name, $value) = split(/=/, $pair); # split var and value using = as delim.

   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

   ${$name} = $value;
}
 } # End sub parse_form

Good luck !

David
> 
> Most recent editions of Perl come with the CGI module,
> which is what you want. Type "perldoc CGI" at your
> friendly neighborhood command prompt. The O'Reilly
> book "CGI Programming with Perl" has a good overview,
> as do no doubt countless other books.
> 
> The basic steps are:
> 
> use CGI;
> my $cgi = new CGI;   # Optional O-O interface
> print $cgi->header, $cgi->start_html("My Page");
> print $cgi->param("foo");  # print value of "foo"
> param
> print $cgi->end_html;
> 
> Note that you can also use it to output the HTML
> response, although you don't have to. More details in
> documentation.
> 
> - John
> 
> --- Conan Chai <[EMAIL PROTECTED]> wrote:
> > hi,
> > 
> > are there any perl modules that splits the http
> > request headers into name/value pairs?
> > 
> > Conan
> > It Will Come To Us !!!
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Games - play chess, backgammon, pool and more
> http://games.yahoo.com/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]