[7244] in Perl-Users-Digest
Perl-Users Digest, Issue: 869 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 14 22:07:17 1997
Date: Thu, 14 Aug 97 19:00:28 -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 Thu, 14 Aug 1997 Volume: 8 Number: 869
Today's topics:
a perl4 question <daryl.williams@tivoli.com>
Re: a perl4 question (Mike Stok)
Re: Back quotes don't seem to work well in Win32 <gordon.leslie.mcdorman@sap-ag.de>
Re: Converting an Array to a Hash <che@imsa.edu>
Extracting HTML links to ASCII <sjeer@planning.org>
Generic script in Perl (Marcantonio Fabra)
Help with Regexp (Sajjad Lateef)
Help with Regexp (Sajjad Lateef)
Re: Help with Regexp (Mike Stok)
Re: HELP: Search and replace!! (Eric Bohlman)
how to set shell variable from perl? (Tom)
How to use the Filter module? (Haizhou Chen)
Re: incredibly simple question (mARCO bLOORE)
localizing $^A causes core dump <duplisse@rentwks1.golden.csc.com>
Re: need help with perl and dates (Jon Hedley)
Re: need majordomo setup advise <mattdb@syntrillium.com>
Re: Net::FTP documentation and examples <zenin@best.com>
Re: Newbie (Tad McClellan)
Re: Numbers to strings with preceeding 000's (Charles DeRykus)
Opening to Telnet without System() (Colin P. Ryan)
perform operations on files withing directory tree (Chasmo)
Re: Perl and Windows NT (Viper)
Re: Perl interpreter and WIN 95 and Microsoft Internet <gordon.leslie.mcdorman@sap-ag.de>
Re: perl question (Tad McClellan)
Re: perl-5.003 on UW: 'make test' fails (Tye McQueen)
Re: Puting pattern in a variable (Eric Bohlman)
Q: IPC between Perl and C (Joachim Wunder)
Skipping portions of text; how? (code included) <ssjaaa@uta.fi>
Re: Skipping portions of text; how? (code included) <zenin@best.com>
sockaddr_in <khallera@hklaw.com>
Re: The eternal question: Has anyone gotten DynaLoader <dan_aug97@unitech.com>
trying to compile 5.004...lib/socket........perl: can't (Cs.)
We Need Help... (James Hurff)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Aug 1997 17:14:26 -0500
From: Daryl Williams <daryl.williams@tivoli.com>
Subject: a perl4 question
Message-Id: <33F38342.F5@tivoli.com>
does anyone know how to do something like the following
in perl4:
What I need to do is have an array that looks like this conceptually:
firstkey, item1, item2, item3
secondkey, item1, item2, item3
thirdkey, item1, item2, item3
What I want to do is index into the array by the *key and then
iterate thru the item*'s assigning or printing the item* values.
I'm not sure how to do that.
My first attempt looked something like this:
@itemarray1 = (0,0,0);
@itemarray2 = (0,0,0);
%bigarray = (
'firtskey', @itemarray1,
'secondkey', @itemarray2
);
Obviously not correct syntax but you get the idea.
tia,
//daryl
------------------------------
Date: 15 Aug 1997 00:35:41 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: a perl4 question
Message-Id: <5t088t$42l@news-central.tiac.net>
In article <33F38342.F5@tivoli.com>,
Daryl Williams <daryl.williams@tivoli.com> wrote:
>does anyone know how to do something like the following
>in perl4:
>
>What I need to do is have an array that looks like this conceptually:
>
>firstkey, item1, item2, item3
>secondkey, item1, item2, item3
>thirdkey, item1, item2, item3
>
>What I want to do is index into the array by the *key and then
>iterate thru the item*'s assigning or printing the item* values.
>I'm not sure how to do that.
One way to do it is with typeglobs,
#!/usr/bin/perl4.036 -w
srand ($$ ^ time); # YES, I KNOW...
$package = 'safePackage'; # avoid accidental collisions
while (<DATA>) {
chop;
($key, @rest) = split (/,\s+/);
{
local (*GLOB) = "${package}'$key";
@GLOB = @rest;
}
}
foreach $key ('first', 'second', 'third') {
{
local (*GLOB) = "${package}'${key}key";
push (@GLOB, $key);
splice (@GLOB, rand (@GLOB), 1, 'Replaced');
print "$key: (@GLOB)\n";
}
}
__END__
firstkey, item1, item2, item3
secondkey, item4, item5, item6
thirdkey, item7, item8, item9
produces
first: (item1 Replaced item3 first)
second: (Replaced item5 item6 second)
third: (item7 Replaced item9 third)
bu setting *GLOB to a string containing a variable name you can use GLOB
with the appropriate prefix as an alias for a named variable (scalar,
array, hash etc...) but you have to think clearly!
Perl 5 references kane all this kind of stuff a lot easier and if you're
doing anything more than the most trivial thing I'd say that doing it in
perl 4 may cause a future maintainer to spend more time finding the
script's author than maintaining it :-)
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, 15 Aug 1997 00:24:48 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: Back quotes don't seem to work well in Win32
Message-Id: <ubu3070of.fsf@sap-ag.de>
>>>>> "RB" == Rodney Broom <broomer2@primenet.com> writes:
RB> Hello All, Ok, Ok, before anyone sais anything, I know that
RB> Perl is native to UNIX and that some things just don't ever
RB> opperate correctly in Win32.
In general, I have had very good results with Perl and Win32 (NT).
RB> That said, I have used statements like:
RB> print (`cls`); print (`dir`);
That's an interesting concept; I never thought of doing such a
thing. However, upon testing the above commands, I do seem to get
appropriate results: namely captured output from the above commands.
Of course, if you do want to actually clear the console window, you
might consider the following:
system("cls"); print (`dir`);
That said, I'm not really sure why you would want to do this. Reading
the File::Find and glob() documentation will provide hours of
entertainment. No, really.
For other Windows related questions, see:
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
Hope this helps.
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: 14 Aug 1997 13:44:21 -0500
From: Ben Gertzfield <che@imsa.edu>
Subject: Re: Converting an Array to a Hash
Message-Id: <y8srabwr4e2.fsf@imsa.edu>
>>>>> "Bill" == Bill Baker <baker@hpspk7jp.spk.hp.com> writes:
Bill> I have been trying to find an elegant (read that as 'terse')
Bill> way to take an array and save it as a hash where the even
Bill> numbered entries in the array are the keys for the (entry
Bill> offset + 1) entries.
This is about the tersest I could think of..
%hash = @array;
*grin*
Bill> I am sure this will end up being a {hitting forehead with
Bill> palm} "Why didn't I think of that!" kind of answer.
Yep, I'd agree.
--
Brought to you by the letters X and B and the number 12.
"You forgot Uranus." "Goooooooooodnight everybody!" -- Yakko and Wakko
Ben Gertzfield <http://www.imsa.edu/~wilwonka/> Finger me for my public
PGP key. I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.
------------------------------
Date: Thu, 14 Aug 1997 18:42:26 -0500
From: Sanjay Jeer <sjeer@planning.org>
Subject: Extracting HTML links to ASCII
Message-Id: <33F397E2.13CD85E2@planning.org>
A perl newbie question:
Is there a utility or snippet of code that I can use to suck up hundreds
of HTML files and extract just the links, that is, just the Link Text
and the underlying URL into a tab separated ASCII table?
Any help, pointers, references will help. Thanks.
------------------------------
Date: Thu, 14 Aug 1997 19:43:41 -0200
From: fabra@ax.apc.org (Marcantonio Fabra)
Subject: Generic script in Perl
Message-Id: <5t01ia$i57@ax.apc.org>
I have a file called arq.htm. My script reads this file, make some procedures on
it and write all the records to a file called arq.html.
Here's the script:
#!/usr/local/bin/perl
#
# change.pl
open(inpfile,"<arq.htm");
open(outfile,">arq.html");
while ($temp=<impfile>)
{
<procedimentos>
print outfile "$temp";
}
close impfile;
close outfile;
My question is:
How can I change this script in order to do this operations in all the htm files
of my directory ?
Marcantonio Fabra
------------------------------
Date: 14 Aug 1997 22:24:10 GMT
From: sajjad@uic.edu (Sajjad Lateef)
Subject: Help with Regexp
Message-Id: <5t00ia$27ps$1@piglet.cc.uic.edu>
Hello Regexp gurus,
I am trying to match the following different strings
with one regexp.
abc # string of chars with no embedded spaces
123 # Number with no embedded spaces
07/12/1997 # Date
212-212-2222 # Phone Number
11:00 # Time format
abc123 # alphanumeric string
This is a test # A sentence with alphanumeric fields
I thought that /(\w*:?\/?-?\s*)*/ would do the trick.
I get a message (warning?) that it matches null strings many times.
And, of course, it does not do what I want it to do.
Any suggestions would be appreciated.
Thanks,
Sajjad
sajjad@uic.edu
--
Sajjad Lateef http://www.eecs.uic.edu/~slateef/
sajjad <at> acm.org
------------------------------
Date: 14 Aug 1997 22:16:13 GMT
From: sajjad@uic.edu (Sajjad Lateef)
Subject: Help with Regexp
Message-Id: <5t003d$g5e$1@piglet.cc.uic.edu>
--
Sajjad Lateef http://www.eecs.uic.edu/~slateef/
sajjad <at> acm.org
------------------------------
Date: 15 Aug 1997 00:18:32 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Help with Regexp
Message-Id: <5t078o$2ov@news-central.tiac.net>
In article <5t00ia$27ps$1@piglet.cc.uic.edu>,
Sajjad Lateef <sajjad@uic.edu> wrote:
>abc # string of chars with no embedded spaces
>123 # Number with no embedded spaces
>07/12/1997 # Date
>212-212-2222 # Phone Number
>11:00 # Time format
>abc123 # alphanumeric string
>This is a test # A sentence with alphanumeric fields
>I thought that /(\w*:?\/?-?\s*)*/ would do the trick.
>I get a message (warning?) that it matches null strings many times.
>And, of course, it does not do what I want it to do.
That's necause everything in the ()s is optional so you're effectively
doing (possibly nothing)*
You needn't do everythinh in a regex, you could, if the string being
examined is in $_ say then something like this may be of use
if (/^[A-Z]+$/i or # string of 1 or more word chars
/^\d+$/ or # string of 1 or more digits
m:^\d\d?/\d\d?/\d\d\d\d$/ or # date (need to check values?)
... )
and if you put the commonest matches earliest it shouldn't be too
inefficient.
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, 15 Aug 1997 01:42:15 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: HELP: Search and replace!!
Message-Id: <ebohlmanEExM2F.6JF@netcom.com>
Vinny Carpenter (vscarpenter@qgraph.com) wrote:
: Now I want it to
: replace the whole line with simply the word Intranet.
: perl -e 's/Internet * /Intranet/gi' -p -i.bak file.html
: But that doesn't work... Can someone help?? Thanks in advance.
Take a look at perlre(1). The reason your pattern doesn't work is that
it matches "Internet" followed by zero or more spaces followed by a
space. That's not at all the same thing as "a whole line containing the
word 'Internet'." Once you know how to write a Perl regular expression
(and you will once you're read perlre), the right pattern will be obvious
to you.
------------------------------
Date: 15 Aug 1997 01:49:34 GMT
From: ii@fairhope.com (Tom)
Subject: how to set shell variable from perl?
Message-Id: <5t0cje$lfo$1@gte2.gte.net>
The following command works fine from the csh, but in perl it seems to
be ignored.
`setenv MYDIR "$HOME/foo" `
Any suggestion?
Tom
------------------------------
Date: 15 Aug 1997 01:21:20 GMT
From: hachen@cs.umn.edu (Haizhou Chen)
Subject: How to use the Filter module?
Message-Id: <5t0aug$9ef@epx.cis.umn.edu>
Hi,
I am wondering how to use the Filter module. I downloaded the module from
CPAN and read the man page. It didn't quite make sense to me.
What I want to do is this: Filter my Perl source and produce something like
#!/usr/local/bin/perl
use MyFilter;
*Il~k^j#%$%^*&&(()JGHIngtotyyy&&(((((!@#$%%nnnnudu
.....
.....
And this this program can be decrypted and executed. Anybody has the
experience of doing it?
Thank you.
Haizhou Chen
hachen@cs.umn.edu
------------------------------
Date: Thu, 14 Aug 1997 18:54:26 -0400
From: bloore@h-plus-a.com.NOSPAM (mARCO bLOORE)
Subject: Re: incredibly simple question
Message-Id: <bloore-ya02408000R1408971854260001@news.bellglobal.com>
In article <pviton.417.000B9699@magnus.acs.ohio-state.edu>,
pviton@magnus.acs.ohio-state.edu (Philip A. Viton) wrote:
> I'm embarassed to ask this, but I've been working with it for an hour, and
> can't see what's wrong. The fragment below is designed to say one thing if
> you type Y or y and another if you type anything else. The anything-else
> branch doesn't seem to get taken no matter what you type.
>
> print STDERR "\nPlease answer Y or N: ";
> $resp=<STDIN>;
> if ($resp = ~ /^[yY]+/)
> { print STDERR "Your response was Y\n" }
> else
> {print STDERR "Your response wasn't Y\n" }
first, use perl -w, to get warned about problems the compiler notices.
then, make your test
if ($resp =~ /^[yY]+/)
ie, =~ is a matching operator, = ~ is an assignment of a complemented value.
--
mARCO bLOORE bloore@h-plus-a.com
Vice-President, Software Engineering
H+a http://www.h-plus-a.com/
http://www.nikolai.com/
------------------------------
Date: Thu, 14 Aug 1997 17:22:28 -0600
From: Ian Duplisse <duplisse@rentwks1.golden.csc.com>
Subject: localizing $^A causes core dump
Message-Id: <33F39334.167E@rentwks1.golden.csc.com>
With Perl 5.002, localizing $^A in a subroutine and returning it causes
a SEGV. Example:
sub fixpara {
local($^A);
# do some stuff with $^A, including calling subroutines
# that access $^A (and hence the need for local vs. my)
# and besides, my doesn't work with special global variables
return $^A;
}
When calling fixpara(), I get a core dump. I want to localize $^A so
that I don't influence the global $^A. The FAQS indicate that
localizing such variables is OK, but it isn't working for me. Does
anyone know what is going wrong?
TIA,
Ian Duplisse
------------------------------
Date: Thu, 14 Aug 1997 10:20:09 GMT
From: jhedley@mustangpcs.com (Jon Hedley)
Subject: Re: need help with perl and dates
Message-Id: <33f4db3c.13226799@news.magna.com.au>
On Thu, 14 Aug 1997 08:56:53 +0200, Masoud M-Kho'i EHS/LI 80441 3322
<ehsmakh@aom.ericsson.se> wrote:
> $date=`date '+%y%m%d'`;
>
After you put the date into $date, do
chop ($date);
Or better yet,
chop($date=`date '+%y%m%d'`);
Chop just loses the last character of a string, in this case \n.
Hope this helps,
Jon.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jon Hedley Mustang Computer Services
jhedley@mustangpcs.com http://www.mustangpcs.com
Ask the all knowing Oracle! http://www.mustangpcs.com/oracle/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
------------------------------
Date: 14 Aug 1997 16:44:01 -0700
From: "Matt Bieber" <mattdb@syntrillium.com>
Subject: Re: need majordomo setup advise
Message-Id: <01bca90c$0c06b880$6816a5ce@primenet.com>
Alvarez-
Well, first I count only 6 aliases in your alias file. Most importantly it
seems you refer to the owner as owner-soi in your alias file, and it's
referenced owner-Sounds-of-India in the email. Try adding an alias for
that. It sounds like the mail is looking to go to the owner for approval -
the alias for approval points to owner-soi.
Matt
alvarez@acunet.net wrote in article <871513058.11167@dejanews.com>...
> Hi All,
>
> Majordomo was setup by another person.
> We are using version 1.94.3 of Majordomo.
>
> Majordomo works fine, except that i have to
> create a new mailing list now for the first time
> and have encountered a little difficulty.
> I created a mailing list called "soi" which
> stands "Sounds of India"
>
> The configuration for that list is located at:
>
> /usr/local/majordomo/lists/more soi.config
>
> I added an alias for the soi mailing list in the following file:
> /var/adm/sendmail/majordomo.aliases
>
> > #soi
> > #########################################################
> > # list subscriber file: /usr/local/majordomo/lists/soi
> > # list admin password: /usr/local/majordomo/lists/soi.passwd
> > # list information file: /usr/local/majordomo/lists/soi.info
> > #########################################################
> > soi: "|/usr/local/majordomo/wrapper resend -l soi soi-list"
> > soi-list: :include:/usr/local/majordomo/lists/soi
> > owner-soi: majordomo-owner
> > soi-owner: owner-soi
> > soi-request: "|/usr/local/majordomo/wrapper majordomo -l soi"
> > soi-approval: owner-soi
> > #END SOI
>
> There are 7 aliases in the above file, but the
> newaliases command reports only 6 aliases. I wonder
> why? What am i missing?
>
> Finally, when i try to send a message to the soi list
> that message never bounces back to me, it
> gets stuck the root's email account. Detail follows:
>
> > ----- The following addresses had permanent fatal errors -----
> >owner-Sounds-of-India@tortola.acunet.net
> >
> > ----- Transcript of session follows -----
> >550 owner-Sounds-of-India@tortola.acunet.net... User unknown
> >550 owner-Sounds-of-India@tortola.acunet.net... User unknown
> >
> > ----- Original message follows -----
> >--
>
> Could you please give me a hint as to solving this problem?
>
> I think the problem is in
> /usr/var/adm/sendmail/majordomo.aliases
>
> Please advise. Thank you.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>
------------------------------
Date: 15 Aug 1997 01:05:09 GMT
From: Zenin <zenin@best.com>
Subject: Re: Net::FTP documentation and examples
Message-Id: <5t0a05$keq$2@nntp2.ba.best.com>
Parillo <lparillo@newshost.li.net> wrote:
> On the Activeware port of Perl, I could not find perldoc.
> Is it part of the standard distribution, or is the source
> available elswhere and does it run on Windoze?
Yes, it's part of the standard dist. It's also writen in perl,
so you may need to find it and run it as "perl.exe perldoc net::ftp"
or some other silly nonsense.
--
-Zenin
zenin@best.com
------------------------------
Date: Thu, 14 Aug 1997 16:04:32 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Newbie
Message-Id: <0trvs5.38k.ln@localhost>
Emiliano Lozano (emiliano@dsp.sps.mot.com) wrote:
: I am just learning how to use Perl and am going through the examples
: in Learning Perl and I get an error on the first program that uses the
: chomp command. The error reads:
: "chomp" may clash with future reserved word at hello line 4.
: syntax error in file hello at line 4, next 2 tokens "chomp ("
: This is the program
: #!/usr/bin/perl -w
: print "What is your name? ";
: $name = <STDIN>;
: chomp ($name);
: print "Hello, $name!\n";
: I would appreciate any help on this simple matter.
Discard that old camel carcass perl of only historical interest,
and install perl 5.
(Friends don't let friends use Perl 4...)
(while you are downloading perl5.004, you can continue by doing it the
quaint perl4 way: chop()
)
Most folks won't bother with perl4 questions anymore.
If you want help, upgrade ;-)
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 14 Aug 1997 22:53:15 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Numbers to strings with preceeding 000's
Message-Id: <EExE8r.70E@bcstec.ca.boeing.com>
In article <33eebd53.15639777@nntp.netcruiser>,
Brian Lavender <brian@brie.com> wrote:
> I have a list
> @list = 1..30;
>
> I want to make this list into a list of strings so the strings are in
> the format.
> @stringlist =
> ('001','002','003','004','005','006','007','008','009','010','011','012',...,'029','030');
>
> How do I do this?
>
Here's a way:
@stringlist = map { "0" x (3-length) . $_ } @list;
Alternatively,
@stringlist = map { sprintf "%03d", $_ } @list;
HTH,
--
Charles DeRykus
ced@carios2.ca.take_it_out.com
------------------------------
Date: 13 Aug 1997 12:21:35 -0400
From: drop@presence.lglobal.com (Colin P. Ryan)
Subject: Opening to Telnet without System()
Message-Id: <5ssmuf$eeu@presence.lglobal.com>
Hello, all.
I an looking for a solution to a problem with Perl5.003 in the NT 4.0 environment.
I want to telnet to port 80 of a server issue a GET and close the connection via a perl
program. Normally I would do something like
open(TNET,"|telnet xxx.xxx.com");
print TNET "GET http://xxx.xxx.com");
close (TNET);
However this is in NT environ and there is no command line telnet.
Anyone have any suggestions.
Please respond via email;
cryan@intradigital.com
TIA
--
-------------------------------\\|!|//--------------------------------
| Colin P. Ryan \!/ Business Strategies and |
| intraDigital Systems Group Inc. Solutions for Intranets |
| 320 1/2 Bloor St. W. Toronto. ON and E-Commerce |
| e:cryan@intradigital.com Phone: (416)515-7400 |
----------------------------------------------------------------------
------------------------------
Date: Thu, 14 Aug 1997 23:14:17 GMT
From: chasmo@cmc.net (Chasmo)
Subject: perform operations on files withing directory tree
Message-Id: <33f390b7.9568585@news.cmc.net>
Hi;
I'm fairly new to Perl and still trying to figure out how to execute
operations on all files within a selected directory tree. I'm familiar
with using ARGV and *.html (or whatever) to select files within the
working directory, but how do I specify a whole tree?
Thanks,
Chasmo
chasmo@zapt.com
------------------------------
Date: Thu, 14 Aug 1997 22:04:53 GMT
From: lord_viper@mailrunner.net (Viper)
Subject: Re: Perl and Windows NT
Message-Id: <33f380ba.4182998@news.accesscom.net>
On Wed, 13 Aug 1997 23:21:50 -0400, Mike Turk <mturk@westonia.com>
wrote:
| I managed to do it with the help of the FAQ at
| http://www.perl.hip.com/FAQ/
| As far as scripts go just do search on perl and you'll find scripts
| galore!
| Mike Turk
| mturk@westonia.com
Yeah, and you'll get a boat load of UNIX scripts... not what he wants.
Go to a Windows NT specific site for great stuff, such as
http://www.4images.com/ntperl
'Nuff said.
-------------------------------------------------
Remove the underscore from the email address!
------------------------------
Date: Thu, 14 Aug 1997 23:38:51 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: Perl interpreter and WIN 95 and Microsoft Internet info server
Message-Id: <uhgcsfi7o.fsf@sap-ag.de>
>>>>> "Auto" == Auto by Internet <Admin@iani.com> writes:
Auto> In order to execute my perl scripts do i need to run the
Auto> interpreter on a server or can I just have the interpreter
Auto> installed and test them like that? I currently run win95
Auto> and would like to run Microsoft Internet Information Server
Auto> on it, is that possible or do i need NT?
1. If I understand your question, the answer is yes.
2. See the following Web page for information on Perl, Windows and
associated web servers:
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
3. For information on running MS IIS, see Microsoft's web site, or
look in comp.infosystems.www.servers.ms-windows.
Hope this helps.
--
--------------------------------------------------------------
The opinions expressed above are mine, not my employer's.
gordon.leslie.mcdorman@sap-ag.de
------------------------------
Date: Thu, 14 Aug 1997 15:57:45 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: perl question
Message-Id: <9grvs5.2ri.ln@localhost>
Rob Starling (rstarling@btg.com) wrote:
: +jeff wrote:
: >
: > I've got a script that does three things, set a variable $cheese = "foo",
: > and open up file handle FILE for reading, and print the contents of this
: > file to standard output. The file that has been opened has, somewhere in
: > int, a string that looks like this: $cheese. When I output to stdout, why
: > won't the $cheese in the file be interpolated into "foo"? The code looks
: > like this:
: >
: > $cheese = "foo";
: > open( FILE, "$file" );
: > while( <FILE> ) { print "$_"; }
: >
: > and the contents of $file are as follows:
: >
: > =======
: > this is just $cheese for me
: > ======
: >
: > Any ideas?
: >
: > +jeff
: try:
: while( <FILE> ) { s/\$(\w+)/${$1}/ge; print; }
^
^
As the replacement part is already "double quoteish", you don't
need to evaluate it too...
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 14 Aug 1997 17:08:34 -0500
From: tyde@medtrodnet.cdom (Tye McQueen)
Subject: Re: perl-5.003 on UW: 'make test' fails
Message-Id: <5svvl2$hq@fiinix.metronet.com>
[Posted and e-mailed.]
Wolfgang Schludi <schludi@ra.syscomp.de> writes:
) $ uname -a
) UNIX_SV soft2 4.2MP 2.1 i386 x86at
[...]
) if I compile perl-5.003 under UW and run 'make test' I get the
) following errors:
[...]
) > op/glob........FAILED on test 1
) > op/goto........ok
) > op/groups......groups: could not find passwd entry
) > ok
) [...]
) > op/readdir.....FAILED on test 3
) > [...]
) > lib/dirhand....FAILED on test 3
[...]
) and I think, as a consequence, 'make install' fails while installing
) the .pod files:
[...]
) > installperl: pod/perl.pod.pod not found at installperl line 409.
)
) and yes, I read the UW-FAQ (D34)
That is pretty old. http://www.metronet.com/~tye/perlsvr4.html
is more up-to-date. It has the fix for the "select" problem that
another poster noted.
) and yes, this also happens, when I change "d_csh='define'" to
) "d_csh='undef'" in config.sh before "LD_LIBRARY_PATH=`pwd` make"
That won't have any effect unless you run "./Configure -S" to
propogate that change to the source files (I think).
Those two fixes probably solve most but not all of the problems
you are having. Let us know what problems remain after that.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
Remove d's from address to reply (sorry for the inconvenience).
------------------------------
Date: Fri, 15 Aug 1997 00:48:26 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Puting pattern in a variable
Message-Id: <ebohlmanEExJKq.28L@netcom.com>
Bob Wilkinson (b.wilkinson@pindar.co.uk) wrote:
: Try something like
: my $regex = join("|",@List);
This is potentially unsafe if the regexes in @List are more complicated
than simple keywords. Something like
my $regex = '('.join(")|(",@List).')';
would ensure that there are no unintentional precedence problems.
: if (/$regex/) {
: print "OK\n";
: } else {
: print "No match\n";
: }
: Bob
: --
: .sig file on holiday
------------------------------
Date: Fri, 15 Aug 1997 01:08:51 GMT
From: Joachim.Wunder@LRZ-Muenchen.DE (Joachim Wunder)
Subject: Q: IPC between Perl and C
Message-Id: <33f3ab58.1107619@news.lrz-muenchen.de>
Hi!
I am trying to figure out how to do InterProcessCommunication (IPC) between a C
program and a Perl 5 program.
Any hints and/or code examples will be appreciated!
Thank you all,
Joachim
--
Email: Joachim.Wunder@LRZ-Muenchen.DE
------------------------------
Date: 15 Aug 1997 00:53:02 +0300
From: Jari Aalto <ssjaaa@uta.fi>
Subject: Skipping portions of text; how? (code included)
Message-Id: <ptru3gse8jl.fsf@kielo.uta.fi>
hi, [Please CC too if you can]
I have trouble undertanding why the
if ( // .. // )
does not work as I would expect. I'm trying to exlude TOC from
following sample text. See also the included function.
The only thing that gets filetered is heading "table of
contents". How do I filted heading and text inside it up
till next heading?
jari
Table of contents
1.0 Head 1
1.1 Aa 1
1.2 Aa 2
1.0 Head 1
1.1 Aa 1
1.2 Aa 2
End
#----------------------------------------------------------------------
sub killToc {
# DESCRIPTION
# Removed heading "Table of contents"
#
# INPUT
# @ ,whole text
#
# RETURN
# @ ,modified text
local( $f ) = "$lib.killToc";
local(*arr ) = @_;
local( $_ , @ret);
for ( @arr )
{
print ">> $_";
if ( /^Table\s+of\s+contents\s*$/i .. /^[A-Z0-9]/ )
{
# save next header
#
if ( ! /^Table\s+of\s+contents\s*$/i
&& /^[A-Z0-9]/
)
{
push( @ret, $_);
}
print ">> SKIP $_";
next;
}
push( @ret, $_);
}
@ret;
}
------------------------------
Date: 15 Aug 1997 01:30:23 GMT
From: Zenin <zenin@best.com>
Subject: Re: Skipping portions of text; how? (code included)
Message-Id: <5t0bff$keq$3@nntp2.ba.best.com>
Jari Aalto <ssjaaa@uta.fi> wrote:
> hi, [Please CC too if you can]
> I have trouble undertanding why the
> if ( // .. // )
> does not work as I would expect.
Personaly, I wouldn't expect it to do much actually.
> I'm trying to exlude TOC from
> following sample text. See also the included function.
> The only thing that gets filetered is heading "table of
> contents". How do I filted heading and text inside it up
> till next heading?
I'd recommend using a double while() loop, something like:
MAIN: while (<>) {
if (/^Table Of Contents/) {
while (<>) {
redo MAIN if (/^\S/);
}
} else {
...stuff...
}
}
--
-Zenin
zenin@best.com
------------------------------
Date: 14 Aug 1997 22:03:26 GMT
From: "Kevin Halleran" <khallera@hklaw.com>
Subject: sockaddr_in
Message-Id: <01bca8fe$0dd120a0$61064696@KevinWork>
I have PERL Win32 and trying to connect ot an SQL host listining at the
below address. For some reason the script blows up at the sockaddr_in
statment.
Error:
Undefined subroutine &main::sockaddr_in called at soctest.pl line 4.
Can someone please help?
I've got open in front of me:
PERL5 for Dummies
Programming PERL (The Camel Book)
Web Client Programming with PERL (The Pelican Book)
and all assume the below code will work.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
use Socket;
socket(KEVIN, PF_INET, SOCK_STREAM, (getprotobyname('tcp'))[2])||die $!;
connect(KEVIN,(sockaddr_in (1433,150.20.6.185)))||die " ";
$buffer="SELECT number,text FROM test";
syswrite(KEVIN,$buffer,length($buffer));
sysread(KEVIN,$buffer,100);
close(KEVIN);
print $buffer;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Kevin A. Halleran
------------------------------
Date: 15 Aug 1997 01:17:05 GMT
From: Dan Harkless <dan_aug97@unitech.com>
Subject: Re: The eternal question: Has anyone gotten DynaLoader to work on AIX 4.1?
Message-Id: <5t0amh$9jk$1@speedx1.speed.net>
In article <5se25g$8cc$1@speedx1.speed.net>, I wrote:
>I've been meaning to get into perl for some time now, for CGI, database, and
>other scripting purposes, and I finally bit the bullet, but I can't get perl to
>work with dynamic loading on my AIX 4.1.4 system.
>
>I went through Deja News, and there were about 47 articles about how dynamic
>loading doesn't work out-of-the-box on AIX 4, but none of the suggestions there
>that I tried worked.
>
>I am using IBM's C Set ++. I also have gcc installed, but haven't tried it
>yet.
>
>This is kinda frustrating -- has there ever been a solution to the perl
>installation problem on AIX 4? Maybe a beta version of perl or something?
I'll assume by the deafening silence that no one has succeeded in getting perl
with dynamic loading to work on AIX 4.x? Pity...
The only response I got was from a guy who suggested I try
aixpdslib.seas.ucla.edu, but they only have perl 5.002 there, the binary
distribution is missing the libraries, and the source distribution won't
compile.
Is it really true that no one out there is doing CGI with perl under AIX 4?
--
Dan Harkless Unitech Research, Inc. <dan_aug97@unitech.com>
NOTE: This is a monthly mail alias used to post to the USENET without
conSPAMinating my real address. If you are replying after August 1997,
your mail may bounce. If so, replace 'aug with the current month's abbrev.
------------------------------
Date: 14 Aug 1997 17:21:01 GMT
From: carl@csiway.com (Cs.)
Subject: trying to compile 5.004...lib/socket........perl: can't resolve symbol '__inet_ntoa'
Message-Id: <5svept$5a9$1@ns2.csiway.com>
I am getting:
lib/socket........perl: can't resolve symbol '__inet_ntoa'
FAILED on test 0
What is wrong here? email me pleas.e....thanks Carl
------------------------------
Date: Thu, 14 Aug 1997 20:43:19 GMT
From: jhurff@resourcecenter.com (James Hurff)
Subject: We Need Help...
Message-Id: <33f36dc9.6028578@snews.zippo.com>
Internet Association Group, Inc. needs to employ a good Perl
programmer
to develop a Perl utility to make a socket connection with an NNTP
server and upload or download news articles to a specified NNTP sever.
If you have experience in developing Perl scripts implementing socket
connections and/or NNTP protocols, please contact James Hurff at
1-800-691-8413 ext 4 or respond via email. The Perl application will
need to run on a Windows NT Server 4.0 Intel machine which already is
running Perl for Win32 (Active Ware's Distribution of Perl 5).
Thanks.
James Hurff
System Administrator
Internet Association Group, Inc.
------------------------------
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 869
*************************************