[7460] in Perl-Users-Digest
Perl-Users Digest, Issue: 1085 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 26 12:07:21 1997
Date: Fri, 26 Sep 97 09:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 26 Sep 1997 Volume: 8 Number: 1085
Today's topics:
-ln015 on #! line -vs- command line (John L. Allen)
call from IMG tag <fishrman@shell.wco.com>
Re: Change /etc/passwd <ajdavid@ibm.net>
Re: Help - Countdown Script Hack. (Bennett Todd)
Help building 5.004_01 with sfio (Ken Williams)
Re: Help.Where do Perl users look for a job? (Salvatore Sferrazza)
Hex to Binary string conversion? (Scott Bettis)
Re: Hex to Binary string conversion? <rootbeer@teleport.com>
Re: Hex to Binary string conversion? (Mike Stok)
Re: Hex to Binary string conversion? <seay@absyss.fr>
Re: how do I read the Time and Date with CGI? (Jeremy D. Zawodny)
Re: importing comma deliniated - I'm stuck! (Jay Flaherty)
Re: Julian Date Routine (Mike Stok)
Math::Complex test problems <goodin@cs.purdue.edu>
Memory fails me <rste@greencathedral.com>
Perl and Databases <juliano@apptive.co.uk>
Re: Perl and html problem <tou@tou.com>
Re: Perl crashing RS600 box <bob_melson@phx.mcd.mot.com>
Re: Perl on AS/400 <pvhp@forte.com>
Re: predictable random numbers across continued runs (Greg Bacon)
Re: printing variables... (Andrew M. Langmead)
Re: XS (Mike Stok)
Y2K <keisler@cig.mot.com>
Re: Y2K (Jeremy D. Zawodny)
Re: Y2K (Tad McClellan)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Sep 1997 10:00:25 -0400
From: allen@gateway.grumman.com (John L. Allen)
Subject: -ln015 on #! line -vs- command line
Message-Id: <60gf5p$rj7@gateway.grumman.com>
Ok, what's going on here?. If /tmp/foo is
#!/bin/perl -ln015
print "$\$/";
mustn't the output of echo | /tmp/foo | od -b be identical to the
output of
echo | /bin/perl -ln015 -e 'print "$\$/"' | od -b
??? They're not. The first gives
015 015 015
Ths second gives
012 015 012
Perl4 gives the second answer for both cases.
John.
--
_/JohnL\_allen@gateway.grumman.com <Sun>: 9.5 billion pounds per sec to energy
~\Allen/~Fax: 516-575-7428 <Universe>: 1e22 stars = 22 solar masses per sec
------------------------------
Date: 26 Sep 1997 15:33:31 GMT
From: "Michael A. Watson" <fishrman@shell.wco.com>
Subject: call from IMG tag
Message-Id: <60gkkb$sr1$2@news.wco.com>
I saw a posting that said you could call a PERL script from a HTML
IMG tag like this: <IMG SRC="http://your_url/cgi-bin/your_script.cgi">.
I could not get this to work at all. Any hints?
Also if it is possible to do this how can you pass arguments?
Mike
------------------------------
Date: Sat, 27 Sep 1997 01:36:05 +1000
From: Anthony David <ajdavid@ibm.net>
Subject: Re: Change /etc/passwd
Message-Id: <342BD665.26C7A1EC@ibm.net>
Juan Carlos del Rio wrote:
> Jeremy D. Zawodny wrote:
> > >> >Is there any perl function or routine that can send the password
>
> > >> >parameters (user, old password, new password) to the passwd
> command?
> > >>
> > >> The simplest way to do this from a language perspective is to use
> expect
> > >> see http://expect.nist.gov.
> > >
> > You're suggesting that one use the HTTPD module to change Unix
> system
> > passwords? I must have missed something...
>
> Yes that is correct. I am trying to work with expect, as J Gloudon
> suggested. It seems like working in other environments, though I was
> not
> able yet to make it work on HP-UX 10.20 and running the /etc/passwd
> command. I think it can be useful for an Intranet and for changing a
> password in a system people never access by telnet.
My colleague, who I introduced to Perl, used Comm.pl from CPAN.
It seems to work OK in System V (unlike chat.pl and lchat.pl).
This does the "expect-like" processing needed to run passwd.
Regards Anthony
------------------------------
Date: 26 Sep 1997 13:58:25 GMT
From: bet@network.rahul.net (Bennett Todd)
Subject: Re: Help - Countdown Script Hack.
Message-Id: <slrn62nfrv.np7.bet@waltz.rahul.net>
On Wed, 24 Sep 1997 21:56:47 GMT, Thomas Parker <muse@datasync.com> wrote:
>I basically want to be able to count down to a date that occurs on Feb 10
>1999.
perl -MDate::Parse -le 'print int((str2time("1999-02-10")-time)/86400)'
As a general rule of of thumb, if something is tricky to do right (date and
time computations fit here:-) and is likely to be of interest to other people
(another match) then you'll probably find one or more good helpful components
in the Comprehensive Perl Archive Network (CPAN). I personally like the
TimeDate module, with Date::Parse containing str2time(), and use it regularly.
Go to either of
<URL:http://perl.org/CPAN/>
<URL:http://perl.com/CPAN/>
When I'm looking for a module and don't know what it's gonna be called, I tend
to browse the topics in
<URL:http://perl.org/CPAN/modules/by-module/>
<URL:http://perl.com/CPAN/modules/by-module/>
The CPAN module is pretty cool, too, though I haven't used it much for
searching yet.
-Bennett
------------------------------
Date: Fri, 26 Sep 1997 10:34:37 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Help building 5.004_01 with sfio
Message-Id: <ken-2609971034370001@news.swarthmore.edu>
Hi-
I'm having great difficulty building sfio into my Perl. I do what the
docs say, namely run
sh Configure -Duseperlio -Dusesfio
and feed it some extra cc and ld flags when appropriate. But when I look
at the config.sh file produced by Configure, it still says
usesfio='false'
. And sure enough, when I do the 'make', the perl executable I produce
doesn't have sfio in it:
[forum]:/usr/local/src/perl-fcgi# ./perl -V:usesfio
usesfio='false';
I can try editing the config.sh file manually, and then running Configure
-S, but this makes me a little uncomfortable. Why didn't the instructions
work? Are they out of date?
The instructions I'm using came with FastCGI developer's kit version 2.0b2.
I am happy to provide more information about my system, my Perl, etc.
Thanks very much for any help you can offer!
-Ken Williams
The Math Forum
ken@forum.swarthmore.edu
------------------------------
Date: 26 Sep 1997 15:38:11 GMT
From: nysfe@ny.ubs.com (Salvatore Sferrazza)
Subject: Re: Help.Where do Perl users look for a job?
Message-Id: <60gkt3$1ve$1@ns2.ny.ubs.com>
In article <60ga8r$8hv$1@mainsrv.main.nc.us>, scott@lighthouse.softbase.com (Scott McMahan) says:
>3. Perl and Visual Basic skills are going to be *extremely* rare in the
>same person. Perl has certainly come to Windows, but is primarily still
>a UNIX systems programming language. People who do that usually are
>not VB programmers, and vice versa. (There are exceptions, obviously --
>I myself write Visual Basic for Applications programs and know Perl
>very well, but we're a minority.)
>
I started out programming with Visual Basic but lately I have
been doing more and more Perl. Sybase is the link that ties them together.
Most of the front end (i.e. VB) stuff I write talks to Sybase databases,
but when stuff needs to run @ night (batch jobs, downloads) Sybperl is
really the way to go, especially when parsing legacy data feeds. I think more
and more you will see GUI programmers doing some Perl stuff as legacy data
access in client/server systems becomes more and more prevalent. I don't
think the trend will be VB programmers doing Win32 Perl as long as UNIX
remains the favored database server platform. The bottom line is if your a
programmer familiar with standard programming techniques and tactics, switching
to another language is mostly an issue of semantics and idiosyncracies, at least
in my experiences.
Regards,
-- Sal
------------------------------
Date: Fri, 26 Sep 1997 04:09:05 GMT
From: rsbettis@juno.com (Scott Bettis)
Subject: Hex to Binary string conversion?
Message-Id: <60fcir$eo@opengovt.open.org>
I can't seem to find any perl code to convert numbers/strings between
hex, dec and binary formats. What I'm after is something like
$hexStr = &Bin2Hex('00110101');
-- or --
$hexStr = &HexNum('b00110101');
I could do it I suppose, but I figure it's gotta be out there
somewhere probably better than I could hack out. <g>
Scott Bettis
rsbettis@juno.com
------------------------------
Date: Fri, 26 Sep 1997 07:40:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Scott Bettis <rsbettis@juno.com>
Subject: Re: Hex to Binary string conversion?
Message-Id: <Pine.GSO.3.96.970926073738.376X-100000@usertest.teleport.com>
On Fri, 26 Sep 1997, Scott Bettis wrote:
> I can't seem to find any perl code to convert numbers/strings between
> hex, dec and binary formats.
Check out the perlfunc(1) manpage, which has functions called hex, pack,
and unpack, among others which you may be able to use. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 26 Sep 1997 14:54:12 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Hex to Binary string conversion?
Message-Id: <60giak$50l@news-central.tiac.net>
One thing that might work for you is
$hex = unpack 'H*', pack 'B*', $binString;
if you're using nybbles then you might have to specify a number in the H
template as the packed string is rounded up to the nearest byte e.g.
print unpack 'H*', pack 'B*', '0011'
prints 30 as pack 'B4', '0011' produces a byte, so you might say
print unpack 'H1', pack 'B*', '0011'
If you want to generalise it it may be worth wrapping in a function so
that the input string is left padded with 0s to make it a multiple of 4
characters long and the unpack template is adjusted e.g.
sub bin2hex {
my $bin = shift;
if (defined $bin) {
$bin =~ tr/01//cd;
}
else {
$bin = '0';
}
my $length = length $bin;
if ($length == 0 or $length % 4) {
$bin = '0' x (4 - $length % 4) . $bin;
$length = length $bin;
}
my $hexLength = $length ? $length / 4 : 0;
unpack "H$hexLength", pack "B$length", $bin;
}
Hope this helps,
Mike
In article <60fcir$eo@opengovt.open.org>,
Scott Bettis <rsbettis@juno.com> wrote:
>I can't seem to find any perl code to convert numbers/strings between
>hex, dec and binary formats. What I'm after is something like
>
> $hexStr = &Bin2Hex('00110101');
>
>-- or --
>
> $hexStr = &HexNum('b00110101');
>
>I could do it I suppose, but I figure it's gotta be out there
>somewhere probably better than I could hack out. <g>
>
>Scott Bettis
>rsbettis@juno.com
>
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 26 Sep 1997 17:04:16 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Hex to Binary string conversion?
Message-Id: <342BCEF0.148C622@absyss.fr>
Scott Bettis wrote:
>
> I can't seem to find any perl code to convert numbers/strings between
> hex, dec and binary formats. What I'm after is something like
There is no "one way" of doing this. Usually sprintf() for
decimal->non-decimal and hex()/oct() for non-decimal->decimal. You can
also play lots of games with pack/unpack.
Since I don't do this very often, I haven't checked CPAN lately.
Perhaps there is something somewhere (down in Math:: perhaps) that
converts bases. Dunno.
- doug
------------------------------
Date: Fri, 26 Sep 1997 13:58:38 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: how do I read the Time and Date with CGI?
Message-Id: <342cbe6f.153251564@igate.hst.moc.com>
[cc'd automagically to original author]
On Fri, 26 Sep 1997 08:40:33 -0500, johnh@studiopointe.com (Preferred
Client) wrote:
>I am writing a cgi script that allows the ADMIN to update mortgage prices
Ok...
>The script is working fine but I would like to have it display
>a time and date stamp to the Html file it generates.
I'm a bit puzzled.
Do you mean:
(1) "I would like to have it write a date/time stamp to the HTML file
it generates."
OR
(2) "I would like to have it display a date/time stamp back to the
user along with some other stuff my script displays dynamically?
>This date and time
>stamp would tell the viewer how up to date the information is.
>If anyone know of a way to get the time and date information in CGI, or
>Javascript, your help would be appreciated.
Well, you can do it in JavaScript, but I'd have to grab my JavaScript
book and look-up how. You could do the same, so if that's the route
you choose, so be it.
In Perl, however, you probably want to know how to get the current
date and time in a "printable" format. How about:
$timestamp = localtime(time);
The only difference in (1) and (2) above is where you put the info. Do
you send it to the browser, or to a file that your script it writing.
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 26 Sep 1997 13:59:21 GMT
From: fty@hickory.engr.utk.edu (Jay Flaherty)
Subject: Re: importing comma deliniated - I'm stuck!
Message-Id: <60gf3p$p4n$1@gaia.ns.utk.edu>
Shane (zatezalo.2@osu.edu) wrote:
: Ok, I'm stuck! I tried the code in the FAQ. I tried old code from old posts.
: No luck.
:
: I'm trying to read-in data from a comma deliniated file. Its from a huge
: Access 7.0 database. I'm trying to import the data into a new
: SQL database.
You are going about it the wrong way. You don't need perl to load data into
the database. Forget about the quotes. Go to MSAccess and export the file as
a comma separated file (no quotes around fields). i.e:
Miller,John,E,mill02,mill,688-6666,,770-7777,293-33332,etc...
create your database in mysql to mimic the table you are importing. Don't
create any indexes yet (It will go much faster). Then run the mysql
command:
/usr/local/bin/mysql DBname -e "LOAD DATA INFILE 'table.csv' INTO table
TBname fields terminated by ','";
where:
DBname is the name of the database
table.csv is the name of the comma separated file
TBname is the name of the table
make sure to put the csv file in the same directory the database is located. ie
var/mysql/data/DBname
Jay
--
**********************************************************************
Jay Flaherty fty@utk.edu
"Once in awhile you get shown the light, in the strangest of places if
you look at it right" - R. Hunter
**********************************************************************
------------------------------
Date: 26 Sep 1997 13:56:02 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Julian Date Routine
Message-Id: <60geti$1qu@news-central.tiac.net>
In article <342B8023.1B89@dont.spam.me>,
Brian Ewins <Brian.Ewins@dont.spam.me> wrote:
>In perl, you are much better using unix's internal time format
>(seconds since the epoch) as returned from time(); it does the
>same job.
>
>And a quick conversion:
>$julian = 2440588+int(time/86400);
> ^Julian date for jan 1st 1970
> ^seconds in a day
Whether the unix internal time is better depends on what you're trying to
do... Unix time is good for 1970 .. 2038 to the second, but many things
are only wanted to the day and may fall outside that range e.g.
$ perl -MTime::JulianDay -e 'print julian_day (1964, 5, 8) - julian_day (1776, 7, 4), "\n"'
tells me how many days late I was for independence day...
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: 26 Sep 1997 09:16:17 -0500
From: Jeff Goodin <goodin@cs.purdue.edu>
Subject: Math::Complex test problems
Message-Id: <wuu3f8yxce.fsf@orion.cs.purdue.edu>
I am trying to build perl-5.00403 on a variety of platforms.
I have been successfull on all but Irix 5. I get 3 failed tests
in the Math::Complex module.
I found a patch by Jarkko Hietaniemi that specifically dealt
with the problem I am having. Unfortunatly, the copy I got
was corrupt (missing many >'s) and I did not bookmark the
site I found it on.
It was a site in Germany that had a searchable index of one
of the perl mailing lists or usenet groups.
Please e-mail me if you know where I can get this patch.
The first few lines of it are:
--- lib/Math/Complex.pm.dist Sun Aug 24 18:06:47 1997
+++ lib/Math/Complex.pm Mon Aug 25 13:52:18 1997
@@ -1,8 +1,8 @@
-# $RCSFile$
#
# Complex numbers and associated mathematical functions
-# -- Raphael Manfredi, September 1996
-# -- Jarkko Hietaniemi, March-April 1997
+# -- Raphael Manfredi September 1996
+# -- Jarkko Hietaniemi March-August 1997
+#
Thanks!
Jeff Goodin
goodin@cs.purdue.edu
Systems Programmer
Computer Science, Purdue Univ.
------------------------------
Date: Fri, 26 Sep 1997 16:35:42 +0100
From: "Rufus" <rste@greencathedral.com>
Subject: Memory fails me
Message-Id: <60gkol$hhm$1@plug.news.pipex.net>
How do I pick out character n of a string of length N?
I can clearly do this using substr, but I am sure that once I could clearly
do it the right way. It is a long time since I have used perl, and I have
been corrupted by other languages to the point where I can never remember
which syntax is which. Normally this is not a problem, but the manual does
not seem to want to answer this question.
substr works, but will be slow, and I am sure is not the way I did it
before. Please someone, remind me...
Thanks,
Rufus rste@greencathedral.com
The opinions expressed in this email match those of my company only where
those of my company happen through chance to match those in the email.
------------------------------
Date: Fri, 26 Sep 1997 15:22:25 -0700
From: Julian W H Osborne <juliano@apptive.co.uk>
Subject: Perl and Databases
Message-Id: <342C3567.2462@apptive.co.uk>
Hi,
I have a small problem which I'm _praying_ I might resolve with all your
help.
Here goes. I have an MS-Access DB which I need firstly to convert to
something that will sit on a unix box (any one know of a utility to do
this?) . Once I've got the DB over to unix I need to play around with
it using perl. If anyone can be me any pointer I'd be greatful.
Thanks in advance.
Julian.
------------------------------
Date: Fri, 26 Sep 1997 07:46:12 -0700
From: Joel Shellman <tou@tou.com>
To: Robbert Uittenbosch <robbert@bicho.eui.upm.es>
Subject: Re: Perl and html problem
Message-Id: <342BCAB4.CC38F8FE@tou.com>
Robbert Uittenbosch wrote:
>
> Hi,
>
> At this moment I'm developing an internet site which uses perl as cgi.
> Everytime I open the site I get the following errormessage :
> 500 internal server error.
> Or I get the contents of the perlscript.
> I have tried everything that I could think of, but it still fails.
>
> I know that on my server the perlfiles have te be in the cgi-bin
> directory, and I do that. So that can't be the problem.
> Who out there can help me with this problem, the perl and htmlfiles are
> at the end of this message.
>
> Any help is welcome.
>
> Robbert
> Email :robbert@bicho.eui.upm.es
Did you change the permissions of the cgi file to executable?
I usually use:
chmod 755 [filename]
-joel
--
TaoTree Research and Development
Web Development/Design, Virtual Servers, hosting, Perl/CGI programming
http://www.tou.com/rd/
Revolutionary new clicks-based Banner Exchange Guarantees you traffic
http://www.tou.com/ite/
------------------------------
Date: Fri, 26 Sep 1997 08:24:33 -0700
From: Bob Melson <bob_melson@phx.mcd.mot.com>
Subject: Re: Perl crashing RS600 box
Message-Id: <342BD3B1.446B@phx.mcd.mot.com>
Mike Heins wrote:
>
> I don't think I said it was bad. 8-) I was trying to be kind
> to the poster rather than the OS.
>
> AIX definitely is strange, though, for someone coming from a more
> mainstream Unix. When I was with a company that did device driver
> code we had many struggles with the ODM -- I am sure as many with
> our understanding of the thing as from defects. Of course by the
> time we were done, we had one of the slickest little SMIT installs
> around -- certainly the best I saw from a third party to that
> date.
>
> Our developers did find plenty of bugs in 3.1.x, though I believe
> most were shaken out by the time 3.2 came out.
>
> Regards,
> Mike
--
Mike:
I'm sorry if I gave the impression I thought you were bashing AIX - far
from it, in fact. Where I did (and do) take exception is in the
assumption that the original poster's problem was more likely o/s
related than a probable error in his script. Even granting AIX's
idiosyncracies, of which there are more than just a few, a well behaved
program rarely causes a system crash.
WRT the ODM database, it's both a blessing and a curse. A blessing in
that it simplifies configuration management, a curse because it's so
damned fragile - any kind of mistake that causes a failure in the
synchronization of the various pieces of the ODM can lead to terminal
meltdown. This isn't on topic, so I'll stop now.
Hope this clarifies matters.
Bob
----------------------------------------------------------------------------
Bob Melson The right to be heard does not include
Motorola Computer Group the right to be taken seriously
2900 S. Diablo Way, Tempe, AZ Hubert Humphrey
----------------------------------------------------------------------------
------------------------------
Date: Fri, 26 Sep 1997 08:07:21 -0700
From: Peter Prymmer <pvhp@forte.com>
To: param@sunway.com.sg
Subject: Re: Perl on AS/400
Message-Id: <342BCFA9.6957@forte.com>
Param V wrote:
>
> Hi
>
> Could you please help me setup Perl on AS/400 including HTTP
> configuration on AS/400.
>
> Thanks
>
> Param
Have you looked at the page at:
http://as400.rochester.ibm.com/workshop/perl_rm.htm
that will help you set up perl I believe. Is there any documentation
about how to run a Rexx exec as a cgi script on AS/400? If so
see if you can use that as a suggestion for putting a header at the
top of your perl script. Please note that I am only guessing
I do run perl on MVS but not AS/400.
Peter Prymmer
------------------------------
Date: 26 Sep 1997 14:07:33 GMT
From: gbacon@adtran.com (Greg Bacon)
To: zbrown@lynx.dac.neu.edu (Zachary Brown)
Subject: Re: predictable random numbers across continued runs
Message-Id: <60gfj5$fs6$2@info.uah.edu>
[Posted and mailed]
In article <60f2oq$bt6@lynx.dac.neu.edu>,
zbrown@lynx.dac.neu.edu (Zachary Brown) writes:
: I have a program that uses random numbers to implement a genetic
: algorithm. I can break out of a run and continue it later by storing the
: breeding information in a file. But when I continue it later, the random
: number generator is reset to its original starting point, rather than
: continuing from where it left off. Thus the program behaves differently
: if it is stopped and restarted than if it is left in a single run.
:
: This is unacceptable. I must have a way to keep the program
: deterministic. Is there any way to have perl continue generating random
: numbers from where it left off, using rand() and srand()? I would prefer
: not to have to write my own random number generators, since perl already
: has one.
Most psuedo-random number generators make use of the modulus, and we
haven't quite figured out how to undo the modulus reliably. :-) This
is a good thing, because without one-way functions, we couldn't have
password security et al.
One way of doing what you want is to record the seed you use and then
use a sub like
sub get_random {
my $arg = shift || 1;
$random_count++;
rand $arg;
}
When you want a random number, call this wrapper (note that $random_count
should be a global). When you stop your program, it should keep the seed
and $random_count somewhere it can find it when it restarts. Have an
initialization sub like
sub resume_rand {
my $seed = shift;
my $count = shift;
srand $seed;
for (my $i = 0; $i < $count; $i++) {
rand;
}
}
Then you'll be back where you were with respect to random numbers.
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Fri, 26 Sep 1997 14:50:31 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: printing variables...
Message-Id: <EH4EK7.1Fo@world.std.com>
mick@io.com (Michele Beltrame) writes:
>However, Perl inteprets the full $hpathbkg as a variable name. How can I
>resolve this without having to use more than one print function? If I use
>something like:
You can put curly braces around a variable, like:
"${hpath}bkg.jpg"
--
Andrew Langmead
------------------------------
Date: 26 Sep 1997 14:03:44 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: XS
Message-Id: <60gfc0$23o@news-central.tiac.net>
In article <MPG.e95b64ffb4f1370989682@nntpserver.swip.net>,
Toad <toad@hem1.passagen.se> wrote:
>I need to create a Perl interface to a .so file that I've created in C.
>As I understand it you're supposed to use XS, rigth? And I've looked
>through the xstut man page, but frankly I think I need some more
>comprehensible info on this subject. I did the steps described, but it
>didn't do it for me :(
In what way didn't it do it for you? One resource that's just become
available is Sriram Srinivasan's Advanced Perl Programming book
(published by O'Reilly) which has a chapter on using SWIG and XS to make
perl extensions. One thing to do is to let the tool deal with making the
.so file from C as it should get the compile options right for your perl
installation.
Have you worked through the examples in the xstut page and tried them?
Have you checked out the perlxs and perlguts pages to give yourself some
background?
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 26 Sep 1997 09:54:39 -0500
From: Mark Keisler <keisler@cig.mot.com>
Subject: Y2K
Message-Id: <Pine.SUN.3.95.970926095300.14640B-100000@booboo>
Is anyone aware of any Y2K related bugs with perl? We are currently
using perl4.036 as well as perl5.002. Could I get some kind of
assurance from LArry or Randall as to perl's soundness in the face of
year 2000?
-----------------------------------------------------------------------------
Mark Keisler, Motorola ITS Eclectic Team
Business People
Your business - is your greatest prejudice: it ties you to your
locality, to the company you keep, to the inclinations you feel.
Diligent in business - but indolent in spirit, content with your
inadequacy, and with the cloak of duty hung over this contentment:
that is how you live, that is how you want your children to live!
-----------------------------------------------------------------------------
------------------------------
Date: Fri, 26 Sep 1997 15:15:32 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Y2K
Message-Id: <342fd0f2.157990227@igate.hst.moc.com>
[cc'd automagically to original author]
On Fri, 26 Sep 1997 09:54:39 -0500, Mark Keisler <keisler@cig.mot.com>
wrote:
>Is anyone aware of any Y2K related bugs with perl? We are currently
>using perl4.036 as well as perl5.002. Could I get some kind of
>assurance from LArry or Randall as to perl's soundness in the face of
>year 2000?
The following was written by someone, whose name I have lost (it was
on the Perl Institute's Advisory mailing list). In any case, it is
*not* my work:
---snip---
: Perl has no warranty, and TPI does not support Perl. Furthermore,
: Perl is a language, and languages can be misused in many ways. But
: that's the responsibility of the programmer, not of the many
: creators of Perl. Nevertheless, as spokes-organization for the
: Perl freeware movement, we feel compelled to point out that Perl is
: every bit as Y2K compliant as the C language upon which its
: interfaces are based, and in which the Perl interpreter itself is
: written. That is, the interfaces giving access to date information
: in Perl, when used as designed, are Y2K compliant in every sense of
: the word.
---snip---
There are discussions going on right now about making this information
available at www.perl.org and probably www.perl.com.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Fri, 26 Sep 1997 10:20:57 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Y2K
Message-Id: <psjg06.af5.ln@localhost>
[ emailed, posted ]
Mark Keisler (keisler@cig.mot.com) wrote:
: Is anyone aware of any Y2K related bugs with perl? We are currently
: using perl4.036 as well as perl5.002. Could I get some kind of
: assurance from LArry or Randall as to perl's soundness in the face of
: year 2000?
You could try searching for '2000' in the documentation that is
included with every proper perl distribution.
It is a Frequently Asked Question. The Perl FAQ is included with
distributions as of 5.004.
Using an old distribution does not excuse you from checking the FAQ
before posting a FAQ yet one more time...
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 1085
**************************************