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
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:
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")) {
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
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) {
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
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 ";
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
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
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
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(/\
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
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(
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
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
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
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
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
> >
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
---
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
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
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
>
>
> >
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
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
{
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
25 matches
Mail list logo