[17135] in Perl-Users-Digest
Perl-Users Digest, Issue: 4547 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 7 11:05:24 2000
Date: Sat, 7 Oct 2000 08:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970931107-v9-i4547@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 7 Oct 2000 Volume: 9 Number: 4547
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: apache web server set up problems running perl cgi <adamf@box43.gnet.pl>
Re: Blank line appending data to file <nige@npay.freeserve.co.uk>
Declaring variable <g.soper@soundhouse.co.uk>
Re: Declaring variable (Eric Bohlman)
Re: Declaring variable <mauldin@netstorm.net>
Re: Different Ways to Obtain a Client`s IP ? <email@address.com>
Re: Different Ways to Obtain a Client`s IP ? <flavell@mail.cern.ch>
Re: Different Ways to Obtain a Client`s IP ? <christopher_j@uswest.net>
Re: factorial function problem iamnotananimal@my-deja.com
How can I set and read a variable like the session-vari <julien@stokkink.com>
Re: how to remove this using subsitute <wyzelli@yahoo.com>
Re: how to remove this using subsitute (Martien Verbruggen)
Re: how to remove this using subsitute <adamf@box43.gnet.pl>
Re: how to remove this using subsitute <flavell@mail.cern.ch>
Newbie ?, Removing Whitespace at End cmccomas@my-deja.com
Re: Newbie ?, Removing Whitespace at End (Eric Bohlman)
Re: Newbie ?, Removing Whitespace at End <flavell@mail.cern.ch>
Re: Newbie ?, Removing Whitespace at End <bcaligari@my-deja.com>
perl MD5 module insallation iamnotananimal@my-deja.com
Please Help nightmare running rel script. <ian.w@BTINternet.com>
Re: Please Help nightmare running rel script. (Clay Irving)
Re: Please Help nightmare running rel script. (Eric Bohlman)
Re: Rounding Integers <godzilla@stomp.stomp.tokyo>
Uploading files using perl scrip - via e-mail <brendonm@lineone.net>
Re: Uploading files using perl scrip - via e-mail (Martien Verbruggen)
Re: Win32 Widgets? <barbr-en@online.no>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 07 Oct 2000 10:22:08 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage970914245.23779@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 29 Apr 2000
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last _major_ update of the Perl FAQ was in Summer
of 1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://www.cpan.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
For an alternative way to get answers, check out the Perlfaq website.
http://www.perlfaq.com/
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://www.cpan.org/
http://www.perl.com/CPAN/
http://www.cpan.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 07 Oct 2000 13:30:27 +0200
From: Adam <adamf@box43.gnet.pl>
Subject: Re: apache web server set up problems running perl cgi scripts
Message-Id: <39DF0953.27A8@box43.gnet.pl>
Dan and Shelly wrote:
...
> How can I have cgi scripts run, but not display the unwanted text?
> Is my perl script really running and printing to the browser window or is
> the browser merely displaying the text in file "first.pl"?
>
> This cgi stuff seems a lot more difficult to set up than it should be. I've
> been racking my brains for weeks and still no joy. I feel like I should
> just trow in the towel and not bother with it anymore.
>
> Dan
first - do not give up! playing with Apache gives lot of fun,
so it is worth to put some effort to make it alive ;).
The problem does not fit into this group but I will suggest you
couple things which may help you:
1. check configuration of your Apache, look into httpd.conf.
For CGI I use this directives:
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
AddHandler cgi-script cgi
<Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
AllowOverride None
Options ExecCGI FollowSymLinks
</Directory>
2. For configuration as above your Perl CGI scripts have to have
a .cgi extension.
3. You have to tell your Apache where is the Perl interpreter, so
put #!perl.exe in the first line of your scripts,
this is sufficient assuming that %PATH% holds a bin directory of
Perl,
otherwise put absoulte path to perl.exe.
4. Do not be lazy ;), serach the Apache manual and lot of
materials on the web.
good luck.
Adam.
------------------------------
Date: Sat, 7 Oct 2000 11:54:46 +0100
From: "Nige P" <nige@npay.freeserve.co.uk>
Subject: Re: Blank line appending data to file
Message-Id: <8rmvim$uh3$1@newsg4.svr.pol.co.uk>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote
> > Not really. I'm afraid you really need to post a complete (but minimal)
> > script that exhibits the behaviour.
>
> I'll get a copy posted ASAP. There's really not much too it... it's built
> around a bog standard Net::Telnet mod, but I'll get the script up
> tomorrow.
>
Here's the full script....... and it'd the last 4 lines which cause the
problem.
use Net::Telnet;
$login = new Net::Telnet ("Host", "host IP here",
Timeout, 50);
$login->waitfor('/Username: *$/');
$login->print("userid here");
print "Username input\n";
$login->waitfor('/Password: *$/');
$login->print("password here");
print "Password input\n";
$login->waitfor('/\$ *$/');
$login->print("dir live_host_test*");
($livehost) = $login->waitfor('/\$ *$/');
$login->print("type file to write from");
($alertfile) = $login->waitfor('/\$ *$/');
open (LIVEFILE,">>file to write to") || die "Could not open file\n";
print LIVEFILE "$alertfile";
------------------------------
Date: Sat, 07 Oct 2000 14:47:55 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Declaring variable
Message-Id: <4a09c5a44cg.soper@soundhouse.co.uk>
I want to be able to use %VAR throughout a program. The hash is set up in
subroutine 'X' and needs to be accessed by subroutine 'Y' called from
subroutine 'X'.
I thought I should be declaring it as:
local (%VAR) = ();
in subroutine 'X' but this gives the compilation error below when run
under strict.
Global symbol "%VAR" requires explicit package name at line 136.
I'd be grateful if somebody point me in the right direction.
Thanks
--
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/
------------------------------
Date: 7 Oct 2000 14:05:31 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Declaring variable
Message-Id: <8rnajb$uap$3@news.enteract.com>
Geoff Soper <g.soper@soundhouse.co.uk> wrote:
> I want to be able to use %VAR throughout a program. The hash is set up in
> subroutine 'X' and needs to be accessed by subroutine 'Y' called from
> subroutine 'X'.
> I thought I should be declaring it as:
> local (%VAR) = ();
> in subroutine 'X' but this gives the compilation error below when run
> under strict.
> Global symbol "%VAR" requires explicit package name at line 136.
Yes, because local() doesn't actually create or declare a variable; it
just saves the value of an existing global variable.
What you probably want is a file-scoped lexical variable; just put
my %VAR;
before your code. If you really need %VAR (by the way, all-uppercase
variable names are usually considered bad style) to be private to the two
subroutines, enclose its declaration and the subroutines in a block:
{my %VAR;
sub X {
...
}
sub Y {
}
}
------------------------------
Date: Sat, 07 Oct 2000 11:45:10 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Declaring variable
Message-Id: <39DF31B7.C24C1842@netstorm.net>
Geoff Soper wrote:
>
> I want to be able to use %VAR throughout a program. The hash is set up in
> subroutine 'X' and needs to be accessed by subroutine 'Y' called from
> subroutine 'X'.
>
> I thought I should be declaring it as:
> local (%VAR) = ();
> in subroutine 'X' but this gives the compilation error below when run
> under strict.
>
> Global symbol "%VAR" requires explicit package name at line 136.
>
> I'd be grateful if somebody point me in the right direction.
>
As a general rule, the 'strict' pragma requires that variables either:
1. be declared using the my (or our) function, or
2. be referred to using their fully qualified package name, e.g.
$main::variable.
Exempt variables include the globals $a and $b used by sort, variables
predefined by Perl suchs as @ARGV, %ENV, and special variables like $_.
When you try to localize a variable that is undeclared or not referred
to with its complete package name perl issues an error.
The use of 'local' is now frowned upon in most cases because its scope
is ambiguous; a localized variable in sub this {...} can be seen by any
subroutine that sub this {...} calls.
-- Jim
------------------------------
Date: Sat, 07 Oct 2000 12:32:22 GMT
From: "Rob" <email@address.com>
Subject: Re: Different Ways to Obtain a Client`s IP ?
Message-Id: <qJED5.9205$aD2.32762@news-server.bigpond.net.au>
#!/usr/bin/perl
print qq!Content-Type: text/html
Your IP address is $ENV{q/REMOTE_ADDR/}
!;
exit 0;
--
The email address should read - rob at cowsnet dot com
"Philip Lancefield" <dontmail@me.com> wrote in message
news:39dec098.0@d2o313.teliauk.com...
> Here`s my question. I want to record the IP addresses of people visiting
my
> site. The simple way to do this is to use the environmental variables the
> client browser provides. However, there may be occasions when a visitor is
> using a proxy to disguise their real IP address. For security reasons it
is
> important that I obtain the real IP address of the person. I know that,
for
> instance, you can obtain the real IP of a user who is using a proxy for
HTTP
> and FTP by connecting to the security port. So what I would like the
answer
> to is -
>
> a) Is it possible to write programs in Perl that will connect to the
> following ports of the client machine (e.g. using Internet Explorer) -
> Secure, FTP, Gopher, Socks, when a CGI script is called ?
>
> b) Once I have a connection to any of the ports mentioned above will I be
> able to obtain an IP number for the port on the client using Perl ?
>
> c) If it is possible to obtain individual IP numbers from these ports can
> anyone point me in the direction of a website, book, or even provide me
with
> some sample code to help me write a suitable program that will examine the
> clients ports and gather IP addresses ? I am assuming that the average
user
> will have standard numbers for their ports.
>
>
> Any help will be much appreciated. I can send you my e-mail address if
> needed.Thanks in advance.
>
>
------------------------------
Date: Sat, 7 Oct 2000 14:54:34 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Different Ways to Obtain a Client`s IP ?
Message-Id: <Pine.GHP.4.21.0010071445370.23829-100000@hpplus03.cern.ch>
On Sat, 7 Oct 2000, Rob wrote:
> Your IP address is $ENV{q/REMOTE_ADDR/}
No, it isn't, in general. Martien was right: the answer to the
question isn't in general available, nor would it be a useful piece of
information if it was.
Fortunately, you posted in upside-down-fullquote mode, which would set
off the alarm bells for anyone who's got a clue.
------------------------------
Date: Sat, 7 Oct 2000 06:36:45 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Different Ways to Obtain a Client`s IP ?
Message-Id: <BFFD5.31$iH.52369@news.uswest.net>
"Rob" <email@address.com> wrote:
> #!/usr/bin/perl
>
> print qq!Content-Type: text/html
>
> Your IP address is $ENV{q/REMOTE_ADDR/}
> !;
>
> exit 0;
How, bout?
print "Your IP address is: 127.0.0.1".
;)
------------------------------
Date: Sat, 07 Oct 2000 12:46:47 GMT
From: iamnotananimal@my-deja.com
Subject: Re: factorial function problem
Message-Id: <8rn5vm$3rd$1@nnrp1.deja.com>
In article > perl -MCPAN -e 'get Memoize'
>
> should fetch the module for you.
>
/root/.cpan/build/Memoize-0.52#perl Makefile.PL
(ASAP) recommended!
Thanks,
ianaa
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 07 Oct 2000 13:11:00 GMT
From: "Julien Stokkink" <julien@stokkink.com>
Subject: How can I set and read a variable like the session-variable in ASP ?
Message-Id: <EhFD5.684093$Kw2.6104877@flipper>
Can someone help me with the following:
I want to set a variable that's filled with information during the period a
user uses the .PL-scripts on my website,
but I don't know how to do that !
I want to use different .PL-scripts that read the content of such a
variable.
Can anyone help me ?
Julien Stokkink
------------------------------
Date: Sat, 7 Oct 2000 20:14:39 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: how to remove this using subsitute
Message-Id: <j8DD5.5$%54.3078@vic.nntp.telstra.net>
"DT" <dsa@dassda.com> wrote in message
news:MPG.14496d4395b452d0989688@news.cyberway.com.sg...
> Hi,
>
> I have a string like this (with \n):
>
> $HTML='111111111 <script>aaaaaa aaaaaa</script>/n 222222
> 2222222 <script>bbbb bbbbb</script> 333333333';
>
> If I would to use:
>
>
> $HTML =~ s/<script.*[^s].*<\/script>//oi;
>
> the text in between the scripts tags
>
> I will get $HTML to be "11111111", but I $HTML to be "11111111 222222
> 22222222 3333333".
>
For the very limited case described, this seems to work:
s|<script>.*?</script>||g;
but you would probably have more success with the html parser module.
Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_==1)? '':'s';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';
------------------------------
Date: Sat, 7 Oct 2000 21:30:26 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: how to remove this using subsitute
Message-Id: <slrn8ttuq2.jr6.mgjv@martien.heliotrope.home>
On Sat, 7 Oct 2000 17:27:14 +0800,
DT <dsa@dassda.com> wrote:
> Hi,
>
> I have a string like this (with \n):
>
> $HTML='111111111 <script>aaaaaa aaaaaa</script>/n 222222
> 2222222 <script>bbbb bbbbb</script> 333333333';
>
> If I would to use:
>
>
> $HTML =~ s/<script.*[^s].*<\/script>//oi;
>
> the text in between the scripts tags
>
> I will get $HTML to be "11111111", but I $HTML to be "11111111 222222
> 22222222 3333333".
>
> Can anyone help? Thanks
# perldoc -q HTML
Found in /opt/perl/lib/5.6.0/pod/perlfaq9.pod
How do I remove HTML from a string?
[snip]
In other words, read the perl FAQ, section 9. Learn to use the perldoc
tool.
If you have read all that, and you still think you should do it with a
regular expression, then first read the perlre documentation, and make
sure you understand all of it:
# perldoc perlre
Then, before you post another time, make sure that the information you
give is correct. The string you show us above is most likely not what
you would start of with if you want to end up with the other one. I will
interpret what you said as:
I want to strip out everything in a string between <script> and
</script>, inclusive. There may be multiple sets of these things. It has
to match case insensitively. The <script> tag may have attributes.
One solution (and I think this is what you are looking for:
$HTML =~ s#<script[^>]*>.*?</script>##ig;
Note that this can break on things like
<script>
// <!-- </script> -->
var banana = "</script>";
document.write("</script>");
</script>
and other things like that. If that is a problem, you will have to do
some real HTML parsing. If that is never a problem, go ahead an use it.
It can also break on stuff like
<script language="foo" sillycomment=">">...</script>
(note the '>' in the attribute). If that's a problem, use a real parser.
Martien
--
Martien Verbruggen | Since light travels faster than
Interactive Media Division | sound, isn't that why some people
Commercial Dynamics Pty. Ltd. | appear bright until you hear them
NSW, Australia | speak?
------------------------------
Date: Sat, 07 Oct 2000 13:08:47 +0200
From: Adam <adamf@box43.gnet.pl>
Subject: Re: how to remove this using subsitute
Message-Id: <39DF043F.22B8@box43.gnet.pl>
DT wrote:
> I have a string like this (with \n):
> $HTML='111111111 <script>aaaaaa aaaaaa</script>/n 222222
> 2222222 <script>bbbb bbbbb</script> 333333333';
where is that \n included? ;)
> If I would to use:
> $HTML =~ s/<script.*[^s].*<\/script>//oi;
> the text in between the scripts tags
> I will get $HTML to be "11111111", but I $HTML to be "11111111 222222
> 22222222 3333333".
try this:
$HTML =~ s#<script.*?>.*?</script>##gis;
and do not mix ' with ". SIngle quoted strings are not interpolated,
so \n is just \n instead of new line character as you expected.
Adam.
------------------------------
Date: Sat, 7 Oct 2000 14:42:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to remove this using subsitute
Message-Id: <Pine.GHP.4.21.0010071433310.23829-100000@hpplus03.cern.ch>
On Sat, 7 Oct 2000, Martien Verbruggen wrote:
[much useful advice snipped]
> Note that this can break on things like
>
> <script>
> // <!-- </script> -->
> var banana = "</script>";
> document.write("</script>");
> </script>
which contain three samples of incorrect HTML syntax anyway: according
to HTML4, just like HTML3.2 before it, the <script> element contains
CDATA. See
http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2.1 for
explanation and a resolution if the issue, which will incidentally
address that particular point, as far as HTML is concerned. (XHTML is
different, but I don't think you were covering that).
Well, that only deals with one of the details. To do the job
properly, you really do need an HTML parser. As your next specimen
exemplifies:
> <script language="foo" sillycomment=">">...</script>
all the best
------------------------------
Date: Sat, 07 Oct 2000 13:40:05 GMT
From: cmccomas@my-deja.com
Subject: Newbie ?, Removing Whitespace at End
Message-Id: <8rn93l$5s6$1@nnrp1.deja.com>
Hi,
How do I remove extra whitespace at the end of a string? I have a file
in the following format. LastName, FirstName I. with a varying amount
of whitespace after the initial. I have been trying to write a pattern
match statement without much success.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 7 Oct 2000 14:00:19 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Newbie ?, Removing Whitespace at End
Message-Id: <8rna9j$uap$2@news.enteract.com>
cmccomas@my-deja.com wrote:
> How do I remove extra whitespace at the end of a string? I have a file
> in the following format. LastName, FirstName I. with a varying amount
> of whitespace after the initial. I have been trying to write a pattern
> match statement without much success.
See "How do I strip blank space from the beginning/end of a string?" in
perlfaq4.
------------------------------
Date: Sat, 7 Oct 2000 16:04:40 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Newbie ?, Removing Whitespace at End
Message-Id: <Pine.GHP.4.21.0010071558210.23829-100000@hpplus03.cern.ch>
On Sat, 7 Oct 2000 cmccomas@my-deja.com wrote:
> How do I remove extra whitespace at the end of a string?
By reading your FAQs, for example with the perldoc command
perldoc -q space
How do I strip blank space from the beginning/end of a string?
FAQs are good for you: take one frequently, and not only when the
symptoms occur. Every recent Perl installation comes with a free kit
of them. Familiarise yourself with what they contain, and always
check back before deciding to use up the time of the world-wide usenet
community by asking them, in effect, to read to you the documentation
which you already have.
------------------------------
Date: Sat, 07 Oct 2000 14:23:23 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Newbie ?, Removing Whitespace at End
Message-Id: <8rnbkn$7hv$1@nnrp1.deja.com>
In article <8rn93l$5s6$1@nnrp1.deja.com>,
cmccomas@my-deja.com wrote:
> Hi,
>
> How do I remove extra whitespace at the end of a string? I have a file
> in the following format. LastName, FirstName I. with a varying amount
> of whitespace after the initial. I have been trying to write a pattern
> match statement without much success.
$whatever =~ s/\s+$//;
B
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 07 Oct 2000 13:52:59 GMT
From: iamnotananimal@my-deja.com
Subject: perl MD5 module insallation
Message-Id: <8rn9rq$69k$1@nnrp1.deja.com>
I've tried to install the perl Digest-MD5-2.09 module;
but after 'perl Makefile.PL', 'make' and 'make test' returns:
<snip>
`cat blib/arch/auto/Digest/MD5/extralibs.all` -lgdbm -ldb -lm -lc
/usr/i486-linux/bin/ld: cannot open -lmysqlclient: No such file or
directory
make[1]: *** [perl] Error 1
make[1]: Leaving directory `/root/.cpan/build/Digest-MD5-2.09'
make: *** [perl] Error 2
dns:~/.cpan/build/Digest-MD5-2.09#
I have mysql 3.23.22beta installed and there certainly isn't
such a file or directory as requested.
mysql is a binary install on a libc5 (2.0.33 slackware) which I don't
need to upgrade! :)
my /usr/local/mysql/lib listing reveals the only closely related keyword
ie - (mysqlclient):
libmysqlclient.a
libmysqlclient.la*
libmysqlclient.so -> libmysqlclient.so.9.0.0*
libmysqlclient.so.9 -> libmysqlclient.so.9.0.0*
libmysqlclient.so.9.0.0*
The line from blib/arch/auto/Digest/MD5/extralibs.all :
-L/usr/local/mysql/lib -lmysqlclient -lm
-L/usr/lib/gcc-lib/i486-linux/2.7.2 -lgcc
If anyone has a fix; would you please advise.
TIA,
ianaa
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 7 Oct 2000 12:00:51 +0100
From: "Ian" <ian.w@BTINternet.com>
Subject: Please Help nightmare running rel script.
Message-Id: <8rmvq1$mp2$1@neptunium.btinternet.com>
Hi,
I'm new to perl and am having a nightmare running the following perl script
on a UNIX web server. If I run against win3 perl on my PC it gives the
desired output into a window and the HTML produced looks fine. When I move
onto web server it has worked and then for some reason it seems to give the
following error (in a dos box) against every line in the script :-
"Bareword found where operator expected ...... and then the line at fault."
I have to stress that I have had it woking on the host and then was playing
around with chmod to give correct permissions and it all went pear shaped.
The code is as follows just to read a file in and format the info into a web
page format :-
#!/usr/bin/perl
$filename = "Accom.txt";
open (MYFILE, "$filename") || die "Could not open the accommodation file";
print <<"(END ERROR HTML)"; #display error message to user by using the html
below. (any html can go between the <html> tags)
<html>
<head>
<title>People</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" width="570" height="8">
(END ERROR HTML)
#Loop through the peoplem in the file outptting the details into a table.
while(defined($a=<MYFILE>))
{
chomp ($a);
@Dataitems = split(/&/, $a);
print "<tr>\n";
print qq(<td width="486" height="31" bgcolor="#FFFFCC">\n);
print qq(<p align="left"><font face="Verdana" size="1"><a
href="@Dataitems[0]" target="_blank">@Dataitems[1]</a> -
@Dataitems[2]</font></p>\n);
print qq(</td>\n);
print qq(<td width="123" height="31" bgcolor="#FFFFCC"><font
face="Verdana" size="1"> Rating - <img border="0"
src="www.australiauncovered.com/images/@Dataitems[3]stars.gif" width="57"
height="12"></font></td>\n);
print "</tr>\n";
print "<tr>\n";
print qq(<td width="123" height="5"></td>\n);
print "</tr>\n";
}
print qq(</table>\n);
print qq(</body>\n);
print qq(</html>\n);
close (MYFILE);
Any advice or suggestions would be appreciated. Thanks in advance,
Ian
------------------------------
Date: 7 Oct 2000 13:47:53 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Please Help nightmare running rel script.
Message-Id: <slrn8tuac2.a9m.clay@panix3.panix.com>
On Sat, 7 Oct 2000 12:00:51 +0100, Ian <ian.w@BTINternet.com> wrote:
>I'm new to perl and am having a nightmare running the following perl script
>on a UNIX web server. If I run against win3 perl on my PC it gives the
>desired output into a window and the HTML produced looks fine. When I move
>onto web server it has worked and then for some reason it seems to give the
>following error (in a dos box) against every line in the script :-
>
>"Bareword found where operator expected ...... and then the line at fault."
>
>I have to stress that I have had it woking on the host and then was playing
>around with chmod to give correct permissions and it all went pear shaped.
>The code is as follows just to read a file in and format the info into a web
>page format :-
>
>#!/usr/bin/perl
>
>
>$filename = "Accom.txt";
>
>open (MYFILE, "$filename") || die "Could not open the accommodation file";
>
>print <<"(END ERROR HTML)"; #display error message to user by using the html
>below. (any html can go between the <html> tags)
>
><html>
>
><head>
><title>People</title>
></head>
>
><body>
>
><table cellspacing="0" cellpadding="0" border="0" width="570" height="8">
>
>
>(END ERROR HTML)
>
>#Loop through the peoplem in the file outptting the details into a table.
>while(defined($a=<MYFILE>))
> {
> chomp ($a);
> @Dataitems = split(/&/, $a);
>
> print "<tr>\n";
> print qq(<td width="486" height="31" bgcolor="#FFFFCC">\n);
> print qq(<p align="left"><font face="Verdana" size="1"><a
>href="@Dataitems[0]" target="_blank">@Dataitems[1]</a> -
>@Dataitems[2]</font></p>\n);
> print qq(</td>\n);
> print qq(<td width="123" height="31" bgcolor="#FFFFCC"><font
>face="Verdana" size="1"> Rating - <img border="0"
>src="www.australiauncovered.com/images/@Dataitems[3]stars.gif" width="57"
>height="12"></font></td>\n);
> print "</tr>\n";
> print "<tr>\n";
> print qq(<td width="123" height="5"></td>\n);
> print "</tr>\n";
>
> }
>
>print qq(</table>\n);
>print qq(</body>\n);
>print qq(</html>\n);
>
>close (MYFILE);
>
>
>
>
>
>Any advice or suggestions would be appreciated. Thanks in advance,
I see all kinds of problems when I enable warnings with "perl -w" on line 1:
#!/usr/local/bin/perl -w
while (<DATA>) {
chomp;
($foo, $bar) = split /&/;
print "$foo and $bar\n";
@foobar = split /&/;
print "<tr>\n";
print qq(<td width="486" height="31" bgcolor="#FFFFCC">\n);
print qq(<p align="left"><font face="Verdana" size="1"><a
href="@foobar[0]" target="_blank">@foobar[1]</a> -
@foobar[2]</font></p>\n);
print qq(</td>\n);
print qq(<td width="123" height="31" bgcolor="#FFFFCC"><font
face="Verdana" size="1"> Rating - <img border="0"
src="www.australiauncovered.com/images/@Dataitems[3]stars.gif" width="57"
height="12"></font></td>\n);
print "</tr>\n";
print "<tr>\n";
print qq(<td width="123" height="5"></td>\n);
print "</tr>\n";
}
print qq(</table>\n);
print qq(</body>\n);
print qq(</html>\n);
}
__DATA__
one&two&three&four
three&four&five&six
five&six&seven&eight
Result:
Scalar value @foobar[0] better written as $foobar[0] at ./foo2.pl line 11.
Scalar value @foobar[1] better written as $foobar[1] at ./foo2.pl line 11.
Scalar value @foobar[2] better written as $foobar[2] at ./foo2.pl line 11.
Scalar value @Dataitems[3] better written as $Dataitems[3] at ./foo2.pl
line 15.In string, @Dataitems now must be written as \@Dataitems at
./foo2.pl line 15, near "<td width="123" height="31" bgcolor="#FFFFCC"><font
face="Verdana" size="1"> Rating - <img border="0"
src="www.australiauncovered.com/images/@Dataitems"
Unmatched right curly bracket at ./foo2.pl line 30, at end of line
syntax error at ./foo2.pl line 30, near "}"
Execution of ./foo2.pl aborted due to compilation errors.
--
Clay Irving <clay@panix.com>
For what a man would like to to be true, that he more readily believes.
- Francis Bacon
------------------------------
Date: 7 Oct 2000 13:53:12 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Please Help nightmare running rel script.
Message-Id: <8rn9s8$uap$1@news.enteract.com>
Ian <ian.w@btinternet.com> wrote:
> I'm new to perl and am having a nightmare running the following perl script
> on a UNIX web server. If I run against win3 perl on my PC it gives the
> desired output into a window and the HTML produced looks fine. When I move
> onto web server it has worked and then for some reason it seems to give the
> following error (in a dos box) against every line in the script :-
> "Bareword found where operator expected ...... and then the line at fault."
Are you sure you didn't accidentally FTP it to your server in binary
mode? The fact that you're getting that message on every line suggests
that the problem could be some extraneous character on every line.
> I have to stress that I have had it woking on the host and then was playing
> around with chmod to give correct permissions and it all went pear shaped.
> The code is as follows just to read a file in and format the info into a web
> page format :-
Most of these suggestions aren't directly related to the problem you're
having, but are worth looking into.
> #!/usr/bin/perl
-w and use strict would be very helpful here.
> $filename = "Accom.txt";
> open (MYFILE, "$filename") || die "Could not open the accommodation file";
No need for the quotes around $filename. Opening a file in a CGI script
using a relative path is unreliable.
> print <<"(END ERROR HTML)"; #display error message to user by using the html
> below. (any html can go between the <html> tags)
> <html>
> <head>
> <title>People</title>
> </head>
> <body>
> <table cellspacing="0" cellpadding="0" border="0" width="570" height="8">
> (END ERROR HTML)
> #Loop through the peoplem in the file outptting the details into a table.
Those typos suggest that you retyped your code rather than pasting the
original into your post. Don't do that. Besides making you do extra
busy-work, it can introduce errors that aren't in the actual code and it
can hide errors that actually are in the actual code.
> while(defined($a=<MYFILE>))
The "defined" test isn't necessary in Perl 5.005 or above, though it might
be wise to keep it if there's a possibility that your script will be run
under an older version.
> {
> chomp ($a);
> @Dataitems = split(/&/, $a);
> print "<tr>\n";
> print qq(<td width="486" height="31" bgcolor="#FFFFCC">\n);
> print qq(<p align="left"><font face="Verdana" size="1"><a
> href="@Dataitems[0]" target="_blank">@Dataitems[1]</a> -
> @Dataitems[2]</font></p>\n);
Those should be $Dataitems[0], etc.
> print qq(</td>\n);
> print qq(<td width="123" height="31" bgcolor="#FFFFCC"><font
> face="Verdana" size="1"> Rating - <img border="0"
> src="www.australiauncovered.com/images/@Dataitems[3]stars.gif" width="57"
> height="12"></font></td>\n);
> print "</tr>\n";
> print "<tr>\n";
> print qq(<td width="123" height="5"></td>\n);
> print "</tr>\n";
All this would be much easier to type, read and maintain if you used a
here-document.
> }
> print qq(</table>\n);
> print qq(</body>\n);
> print qq(</html>\n);
> close (MYFILE);
------------------------------
Date: Sat, 07 Oct 2000 07:00:01 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Rounding Integers
Message-Id: <39DF2C61.A89BA2C6@stomp.stomp.tokyo>
Logan Shaw wrote:
> Godzilla! wrote:
> > There is no clear rule for rounding off numbers which
> > are not decimal in nature.
> Sure there is.
State this rule.
> If you have a function round() that rounds things, then
> you can define a function round_granular() that rounds them to
> multiples of a certain number:
> sub round_granular
> {
> my ($x, $granularity) = @_;
> return ($granulatiry * round ($x / $granularity));
> }
> Note that this can also works if $granularity is a fraction. So, you
> can use this function to round to the nearest one-tenth, or you can use
> it to round to the nearest 1/32nd.
Excuse me? Are you suffering reading comprehension
problems? What you have stated has zero to do with
rounding off a non-fractional whole number, which is
the topic of this thread.
> > Reason for this is rounding off numbers left of a
> > decimal place, gives an extremely wide margin of error,
> Wide relative to what?
Relative to the whole non-fractional number before
it is rounded off. Hello? Knock. Knock. Anyone
inside there? A quick glance at my data print
is enough to blind you with margin of error.
> All that matters is the application.
My preference is an output of accurate data.
This I believe is more important than the
application producing this data.
> Rounding 72 and 123 to 100 might not be wide for some
> application. Perhaps you're computing something having
> to do with students' classifications and you want to round
> to the nearest multiple of 30 semester-hours so you can
> easily group them according to freshmen, sophomore, etc.
> (In that case, you might want to round down, but the same idea applies.)
Perhaps someone will be kind and politely inform you
what you have stated here doesn't make a lick of sense.
I would not be polite about informing of this grandiose
stupidity displayed by your logic.
> > Why do you want to introduce so much error into your numbers?
> Who says it's error?
This is a joke, right Frank?
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Sat, 7 Oct 2000 11:15:06 +0100
From: "Brendon" <brendonm@lineone.net>
Subject: Uploading files using perl scrip - via e-mail
Message-Id: <8rmt0r$o11$1@supernews.com>
Hi. To anyone who can help, or if you've had a similar problem:
I have created a form with a file field. The script is supposed to attach
the file and send it via e-mail to my e-mail address.
But it's not working. I am using POST, the permissions on the server are
755, so should be fine. The e-mail arrives, but has no file attached.
So, the script is executing, and redirects you to the page it should, but
just won't attach the file.
Is is possible to send a file via a form via e-mail...or am I just being
stupid?
Any help would be appreciated.
Brendon Morris
brendon@morrisweb.co.uk
------------------------------
Date: Sat, 7 Oct 2000 21:43:48 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Uploading files using perl scrip - via e-mail
Message-Id: <slrn8ttvj4.jr6.mgjv@martien.heliotrope.home>
On Sat, 7 Oct 2000 11:15:06 +0100,
Brendon <brendonm@lineone.net> wrote:
> Hi. To anyone who can help, or if you've had a similar problem:
>
> I have created a form with a file field. The script is supposed to attach
> the file and send it via e-mail to my e-mail address.
>
> But it's not working. I am using POST, the permissions on the server are
> 755, so should be fine. The e-mail arrives, but has no file attached.
Where's the code of your script? How are we supposed to know what you
are doing wrong without being able to see what it is you are doing?
No one will be able to help you, unless you show us your code.
BTW, all this form, HTML and CGI stuff is irrelevant. And we don't want
to talk about it. What's relevant is your code and method. That's what
we will discuss.
> Is is possible to send a file via a form via e-mail...or am I just being
> stupid?
No, you cannot send a file via a form via email.
You can however submit the contents of a file (together with some other
information) to a program that runs on a web server, using the CGI. That
program can read that input, and create an email document. That email
document could be formatted according to some MIME standards, and
contain the contents of said file. The program could then deliver the
document to an MTA.
That this information comes from some browser with a HTML form is
totally irrelevant. While HTML forms and CGI programs traditionally are
linked, they are not a prerequisite for each other.
No, you are not stupid (at least, I wouldn't conclude that from this
post), but you do need to read up on how this whole HTTP and Web thing
works. Before you can write a program, you will need to learn how the
environment works, and what happens. Thinking about it in vague userland
terms is not sufficient anymore. Visit for example
http://www.cgi-resources.com/ to get some education on how the whole CGI
thing works in this context.
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: Sat, 7 Oct 2000 09:44:58 +0200
From: =?iso-8859-1?Q?K=E5re_Olai_Lindbach?= <barbr-en@online.no>
Subject: Re: Win32 Widgets?
Message-Id: <sQDD5.121$W31.1692@news1.online.no>
"Noam Tamim" <noamt@yahoo.com> skrev i melding
news:8riq94$1hu$1@news.netvision.net.il...
> Hi.
>
> I'm using ActiveState's ActivePerl on my Windows'98 system. I want to
use
> various GUI widgets -
> like input boxes, message-boxes, and even more complex dialog boxes.
> How can I do it?
>
> One option can be to use Tk - but I can't find the Tk/Perl components
for
> Win32. I've searched the
> FAQ's (and the Web) and found nothing.
> Another option can be an ActiveX component - but again, I don't know
where
> to find it. The standard
> ActivePerl package Win32.pm supplies a basic message-box, but that's
it
> (AFAIK).
>
> Am I missing anything?
If you want to use _M$ specific stuff_: Use WSH. (ActiveX)
Since you have installed Activestate perl on win98, look into AS own
html
documentation, under Windows Scripting Host.
(eg: Start->Programs->ActivePerl->Documentation)
Examples under: <your_perl>\eg\Windows Script Host.
Regards Kåre
------------------------------
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 4547
**************************************