[8756] in Perl-Users-Digest
Perl-Users Digest, Issue: 2373 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 21 20:07:31 1998
Date: Tue, 21 Apr 98 17:00:31 -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 Tue, 21 Apr 1998 Volume: 8 Number: 2373
Today's topics:
Re: Adding users from a web script using system (Jonathan Stowe)
Re: Adding users from a web script using system (Abigail)
Re: beginnings.... on windows 95 <dtbaker_@flash.net>
Re: beginnings.... (Stuart McDow)
Re: CGI-Mail Problem (Abigail)
Re: creating config file to pull into a script. (Jonathan Stowe)
Re: die diff 5.003 and 5.004? <rootbeer@teleport.com>
Re: Embeding a Perl "Parser" in Visual C++ app? (Stuart McDow)
Re: GCC and Solaris can't handle dynamic load ? (Casper H.S. Dik - Network Security Engineer)
Re: How can I get the correct answer? (Abigail)
Re: How to create a new file? <perlguy@inlink.com>
Re: IMAP support? kjj@arf.eng.mcd.mot.com
Re: IMAP support? <xyz@xyz.zxy.xyz.com>
Re: IMAP support? <xyz@xyz.zxy.xyz.com>
Re: Newbie Question re:mkdir for nested directories (Fritz Knack)
Re: Newbie Question re:mkdir for nested directories (Jonathan Stowe)
Re: Pattern Matching on HighBit Characters (Andre L.)
Re: Pattern Matching on HighBit Characters (Jonathan Stowe)
Re: Perl 5.004_04 will not compile under Linux (William Burrow)
Re: perltoot, clarification, please <bmb@ginger.libs.uga.edu>
Re: processes in perl for NT warren@jen.co.il
Re: Q: Simple RegExp match help required... (Craig Berry)
Re: Q: Simple RegExp match help required... <bmb@ginger.libs.uga.edu>
Random Number Generation PERL 5.0 (The Curz1)
re:DATA filehandle <pholser@nortel.com>
Re: RFC: Adding Commands in Filehandles... <repost> <rootbeer@teleport.com>
Re: Sendmail Attach <sowmaster@juicepigs.com>
Re: Sendmail Attach <perlguy@inlink.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 21 Apr 1998 14:48:27 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Adding users from a web script using system
Message-Id: <353c90b1.9028901@news.btinternet.com>
On 21 Apr 1998 08:42:13 GMT, "Stephen Gray"
<sgray@medicine.adelaide.edu.au> wrote:
>I'm trying to create a script to add new users to Windows NT using
>information entered on a web page. The command to actually create the user
>is just "system('net user /add')". This works from the command line but not
>when running under a web server. I assume this is a problem with
>permissions, but I have given the IIS_GUESTANON user created by IIS Admin
>permissions and it still won't work. Have also tried NetAdmin::UserCreate,
>but same deal. Does anyone know what might be going on?
>
Er, and what is the Perl question precisely?
I would however that fixing the permissions thus on the anonymous user
seriously undermines any security your server may have. You would
probably want to set the security on the script itself but for more on
that you will want to look at
comp.infosystems.www.servers.ms-windows
where I am sure they will be pleased to answer.
Alternatively you might get the NT Server resource kit which has got a
Web Admin tool with it.
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: 21 Apr 1998 15:41:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Adding users from a web script using system
Message-Id: <6hieml$7dh$1@client2.news.psi.net>
Stephen Gray (sgray@medicine.adelaide.edu.au) wrote on MDCXCIV September
MCMXCIII in <URL: news:01bd6d01$85a01e20$4dae7f81@sgray.public-health.adelaide.edu.au>:
++ Hi,
++
++ I'm trying to create a script to add new users to Windows NT using
++ information entered on a web page. The command to actually create the user
++ is just "system('net user /add')". This works from the command line but not
++ when running under a web server. I assume this is a problem with
++ permissions, but I have given the IIS_GUESTANON user created by IIS Admin
++ permissions and it still won't work. Have also tried NetAdmin::UserCreate,
++ but same deal. Does anyone know what might be going on?
Yeah, you're posting in the wrong group. This group is about glue
sniffing. Try rec.arts.woodworking.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: Tue, 21 Apr 1998 09:41:39 -0600
From: Dan Baker <dtbaker_@flash.net>
Subject: Re: beginnings.... on windows 95
Message-Id: <353CBE33.3FE0@flash.net>
Kevan wrote:
>
> Where do I begin? I've read the FAQ's etc before posting, but I still
...
> I need to get Perl and install it onto a Windows 95 machine.
----------------------
I'm working on a similar thing, so this is kind of the blind leading the
blind. Here is some info I've rounded up so far:
Q: what version of perl do I need to run on win95, and where do I get
it?
A: At the time this was written v5.004_04 was the latest version
available. you can check out http://www.perl.com/latest.html for more
current information. You will find it easiest to unzip the download that
ends in *.zip if you already have winzip, or some other zip utility. The
GS version is at
http://www.perl.com/CPAN-local/ports/win32/Standard/x86/
Q: Are there any tricks to installing Perl in win32?
A: well, there are a few things to watch out for:
- extract the .zip to any temp directory, it will expand everything
including a bunch of patches and stuff you don't need and can delete
later.
- when you install, specifiy the directory as c:\usr so that you can use
the standard UNIX #! /usr/bin/perl header in your programs to find perl.
The install.bat file will create dirs and install things in the right
place...
- The directory where perl.exe is installed has to be in your path
statement in your autoexec.bat The install script talks about being able
to set your path via an environment tab in your ControlPanels->System,
but this does not exist on some windows95. You can edit your
autoexec.bat with the sysedit tool, and insert a line giving the path to
the perl.exe file like:
path %path%;C:\usr\bin;
or
set PATH=c:\windows;c:\windows\command;c:\usr\bin
- You have to manually associate *.pl files to execute Perl. Under
"windows explorer" select VIEW and then OPTIONS and add a file type .pl
to exec c:\perl\bin\perl.exe when selected.
- don't forget to go back and delete the temporary source installation
directory.
Q: What do I need to get on my windows95 machine to test HTML-cgi-perl
applications?
A: You need to have a webserver running locally to handle the
transactions between the browser, forms, cgi, and perl. there are a few
sources for free webservers:
http://www.imatix.com/html/xitami/ - small, free, and runs cgi!
http://www.microsoft.com/ie/pws/default.htm - HUGE, requires tons of
space, memory, etc.
http://www.apache.org - reports that beta runs on win95
Dan,
remove _ from replyTo for email
------------------------------
Date: 21 Apr 1998 15:38:25 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: beginnings....
Message-Id: <6hiehh$gnv$1@ns1.arlut.utexas.edu>
"Allan M. Due" <due@discovernet.net> writes:
>
> Which includes ActiveState's web site http://www.activestate.com/ where you
> can download Perl for Windows and find answers to some of your questions.
Alternatively, you can download the Standard distribution, which is
newer and more complete. Unless you must use MS IIS, the ActiveState
perl port is not the way to go. It's a down rev version of perl. The
Standard distribution is at the current rev, and it comes bundled with
some nice packages. Gurusamy Sarathy is responsible for the port, and
he did a wonderful job with it. Thanks and praises to him.
http://www.perl.com/CPAN/ports/winNT/Standard/
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
Date: 21 Apr 1998 16:00:26 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: CGI-Mail Problem
Message-Id: <6hifqq$mfm$1@client3.news.psi.net>
Gaby Rau (GRau@alcatel.de) wrote on MDCXCIV September MCMXCIII in
<URL: news:6hiahi$9s3$1@slsgcz.stgl.sel.alcatel.de>:
++
++ The problem is $adr! If it is in the form localuser@localmachine, it works.
++ If I try to send it to any other Email adress (e.g. my own see below),
++ it does not! The mail is then sent to "root" (Postmaster) with an error
++ message like this
++
++ Connected to mailhost:
++ >>> MAIL From:<nobody@slszwg.stgl.sel.alcatel.de>
++ <<< 550 Unknown local user 'nobody'
++ 554 GRau@alcatel.de... Remote protocol error
++
++ So I guess, I have to provide somehow my identity to the CGI-Script?
++ But how? Any idea?
++
++ BTM, the perl-Script works, if not invoked via CGI, but from command line ...
Which means it's not at all a Perl problem. You have a misconfiguration
of your server/system/MTA. Fix that. There are several groups where you
can ask your question, depending on what you want to fix. This group
however is not the right place.
Goodbye.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: Tue, 21 Apr 1998 14:48:31 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: creating config file to pull into a script.
Message-Id: <353ca9fc.15503844@news.btinternet.com>
On Mon, 20 Apr 1998 16:38:13 -0400, Brad Baxter
<bmb@ginger.libs.uga.edu> wrote:
>Would it help to suggest using the typical .ini file format and existing
>utilities for reading the values into perl data structures?
The IniConf Module available from CPAN will help with this. The INI
file format does have the advantage that it is a bit more
self-documenting than an arbitary file format. I have used it quite a
few times in recent months and have no complaints.
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: Tue, 21 Apr 1998 20:36:29 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: v2matt@btv.ibm.com
Subject: Re: die diff 5.003 and 5.004?
Message-Id: <Pine.GSO.3.96.980421132614.21174e-100000@user2.teleport.com>
On 21 Apr 1998 v2matt@btv.ibm.com wrote:
> `ls -M` or die "I DIED:$!\n";
>
>
> On 5.003, $! is set to "Invalid argument", while
> on 5.004, $! has nothing.
$! is set by a failed request to the OS. (If the request succeeded, it may
have any value.) Sometimes, perl makes requests of the OS which aren't
explicit in the Perl source code. In this case, if the backticks fail
because of a failed fork, say, $! will be set from that. But if the
backticked command fails in "the usual manner", that's not a failed
request to the OS, so you can't count upon $! being set to any particular
value.
In short, checking $! after backticks is probably not what you want. You
may want $? instead. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 21 Apr 1998 15:28:46 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Embeding a Perl "Parser" in Visual C++ app?
Message-Id: <6hidve$efd$1@ns1.arlut.utexas.edu>
"Alt.net" <jbush@bigfoot.com> writes:
>
> Any help would be greatly appreciated.
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#Where_can_I_learn_about_linking_
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"It is obvious that about 750,000 people ago, Austin was a wonderful City."
------------------------------
Date: 21 Apr 1998 15:39:14 GMT
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
Subject: Re: GCC and Solaris can't handle dynamic load ?
Message-Id: <casper.893173118@uk-usenet.uk.sun.com>
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]
gbacon@cs.uah.edu (Greg Bacon) writes:
>In article <y6wwck6oe8.fsf@zeus.genie.uottawa.ca>,
> Philippe Lavoie <lavoie@zeus.genie.uottawa.ca> writes:
>: My system, SOlaris 2.5.1, gcc 2.7.2.3 on ultra 1.
>Are you using GNU as and GNU ld? gas + gld + gcc + perl + Solaris is
>a fatal combination. The INSTALL document that ships with the perl
>distribution specifically addresses Solaris and dynamic loading.
Also, the undefined symbol "main" is often caused by creating the
shared objects with "gcc -G" instead of "gcc -shared"
Only the latter works.
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
------------------------------
Date: 21 Apr 1998 16:04:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How can I get the correct answer?
Message-Id: <6hig2v$mfm$2@client3.news.psi.net>
James Yang (James_Yang@via.com.tw) wrote on MDCXCIV September MCMXCIII in
<URL: news:353C1B7B.87A1109F@via.com.tw>:
++
++ 55.46 + 50 -100 = 5.46000000000001
++ 1553.05 + 50 - 1600 = 3.04999999999995
++
++ Is it a bug or I can get the correct answer in the other way?
That's the first question of part 4 of the Perl FAQ.
Abigail
--
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
------------------------------
Date: Tue, 21 Apr 1998 16:07:39 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: How to create a new file?
Message-Id: <353CC44B.E1EEFD24@inlink.com>
open (NEWFILE,">newfilename");
------------------------------
Date: 21 Apr 1998 15:25:18 -0700
From: kjj@arf.eng.mcd.mot.com
Subject: Re: IMAP support?
Message-Id: <c0gn2de95ip.fsf@arf.eng.mcd.mot.com>
xyz <xyz@xyz.zxy.xyz.com> writes:
> Malcolm Beattie wrote:
>
> > Rather than play games with raw IMAP, I've taken the lazy approach and
> > am writing an XSUB interface to Mark Crispin's cclient library, as
> > used by pine and the UW imapd. The advantage of that is that you can
> > just say
> >
> > use Cclient qw(set_callback);
> > set_callback(login => \&get_username_and_password);
> > $stream = Cclient->new("{somehost/imap}INBOX");
> > ...
> >
> > and the cclient library does all the fancy IMAP stuff for you
> > (complete with read-ahead, caching and so on). Or you can just change
> > the mailbox name and have the exact same API for local mailboxes in
> > all sorts of formats (Berkeley, mh, tenex and all the rest).
>
> Must I use the Cclient library when writing a simple IMAP client ? Or
> can I just issue client commands (as per RFC 2060) and parse the server
> responses. Note that I only want to create an IMAP client, not an IMAP
> server. Thanks.
I finally released an alpha version of Net::xAP to CPAN. It provides
a client-side API for IMAP written in pure perl.
I took a look at using c-client when I started designed Net::IMAP.
It's a very workable solution. I don't remember why I chose not to
use it. It was probably some design issue trying to integrate it into
Mail::Folder, but it's been awhile, so I'm not sure.
--
thx,
kjj
------------------------------
Date: Tue, 21 Apr 1998 10:19:31 -0500
From: xyz <xyz@xyz.zxy.xyz.com>
To: Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Subject: Re: IMAP support?
Message-Id: <353CB903.E740F71A@xyz.zxy.xyz.com>
Malcolm Beattie wrote:
> Rather than play games with raw IMAP, I've taken the lazy approach and
> am writing an XSUB interface to Mark Crispin's cclient library, as
> used by pine and the UW imapd. The advantage of that is that you can
> just say
>
> use Cclient qw(set_callback);
> set_callback(login => \&get_username_and_password);
> $stream = Cclient->new("{somehost/imap}INBOX");
> ...
>
> and the cclient library does all the fancy IMAP stuff for you
> (complete with read-ahead, caching and so on). Or you can just change
> the mailbox name and have the exact same API for local mailboxes in
> all sorts of formats (Berkeley, mh, tenex and all the rest).
Must I use the Cclient library when writing a simple IMAP client ? Or
can I just issue client commands (as per RFC 2060) and parse the server
responses. Note that I only want to create an IMAP client, not an IMAP
server. Thanks.
--
Trinh Ta
Lucent Technologies
Naperville, IL 60566
------------------------------
Date: Tue, 21 Apr 1998 10:20:26 -0500
From: xyz <xyz@xyz.zxy.xyz.com>
To: Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Subject: Re: IMAP support?
Message-Id: <353CB93A.1A117DC8@xyz.zxy.xyz.com>
Malcolm Beattie wrote:
> Rather than play games with raw IMAP, I've taken the lazy approach and
> am writing an XSUB interface to Mark Crispin's cclient library, as
> used by pine and the UW imapd. The advantage of that is that you can
> just say
>
> use Cclient qw(set_callback);
> set_callback(login => \&get_username_and_password);
> $stream = Cclient->new("{somehost/imap}INBOX");
> ...
>
> and the cclient library does all the fancy IMAP stuff for you
> (complete with read-ahead, caching and so on). Or you can just change
> the mailbox name and have the exact same API for local mailboxes in
> all sorts of formats (Berkeley, mh, tenex and all the rest).
Must I use the Cclient library when writing a simple IMAP client ? Or
can I just issue client commands (as per RFC 2060) and parse the server
responses. Note that I only want to create an IMAP client, not an IMAP
server. Thanks.
--
Trinh Ta
Lucent Technologies
Naperville, IL 60566
------------------------------
Date: Tue, 21 Apr 1998 19:51:59 GMT
From: fritz.knack@nospam.POPULUS.net (Fritz Knack)
Subject: Re: Newbie Question re:mkdir for nested directories
Message-Id: <353df6a1.14648656@cnews.newsguy.com>
On Tue, 21 Apr 1998 10:09:18 -0700, Laura Morgan
<laura.morgan@itron.com> wrote:
>I'm trying to use the mkdir command to create nested directories. It
>only seems to work when I create one directory at a time down the tree.
>I'm runing Perl for WIN32.
>
>Thanks
I've not had occasion to use mkdir through Perl, but I have to wonder
why you would expect what is probably an OS level call to operate
differently from how it would at the prompt. If you're sitting at C:\
where C:\FOO does not yet exist, the command MD C:\FOO\BAR is going to
choke with an "Unable to create directory" message.
If you're making mulitple subdirectories (and sub-subdirectories,
etc.), create the highest level early in a loop before you create the
next levels through a sub loop, and on down.
Fritz
-------------------------
Sorry 'bout the nospam in the From field. You know how those 'bots are.
------------------------------
Date: Tue, 21 Apr 1998 15:42:21 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Newbie Question re:mkdir for nested directories
Message-Id: <353cb77d.18829772@news.btinternet.com>
On Tue, 21 Apr 1998 10:09:18 -0700, Laura Morgan
<laura.morgan@itron.com> wrote:
>I'm trying to use the mkdir command to create nested directories. It
>only seems to work when I create one directory at a time down the tree.
>I'm runing Perl for WIN32.
>
I Dont think that Win32 supports the creation of entire trees in one
go but you might find the File::Path module helps as it attempts to be
OS agnostic as far as possible. You should have it with your
distribution.
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: Tue, 21 Apr 1998 18:34:54 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Pattern Matching on HighBit Characters
Message-Id: <alecler-2104981834540001@dialup-637.hip.cam.org>
OK, depending on the context, a certain character can be junk or legit,
but reading your question, I thought you were dealing with a file
containing Spanish text.
No hard feelings :)
A.L.
====================
In article <353D0439.16CCD5D0@micro.ti.com>, Holly Sommer
<hsommer@micro.ti.com> wrote:
> Andre L. wrote:
>
> : It's not the first time I see someone using terms like "junk",
> : "funny characters" or "crazy characters" when referring to letters
> : with diacritical marks.
> :
> : I know this place of surely full of educated Americans who don't
> : consider the character sets from other cultures as full of "junk",
> : so I will try not to get angry.
>
> Well, in this case, the junk happened to be acute capital As. I
> would have called it junk if it were a bunch of periods, and I wanted
> to get to the non-period information in the text :)
>
> In this case, it was not a reference to character sets from other
> cultures - these were characters generated as output from a
> search engine database, when we did an "export preferences" command,
> and I wanted to put the results into a human-readable format. So...
> don't be so sensitive :) Junk is junk, and letters from another
> alphabet are letters from another alphabet :)
>
> -Holly, will miss the es-zet, which is being phased out of written
> german
------------------------------
Date: Tue, 21 Apr 1998 15:42:23 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Pattern Matching on HighBit Characters
Message-Id: <353cbb03.19527265@news.btinternet.com>
On Tue, 21 Apr 1998 13:36:33 -0500, Holly Sommer
<hsommer@micro.ti.com> wrote:
>At least, I *think* that is what the problem is.
>
>I have a textfile which is full of junk, and I want to
>strip out the junk. Simple s/<junk>//g , you'd think, except
>that the junk I want to strip out starts with what *LOOKS*
>like a Capital-A-accent with the accent that goes up and
>to the right (not sure what the proper word for that character
>is).
>
I think thats character with hex value C1 so can use it in a regex
like s/\xC1//g;
/J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: 21 Apr 1998 16:22:32 GMT
From: aa126@NOSPAM.fan.nb.ca (William Burrow)
Subject: Re: Perl 5.004_04 will not compile under Linux
Message-Id: <slrn6jphu7.n6r.aa126@fan1.fan.nb.ca>
On 21 Apr 1998 00:07:06 GMT,
David Fetter <dfetter@shell4.ba.best.com> wrote:
>> util.c: In function `Perl_huge':
>> util.c:2348: `__HUGE_VAL_bytes' undeclared (first use this function)
>> util.c:2348: (Each undeclared identifier is reported only once
>> util.c:2348: for each function it appears in.)
>> make: *** [util.o] Error 1
>
>Could you tell a little bit more about the Linux you've installed?
>That can help to track things down a little bit. Please include:
>
>* libc version. The command 'ls /lib/libc*' should tell you.
5.4.38
>* gcc version (gcc -v)
gcc version 2.7.2.1
>* distribution (e.g. Red Hat, Slackware or SuSE)
Slackware 3.2 (slightly customized/updated)
>* The kernel version (if it's earlier than 2.0.33, you need to upgrade)
Linux xxxxxxx 2.0.33 #3 Fri Feb 13 21:54:06 AST 1998 i586
--
William Burrow, VE9WIL (Adv, 5wpm) -- New Brunswick, Canada
Copyright 1997 William Burrow
------------------------------
Date: Tue, 21 Apr 1998 17:23:20 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: perltoot, clarification, please
Message-Id: <Pine.A41.3.96.980421171331.63508B-100000@ginger.libs.uga.edu>
Thanks for the explanation. Also, I finally found the reference I was
looking for in the Camel book
@days{'Jan','Feb'} Same as ($days{'Jan'},$days{'Feb'})
Your reply is much appreciated,
----------------
Brad Baxter, UGA
On 21 Apr 1998, Greg Bacon wrote:
> : @{$self}{keys %fields} = values %fields;
> It's a hash slice assignment. You (and perl) know this because:
> o $self is a reference to a hash
> o The leading `@' tells you what is being wrung out of the left-hand
> side. (Think ``these'' when you see a `@').
------------------------------
Date: Tue, 21 Apr 1998 15:42:49 -0600
From: warren@jen.co.il
Subject: Re: processes in perl for NT
Message-Id: <6hj0c9$kk2$1@nnrp1.dejanews.com>
In article <01bd6d2a$0010d8c0$39cb3d9b@C2334.gor.eur.compaq.com>,
"msnews.microsoft.com" <michele.quici@compaq.com> wrote:
>
> I want to start a child process and after some processing kill it, in Perl
> under Windows NT. Is anybody able to help me on how to achieve this ?
> On Unix it is not difficult but on NT it seems to be.
In Activeware's Win32 version, look in docs/Perl-Win32/win32mod.html, create
a process with Win32::Process::Create (there is an example in this page) and
kill it with $ProcessObj->Kill($ExitCode).
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 21 Apr 1998 20:17:09 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Q: Simple RegExp match help required...
Message-Id: <6hius5$2rt$1@marina.cinenet.net>
jules (jules@jules.mangled.com) wrote:
[big snip]
: Here's the line in my script that's giving me grief:
:
: if ( $line = /^From \?\?\?\@\?\?\? */ ) {
:
: I'm reading that as "if $line equals a start of line, a space, three escaped
: question marks, escaped at sign, three more escaped question marks, a space,
: a wild card to catch everything else on the line"
You're misreading it. The line above assigns the result of running the
regex on $_ to $line. Since $_ probably doesn't match, you get a false
value in $line, and the if-block never executes.
: Interestingly I can get it to work with
:
: if ( $line =~ /From \?\?\?\@\?\?\? */ ) {
That works because =~ is the binding operator; it says "apply this regex
to $line (rather than the default $_)."
By the way, that final ' *' portion of your regex doesn't accomplish
anything; it'll match zero spaces quite happily. If the idea is that the
second set of ?s must be followed by a space, just use a single space
there.
Assuming the above is true, and applying another trick for regex cleaning,
I'd rewrite yours as:
/\QFrom ???@??? /
The \Q is a 'quotemeta' shortcut; it causes everything that follows to be
implicitly escaped against interpretation as a regex or var-substitution
metacharacter. Comes in *very* handy when matching strings with lots of
potential metacharacters in them!
: Where am I screwing up? And, so I can learn from this, why am I screwing
: up?
See above for where. Why? You're new. It'll pass, if you keep banging
away at it for a while.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 21 Apr 1998 16:47:06 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Q: Simple RegExp match help required...
Message-Id: <Pine.A41.3.96.980421164158.63508A-100000@ginger.libs.uga.edu>
You need to use '=~' with regular expressions, not '=' (or even '==').
Moreover / */ means zero or more blanks. You want / .*/ if what you are
after is a blank followed by zero or more arbitrary characters.
On Tue, 21 Apr 1998, jules wrote:
> From ???@??? Fri Sep 29 20:44:48 1995
> Here's the line in my script that's giving me grief:
> if ( $line = /^From \?\?\?\@\?\?\? */ ) {
> I'm reading that as "if $line equals a start of line, a space, three escaped
> question marks, escaped at sign, three more escaped question marks, a space,
> a wild card to catch everything else on the line"
> Interestingly I can get it to work with
> if ( $line =~ /From \?\?\?\@\?\?\? */ ) {
----------------
Brad Baxter, UGA
------------------------------
Date: 21 Apr 1998 22:24:31 GMT
From: thecurz1@aol.com (The Curz1)
Subject: Random Number Generation PERL 5.0
Message-Id: <1998042122243100.SAA05644@ladder03.news.aol.com>
We are in dire need of generating a random number from 0 to <EndOfFile> for use
on our website and opening day is scheduled for May 1st. We are somewhat new to
PERL 5.0 but have good knowlege of JavaScript. We already have an application
written in JavaScript that works well but want one that uses PERL so that it
will run on all browsers AND the source code won't be visible to our
competition. Specifically what we are doing is creating a Random Banner Ad
Generator so that a different (and random) banner is displayed each time. I
have been able to generate the number based on the localtime (seconds) but
since we do not have 60 banners, we need a way to prevent the number from being
larger than the number of banners. Please help if you can.
E-mail me at:
TheCurz1@aol.com
Thanks in advance.
------------------------------
Date: Tue, 21 Apr 1998 10:55:05 -0500
From: Paul Holser <pholser@nortel.com>
Subject: re:DATA filehandle
Message-Id: <353CC159.76A3@nortel.com>
For those interested, I've found the cause of
the problem I was having with the following:
#!/opt/automation/perl5/bin/perl
use strict;
use Pod::Text;
#pod2text( '<&=' . fileno \*DATA );
pod2text( '<&DATA' );
__END__
# Here's some information, in POD format, about what I do.
.
.
.
The uncommented call to pod2text() failed; the
commented call succeeds. I believe this is
because in the uncommented call, the pod2text()
sub would be trying to dup Pod::Text::DATA...but
module Pod::Text has no __END__ or __DATA__ token
in my installation, leading me to believe that
Pod::Text::DATA is not a valid open filehandle.
What I really wanted was
pod2text( '<&main::DATA' );
That did the trick.
Hope this helps someone out there...
Cheers,
pholser
--
// Paul Holser ~ Northern Telecom, Inc. ~ pholser@nortel.com
// Wireless Automation Tool Development
// $time ||= time; $time = time unless $time; # is cap-tuuured!...
// "A good craftsman never blames his tools." --Keith Olbermann
------------------------------
Date: Tue, 21 Apr 1998 16:21:23 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Tanstaafl <Tanstaafl@geocities.com>
Subject: Re: RFC: Adding Commands in Filehandles... <repost>
Message-Id: <Pine.GSO.3.96.980421091301.21174M-100000@user2.teleport.com>
On Sun, 19 Apr 1998, Tanstaafl wrote:
> "Teach yourself CGI programming with Perl in a week."
> >> To this purpose and because I haven't gotten very far in the book I'm
> >> trying it with file handles. (IOW, with $#ARGV.)
> >
> >Oops. $#ARGV isn't a file handle. It's one smaller than the number of
> >command line arguments passed to your program (by default).
>
> It's says command line file handle, maybe be cause of the text
> of the script that added I thught it was pure file handle.
If your book tells you that $#ARGV is any kind of file handle, throw the
book away! $#ARGV is, was, and will always be a number.
> >> print << "end_tag";
> >> # Checks for at least one filehandle
> >>
> >> end_tag
> >
> >Now, you know that that's not a comment in there, right?
>
> I didn't know that, this book is teaching me naughty stuff or
> what?
Maybe... :-) That code uses a "here-document", which is a kind of
quoting. The pound sign doesn't indicate a comment inside there.
> >You may wish to
> >use one of the modules which are designed to handle command-line
> >arguments.
>
> Could you point nme in the correct direction...
Look for Getopt::Long and Getopt::Std, which should come with Perl.
> >You should probably read the Llama book before going further.
>
> ISBN please... (What's this thing with Llama's???)
> blaze your trail!
I thought you said you had the FAQ! :-) From perlbook:
Learning Perl, Second Edition (the Llama Book):
ISBN 1-56592-284-0 (English)
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 21 Apr 1998 18:45:08 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: perlguy@technologist.com
Subject: Re: Sendmail Attach
Message-Id: <353D2174.2291@juicepigs.com>
Buzzzz! MIME could careless what operating system he is using.
MIME::Base64 is probably the easiest way to do it.
Brent Michalski wrote:
>
> Typically I use my Netscape mail and click on the "Attach" button,
> browse for the file I want to attach and then send it to whoever I want.
>
> I know that this is a "smart-ass" answer but your question gives no
> details or important information!!!
>
> Are you on NT, UNIX, Amiga, what?
> Are you trying to do this in Perl?
> Are you trying to do this via a web interface or from the command line?
> Have you looked for the answer anywhere else?
>
> Do you see where this is going? You need to provide us with information
> and list the things you've tried before we can even begin to offer our
> assistance.
> InterRed wrote:
> >
> > How can I send email with attach!...
> >
> > thanks!
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: Tue, 21 Apr 1998 16:06:51 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Sendmail Attach
Message-Id: <353CC41B.28048124@inlink.com>
Typically I use my Netscape mail and click on the "Attach" button,
browse for the file I want to attach and then send it to whoever I want.
I know that this is a "smart-ass" answer but your question gives no
details or important information!!!
Are you on NT, UNIX, Amiga, what?
Are you trying to do this in Perl?
Are you trying to do this via a web interface or from the command line?
Have you looked for the answer anywhere else?
Do you see where this is going? You need to provide us with information
and list the things you've tried before we can even begin to offer our
assistance.
Brent
InterRed wrote:
>
> How can I send email with attach!...
>
> thanks!
------------------------------
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 2373
**************************************