[17660] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5080 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 11 09:05:36 2000

Date: Mon, 11 Dec 2000 06:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976543509-v9-i5080@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 11 Dec 2000     Volume: 9 Number: 5080

Today's topics:
    Re: %ENV does not contain some variables? <bart.lateur@skynet.be>
    Re: Calling PERL from PERL nobull@mail.com
    Re: CGI und Perl-Spezialisten gegen Bezahlung gesucht <schneider@xtewa.de>
    Re: DBM File Open Problem <tward10@jaguar.com>
        Did that but still dont work... <fabian@markisspecialisten.com>
        directory monitoring <bodoni26@resnet.gatech.edu>
    Re: directory monitoring <josef.moellers@fujitsu-siemens.com>
    Re: downloading perl <carvdawg@patriot.net>
    Re: downloading perl <bart.lateur@skynet.be>
        Fail to install module PlRPC-0.2102 <john@imining.com.tw>
    Re: Fail to use DBI::Proxy <john@imining.com.tw>
    Re: How do I capture output from a print command <bart.lateur@skynet.be>
    Re: I want 3 guests/row instead of one. Must change RE  <fabian@markisspecialisten.com>
    Re: Installing modules on a web server nobull@mail.com
    Re: Module install problem under Tru64 <jgoldst@my-deja.com>
        MSIE html form fields sjaakyen@my-deja.com
    Re: net:: (David Efflandt)
        Perl Packages vs Modules <garcia868@yahoo.com>
    Re: Perl Packages vs Modules <bart.lateur@skynet.be>
    Re: Perl Packages vs Modules nobull@mail.com
        PostgreSQL access in Perl scripts (Peter Grossi)
    Re: PostgreSQL access in Perl scripts <spam@klamath.dyndns.org>
    Re: SUPER::DESTROY??? nobull@mail.com
    Re: term ansi color <spam@me.not.com>
        Why does'nt this script write to the GUEST -file? <fabian@markisspecialisten.com>
    Re: Why does'nt this script write to the GUEST -file? (Eric Bohlman)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 11 Dec 2000 09:17:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: %ENV does not contain some variables?
Message-Id: <0k693tsjpe3602gl3v40c3mgb09eb87l33@4ax.com>

Dave Brondsema wrote:

>I don't know if this is related, but as CGI program, the following
>doesn't print all environment variables:
>
>foreach $key (sort(keys %ENV)) {
>    print "$key = $ENV{$key}<br>\n";
>}
>
>In particular, the following must be printed seperately because they
>aren't printed in the above loop:
>
>print "<hr>SCRIPT_NAME: $ENV{SCRIPT_NAME}<br>\n";

(Etc.)

There can be some black magic involved, WRT environment variables.
Sometimes, these aren't imported from the environment into Perl until
they're actually needed. Each import takes time, and you may not need
most of them anyway. Imagine the whole thing to work through the tie
mechanism. Look into "perltie" to see how tieing works in Perl.

Access them once individually, and each will be imported the first time
they're needed. For example, try something like this:

	my @dummy = @ENV{qw(SCRIPT_NAME DOCUMENT_ROOT HTTP_COOKIE)};

After that, your looping code should work.

-- 
	Bart.


------------------------------

Date: 11 Dec 2000 13:06:34 +0000
From: nobull@mail.com
Subject: Re: Calling PERL from PERL
Message-Id: <u91yvf6rad.fsf@wcl-l.bham.ac.uk>

Dave Cross <dave@dave.org.uk> writes:

> Neil Thompson wrote:
> 
> > OK, I give in. I can't find the answer to this. Is it possible to call one
> > perl program from another passing paramters? Is it the eval command?
> 
> Depending on what exactly you want to do, you'd use system, exec or the qx//
> operator.

Or the "do" function, or LWP, or you'd rewrite one as a module or as a
library or do a host of other things.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Mon, 11 Dec 2000 09:28:17 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: CGI und Perl-Spezialisten gegen Bezahlung gesucht
Message-Id: <9126nf$t1c$1@nnrp1.deja.com>


> Hello Adolf,
Are you f*cking out of your mind??
You are the best example of an intolerant, racist idiot who will never
be able to see beyond.

