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 an

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:

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")) {

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

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) {

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

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 ";

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

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

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

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(/\

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 doe

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(

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

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 an

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 hou

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 wo

Re: pass values to another scipt

2002-05-14 Thread David vd Geer Inhuur tbv IPlib
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 > >

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

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 ,wi

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 im

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

2002-04-25 Thread David vd Geer Inhuur tbv IPlib
ECTED] > > > > -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 > > > >

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

2002-04-25 Thread David vd Geer Inhuur tbv IPlib
ill 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- &g

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