[8002] in Perl-Users-Digest
Perl-Users Digest, Issue: 1627 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 13 09:20:55 1998
Date: Tue, 13 Jan 98 06:00:57 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 13 Jan 1998 Volume: 8 Number: 1627
Today's topics:
Re: **1A Please Help, Perl is harrassing me ** <BC3-AU@bigfoot.com>
Berkeley DB under Windows <bkyan@mindcast.com>
Re: Changing System Password <adavid@netinfo.com.au>
Command Line arguments - Perl for Win32 <newspost@dyna_cs.demon.co.uk>
define variable names at run time? <mikihasa@worldnet.att.net>
Re: define variable names at run time? <rjc@liddell.cstr.ed.ac.uk>
Re: Dereferencing, Hashes, and Keys <jdporter@min.net>
Re: Displaying GIFs - oops <patrick@mediacity.com.sg>
Re: effective perl vs. advanced perl books? joseph@5sigma.com
fastest way for two-dimensional arrays (Bernhard Freund)
Re: fastest way for two-dimensional arrays (Tad McClellan)
File Upload and CGI.pm 2.36 <Carlos.de_Sousa@ebc.ericsson.se>
Re: Getopt::Long caveat? (frans postma)
Re: hi! help me with cp , plz... tobez@plab.ku.dk
Re: hi! help me with cp , plz... <merlyn@stonehenge.com>
Local paths in Perl for Win32 <newspost@dyna_cs.demon.co.uk>
Making DynaLoader into a shared library toml@synnet.com
Re: Making DynaLoader into a shared library (Chris Nandor)
Module Net::FTP problems <BC3-AU@bigfoot.com>
Re: Perl to Binary? (Bart Lateur)
Re: perl under windows95 <ebohlman@netcom.com>
Re: qxurl/perl peculiarity (from perlfaq9) (John M. Klassa)
Searching for an IP address in a string <alester@bfsec.bt.co.uk>
Re: Small Pattern Regrex Question? (Tad McClellan)
Re: truncating (Tad McClellan)
unlink () doesn't work under NT <ckko@cse.cuhk.edu.hk>
Who had compiled Perl5.004_04 for SCO Unix R3.2V4.2 <bidouye@club-internet.fr>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jan 1998 03:31:42 -0800
From: Bruce Cook <BC3-AU@bigfoot.com>
Subject: Re: **1A Please Help, Perl is harrassing me **
Message-Id: <un2h0vcdd.fsf@donal.kintailrd>
mcravit@best.com (Matthew Cravit) writes:
>
> In article <comdog-0501980449090001@news.panix.com>,
> brian d foy <comdog@computerdog.com> wrote:
>
> > s/@/\@/g;
>
> That doesn't quite do it, though, since backslashes are special on both
> sides of the regexp. I'm sure what you meant to write was:
>
> s/@/\\@/;
Um.. wouldn't you want
s/\@/\\\@/;
(Assuming that un-quoted '@' will start it looking for an array)
--
...BRU
Bruce Cook, Synonet Corp. E-Mail: bc3-au@bigfoot.com
Phone: +61 15 999 330 Fax: +61 8 9227 7390
------------------------------
Date: Tue, 13 Jan 1998 00:16:23 -0800
From: Benjamin Kyan <bkyan@mindcast.com>
Subject: Berkeley DB under Windows
Message-Id: <34BB22D7.9E54152@mindcast.com>
Hi!
Does anyone know if there's anything that I could use, under Perl,
to tie to the Windows version of Berkeley DB in the same manner
as DB_File.pm does for the UNIX version? Thanks for any suggestions.
--
Best Regards,
Benjamin Kyan (mailto:bkyan@mindcast.com)
Clickstream Communications (http://www.mindcast.com)
------------------------------
Date: Wed, 14 Jan 1998 00:04:00 +1100
From: Anthony David <adavid@netinfo.com.au>
To: Trey Thompson <trey@waymark.net>
Subject: Re: Changing System Password
Message-Id: <34BB6640.3C27DC61@netinfo.com.au>
Trey Thompson wrote:
> I am currently changing the a users password (in the shadow file) by
> opening the shadow file, replacing the old line with the new one, and
> writing the shadow file. Obviously, I only do this if I need some
> automated scripts to change a password, otherwise I user the built in
> passwd function...
>
I assume you mean the Unix command.
> Is there a better way? I would like perl to be able to send a username
> and password to a program and have it change it...
>
Yes there is. Use Perl and Expect.pm (CPAN/authors/id/AUSCHUTZ) tointeract
with the passwd command.
Check out topexample.pl to show you a way to get passwords
from the terminal and interact with a command.
Regards
--
Anthony David | Opinions expressed ARE
Anthony David & Associates | those of my employer
------------------------------
Date: Tue, 13 Jan 1998 13:10:31 GMT
From: "GarryG" <newspost@dyna_cs.demon.co.uk>
Subject: Command Line arguments - Perl for Win32
Message-Id: <01bd2023$4bdd9940$0300a8c0@renegade>
I am trying to debug my perl scripts by running them in a command promt
before,
trying them with an html form, throught the web server.
I can't get the script to accept any data values i pass it.
When I do "perl -w myscript.pl item=value"
The script runs but with no data. It's such a simple thing but I can't see
how its done, can someone out what i'm doing wrong.
Thanks,
--
--
Garry Goodwin
Dynamic Computer Solutions Ltd
http://www.dyna-cs.demon.co.uk
------------------------------
Date: Tue, 13 Jan 1998 05:44:29 -0500
From: "Michael R. Harper" <mikihasa@worldnet.att.net>
Subject: define variable names at run time?
Message-Id: <69fg7q$miv@mtinsc02.worldnet.att.net>
TWIMC:
Does Perl have the capability to define variable names at runtime? For
instance, let's say I have a three-character code (stored in an array
named @CODE) that I want to use as the name of an associative array, but
the code characters are not defined until after the script starts
running. How can I specify the name on the LHS of an assignment
statement for the variable?
Will this:
$CODE[0].$CODE[1].$CODE[2]{"apple"} = "red";
work?
Sincerely,
Michael R. Harper
------------------------------
Date: 13 Jan 1998 10:49:21 +0000
From: Richard Caley <rjc@liddell.cstr.ed.ac.uk>
Subject: Re: define variable names at run time?
Message-Id: <eyhlnwkhcni.fsf@liddell.cstr.ed.ac.uk>
In article <69fg7q$miv@mtinsc02.worldnet.att.net>, Michael R Harper (mrh) writes:
mrh> Does Perl have the capability to define variable names at
mrh> runtime?
Have a look at
man perlref
for talk of symbolic references.
mrh> Will this:
mrh> $CODE[0].$CODE[1].$CODE[2]{"apple"} = "red";
mrh> work?
Nope, but I think
${ $CODE[0].$CODE[1].$CODE[2] }{"apple"} = "red";
does or
${ "@CODE" }{"apple"} = "red";
--
rjc@cstr.ed.ac.uk _O_
|<
------------------------------
Date: Tue, 13 Jan 1998 08:46:32 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Dereferencing, Hashes, and Keys
Message-Id: <34BB7038.22E4@min.net>
Raymon Jones wrote:
>
> foreach $value (keys $$_[0]) {
>
> Well, the Perl compiler gives me an error, informing me that the argument
> to keys has to be a hash, and not a scalar dereference.
>
> 1. How can I get around this problem?
Clearly you want to dererence $_[0] as a hash ref, not as a scalar ref.
Change that first $ to a %, like so: %{$_[0]}. The braces are not
optional here.
> 2. Supposing that I can't get around this problem, how should I create a
> variable local to the function TestFunction that is essentially a copy of
> the hash passed as an argument? i. e. if TestFunction had a my(
> %testhash2) in it, how could I get %testhash2 to contain all the values of
> %testhash . . . in other words, is it possible to dereference the entire
> hash that was passed as an argument, and poke all of the values and keys
> into %testhash2?
Sure. If you say %{$_[0]} as I outline above, you've already done it.
Go ahead and store it in a variable:
my %testhash2 = %{$_[0]};
foreach $value { keys %testhash2 ) {
...
Note: that $value variable should also be "my", just to be on the safe
side.
Note Well: copying hashes from a reference like this, into another
variable,
may be unnecessarily expensive, especially if the hash is large. Unless
you need to modify the hash contents locally without affecting the
original,
consider using only the hash ref:
foreach $value { keys %{$_[0]} ) { ...
hth,
John Porter
jporter@logicon.com
------------------------------
Date: Tue, 13 Jan 1998 18:19:29 -0800
From: Patrick Stacey <patrick@mediacity.com.sg>
Subject: Re: Displaying GIFs - oops
Message-Id: <34BC20B1.36F3@mediacity.com.sg>
Martien Verbruggen wrote:
>
>
> - What is the expected behaviour
> - What does happen?
OK - it should simply display a single graphic.
I have tried another method which gets Content-length,
but still no good. I get "network error".
Try this URL (http://pat.mediacity.com.sg/adengine/test2.pl) which
uses the new code:
-------------#
$gif_image = "c:\\webdocs\\adengine\\sndscape.gif";
if(open(IMAGE,"<".$gif_image)){
$no_bytes = (stat($gif_image))[7];
print "Content-type: image/gif\n";
print "Content-length: $no_bytes\n\n";
print <IMAGE>;
close(IMAGE);
}
else{
print "Content-type: text/html\n\n";
print "Cannot display";
}
exit(0);
-------------#
TIA
/pks
------------------------------
Date: Tue, 13 Jan 1998 02:03:01 -0600
From: joseph@5sigma.com
Subject: Re: effective perl vs. advanced perl books?
Message-Id: <884678379.1558380550@dejanews.com>
Effective Perl Programming is more about Perl style; Advanced Perl
Programming is more about application development. I don't cover
CGI programming, Tk, etc., and tried to avoid an overt Unix bias
(although there are plenty of Unix-isms). On the other hand, I
spend a lot of time illustrating Perl programming idioms. (The
"patterns" word is lurking in my subconscious.) My book answers,
indirectly, just about every FAQ from my beginning and intermediate
classes. COINCIDENTALLY both books cover some similar material but
the resemblance is skin deep.
I haven't spent a lot of time looking through Advanced Perl
Programming (someone want to send me a comp copy?) but what I have
seen looks pretty good, and I would recommend it to someone who
wants to learn more about Perl--just as I would recommend my book.
-joseph
Author, Effective Perl Programming
http://www.effectiveperl.com
In article <slrn6bkdcf.n50.felix@chance.em.nytimes.com>,
felix@nytimes.com wrote:
>
> hello,
>
> i was reading some reviews of effective perl and was wondering
> whether anyone has done any comparisons of it and advanced perl
> programming? that is, are they about at the same level?
> do they cover the same topics or does each have it's own focus?
> any thoughts would be appreciated!
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 12 Jan 1998 20:06:19 GMT
From: 0542760043-0003@t-online.de (Bernhard Freund)
Subject: fastest way for two-dimensional arrays
Message-Id: <69dt3r$2r1$1@news00.btx.dtag.de>
Hi!
I'm new to Perl as well as to newsgroups,
and I've got two questions:
What is the fastest way to create and access
something comparable to a two-dimensional array?
(Some lines of code would help me getting used to the syntax...)
How can get C-subroutines in my perl programs?
So long,
Bernhard Freund
------------------------------
Date: Tue, 13 Jan 1998 06:29:32 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: fastest way for two-dimensional arrays
Message-Id: <cnmf96.3o6.ln@localhost>
Bernhard Freund (0542760043-0003@t-online.de) wrote:
: I'm new to Perl
Welcome!
You should know that perl ships with *lots* of documentation included.
You should take a stab at finding the answers to your questions there
before resorting to posting to Usenet. You nearly always can get the
question answered faster that way.
The docs end with a '.pod' filename extension. Find out where they
got installed on your system, and use them.
: as well as to newsgroups,
The news.announce.newusers newsgroup is chock full of tips
and techniques for getting the most out of Usenet.
: and I've got two questions:
: What is the fastest way to create and access
: something comparable to a two-dimensional array?
: (Some lines of code would help me getting used to the syntax...)
grep 'two.dimension' *.pod
finds two lines. One of them says (my underlining):
---------------------
You can (and should) read more about references in the perlref(1) man
page. Briefly, references are rather like pointers that know what they
point to. (Objects are also a kind of reference, but we won't be needing
them right away--if ever.) This means that when you have something which
looks to you like an access to a two-or-more-dimensional array and/or hash,
what's really going on is that the base type is
merely a one-dimensional entity that contains references to the next
level. It's just that you can I<use> it as though it were a
two-dimensional one. This is actually the way almost all C
^^^^^^^^^^^^^^^
multidimensional arrays work as well.
$list[7][12] # array of arrays
$list[7]{string} # array of hashes
$hash{string}[7] # hash of arrays
$hash{string}{'another string'} # hash of hashes
---------------------
in the 'perldsc - Perl Data Structures Cookbook' man page.
You should also have a look at
'perlLoL - Manipulating Lists of Lists in Perl'
: How can get C-subroutines in my perl programs?
grep 'C.subroutin' *pod
finds two lines. One of them says (in 'perlsub.pod'):
---------------------
See L<perlref> for more on references. See L<perlxs> if you'd
like to learn about calling C subroutines from perl. See
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
L<perlmod> to learn about bundling up your functions in
separate files.
---------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Jan 1998 09:30:46 +0100
From: Carlos de Sousa <Carlos.de_Sousa@ebc.ericsson.se>
To: Lincoln Stein <lstein@w3.org>
Subject: File Upload and CGI.pm 2.36
Message-Id: <34BB2636.9C7BAA4B@ebc.ericsson.se>
This is a multi-part message in MIME format.
--------------AEC58A1A088C8ACC9C640C17
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi!
I'm trying to use the FILE upload feature in a CGI, but can't get it to
work.
I'm on a Solaris 2.5,2.6 environment and I'm using CGI.pm 2.36
My server is a Netscape Enterprise 2.01 and I'm trying it from both
a Netscape Gold 3.01 and a Netscape Communicator 4.0x client.
I've also tried it against a Netscape Enterprise 3.01 without success.
I know the CGI.pm manual refers to Netscape 2 only, but I thought I
would give
it a shot anyway.
What's strange is that the problem seems to be the *SYSOPEN* call, I
can't
seem to find it on my installation.
Where can I find it, or has CGI.pm figured out I'm on something
else than Solaris 2, or is it some package I need to download.
Is it really so that this will only work with a Netscape 2 browser?
What to do about the SYSOPEN call, could I replace it for something
else available on Solaris 2? fopen ?
The Perl release I have currently is 5.001 patchlevel 1m
Please answer me by E-mail, as I don't regurlarly read comp.lan.perl
groups
Best Regards
Carlos de Sousa
--
Carlos de Sousa (NA/EBC/EN/TIL) Senior Systems Programmer
Ericsson Business Networks AB
E-mail: mailto:Carlos.de_Sousa@ebc.ericsson.se
--------------AEC58A1A088C8ACC9C640C17
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Carlos de Sousa
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Carlos de Sousa
n: de Sousa;Carlos
org: <IMG SRC="http://www.ebc.ericsson.se/pictures/smlelogo.gif">Ericsson Business Networks AB
adr: Augustendalsv. 21;;Nacka Strand;Stockholm;;S-131 89;Sweden
email;internet: Carlos.de_Sousa@ebc.ericsson.se
title: Senior Systems Programmer
tel;work: +46 8 422 06 05
tel;fax: +46 8 422 06 20
note: EBC/EN/TIL Room: NA06A76
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------AEC58A1A088C8ACC9C640C17--
------------------------------
Date: Tue, 13 Jan 1998 09:50:46 GMT
From: fpostma@xs4all.nl (frans postma)
Subject: Re: Getopt::Long caveat?
Message-Id: <34bb380f.92071461@hdxf08.telecom.ptt.nl>
On 13 Jan 1998 08:44:34 +0100, JVromans@Squirrel.nl (Johan Vromans)
wrote:
>> >%optctl = ( 'n' => \$num,);
>> >&GetOptions(%optctl);
>> ># lots_of_code
>> >
>> >Suppose the above snippet was run with '-n 10'. That's nice, $num
>> >is now 10. But if no number is given? I cannot find an example of
>> >this *anywhere* in the Camel book! I can only assume that it would
>> >set $num to 1. But what if the script was run with 'n=1'? Am I
>> >missing something? If not, how do I deal with that?
>
>It is not set (defined) at all.
>Of course this defaults to zero unless properly handled.
That's not what I'm seeing here:
use Getopt::Long;
GetOptions('n:i');
print "XX: $opt_n\n" if defined $opt_n;
This returns "XX: 0" if you run it with 'perl x -n' which is what I
would expect since I need to know if option-n was given.
How else can I handle options with optional values?
------------------------------
Date: Tue, 13 Jan 1998 13:00:58 +0100
From: tobez@plab.ku.dk
Subject: Re: hi! help me with cp , plz...
Message-Id: <34BB577A.2156@plab.ku.dk>
Alexander Kovalenko wrote:
> hi guyz! I ran in strange problem.. ;(
> $directory='/'+$name+'/';
> system ("cp /main/*.*",$directory);
Sorry, the string concatenation operator in Perl is . (period), not a +
(plus sign).
You should use either
$directory='/' . $name . '/';
or, better yet (and faster, as documentation suggests),
$directory="/$name/";
Hope this helps,
Anton.
------------------------------
Date: 13 Jan 1998 06:19:51 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Alexander Kovalenko <luckycom@ica.net>
Subject: Re: hi! help me with cp , plz...
Message-Id: <8cafd0fr48.fsf@gadget.cscaper.com>
>>>>> "Alexander" == Alexander Kovalenko <luckycom@ica.net> writes:
Alexander> hi guyz! I ran in strange problem.. ;(
Alexander> My program is the following:
Alexander> $directory='/'+$name+'/';
Broken. What do you think this is, Java? :-) Concatenation is "." not
"+". Or even simpler:
$directory = "/$name/";
Alexander> system ("cp /main/*.*",$directory);
Broken. system and exec behave differently depending on how many
arguments you give them. Since you gave system more than one
argument, the first argument *must* be a command found in your path,
while the remaining arguments (in this case, just $directory) are
passed *uninterpreted by any shell*. The quickest fix here goes one
of two ways:
system "cp /main/*.* $directory";
which invokes a shell to do the whole thing, or
system "cp", </main/*.*>, $directory;
which globs the wildcard argument as the shell would have, then hands
the long list of args to the cp command.
But why are you excluding files that don't contain "."? This won't
copy /main/perl for example! In that case, it's better to do
system "cp", </main/*>, $directory;
Alexander> but for some reasons it does not want to copy all filez from main
Alexander> directory to a new one...
Alexander> I know that this is basic and that I should read some FAQ ,
Alexander> but I do not have that much time... so if ya know how to do
Alexander> it..., plz let me know! Thanx a lot!
Hmm. May I suggest that you run, don't walk, to a nearby bookstore
and pick out "Learning Perl", which would have answered all your
questions? And while you're there, perhaps you'll notice that "thanx"
and "filez" probably *aren't* found in any dictionary. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 231 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 13 Jan 1998 13:10:32 GMT
From: "GarryG" <newspost@dyna_cs.demon.co.uk>
Subject: Local paths in Perl for Win32
Message-Id: <01bd2024$5065c400$0300a8c0@renegade>
I have a real painful problem when writing perl scripts.
When I run them from a comamnd prompt to test them, I have to reference the
data directory from the current directory the script is run from.
eg: script in /cgi-bin/project
data dir = ../../docs/project/data
actually http://localhost/project/data
but when I run the script through the web browser the current directory is
cgi-bin,
so the data directory is
../docs/project/data
Is this an oddity with perl or perl for win32, or should I look at the way
my server is setup?
--
--
Garry Goodwin
Dynamic Computer Solutions Ltd
http://www.dyna_cs.demon.co.uk
(Change underscore to minus for my real address!)
--
------------------------------
Date: Tue, 13 Jan 1998 05:43:13 -0600
From: toml@synnet.com
To: toml@synnet.com
Subject: Making DynaLoader into a shared library
Message-Id: <884635156.2017722374@dejanews.com>
Greetings:
I have been trying to make the Dynaloader so
we can placed it into a shared library (libperl.so)
Is this possible? I have been able to follow
the instructions to make a shared libperl.so. That
works fine. What we are trying to do is write
a C program which calls perl which calls C.
Thanks for any help.
Tom
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 13 Jan 1998 08:40:20 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Making DynaLoader into a shared library
Message-Id: <pudge-1301980840200001@ppp-5.ts-1.kin.idt.net>
In article <884635156.2017722374@dejanews.com>, toml@synnet.com wrote:
# I have been trying to make the Dynaloader so
# we can placed it into a shared library (libperl.so)
# Is this possible? I have been able to follow
# the instructions to make a shared libperl.so. That
# works fine. What we are trying to do is write
# a C program which calls perl which calls C.
# Thanks for any help.
Is it just me, or is this silly? If DynaLoader is a shared library ...
DynaLoader is required to load a shared library. If it is shared, well,
it cannot load itself before it is loaded.
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: 13 Jan 1998 03:28:35 -0800
From: Bruce Cook <BC3-AU@bigfoot.com>
Subject: Module Net::FTP problems
Message-Id: <uoh1gvcik.fsf@donal.kintailrd>
Trying to use the Net::FTP module, I'm getting the following error:
Not having used maodules to any great extent, I'm a little lost
as to where to start looking.
Could anybody tell what this means, and where to start looking.
(Just installed perl-5.004, and libnet-1.0605
[bruce@cletus develop]$ ./get-maillist.pl
Can't locate auto/Net/FTP/net.al in @INC at ./get-maillist.pl line 14
[bruce@cletus develop]$
***** get-maillist.pl:
#! /usr/bin/perl
# Grab the mailing list data which has been placed into seperate files
# in a directory on my mail serving machine
$mail_machine= "mail.wantree.com.au";
$username= "bcook";
$password= "youdidntthinkidleavethisdidyou";
$mail_directory= "Maillist";
use Net::FTP;
$ftp = Net::FTP->net($mail_machine);
$ftp->login($username, $password);
$ftp->cwd($mail_directory);
@files= $ftp->ls;
print("@files\n");
$ftp->quit;
--
...BRU
Bruce Cook, Synonet Corp. E-Mail: bc3-au@bigfoot.com
Phone: +61 15 999 330 Fax: +61 8 9227 7390
------------------------------
Date: Tue, 13 Jan 1998 09:29:52 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl to Binary?
Message-Id: <34bd2cfc.2117798@news.tornado.be>
jwbacon@ix.netcom.com (J. Bacon) wrote:
>>Well, it *is* a "compiler" in the sense of "bring together". :-)
>Sorry about the misrepresentation of 'compiler'. merlyn@stonehenge.com is (as
>near as I can determine) COMPLETELY correct in the statement. The product
>looks to me to be some sort of bundler, which allows a perl script to run
>without the Perl binary already installed on the target machine.
>
>Still, it produces a (huge!) file which runs as a standalone executable.
It sounds much like the "Save a runtime" option on the Macintosh.
MacPerl has had this option for years. For free. Three cheers for
Matthias! (the MacPerl porter)
Bart.
------------------------------
Date: Tue, 13 Jan 1998 07:59:01 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: perl under windows95
Message-Id: <ebohlmanEMpq6E.HrF@netcom.com>
cwtalbot@intellex.com wrote:
: Thank you for you response suggesting I run the program from DOS. I
: should have indicated in my original message that I had already tried
: that, and got a message stating "This program cannot run in this mode"
In Win95, there are two kinds of "DOS prompts." The first kind, which
you seem to be using, is one that runs in "DOS mode" in which Win95
actually goes away and doesn't come back until you exit from the prompt
(at which point Win95 spends a couple minutes reloading). The second
kind, which is the one you need, is simply a command-line window (which
can be run full-screen) that exists at the same time as other Win95
applications. Which one you get is controlled by the properties
associated with the shortcut you're using; you want to make sure that
"use MS-DOS mode" is *not* checked.
------------------------------
Date: 13 Jan 1998 12:37:24 GMT
From: klassa@aursgh.aur.alcatel.com (John M. Klassa)
Subject: Re: qxurl/perl peculiarity (from perlfaq9)
Message-Id: <69fn64$ogi$1@aurwww.aur.alcatel.com>
On Mon, 12 Jan 1998 19:08:31 -0600, Tad McClellan <tadmc@flash.net> wrote:
->It *must* match '\1\s*>' at the end. So it has to keep going until
->it finds a double quote, followed by '>', with some optional
->whitespace in between.
*Doh*! Yup, of course... It was a stupid oversight on my part. Thanks
for pointing it out!
Take care!
John
--
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><
------------------------------
Date: Tue, 13 Jan 1998 10:06:30 +0000
From: Adrian Lester <alester@bfsec.bt.co.uk>
Subject: Searching for an IP address in a string
Message-Id: <34BB3CA6.3BAC@bfsec.bt.co.uk>
Dear all,
Could you please offer some help. I'm trying to search a hosts file
for an IP address. I thought it would work when I used quotemeta, but
it still doesn't find the IP address in the file. I've already checked
the file permissions before calling the sub routine.
I should get the message "Found IP Address" once, but it is never
printed; the if test always fails. Why?
sub CheckHostsFile
{
my ($hostname, $ipAddress) = @_;
my $hostsFile = new FileHandle "/etc/hosts";
my $done_yet =0;
my ($safeIPAddress, $line, $safeLine);
$safeIPAddress = quotemeta $ipAddress;
while (<$hostsFile>)
{
$line = $_;
$safeLine = quotemeta $line;
if ( ($safeIPAddress =~ $safeLine) and
( not $doneYet )
)
{
print STDOUT "Found IP address\n";
$doneYet = 1;
}
}
}
Adrian Lester
alester@bfsec.bt.co.uk
------------------------------
Date: Tue, 13 Jan 1998 00:25:29 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Small Pattern Regrex Question?
Message-Id: <pc1f96.ci5.ln@localhost>
John Irving (hyperc@magma.ca) wrote:
[snip]
: The problem is that there may be many different patterns
: (one|two|three|etc)
I don't see that as a problem.
: some which might not end in a period.
Those are definitely not going to be a problem. The ones that _do_
end in a period (or any other non-word char) are a problem if you
always use a \b.
: I currently have
: a variable $wb which is '\b' or nothing depending on the users choice of
: options.
Modify what it depends on then ;-)
[snip code]
: if ($case_sensitive) {$case_op = '(?i)'; }
: foreach $Query (@User_submitted_Queries) {
: $patterns_to_match .= "$case_op$Query\|";
if ($full_matches) {
$wb1 = ($Query =~ /^\W/) ? '' : '\b'; # don't use \b if not word char
$wb2 = ($Query =~ /\W$/) ? '' : '\b';
$patterns_to_match .= "$case_op$wb1$Query$wb2\|";
}
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 13 Jan 1998 06:16:57 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: truncating
Message-Id: <pvlf96.ll6.ln@localhost>
Aaron C. Paulley (aaronp@weirdness.com) wrote:
: >
: >File::Basename module would be best. It will work across different
: >Operating Systems.
: >
: >
: >To do it non-portably:
: >
: > $filename = $1 if m#.*/(.*)$#;
: >
: So the line:
: $filename = $fullfilename if m#.*/(.*)$#;
: would take the variable $fullfinename which = "/usr/bin/local/filename.txt"
: and create a new variable ($filename) that would = "filename.txt" ?
No. You want:
$filename = $1 if $fullfilename =~ m#.*/(.*)$#;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Jan 1998 11:16:25 GMT
From: Ko Kin <ckko@cse.cuhk.edu.hk>
Subject: unlink () doesn't work under NT
Message-Id: <69fie9$qtp@eng-ser1.erg.cuhk.edu.hk>
Hi all,
I used an unlink () statement in my Perl script running under NT 4, but
it doesn't seem to work. Any advice?
Thanks.
--
Regards,
KoKin
------------------------------
Date: Tue, 13 Jan 1998 11:23:33 +0000
From: STOCK Fridiric <bidouye@club-internet.fr>
Subject: Who had compiled Perl5.004_04 for SCO Unix R3.2V4.2
Message-Id: <34BB4EB5.A0B@club-internet.fr>
Hello,
I've problem in compiling Perl5.004_04 under SCO Unix R3.2V4.2 with GCC
2.7.2.2.
So if somebody had compiled it with success I'd like to get the
config.sh file
Thank's
--
00 00
Fridiric STOCK
00 00
------------------------------
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 1627
**************************************