Congratulations - go shoot yourself :(


Ciao,
SimBean. (GERMAN)


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Mon, 11 Dec 2000 08:09:28 -0000
From: "Trevor Ward" <tward10@jaguar.com>
Subject: Re: DBM File Open Problem
Message-Id: <91223p$s3u5@eccws12.dearborn.ford.com>

Here is a little point, If your ISP has upgraded the version of perl then
you will not be able to access the DBM files, created with a previous perl
version.  I have encountered this on numerous occasions also if you create
the files on NT and move to Unix you cannot read them.

The only solution I have ever found to this is to write an extract to a flat
file from my development system and then reload this into the production
system.

Saying that the actual reason for this I dont know but would like to.

Steve Bobrowski <sbobrows@ix.netcom.com> wrote in message
news:t37quanbckav34@corp.supernews.com...
> Hi,
>
> Our webhost recently did some kind of server upgrade that knocked out all
of
> our site's DBM files. Specifically, the working version of our scripts
> accessed our DBM files with dbmopen, dbmclose. I thought that during their
> upgrade, they might have modified the type of DBM implementation available
> on the server, so I rewrote the scripts to use tie() with the AnyDBM_File
> library, but still cannot access the existing DBM files (or restored
backups
> of the files). However, I can create new DBM files and access them just
fine
> with both the old and new versions of the scripts.
>
> I've been searching around for anyone that has had a similar experience,
but
> have not had any luck. Can anyone help?
>
> Thanks!
> Steve B.
> sbobrows@ix.netcom.com
>
>




------------------------------

Date: Mon, 11 Dec 2000 14:00:52 GMT
From: "Fabian Thorbjörnsson" <fabian@markisspecialisten.com>
Subject: Did that but still dont work...
Message-Id: <o65Z5.3418$Kd1.388224@newsb.telia.net>

Thank you! I ges I was to tired to see that. Anyway, I changed that but it
does'nt work anyway. My guestfile-string <!--begin--> removes when running
the scipt and instead it writes:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>.

MY SCRIPT LOOKS LIKE THIS NOW:

if ( $FORM{'post'} && $linkmail ) {
    open (FILE,"+< $guestbookreal") || die "Can't Open $guestbookreal:
$!\n";
    flock FILE,2; # lock file during modification
    seek FILE,0,0;
    @LINES = <FILE>;
    seek FILE,0,0;
    truncate FILE,0;

    foreach (@lines) {
        if (/<!--begin-->/) {
            print FILE "<!--begin-->\n" if $entry_order;
            print FILE "$FORM{'foretag'}<br>$FORM{'realname'}<br>",
              "$FORM{'adress'}<br>$FORM{'post'}<br><br>" ;
            print FILE "<!--begin-->\n" unless $entry_order;
        } else {
            print FILE $_;
        }
    }
    close FILE;
}

"Eric Bohlman" <ebohlman@omsdev.com> skrev i meddelandet
news:912lr5$bkq$3@bob.news.rcn.net...
> "Fabian Thorbjörnsson" <fabian@markisspecialisten.com> wrote:
>
> > Please help me with this one, regards Fabian
>
> > if ( $FORM{'post'} && $linkmail ) {
> >     open (FILE,"+< $guest") || die "Can't Open $guest: $!\n";
> >     flock FILE,2; # lock file during modification
> >     seek FILE,0,0;
> >     @LINES = <FILE>;
> >     seek FILE,0,0;
> >     truncate FILE,0;
>
> >     foreach (@lines) {
> >         if (/<!--begin-->/) {
> >             print GUEST "<!--begin-->\n" if $entry_order;
>
> You've never opened GUEST.  I'm assuming that you really mean FILE there.
>




------------------------------

Date: Mon, 11 Dec 2000 07:19:09 -0500
From: "Steven Scott" <bodoni26@resnet.gatech.edu>
Subject: directory monitoring
Message-Id: <912gnu$pi9$1@news-int.gatech.edu>

I'd like to write a daemon in Perl that sits and monitors a directory for
file changes/additions/deletions.  I know that /somehow/ this is possible,
at least in c++, (by virtue of copying a file and watching kde dcop messages
suddenly spring to life)....but I don't know if it's possible to do in Perl
(assuming yes), and if so, how hard it is (assuming fairly difficult).
I've spent a while perusing o'reilly, and can't seem to find anything
addressing this.  any ideas?

thanks

--
Steven Scott [imnotgoth@progoth.com]
"...computer technicians spent huge portions of their youth heavily
steeped in Lego and its highly focused, solitude-promoting culture.
Lego was their common denominator toy." --Douglas Coupland




------------------------------

Date: Mon, 11 Dec 2000 14:15:10 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: directory monitoring
Message-Id: <3A34D35E.F7F81AE2@fujitsu-siemens.com>

Steven Scott wrote:
> =

> I'd like to write a daemon in Perl that sits and monitors a directory f=
or
> file changes/additions/deletions.  I know that /somehow/ this is possib=
le,
> at least in c++, (by virtue of copying a file and watching kde dcop mes=
sages
> suddenly spring to life)....but I don't know if it's possible to do in =
Perl
> (assuming yes), and if so, how hard it is (assuming fairly difficult).
> I've spent a while perusing o'reilly, and can't seem to find anything
> addressing this.  any ideas?

Unless you tell us under which OS you want to do this, it's hard to
tell.
But since you're referring to kde, I assume it's some kind of Un*x
derivative.
No, Un*x does not have a means of sending an asynchronous message to a
process that the contents of a file or directory has changed. What you
can do is to monitor the directory's inode (by using stat) and
periodically checking for changes in the mtime.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)


------------------------------

Date: Mon, 11 Dec 2000 06:24:38 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: downloading perl
Message-Id: <3A34B976.AAFE1003@patriot.net>

It looks like you downloaded the version for the Alpha, rather than
Intel, platform.  You should have downloaded Api522e.exe.

Maybe you should back off of programming for a while.  No offense,
but there are somethings you need to learn before you get involved with
programming...or you'll very likely find yourself extremely frustrated...

rajeshpm wrote:

> Thanks, i tried it.  But now i have another problem.
> I downloaded activeperl, that is, Apa522e.exe
> Now when i double click on it, it gives a message that the file
> is not compiled for this version of Windows.
> Maybe i am having windows 98, thats why.
>
> do i have to download something else for windows 98, or what?
>
> Thanks
> regards
>
> H C <carvdawg@patriot.net> wrote in message
> news:3A33BAED.D57981B8@patriot.net...
> > http://www.activestate.com
> >
> > It's the ONLY site that you should download ActivePerl from...it's NOT
> > warez..
> >
> > rajeshpm wrote:
> >
> > > Can somebody help me please.
> > >
> > > I want to download perl.  I have windows98.  Which site is the best to
> > > download ActivePerl and what version.
> > >
> > > Thanks
> > > regards
> >
> > --
> > Q: Why is Batman better than Bill Gates?
> > A: Batman was able to beat the Penguin.
> >
> >

--
Q: Why is Batman better than Bill Gates?
A: Batman was able to beat the Penguin.




------------------------------

Date: Mon, 11 Dec 2000 13:22:49 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: downloading perl
Message-Id: <t9l93tog3pua1v4eoa5bpmfu8etq8a97lo@4ax.com>

H C wrote:

>You should have downloaded Api522e.exe.

Isn't that 5.005? Shouldn't he be getting 6 something?

-- 
	Bart.


------------------------------

Date: Mon, 11 Dec 2000 16:18:11 +0800
From: "John" <john@imining.com.tw>
Subject: Fail to install module PlRPC-0.2102
Message-Id: <9122tq$t5k@netnews.hinet.net>

Hi all:

The version of my perl is 5.6.0.
I have installed Net::Daemon and Storable.
When install PlRPC, I do the following steps:

perl Makefile.PL
make
make test

When executing 'make test', the following error occurred.

PERL_DL_NONLAZY=1
/usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/pe
rl5/5.6.0/i586-linux -I/usr/local/lib/perl5/5.6.0 -e 'use Test::Harness
qw(&runt
ests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/base..............ok
t/client............Use of uninitialized value in concatenation (.) at
t/lib.pl
line 30.
Use of uninitialized value in concatenation (.) at t/lib.pl line 31.
Use of uninitialized value in concatenation (.) at t/lib.pl line 32.
t/client............NOK 10FAILED tests 1-10
        Failed 10/10 tests, 0.00% okay
t/compress..........skipped test on this platform
t/crypt.............skipped test on this platform
t/methods...........Use of uninitialized value in concatenation (.) at
t/lib.pl
line 30.
Use of uninitialized value in concatenation (.) at t/lib.pl line 31.
Use of uninitialized value in concatenation (.) at t/lib.pl line 32.
t/methods...........ok 11/11FAILED tests 1-9
        Failed 9/11 tests, 18.18% okay
Failed Test  Status Wstat Total Fail  Failed  List of failed
----------------------------------------------------------------------------
---
t/client.t                   10   10 100.00%  1-10
t/methods.t                  11    9  81.82%  1-9
2 tests skipped.
Failed 2/5 test scripts, 60.00% okay. 19/24 subtests failed, 20.83% okay.
make: *** [test_dynamic] Error 29

Why?
Have I missed something?
Thanks in advance.

John Hsieh
john@imining.com.tw




------------------------------

Date: Mon, 11 Dec 2000 16:30:26 +0800
From: "John" <john@imining.com.tw>
Subject: Re: Fail to use DBI::Proxy
Message-Id: <9123lo$jr@netnews.hinet.net>

Peter Dintelmann has answered my question.
And I think his answer is exactly correct.
So I post it.
Thanks Peter.

Below is the answer....

    Hi John,

"John" <john@imining.com.tw> wrote in message
news:90q6l7$rrh@netnews.hinet.net...

> I want to access database(Access or SQL server) on NT from Linux through
> DBI::Proxy.

    [snip]

> I failed to call connect and the following error message was showed:
>
> install_driver(Proxy) failed: Can't locate RPC/PlClient.pm in @INC (@INC
> contains: /usr/local/lib/perl5/5.00557/i686-linux
> /usr/local/lib/perl5/5.00557 /usr/loc
> al/lib/perl5/site_perl/5.00557/i686-linux
> /usr/local/lib/perl5/site_perl/5.00557
>  .) at /usr/local/lib/perl5/site_perl/5.00557/i686-linux/DBD/Proxy.pm line
> 28.
> BEGIN failed--compilation aborted at
> /usr/local/lib/perl5/site_perl/5.00557/i686
> -linux/DBD/Proxy.pm line 28.
> Perhaps a module that DBD::Proxy requires hasn't been fully installed
>  at insert_dbi4.pl line 13
>
> Why?

    The first messages states that RPC::PlClient
    is missing.

    You will need the following modules on both
    client and server to get it working:

        * Storable
        * Net::Daemon
        * PlRPC

    HTH.

        Peter Dintelmann





------------------------------

Date: Mon, 11 Dec 2000 09:39:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How do I capture output from a print command
Message-Id: <n1893t4v91854batmiu1gmmknn6s6vqsf5@4ax.com>

andrewl@tnl.com.au wrote:

>I can not believe perl4 can not do this ?  amazing !!!???

It can't.

I'd suggest using the tie mechanism, to tie the output handle to
whatever you want to do with the output (for example, appending to a
variable), but tie is an addition in Perl5.

Using Unix, your can use all sorts of fork/pipe tricks, but that's Unix,
not Perl. Since I'm in no way a Unix guru, I won't even make an attempt
in that way.

-- 
	Bart.


------------------------------

Date: Mon, 11 Dec 2000 09:23:45 GMT
From: "Fabian Thorbjörnsson" <fabian@markisspecialisten.com>
Subject: Re: I want 3 guests/row instead of one. Must change RE and setting up rows and collumns i outfile.
Message-Id: <B21Z5.3106$Kd1.386329@newsb.telia.net>

Thank you for your aswer. (I sent a copy of this message to the group)
This is the whole script. Nothing showed up in the guestbookfile when
submittet.
I edited the guestbook file and wrote <!--begin--> and changed the chmod to
777.

Here is the form http://www.markisspecialisten.com/broschyr.shtml
Here is the guestbook http://www.markisspecialisten.com/guestbook.htm




#!/usr/bin/perl
############################################################################
##
# Guestbook                     Version 2.3.1
#
# Copyright 1996 Matt Wright    mattw@worldwidemart.com
#
# Created 4/21/95               Last Modified 10/29/95
#
# Scripts Archive at:           http://www.worldwidemart.com/scripts/
#
#################
#########################################################
# COPYRIGHT NOTICE
#
# Copyright 1996 Matthew M. Wright  All Rights Reserved.
#
#
#
# Guestbook may be used and modified free of charge by anyone so long as
#
# this copyright notice and the comments above remain intact.  By using this
#
# code you agree to indemnify Matthew M. Wright from any liability that
#
# might arise from it's use.
#
#
#
# Selling the code for this program without prior written consent is
#
# expressly forbidden.  In other words, please ask first before you try and
#
# make money off of my program.
#
#
#
# Obtain permission before redistributing this software over the Internet or
#
# in any other medium. In all cases copyright and header must remain
intact.#
############################################################################
##
# Set Variables

$guestbookurl = "http://www.markisspecialisten.com/987.htm";
$guestbookreal = "/home/markisspecialisten/www/guestbook.htm";
$guestlog = "/home/markisspecialisten/www/guestlog.html";
$cgiurl =
"http://www.markisspecialisten.com/cgi-markisspecialisten/guestbook.pl";
$date_command = "/usr/bin/date";

# Set Your Options:
$mail = 1;              # 1 = Yes; 0 = No
$uselog = 0;            # 1 = Yes; 0 = No
$linkmail = 1;          # 1 = Yes; 0 = No
$separator = 0;         # 0 = <hr>; 0 = <br>
$redirection = 1;       # 1 = Yes; 0 = No
$entry_order = 1;       # 1 = Newest entries added first;
                        # 0 = Newest Entries added last.
$remote_mail = 1;       # 1 = Yes; 0 = No
$allow_html = 1;        # 1 = Yes; 0 = No
$line_breaks = 0; # 1 = Yes; 0 = No

# If you answered 1 to $mail or $remote_mail you will need to fill out
# these variables below:
$mailprog = '/usr/sbin/sendmail';
$recipient = 'broschyr@markisspecialisten.com';

# Done
############################################################################
##

# Get the Date for Entry
$date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`; chop($date);
$shortdate = `$date_command +"%D %T %Z"`; chop($shortdate);

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);

   # Un-Webify plus signs and %-encoding
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.|\n)*-->//g;

   if ($allow_html != 1) {
      $value =~ s/<([^>]|\n)*>//g;
   }

   $FORM{$name} = $value;
}

# Print the Blank Response Subroutines
&no_comments unless $FORM{'comments'};
&no_name unless $FORM{'realname'};

# Begin the Editing of the Guestbook File

if ( $FORM{'post'} && $linkmail ) {
    open (FILE,"+< $guestbookreal") || die "Can't Open $guestbookreal:
$!\n";
    flock FILE,2; # lock file during modification
    seek FILE,0,0;
    @LINES = <FILE>;
    seek FILE,0,0;
    truncate FILE,0;

    foreach (@lines) {
        if (/<!--begin-->/) {
            print GUEST "<!--begin-->\n" if $entry_order;
            print GUEST "$FORM{'foretag'}<br>$FORM{'realname'}<br>",
              "$FORM{'adress'}<br>$FORM{'post'}<br><br>" ;
            print GUEST "<!--begin-->\n" unless $entry_order;
        } else {
            print GUEST $_;
        }
    }
    close GUEST;
}


# Log The Entry

if ($uselog eq '1') {
   &log('entry');
}


#########
# Options

# Mail Option
if ($mail eq '1') {
   open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";

   print MAIL "Reply-to: $FORM{'epost'}\n";
   print MAIL "From: $FORM{'realname'}\n";
   print MAIL "Subject: Skicka mig AMA-Broschyren\n\n";
  print MAIL "$FORM{'foretag'}\n";
   print MAIL "$FORM{'realname'}\n";
  print MAIL "$FORM{'adress'}\n";
 print MAIL "$FORM{'post'}\n";
  print MAIL "$FORM{'telefon'}\n";
  print MAIL "$FORM{'fax'}\n";
  print MAIL "$FORM{'epost'}";
     close (MAIL);
}

if ($remote_mail eq '1' && $FORM{'username'}) {
   open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";

   print MAIL "To: $FORM{'username'}\n";
print MAIL "From: $recipient\n";
      print MAIL "Subject: Prislistor från Markisspecialisten\n\n";
  print MAIL "Tack! \n";print MAIL "Du får härmed tillträde till vår
prislista. \n\n";print MAIL "Du finner den på:
www.markisspecialisten.com/72.htm \n\n";print MAIL "Om ni önskar svar på era
funderingar så kan ni kontakta oss på: \n";print MAIL "$recipient\n";print
MAIL "eller på telefon 08-56030100 (jour 070-7313200)\n\n";print MAIL "MVH
Personalen på Markisspecialisten\n";
close (MAIL);
}




# Print Out Initial Output Location Heading
if ($redirection eq '1') {
   print "Location: $guestbookurl\n\n";
}
else {
   &no_redirection;
}

#######################
# Subroutines

sub no_comments {
   print "Content-type: text/html\n\n";
   print "<html><head><title>Prislistor</title></head>\n";
   print "<body><h1>Your Comments appear to be blank</h1>\n";
   print "The comment section in the guestbook fillout form appears\n";
   print "to be blank and therefore the Guestbook Addition was not\n";
   print "added.  Please enter your comments below.<p>\n";
   print "<form method=POST action=\"$cgiurl\">\n";
   print "Your Name:<input type=text name=\"realname\" size=30 ";
   print "value=\"$FORM{'realname'}\"><br>\n";
   print "E-Mail: <input type=text name=\"username\"";
   print "value=\"$FORM{'username'}\" size=40><br>\n";
   print "City: <input type=text name=\"city\" value=\"$FORM{'city'}\" ";
   print "size=15>, State: <input type=text name=\"state\" ";
   print "value=\"$FORM{'state'}\" size=15> Country: <input type=text ";
   print "name=\"country\" value=\"$FORM{'country'}\" size=15><p>\n";
   print "Comments:<br>\n";
   print "<textarea name=\"comments\" COLS=40 ROWS=4></textarea><p>\n";
   print "<input type=submit> * <input type=reset></form><hr>\n";
   print "Return to the <a href=\"$guestbookurl\">Guestbook</a>.";
   print "\n</body></html>\n";

   # Log The Error
   if ($uselog eq '1') {
      &log('no_comments');
   }

   exit;
}

sub no_name {
   print "Content-type: text/html\n\n";
   print "<html>\n<head>\n<title>Felaktg inmatning</title>\n</head>\n";
 print "<meta http-equiv=\"Refresh\" content=\"4;
URL=http://www.markisspecialisten.com/broschyr.shtml\">\n";
print "<body bgcolor=\"#FFFFFF\" text=\"#000093\" link=\"#000093\"
vlink=\"#000093\" alink=\"#000093\">\n";   print "<body>\n";
    print "<br><br><br><br><br><br><br><br><br><strong><p
align=\"center\"><font color=\"#000000\" size=\"3\"
face=\"Verdana\">Felaktig inmatning!</font></strong></p>";
  print "\n</body></html>\n";

   # Log The Error
   if ($uselog eq '1') {
      &log('no_name');
   }

   exit;
}

# Log the Entry or Error
sub log {
   $log_type = $_[0];
   open (LOG, ">>$guestlog");
   if ($log_type eq 'entry') {
      print LOG "$ENV{'REMOTE_HOST'} - [$shortdate]<br>\n";
   }
   elsif ($log_type eq 'no_name') {
      print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] - ERR: No Name<br>\n";
   }
   elsif ($log_type eq 'no_comments') {
      print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] - ERR: No ";
      print LOG "Comments<br>\n";
   }
}

# Redirection Option
sub no_redirection {

   # Print Beginning of HTML
   print "Content-Type: text/html\n\n";
   print "<html><head><title>Thank You</title></head>\n";
   print "<body><h1>Thank You For Signing The Guestbook</h1>\n";

   # Print End of HTML
   print "<hr>\n";
   print "<a href=\"$guestbookurl\">Back to the Guestbook</a>\n";
print "- You may need to reload it when you get there to see your\n";
   print "entry.\n";
   print "</body></html>\n";

   exit;
}










------------------------------

Date: 11 Dec 2000 13:12:40 +0000
From: nobull@mail.com
Subject: Re: Installing modules on a web server
Message-Id: <u9zoi35cfr.fsf@wcl-l.bham.ac.uk>

Geoff Soper <g.soper@soundhouse.co.uk> writes:

> I need to use a module that isn't included in the standard installation
> (Image::Size) and the script will run on a remote server. I only have FTP
> access so is there anyway I can achieve this myself or is it a job for the
> server's administrator?

See FAQ "How do I keep my own module/library directory?".

If the module you want to install is not pure Perl then you either
need to have access to another system running on same platform or
you'll need help from the server's administrator.  According to CPAN
Image::Size is pure Perl.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Mon, 11 Dec 2000 13:03:58 GMT
From: JL Goldstein <jgoldst@my-deja.com>
Subject: Re: Module install problem under Tru64
Message-Id: <912jbt$5p4$1@nnrp1.deja.com>

In article <90ug96$8sc$1@nnrp1.deja.com>,
  yongli01@my-deja.com wrote:
> Hi, all,
>
> I tried to install Data-Dumper-2.101 on a machine (Tru64 Unix version
> 5.0). The Perl is version 5.004. I use the following command:
>
> perl Makefile.PL PREFIX=/vol/local
> make
> make test
> make install
>
> The first three commands ran successfully. But I got the following
> message when I run 'make install':
>
> Writing
>
/vol/local/lib/perl5/site_perl/alpha-dec_osf/auto/Data/Dumper/.packlist
> sh: /vol/local/lib/perl5/alpha-dec_osf/5.00404/perllocal.pod: cannot
> create
> *** Exit 1
> Stop.

Could it be that you don't have write permissions for the target
directory? Chances are you have to be root to install to /vol/local/lib.


--
Anyone for Perl bowling?


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Mon, 11 Dec 2000 11:18:31 GMT
From: sjaakyen@my-deja.com
Subject: MSIE html form fields
Message-Id: <912d64$1al$1@nnrp1.deja.com>

Hi


Is it true that the MSIE can't handle more then 75 fields in a form ??

Sjaak


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Mon, 11 Dec 2000 11:47:44 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: net::
Message-Id: <slrn939fnb.1oc.efflandt@efflandt.xnet.com>

On Mon, 11 Dec, EnIgMaBoM <enigmabomb@home.afraid.of.spam.com> wrote:
>will net::: do backwards translation from a domain to an IP addy?

I think you mean forward translation, reverse lookup is when you resolve a
domain name for a given IP.  I don't know what net::: is, but you can
resolve a name to an IP with:

$ip = join(".",unpack("C4",scalar gethostbyname($host)));

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


------------------------------

Date: Sun, 10 Dec 2000 13:04:36 -0800 (PST)
From: J Garcia <garcia868@yahoo.com>
Subject: Perl Packages vs Modules
Message-Id: <20001210210436.19149.qmail@web1609.mail.yahoo.com>

I have read the online Perl documentation but am still
not clear as to the difference between packages and
modules. What are the differences between the two and
which is considered more preferable? Any code snippets
or pointers to online examples would of course help. Thanks.

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/


------------------------------

Date: Mon, 11 Dec 2000 13:34:15 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl Packages vs Modules
Message-Id: <3bl93tsnq7aacq7i5u3p6eam9od1e3vnr4@4ax.com>

J Garcia wrote:

>I have read the online Perl documentation but am still
>not clear as to the difference between packages and
>modules. What are the differences between the two and
>which is considered more preferable?

A package is a namespace. A module is a file.

Usually, modules contain a package of the same name, often even just
that. But a single file can contain more than one package. For example,
run this as a script:
	# in main
	print Foo::greet('world');

	package Foo;  # package starts here
	sub greet {   # this is Foo::greet
	    my $name = shift;
	    "Hello, $name!";
	}

	
In this example, there are two packages (namespaces), namely main
(implicit) and Foo (explicit). Here, greet() is a sub that doesn't exist
in main, but it does exist in Foo.

For a real world example, you may look at XML Parser, which contains not
only XML::Parser, but several assisting packages as well, such as
XML::Parser::Tree, and a few others. Putting all of this in one file
just relives you from loading several files, of which most need to be
loaded anyway, and

For modules from which data is imported, it is important that the (= at
least one) package name is *exactly* the same as the module name, case
and all. Otherwise, import() will fail.

OO modules usually don't do any import(). You can play tricks there,
where you use one module, and then access the classes defined therein
with an entirely different name. Oh, yes, for classes, the same concept
of package gets reused. Green language, Perl.

   HTH,
   Bart.


------------------------------

Date: 11 Dec 2000 13:01:14 +0000
From: nobull@mail.com
Subject: Re: Perl Packages vs Modules
Message-Id: <u9y9xn5b0r.fsf@wcl-l.bham.ac.uk>

J Garcia <garcia868@yahoo.com> writes:

> I have read the online Perl documentation but am still
> not clear as to the difference between packages and
> modules.

Packages are a real thing that exists in the language core.

Sourcefiles are real things.

Modules are (largely) a set of conventions about how to organise
packages and sourcefiles.  In particular at their simplest modules
consist of a source file that has a .pm suffix and that defines a
package which has the same name as the sourcefile (with :: used as the
directory separator).  So the module Foo::Bar is a file called
'Foo/Bar.pm' which defines the package Foo::Bar.

The only hard thing that the language has that supports modules is
that the use and require functions allow the following:

require Foo::Bar; # This is a shorthand for...
require 'Foo/Bar.pm';

use Foo::Bar LIST; # This is a shorthand for...
BEGIN { require Foo::Bar; Foo::Bar->import(LIST); }

no Foo::Bar LIST; # This is a shorthand for...
BEGIN { require Foo::Bar; Foo::Bar->unimport(LIST); }

The rest is all in the mind.

> What are the differences between the two and
> which is considered more preferable? 

Which is preferable a brick or a wall?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Mon, 11 Dec 2000 11:19:40 GMT
From: mail@2kbs.co.uk (Peter Grossi)
Subject: PostgreSQL access in Perl scripts
Message-Id: <3a34b748.443736154@news.telinco.net>

Hi

Can anybody help me access PostgreSQL database from a Perl script? I
have set up databases on a Linux server, and have no problem
processing them in Java apps on the network. I also have no problem
running Perl scripts to process dynamic data in web pages. 

I would like to access PostgreSQL data via Perl in dynamic web pages.

Many thanks

Peter Grossi



------------------------------

Date: Mon, 11 Dec 2000 13:23:29 GMT
From: Neil Conway <spam@klamath.dyndns.org>
Subject: Re: PostgreSQL access in Perl scripts
Message-Id: <3A34D551.8090402@klamath.dyndns.org>

Peter Grossi wrote:

> Can anybody help me access PostgreSQL database from a Perl script?

Take a look at the modules 'DBI' and 'DBD::Pg' on CPAN.

Regards,

Neil



------------------------------

Date: 11 Dec 2000 12:56:17 +0000
From: nobull@mail.com
Subject: Re: SUPER::DESTROY???
Message-Id: <u94s0b6rri.fsf@wcl-l.bham.ac.uk>

Brendon Caligari <bcaligari@my-deja.com> writes:

> Suppose I have a 'Cat' inherited from 'Pest' where both 'Cat'
> and 'Pest' should have a DESTROY function.
> 
> Is it sensible to manually call Pest's DESTROY from within Cat's?

Yes.

>  Am I missing anything?

Not that I can see.

> sub DESROY {
>   my $refPest = shift;
>   .
>   .
>   $refPest->SUPER::DESTROY;
> }

Looks good to me.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Mon, 11 Dec 2000 12:53:34 +0000
From: Alistair McDonald <spam@me.not.com>
Subject: Re: term ansi color
Message-Id: <3A34CE4E.A50F12E4@me.not.com>

Which version of windows are you using?  If you're using NT or 2000, the
command prompt doesn't do ANSI at all.  If that's the case, try the BASH
command prompt from cygwin.  

Alistair

matteo wrote:
> 
> **** Post for FREE via your newsreader at post.usenet.com ****
> 
> I've tried to usa an example from the perl documentation of
> 
> term ansi color
> 
> use Term::ANSIColor;
>     print color 'bold blue';
>     print "This text is bold blue.\n";
>     print color 'reset';
>     print "This text is normal.\n";
>     print colored ("Yellow on magenta.\n", 'yellow on_magenta');
>     print "This text is normal.\n";
>     use Term::ANSIColor qw(:constants);
>     print BOLD, BLUE, "This text is in bold blue.\n", RESET;
>     use Term::ANSIColor qw(:constants);
>     $Term::ANSIColor::AUTORESET = 1;
>     print BOLD BLUE "This text is in bold blue.\n";
>     print "This text is normal.\n";
> 
> in windows prompt I obtain this (no color, only bw)
> 
> ?[1;34mThis text is bold blue.
> ?[0mThis text is normal.
> ?[33;45mYellow on magenta.
> ?[0mThis text is normal.
> ?[1m?[34mThis text is in bold blue.
> ?[0m?[1m?[34mThis text is in bold blue.
> ?[0m?[0mThis text is normal.
> 
> what to do?
> thanks
> 
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
>                       http://www.usenet.com
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


------------------------------

Date: Mon, 11 Dec 2000 11:32:50 GMT
From: "Fabian Thorbjörnsson" <fabian@markisspecialisten.com>
Subject: Why does'nt this script write to the GUEST -file?
Message-Id: <CX2Z5.3094$O%.493811@newsc.telia.net>


Please help me with this one, regards Fabian

if ( $FORM{'post'} && $linkmail ) {
    open (FILE,"+< $guest") || die "Can't Open $guest: $!\n";
    flock FILE,2; # lock file during modification
    seek FILE,0,0;
    @LINES = <FILE>;
    seek FILE,0,0;
    truncate FILE,0;

    foreach (@lines) {
        if (/<!--begin-->/) {
            print GUEST "<!--begin-->\n" if $entry_order;
            print GUEST "$FORM{'foretag'}<br>$FORM{'realname'}<br>",
              "$FORM{'adress'}<br>$FORM{'post'}<br><br>" ;
            print GUEST "<!--begin-->\n" unless $entry_order;
        } else {
            print GUEST $_;
        }
    }
    close GUEST;
}





------------------------------

Date: 11 Dec 2000 13:46:13 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Why does'nt this script write to the GUEST -file?
Message-Id: <912lr5$bkq$3@bob.news.rcn.net>

"Fabian Thorbjörnsson" <fabian@markisspecialisten.com> wrote:

> Please help me with this one, regards Fabian

> if ( $FORM{'post'} && $linkmail ) {
>     open (FILE,"+< $guest") || die "Can't Open $guest: $!\n";
>     flock FILE,2; # lock file during modification
>     seek FILE,0,0;
>     @LINES = <FILE>;
>     seek FILE,0,0;
>     truncate FILE,0;

>     foreach (@lines) {
>         if (/<!--begin-->/) {
>             print GUEST "<!--begin-->\n" if $entry_order;

You've never opened GUEST.  I'm assuming that you really mean FILE there.



------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5080
**************************************


home help back first fref pref prev next nref lref last post