[17656] in Perl-Users-Digest
Perl-Users Digest, Issue: 5076 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 10 18:05:36 2000
Date: Sun, 10 Dec 2000 15:05:13 -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: <976489512-v9-i5076@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 10 Dec 2000 Volume: 9 Number: 5076
Today's topics:
Re: appending to the begining of a file in PERL <bowman@montana.com>
Re: ascii -> unicode file <nospam.newton@gmx.li>
Re: can't get to mySQL from cgi-bin locdog@my-deja.com
Date Manipulation / Cron Job <markh@argolink.net>
Re: Date Manipulation / Cron Job (Chris Fedde)
Re: Date Manipulation / Cron Job (Garry Williams)
Re: Date Manipulation / Cron Job <iltzu@sci.invalid>
DBM File Open Problem <sbobrows@ix.netcom.com>
detecting overflow <thehobbit@altern.org>
downloading perl <rajeshpm@emirates.net.ae>
Re: downloading perl <carvdawg@patriot.net>
Re: downloading perl <rajeshpm@emirates.net.ae>
EXTREME (julian esteban)
Re: How do ya read a cookie? (Richard Zilavec)
Re: I want 3 guests/row instead of one. Must change RE (David Efflandt)
Re: I want 3 guests/row instead of one. Must change RE (David Efflandt)
Re: IO::Select::select not blocking on a filehandle <uri@sysarch.com>
IO::Socket::INET help, please. ynotssor@my-deja.com
Re: IO::Socket::INET help, please. <uri@sysarch.com>
Re: lwp <ng@fnmail.com>
Mathematics in Perl <kyle@iol.ie>
Re: Mathematics in Perl (Chris Fedde)
Re: Mathematics in Perl <joe+usenet@sunstarsys.com>
MIME::Base64 - Encoding problem <scrix@unlimited.dk>
Re: MIME::Base64 - Encoding problem <stephenk@cc.gatech.edu>
Modules & OOP beyond Sriram's "Advanced Perl Programmin <bcaligari@my-deja.com>
Re: Modules & OOP beyond Sriram's "Advanced Perl Progra <uri@sysarch.com>
Re: Newbie problem reg. activeperl <bwalton@rochester.rr.com>
Perl 5.6.0 installation question <thoren@southern-division.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 10 Dec 2000 10:13:22 -0700
From: "bowman" <bowman@montana.com>
Subject: Re: appending to the begining of a file in PERL
Message-Id: <9VOY5.1642$XY.17849@newsfeed.slurp.net>
<mmustafa@my-deja.com> wrote in message news:9107f6$ef1$1@nnrp1.deja.com...
> Does anyone know how to append to the begining of a file in PERL? I
> know that to append to a file , you use '>>'. This appends to the end
> of the file.
> Please let me know if there is a way to append to the begining of the
> file.
perldoc -q append
------------------------------
Date: Sun, 10 Dec 2000 20:58:37 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: ascii -> unicode file
Message-Id: <tjm73t4pkkodjpetvfio3frjb88j6snejn@4ax.com>
On Sun, 10 Dec 2000 01:00:37 -0000, David Lee <dwl@slip.net> wrote:
> Some questions:
>
> 1) Is perl v5.006 available for Win32 systems?
Yes. (It's usually called 5.6, though.)
> Pre-built version?
Yes. I know ActiveState provides a pre-built version (I think they're at build
620 now). Don't know about IndigoStar's version; check their web page.
> 3) Is there a hack I can do in perl 5.004 to read an ascii file
> and save it as a unicode file or convert an ascii file
> to unicode?
What's a "Unicode file"? Unicode just assigns numbers (code points) to
characters; you can't save code points in files since you have to write out
bytes. There are several different ways to represent the Unicode code points as
bytes. UTF-8, UTF-16BE, and UTF-16LE are just some of them. (And if the "ASCII"
file really only contains ASCII characters -- that is, with codes from 0 to 127
--, then they are all trivially convertable to Unicode and any of the above
transformation formats. You could probably even do it with Perl 1. And if it's
Latin-1 aka ISO-8859-1, then UTF-16* is also trivial, and UTF-8 only a bit
harder.)
> Please reply to DWL@slip.net
Nope. Ask here, get the answer here.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sun, 10 Dec 2000 20:47:13 GMT
From: locdog@my-deja.com
Subject: Re: can't get to mySQL from cgi-bin
Message-Id: <910q4g$sac$1@nnrp1.deja.com>
I don't see your http headers there.
Try adding
print "Content-type: text/html\n\n";
before you print anything out to the screen.
--LoC
In article <90j74p$b5i$1@nnrp1.deja.com>,
richard_dobson@my-deja.com wrote:
> hi,
> i have installed indigo perl which has DBD::mySQL within it. I also
> have mySQL. I have a script that runs from the command line but not
> from the cgi-bin. I don't have any difficulties running other cgi
> scripts. It is very simple and the core is as follows:
> (not including cgi headers)
>
> use DBI;
> my $dbh = DBI->connect("DBI:mysql:database=database01;host=localhost",
> undef, undef,{'RaiseError' => 1});
>
> my $sth = $dbh->prepare("SELECT * FROM table01");
> $sth->execute();
> while (my $ref = $sth->fetchrow_hashref()) {
>
> print "Found a row: id = $ref->{'field01'}, name = $ref->{'field02'}
\n";
>
> }
> $sth->finish();
>
> $dbh->disconnect();
>
> the browser produces the following response:
>
> 'The server encountered an internal error or misconfiguration and was
> unable to complete your request.'
>
> Am I missing something simple here?
>
> thanks in advance
> Rich
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Dec 2000 10:50:52 -0600
From: Mark Henderson <markh@argolink.net>
Subject: Date Manipulation / Cron Job
Message-Id: <3A33B46C.1C913CE9@argolink.net>
Greetings:
I don't have the ability to instal new modules on my ISP's server
(running Perl 5.05), and they are a bit sticky about such things. So, I
was wondering if any of you might be able to help me with a code
snippet. The problem is as follows:
1) I want to execute a function to clean up my database every other
Monday. I can easily have my ISP institute a cron job on the server to
kick of my Perl script that cleans the database, but the problem with
cron is that it can only be told to run every Monday.
2) When my Perl script executes every Monday, I want to have some code
in it to check and see if this is an even or odd Monday and either exit
or perform the functions for cleaning the database. Does anybody have
any code snippets or references for how I might check the date, and then
determine if this is the Monday that I want to execute the database
cleaning functions?
Replies off-list are also welcome.
Thanks,
Mark
------------------------------
Date: Sun, 10 Dec 2000 17:55:52 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Date Manipulation / Cron Job
Message-Id: <IsPY5.111$B9.170957824@news.frii.net>
In article <3A33B46C.1C913CE9@argolink.net>,
Mark Henderson <markh@argolink.net> wrote:
>Greetings:
>
>I don't have the ability to instal new modules on my ISP's server
>(running Perl 5.05), and they are a bit sticky about such things. So, I
>was wondering if any of you might be able to help me with a code
>snippet. The problem is as follows:
>
>1) I want to execute a function to clean up my database every other
>Monday. I can easily have my ISP institute a cron job on the server to
>kick of my Perl script that cleans the database, but the problem with
>cron is that it can only be told to run every Monday.
>
>2) When my Perl script executes every Monday, I want to have some code
>in it to check and see if this is an even or odd Monday and either exit
>or perform the functions for cleaning the database. Does anybody have
>any code snippets or references for how I might check the date, and then
>determine if this is the Monday that I want to execute the database
>cleaning functions?
>
Here is a list of random thoughts on this.
You might be able to compromise on the crontab entry. Every other
monday is hard, but running on the 1st and 15th is easy.
You could have the ISP run your command every day between 1st and
7th then again between the 15th and 21st. The program checks to
see if today is Monday before it runs.
The above idea can also be inverted. Run every Monday via cron.
If the date is betwen the 1st and 7th or between the 15th and 21st
then you can run.
The module Date::Calc has exactly the kinds of functions that you need.
Another approach is to keep a counter in a data file. Every run
you increment the counter. If the counter value is even you run.
There is a module for called File::CounterFile that keeps the
counter for you. But it is also a CPAN module and so can't be used
ether.
You could always change ISPs.
Good luck
chris
--
This space intentionally left blank
------------------------------
Date: Sun, 10 Dec 2000 18:09:15 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: Date Manipulation / Cron Job
Message-Id: <fFPY5.379$uF3.28102@eagle.america.net>
On Sun, 10 Dec 2000 10:50:52 -0600, Mark Henderson
<markh@argolink.net> wrote:
[snip]
>2) When my Perl script executes every Monday, I want to have some
>code in it to check and see if this is an even or odd Monday and
>either exit or perform the functions for cleaning the database.
Here's a way (a fish) to do it with Perl:
$ cat x
#!/usr/local/bin/perl -w
use strict;
use Fcntl;
my $SEMAPHORE = '/tmp/my_semaphore';
sysopen(SEM, $SEMAPHORE, O_CREAT|O_RDWR)
|| die "can't open $SEMAPHORE: $!";
my $not_this_week = <SEM> || 0;
chomp($not_this_week);
seek(SEM, 0, 0)
|| die"couldn't reposition $SEMAPHORE: $!";
if ( $not_this_week ) {
print SEM "0\n";
close(SEM) || die "can't rewrite $SEMAPHORE: $!";
print "exiting because not this week\n";
exit;
}
print SEM "1\n";
close(SEM) || die "can't rewrite $SEMAPHORE: $!";
# Begin this week's processing
print "processing this week\n";
exit;
__END__
$ cat /tmp/my_semaphore
cat: cannot open /tmp/my_semaphore
$ perl x
processing this week
$ cat /tmp/my_semaphore
1
$ perl x
exiting because not this week
$ cat /tmp/my_semaphore
0
$
You probably want to store the file in your own directory so that it
doesn't get deleted by the system or the sysadmin.
--
Garry Williams
------------------------------
Date: 10 Dec 2000 21:10:52 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Date Manipulation / Cron Job
Message-Id: <976482129.20042@itz.pp.sci.fi>
In article <3A33B46C.1C913CE9@argolink.net>, Mark Henderson wrote:
>
>2) When my Perl script executes every Monday, I want to have some code
>in it to check and see if this is an even or odd Monday and either exit
my $week = 60*60*24*7;
exit if time() % (2*$week) < $week;
Now, I have no idea on which Mondays this will exit. (Actually, I do
now. It'll exit tomorrow.) But whatever it does, if you run it again
exactly seven days later, it'll do the opposite.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clpm
------------------------------
Date: Sun, 10 Dec 2000 12:48:05 -0800
From: "Steve Bobrowski" <sbobrows@ix.netcom.com>
Subject: DBM File Open Problem
Message-Id: <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: 10 Dec 2000 16:18:31 +0100
From: Frodo Baggins <thehobbit@altern.org>
Subject: detecting overflow
Message-Id: <87k898tid4.fsf@shire.univ-pau.fr>
Hi people,
I'm trying to write a Perl module to do arithmetic on arbitrary precision
integers. Obviously, these new operation will pay an overload on built-in
operators for these cases in which the latter can be used. So I'd like to use
standard built-in whenever possible. I tried to do something like
sub add {
use integers;
my $result = eval {$_[0] + $_[1]};
return $result if (defined $result);
goto &myadd;
}
where myadd is the subroutine handling the case where one at least is a "big"
integer.. Well, it didn't work :( Even with the inter pragma, overflow errors
aren't detected... Any idea?
--
Leo "TheHobbit"
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This email was infected under the terms of the GNU General Public License.
------------------------------
Date: Sun, 10 Dec 2000 20:34:56 +0400
From: "rajeshpm" <rajeshpm@emirates.net.ae>
Subject: downloading perl
Message-Id: <910bbh$onj5@news.emirates.net.ae>
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
------------------------------
Date: Sun, 10 Dec 2000 12:18:38 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: downloading perl
Message-Id: <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.
------------------------------
Date: Mon, 11 Dec 2000 01:13:20 +0400
From: "rajeshpm" <rajeshpm@emirates.net.ae>
Subject: Re: downloading perl
Message-Id: <910rm0$onh6@news.emirates.net.ae>
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.
>
>
------------------------------
Date: 10 Dec 2000 22:34:30 GMT
From: julian@rec.com (julian esteban)
Subject: EXTREME
Message-Id: <9110dm$5ldd24@SGI3651ef0.iddeo.es>
Welcome to Extreme!
14 categories of adult indexes.
NO SPAM NO BANNERS ONLY FREE PICS AND LINKS
Bienvenido a Extreme!
14 categorias de adultos
NO SPAM NO BANNERS SOLO FOTOS Y ENLACES GRATIS
http://usuarios.tripod.es/web_extreme
------------------------------
Date: Sun, 10 Dec 2000 16:35:21 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: How do ya read a cookie?
Message-Id: <3a33b084.218859111@news.tcn.net>
>
>Is this a simple procedure to do in perl?
perldoc CGI::Cookie
--
Richard Zilavec
rzilavec@tcn.net
------------------------------
Date: Sun, 10 Dec 2000 19:21:48 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: I want 3 guests/row instead of one. Must change RE and setting up rows and collumns i outfile.
Message-Id: <slrn937lun.m5.efflandt@efflandt.xnet.com>
On Sun, 10 Dec 2000 11:13:19 GMT, Fabian <fabianos@telia.com> wrote:
>
>I like to change this script to display the output.
>In regular guestbooksscripts there is a new guest/row.
>I want 3 guests/row.
>Is it possible.
>Can i anyone help me?
>Fabian
This appeared to be a variation of Matt's guestbook script that had been
so buchered as to render it inoperative (mismatched brackets and missing
'if' statement). I don't know it something got lost in the cut & paste,
but the bad form mades some simple blocks difficult to follow.
Rather than replicate the rubbish I will streamline it and add file
locking, although, it should really be using the Perl CGI module for form
handling.
Not sure if you want the "&& $linkmail" here, but it appeared to be a
condition about whether the new entry should be added.
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;
}
--
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 19:25:27 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: I want 3 guests/row instead of one. Must change RE and setting up rows and collumns i outfile.
Message-Id: <slrn937m5k.m5.efflandt@efflandt.xnet.com>
I forgot to mention that you can add any number of lines you want to
(print GUEST "any number of lines\n";) between where it print one
<!--begin--> or the other to the file.
--
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 18:08:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: IO::Select::select not blocking on a filehandle
Message-Id: <x74s0ckv2e.fsf@home.sysarch.com>
>>>>> "F" == Freddie <freddie@ns1.nowait.net> writes:
F> $logfh is ALWAYS in @$rh_set, so the select call is always
F> returning straight away, making a nice spinlock = 100% CPU usage
F> :-( I've tried it with can_read() too, same problem... anyone have
F> any ideas?
file handles for regular files are ALWAYS readable/writeable so
IO::Select will never block on them. what you want is asynchronous file
i/o which is supported by a few OS's and not directly in perl. perl6
will probably support it but don't wait for it.
so there is no trivial way to do what you want. but why do you care?
just read/write the file when needed and don't use I/O select. writing
is buffered and should be fast and reading will block some when disk
reads are needed.
F> (cc: to my e-mail address please)
as you didn't mung your address, i will do it.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 10 Dec 2000 16:08:48 GMT
From: ynotssor@my-deja.com
Subject: IO::Socket::INET help, please.
Message-Id: <9109qf$g2i$1@nnrp1.deja.com>
Greetings;
Would someone please assist with the syntax of this construct? The
intent is to schedule a cron job on a remote machine. I'm sure my
inexperience with perl is obvious.
The TMPFILE indicates that the variables are correct; the error in the
Apache error-log is:
String found where operator expected at /home/httpd/cgi-bin/vacation.cgi
line 174, near "->print
"$user\n$pass\necho /usr/dt/bin/dtmail -v stop | at -m -t
$year$month$day$endtime\nexit\n""
(Missing operator before "$user\n$pass\necho /usr/dt/bin/dtmail
-v stop | at -m -t $year$month$day$endtime\nexit\n"?)
syntax error at /home/httpd/cgi-bin/vacation.cgi line 174, near "->print
"$user\n$pass\necho /usr/dt/bin/dtmail -v stop | at -m -t
$year$month$day$endtime\nexit\n""
Execution of /home/httpd/cgi-bin/vacation.cgi aborted due to compilation
errors.
The perl construct:
# Schedule a cron job for vacation message removal.
sub schedule_cron {
open(TMPFILE, ">/tmp/debug") || &html_abort("Cannot open
/tmp/debug");
print TMPFILE "$server:23\n$user\n$pass\necho /usr/dt/bin/dtmail -v
stop | at -m -t $year$month$day$endtime\nexit\n";
close(TMPFILE);
$socket = IO::Socket::INET->new('$server:23');
$socket->print
"$user\n$pass\necho /usr/dt/bin/dtmail -v stop | at -m -t
$year$month$day$endtime\nexit\n";
$socket->close;
}
What operator is expected? Are there other problems as well? Your
observations are much appreciated.
- tony
-
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Dec 2000 18:36:22 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: IO::Socket::INET help, please.
Message-Id: <x7y9xojf89.fsf@home.sysarch.com>
>>>>> "y" == ynotssor <ynotssor@my-deja.com> writes:
y> sub schedule_cron {
y> open(TMPFILE, ">/tmp/debug") || &html_abort("Cannot open
y> /tmp/debug");
y> print TMPFILE "$server:23\n$user\n$pass\necho /usr/dt/bin/dtmail -v
y> stop | at -m -t $year$month$day$endtime\nexit\n";
y> close(TMPFILE);
it would be better to build up you string in variable so you can print
it twice and not worry about editing 2 copies.
y> $socket = IO::Socket::INET->new('$server:23');
^ ^
single quotes don't interpolate so that won't work. always check the
results of socket connections.
y> $socket->print
y> "$user\n$pass\necho /usr/dt/bin/dtmail -v stop | at -m -t
y> $year$month$day$endtime\nexit\n";
method calls require parens around their arguments. this is not the same
as the earlier print which doesn't need parens.
comp.lang.perl.modules removed as this is a syntax problem.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 10 Dec 2000 15:13:42 -0600
From: "Enrico Ng" <ng@fnmail.com>
Subject: Re: lwp
Message-Id: <910rmb$p73$1@info1.fnal.gov>
umm, how do I do that?
--
Enrico Ng <ng@fnmail.com>
"matteo" <dsdf@sdfd.com> wrote in message news:3a3366a9@post.usenet.com...
> **** Post for FREE via your newsreader at post.usenet.com ****
>
> try to use a4proxy to see what urls are loaded
>
> "Enrico Ng" <ng@fnmail.com> ha scritto nel messaggio
> news:90u74i$c12$1@info1.fnal.gov...
> > I dont know if this is possible, but I want to make a script that will
> login
> > to my online bank acount and display my balance.
> > the problem is that the form that is used to login is a asp script.
> > I tryed just putting ?usename=enricong&password=...
> > but that didnt work.
> >
> > any ideas?
> >
> > --
> > Enrico Ng <ng@fnmail.com>
> >
> >
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
> http://www.usenet.com
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
Date: Sun, 10 Dec 2000 20:13:06 GMT
From: Kyle Parfrey <kyle@iol.ie>
Subject: Mathematics in Perl
Message-Id: <3A33F219.E94EF7F3@iol.ie>
Hello all:
I want to write a script that takes a mathematical function, supplied
with all needed numbers,
and returns its integral. I want to do this for a list of numbers. Is
there either some
built in function that would do this or some module that would contain
such a function?
Thanks,
Kyle
------------------------------
Date: Sun, 10 Dec 2000 20:34:41 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Mathematics in Perl
Message-Id: <BNRY5.113$B9.170601472@news.frii.net>
In article <3A33F219.E94EF7F3@iol.ie>, Kyle Parfrey <kyle@iol.ie> wrote:
>Hello all:
>I want to write a script that takes a mathematical function, supplied
>with all needed numbers,
>and returns its integral. I want to do this for a list of numbers. Is
>there either some
>built in function that would do this or some module that would contain
>such a function?
>
>Thanks,
>Kyle
Maybe you can find something useful in CPAN. I see Math::Integral::Romberg
there.
chris
--
This space intentionally left blank
------------------------------
Date: 10 Dec 2000 16:43:43 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Mathematics in Perl
Message-Id: <m3lmtohrzk.fsf@mumonkan.sunstarsys.com>
Kyle Parfrey <kyle@iol.ie> writes:
> Hello all:
> I want to write a script that takes a mathematical function, supplied
> with all needed numbers,
> and returns its integral. I want to do this for a list of numbers. Is
> there either some
> built in function that would do this or some module that would contain
> such a function?
>
What sort of integration are you trying to do:
symbolic (e.g. x -> x^2/2 + C)or numerical?
It's not too hard to implement something
like Simpson's rule yourself.
--
Joe Schaefer
------------------------------
Date: Sun, 10 Dec 2000 17:38:54 +0100
From: S=?ISO-8859-1?B?+A==?=ren Christian Rix <scrix@unlimited.dk>
Subject: MIME::Base64 - Encoding problem
Message-Id: <B659702E.4BC9%scrix@unlimited.dk>
Hi, I'm trying to make a small routine that will base64 encode a jpeg file
(or any file).
When I use this code:
use MIME::Base64 qw(encode_base64);
open(FILE, $ARGV[0]) or die "$!";
while (read(FILE, $buf, 60*57)) {
print encode_base64($buf);
}
(#This is the example code from MIME-Base64-2.11/Base64.pm)
It seems to work fine with plain text files, but when I feed it a jpeg at 20
Kbytes or so it only returns about 90 bytes.
What am I doing wrong ? (win32 - perl 5.x)
Thanks for your time
Søren Christian Rix
------------------------------
Date: Sun, 10 Dec 2000 13:28:34 -0500
From: Stephen Kloder <stephenk@cc.gatech.edu>
Subject: Re: MIME::Base64 - Encoding problem
Message-Id: <3A33CB51.BCB4C68A@cc.gatech.edu>
Søren Christian Rix wrote:
> Hi, I'm trying to make a small routine that will base64 encode a jpeg file
> (or any file).
>
> When I use this code:
>
> use MIME::Base64 qw(encode_base64);
>
> open(FILE, $ARGV[0]) or die "$!";
> while (read(FILE, $buf, 60*57)) {
> print encode_base64($buf);
> }
>
> (#This is the example code from MIME-Base64-2.11/Base64.pm)
>
> It seems to work fine with plain text files, but when I feed it a jpeg at 20
> Kbytes or so it only returns about 90 bytes.
>
> What am I doing wrong ? (win32 - perl 5.x)
>
Probably stopped as soon as it hit an EOF character (^Z). You want it to read in
binary mode. Insert the line:
binmode FILE;
after opening the file.
perldoc -f binmode
--
Stephen Kloder | "I say what it occurs to me to say.
stephenk@cc.gatech.edu | More I cannot say."
Phone 404-874-6584 | -- The Man in the Shack
ICQ #65153895 | be :- think.
------------------------------
Date: Sun, 10 Dec 2000 20:39:55 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Modules & OOP beyond Sriram's "Advanced Perl Programming"
Message-Id: <910pmq$s4h$1@nnrp1.deja.com>
Now I've been a few months doing Perl and have moved most
c/awk/sed/shell stuff to perl scripts, where I admit that many a
tedious sysadmin job have been automated, leaving me ample free time to
procrastinate while the job still gets done.
I would appreciate any kind recommendations to texts that cover
Modules / OOP in more depth than O'Reilly's (fantastic) Advanced Perl
Programming yet more 'readable' than the perl Docs / Programming Perl.
Brendon
++++
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 10 Dec 2000 21:08:41 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Modules & OOP beyond Sriram's "Advanced Perl Programming"
Message-Id: <x7u28cj86e.fsf@home.sysarch.com>
>>>>> "BC" == Brendon Caligari <bcaligari@my-deja.com> writes:
BC> I would appreciate any kind recommendations to texts that cover
BC> Modules / OOP in more depth than O'Reilly's (fantastic) Advanced Perl
BC> Programming yet more 'readable' than the perl Docs / Programming Perl.
object oriented perl by damian conway. it will answer all of your
questions and needs.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 10 Dec 2000 21:14:17 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Newbie problem reg. activeperl
Message-Id: <3A33F2C8.DD0A8757@rochester.rr.com>
rajeshpm wrote:
>
> I have installed ActivePerl 5.6 on my computer. I have windows98.
> When i double click it on windows explorer it gives a message saying that
> the version of windows i am using is not compatible.
>
> So what do i do ? is there a solution to this.?
> Can somebody help.
...
> vidya
Maybe if you told us *exactly* what the error message says and *exactly*
what you double-clicked on to get it, then someone might be able to
help.
--
Bob Walton
------------------------------
Date: Sun, 10 Dec 2000 23:47:23 +0100
From: Thoren Johne <thoren@southern-division.com>
Subject: Perl 5.6.0 installation question
Message-Id: <MPG.149e26668edcb711989702@news.btx.dtag.de>
hi,
i try to install Perl 5.6.0 on a virtual server.
OS is bsdos 3.1
if i run 'sh Configure -Dprefix='/usr/home/southern/usr/local'
everything compiles fine, but after installation @INC points to the
physical path:
/usr/home/southern/usr/local/lib/perl5/5.6.0/i386-bsdos
/usr/home/southern/usr/local/lib/perl5/5.6.0
/usr/home/southern/usr/local/lib/perl5/site_perl/5.6.0/i386-bsdos
/usr/home/southern/usr/local/lib/perl5/site_perl/5.6.0
/usr/home/southern/usr/local/lib/perl5/site_perl
what do i need to do that @INC points to my virtual place - like
/usr/local/lib/perl5/5.6.0/i386-bsdos
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/i386-bsdos
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
TIA
thoren
8#X
--
----------------------------------------------------------------------
Thoren Johne - 8#X - thoren@southern-division.com
Southern Division Classic Bikes - www.southern-division.com
------------------------------
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 5076
**************************************