[16880] in Perl-Users-Digest
Perl-Users Digest, Issue: 4292 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 11 21:10:32 2000
Date: Mon, 11 Sep 2000 18:10:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <968721018-v9-i4292@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 11 Sep 2000 Volume: 9 Number: 4292
Today's topics:
Re: Network Workgroop <elephant@squirrelgroup.com>
Perl / apache configuration problem <christopher_j@uswest.net>
Re: Perl and System Environment Variables <elephant@squirrelgroup.com>
Re: Perl substraction weird result <srmalloy@home.com>
Piping output on Win32 system eedlin@my-deja.com
Problem with join function (and split function) <g.soper@soundhouse.co.uk>
Prune doesn't work in find (Mike Nelsen)
Re: Qualifications for new Perl programmer????? <elephant@squirrelgroup.com>
Re: Qualifications for new Perl programmer????? (Gwyn Judd)
Re: Recognizing wrapped lines <pmorch@cisco.com>
Re: Regexp Question (Really did fix the bad line break) <mischief@motion.net>
Re: regular expression syntax (Gwyn Judd)
Re: regular expression syntax (Gwyn Judd)
Running external programs and grabbing the output <nothing here! complain about that!!!>
Re: Running external programs and grabbing the output (Abigail)
Re: s/// mystery: regexp challenge <ruedas@geophysik.uni-frankfurt.de>
simple question interlocator@my-deja.com
Re: This *should* be easy, string parsing question <ren.maddox@tivoli.com>
Re: two questions- help interlocator@my-deja.com
URI... what is this? <lmoran@wtsg.com>
Re: URI... what is this? (brian d foy)
Re: why does foreach iterate on an undef variable? (Ilya Zakharevich)
Re: xml type file parsing help. <lr@hpl.hp.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Sep 2000 11:29:35 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Network Workgroop
Message-Id: <MPG.142815e9ef58bad9989777@localhost>
Maarten Veerman <mtveerman_nospam@mindless.com> wrote ..
>What module(s) do I need to do the following:
>Get the list of computers in a workgroop and a list of all workgroops....
I can't be bothered checking for you .. so what you want is almost
certainly in the standard module Win32::NetAdmin .. but you might need
one of Dave Roth's Win32 modules from
http://www.roth.net/perl/
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 11 Sep 2000 15:49:52 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Perl / apache configuration problem
Message-Id: <ekdv5.436$EW2.312149@news.uswest.net>
OK, here's my problem. I just compiled and installed a new version
of perl. Everything works fine, except when I try to run a cgi
script through my apache web server that uses a module I've only
installed on the new perl it gives me an error. Plus, it lists
the values for the @INC variable for where it looks for modules,
however these are the wrong values, these values look like the
ones for the other perl installation, however I cannot for the
life of me figure out why. The path to perl after the shebang
in my scripts is to the correct _new_ perl install, and I'm not
running mod_perl. When I run the script from the command line
(either using ./script.cgi or perl script.cgi) it works perfectly
fine.
I suppose I could put my new perl where my old perl was and "cheat"
the problem, but I'd much rather figure out what's going on.
Thanks for any help.
------------------------------
Date: Tue, 12 Sep 2000 11:55:29 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Perl and System Environment Variables
Message-Id: <MPG.14281bfcb296029598977b@localhost>
lim_k@my-deja.com <lim_k@my-deja.com> wrote ..
>I know this question has been asked before, but I must have missed the
>posting. How would you pass system environment variables in a PERL
>script for a cron'ed process?
pass them to where ?
>I have tried:
>
>$ENV{PATH} = "/yadda/yadda/yadda:/blah/blah/blah:";
>
>print "PATH=$ENV{PATH};
this will not work because you are missing a double-quote .. but it will
work perfectly well if you add that back
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 11 Sep 2000 23:53:06 GMT
From: Sean Malloy <srmalloy@home.com>
Subject: Re: Perl substraction weird result
Message-Id: <vbrqrscf299fh3k4n4n1edqbqhm1utno2i@4ax.com>
karabot@canada.com wrote:
>We are running version 5.005_03 built for i386-linux on a slackware 7.0
>server. Check out the following calculation:
>
>% perl -e 'print(30.4 - 30 . "\n")'
>0.399999999999999
>
>Does anybody know why the result is NOT 0.4 ?
It's because _computers_ think in binary, so fractions have to be
represented as _binary_ fractions, and most of them wind up as
_approximations_ of their decimal value. 0.4 cannot be properly
expressed as a sum of inverse powers of two -- it's approximately 1/4
+ 1/8 + 1/64 + 1/128, but there's a tiny remainder that keeps getting
strung out. So 30.4 is actually represented by '11110.0110011...' (or
variations thereof, depending on the specific binary representation of
floating-point variables; the point is that the fractional portion
doesn't add back up completely).
So when you subtract 30, what you get is a number which is _almost_,
but not quite, 0.4 -- and if you don't specify the number of decimal
places in your answer, you're going to get this 'off by a fraction'
result. Format the result to, say, two decimal places, and you'll get
'0.40'.
--
Sean R. Malloy | American Non Sequitur
Naval Medical Center | Society
San Diego, CA 92134-5000 |
srmalloy@home.net | "We may not make sense,
srmalloy@nmcsd.med.navy.mil | but we do like pizza"
FORMAL NOTICE: unsolicited commercial email will be read
at a charge of $500 per item. Receipt of such email shall
be considered to constitute acceptance of contract, and
will be billed immediately.
------------------------------
Date: Mon, 11 Sep 2000 23:57:38 GMT
From: eedlin@my-deja.com
Subject: Piping output on Win32 system
Message-Id: <8pjrh7$nai$1@nnrp1.deja.com>
Hello All,
I'm sure someone has done this before, but I can't seem to find or do
exactly what I need.
I'm porting some Unix sh scripts to perl on a PC (Oh what FUN!).
I have the following code (sh)
($cmd $args 2>&1) |\
sh -c "while read line; do echo \"\$line\" >> $log;done" &
Now $cmd is a binary (daemon) that continues to spew stuff to STDOUT.
Piping it into the subshell and then into the log file allows users to
cycle logs and keep the output going to $log instead of the old file
descriptor which used to be $log, but is now named something different
(ie $log.Sep2000).
On top of doing this I also need to run it in the background.
I tried using Win32::Process, but I'm guessing that it does not support
piping. I tried this :
my $cmd_object;
Win32::Process::Create($cmd_object,
"$binDir\\${cmd}.exe",
"$cmd $args | cmd_log_router $logFile",
0,
"NORMAL_PRIORITY_CLASS",
".") or die ErrorReport();
cmd_log_router is a simple perl scripts which takes in STDIN and prints
it in the passed in file ($logFile in this case).
When I run it this way, the cmd is executed and is running in the
background, but the output is not being piped to cmd_log_router. It is
being spewed to the console and the log is never created.
Anyone have an idea or two? These types of problems keep making my list
of reasons to blow up all of our PCs even longer!
Thanks,
Eric
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 12 Sep 2000 00:24:30 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Problem with join function (and split function)
Message-Id: <49fc96b21bg.soper@soundhouse.co.uk>
In a script I have tried to take an array and join its elements into one
string delimited by colons. This doesn't seem to be working.
The line in question is line 95 and the script is
http://www.soundhouse.co.uk/cgi-bin/2.cgi which is available for
inspection at http://www.soundhouse.co.uk/geoff as is the database file.
Through debugging I have established that it is an array before and after
using join on it.
It doesn't actually affect the program as later the line which should
split the string into an array (using colon as the delimiter) passes it
straight through. (line 136)
As I say this means the script functions fine but I would like to know
more about these two anomolies.
Thanks
--
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/
------------------------------
Date: Mon, 11 Sep 2000 23:13:06 GMT
From: mnelsen@nc.rr.com (Mike Nelsen)
Subject: Prune doesn't work in find
Message-Id: <39bd64e4.2944673@news-server>
Don't want to search in sub-directories if a -nosub option. I couldn't
get the File::Find::prune=1 to work. It didn't give me any files in
the starting directory just the directory itself. Here's the simple
example that should just display the files in $sourceDir and no
sub-directories below:
find(\&wanted, $sourceDir);
#********************************************************
sub wanted
{
$sourcePath = $File::Find::dir;
print "$sourcePath\\$_\n";
if ($opt_nosub) {
$File::Find::prune=1;
}
}
I traced through the execution and it looks like the problem is in
Find.pm in the find_opt function. When I changed the line from:
next if $prune;
to also check for '.'
next if ($prune) && ($_ ne '.');
everything worked fine. Has anyone else heard of this problem?
sub find_opt {
my $wanted = shift;
my $bydepth = $wanted->{bydepth};
my $cwd = $bydepth ? Cwd::fastcwd() : Cwd::cwd();
# Localize these rather than lexicalizing them for backwards
# compatibility.
local($topdir,$topdev,$topino,$topmode,$topnlink);
foreach $topdir (@_) {
(($topdev,$topino,$topmode,$topnlink) =
($Is_VMS ? stat($topdir) : lstat($topdir)))
|| (warn("Can't stat $topdir: $!\n"), next);
if (-d _) {
if (chdir($topdir)) {
$prune = 0;
unless ($bydepth) {
($dir,$_) = ($topdir,'.');
$name = $topdir;
$wanted->{wanted}->();
}
#next if $prune; # original line
next if ($prune) && ($_ ne '.'); # fixed problem
.....
Michael Nelsen
------------------------------
Date: Tue, 12 Sep 2000 10:33:48 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <MPG.142808d798690b1d989775@localhost>
Eric Bohlman <ebohlman@netcom.com> wrote ..
>Christopher M. Jones (christopher_j@uswest.net) wrote:
>: There's one good way to avoid getting unfairly pegged as
>: someone who doesn't know their stuff, and that is to have
>: a gallery of examples (as well as a good history of all
>: your past work _if_ you can show it).
>
>One of the advantages of the open source movement is that it allows
>programmers to build portfolios. As Gerald Weinberg pointed out, if
>you're going to hire a musician or a performer, you can simply give them
>an audition. It won't tell you everything you need to know, but it will
>let you put together a "short list" very quickly.
I guess that my quiz was as close as I could get to a meaningful
audition .. the idea was "if they can answer most of these without
reference material then they're likely to be able to understand and do
the work required when they can refer to the docs"
out of those nine .. four people said (almost word-for-word) "I guess I
should have brushed up on my Perl skills before coming to a Perl job
interview"
there were three people (two of which were in the above four) who argued
that they were the type of person who didn't memorise facts and that
they would do a lot better with a reference manual next to them (and I'm
thinking - my dog could answer this quiz with the reference manual next
to him)
but by far the most scarey statistic was that there were two people
(might have been three - I can't find one of the candidate's answers)
who supplied absolutely no answers to any of the questions .. not even a
guess .. they were both (all) sent by the same agency - which I stopped
using immediately
the other qualifier is that I'm in Australia (Sydney) .. and I suspect
that the Perl marketplace is quite limited here .. the big IT employers
in the city are all NT based outfits - so a lot of the on-the-job
training in the city is in NT/ASP technology
Perl has made it into some uni courses .. but not a lot
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Tue, 12 Sep 2000 00:14:12 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <slrn8rqtag.7oe.tjla@thislove.dyndns.org>
I was shocked! How could brian d foy <brian@smithrenaud.com>
say such a terrible thing:
>In article <slrn8rpoua.383.tjla@thislove.dyndns.org>, tjla@guvfybir.qlaqaf.bet (Gwyn Judd) posted:
>
>> This reminds me of the guy who used the 'delete' compression software.
>> Everytime he wanted to "uncompress" a file he would use the 'undelete'
>> command. By the way she said a minimum of 500 lines so yours fails. ;)
>
>any specification which includes a minimum line count must have
>been written by a moron or someone who gets paid by the line.
So what are you trying to say? That she is a moron? *gasp* ;)
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
I'm going to keep taking yoga till I can blow myself, or I've just been
throwing money away.
-Capone (contributed by Randall Joiner)
------------------------------
Date: Mon, 11 Sep 2000 17:30:25 -0700
From: "Peter V. Morch" <pmorch@cisco.com>
Subject: Re: Recognizing wrapped lines
Message-Id: <39BD7921.77114F8C@cisco.com>
I suspect the reason you haven't gotten a reply is that it really
depends on the nature of the lines. There is no generic way to join
lines once they have been wrapped - the original information is lost.
But if you know e.g. "all lines begin with FOO", or some other way of
identifying wrapped lines, then it is rather straight forward. But the
first step is to reconstruct the original lines, using knowledge of the
specific line format in question.
The easiest is of course to start out with lines that aren't wrapped.
Can't you get the files before they get wrapped?
Peter
------------------------------
Date: Mon, 11 Sep 2000 17:06:33 -0500
From: "Chris Stith" <mischief@motion.net>
Subject: Re: Regexp Question (Really did fix the bad line break)
Message-Id: <srqlon11ct6130@corp.supernews.com>
<cghawthorne@yahoo.com> wrote in message news:8o769c$4c4$1@nnrp1.deja.com...
> Hi!
Hullo.
> I have a question on constructing a regexp. I'm designing a CGI script
> that will need to take an image file name
> (/home/person/public_html/img.gif)
> and translate it to something that can be used in an <img> tag
> (example.com/~person/img.gif). The easiest way I can think of to do
> this is to use a regexp to return everything from the last "/" on and
> deal with it from there.
$file =~ s/\/home\/([\w.]+)\/public_html\/([\w.]+)/example.com\/~$1\/$2/;
> ### Cargo cult programming... Mmm mmm good!
>
> > Any ideas would be appreciated!
>
> I think I'll have steak for dinner tonight. I also think I'll have
> some brussels sprouts with that steak. And maybe a beer or
> three. Thanks for appreciating my random thoughts!
>
> Chris Stith
> mischief@pikenet.net mischief@motion.net mischief@bachelorboy.com
> mr_mischief1@hotmail.com _pcu_@yahoo.com
chris.stith-personal@nemonet.com
> There's no time like one remembered fondly.
>
>
>
------------------------------
Date: Tue, 12 Sep 2000 00:02:27 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: regular expression syntax
Message-Id: <slrn8rqskh.7oe.tjla@thislove.dyndns.org>
I was shocked! How could Andrew Johnson <andrew-johnson@home.com>
say such a terrible thing:
>In article <slrn8rpt49.383.tjla@thislove.dyndns.org>,
> Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
>[snip]
>
>> That is quite simple.
>
>Perhaps -- but your regex doesn't fit the OP's requirements. Test it
>again on this content:
bummer. I should learn to stop coding at 3 in the morning. I realised
mine was way too complicated anyway when I woke up this morning:
m;(.*?)<ul>(.*?)</ul>(.*);s
works just fine for your example and mine
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Uppity women of the world, unite!
------------------------------
Date: Tue, 12 Sep 2000 00:09:45 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: regular expression syntax
Message-Id: <slrn8rqt26.7oe.tjla@thislove.dyndns.org>
I was shocked! How could Ren Maddox <ren.maddox@tivoli.com>
say such a terrible thing:
>So, without nesting, and as long as all "<ul>"s are paired with a
>"</ul>" (and vice-versa), your RE will find the *last* such pair. The
>OP wanted the *first*. To get that, simply change the ".*" in your
>alternations to "[^<]*".
Yeah oops :) 3am coding sessions always have bugs no matter how much I
think I test:
($precontent, $alist, $postcontent) =
($content =~ m;(.*?)<ul>(.*?)</ul>(.*);xs);
Also does the right thing and is somewhat shorter
>And as a bonus, if you change the "(.*)" at the end to
>"((?:<(?!ul)|[^<]*)*)" (and add a "g" modifier), then you can use this
>RE to match multiple "<ul>...</ul>" pairs. Of course, that isn't what
>the OP asked for.
ergo:
@results =
($content =~ m;(.*?)<ul>(.*?)</ul>(?:<(?!ul)|[^<]*)*;gs);
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
A pretty woman can do anything; an ugly woman must do everything.
------------------------------
Date: Mon, 11 Sep 2000 17:32:51 -0700
From: "Someperson" <nothing here! complain about that!!!>
Subject: Running external programs and grabbing the output
Message-Id: <srqti06rct6164@news.supernews.com>
Hi
I am trying to figure out where to start here. I have an NT command line
utility that I want to grab the output from and send input to. It runs by
passing it one string of args, and the output is one string.
I assume something like this:
system "myprogram.exe -arg1 -arg2";
$output = <STDOUT>;
print $output;
....would not work.
Any idea where I should look for some instruction on this?
Thanks for any help.
------------------------------
Date: 12 Sep 2000 00:31:32 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Running external programs and grabbing the output
Message-Id: <slrn8rqu95.pg4.abigail@alexandra.foad.org>
Someperson (nothinghere!complainaboutthat!!!) wrote on MMDLXIX September
MCMXCIII in <URL:news:srqti06rct6164@news.supernews.com>:
%% Hi
%%
%% I am trying to figure out where to start here. I have an NT command line
%% utility that I want to grab the output from and send input to. It runs by
%% passing it one string of args, and the output is one string.
%%
%% I assume something like this:
%%
%% system "myprogram.exe -arg1 -arg2";
%% $output = <STDOUT>;
%% print $output;
%%
%% ....would not work.
%%
%% Any idea where I should look for some instruction on this?
How about the Perl manual? For instance, starting by what the manual
has to say about *drumroll* system?
Or would that just be too obvious?
Abigail
--
$_ = "\x3C\x3C\x45\x4F\x54" and s/<<EOT/<<EOT/e and print;
Just another Perl Hacker
EOT
------------------------------
Date: Tue, 12 Sep 2000 01:34:55 +0200
From: Thomas Ruedas <ruedas@geophysik.uni-frankfurt.de>
Subject: Re: s/// mystery: regexp challenge
Message-Id: <39BD6C1F.5473278B@geophysik.uni-frankfurt.de>
>>>:} >>"" use Tie::IxHash;
>>:} >What is the purpose of the tie here?
>:} In this context actually none, but in the original converter order
>:} matters, because e.g. \& was another command, which has to be converted
>:} into & if it is not converted first, all of the rest will be messed
>:} up.
>So, why use a hash? If order matters, why not just use an array?
Sure one could have used arrays as well (and actually I have used arrays
for this kind of thing until now). On the other hand, for this special
task I felt more comfortable with a hash, because there are always pairs
of commands related to each other. I also wanted to give Tie::IxHash a
try. - Performance (if that is the reason you asked) does not really
matter for me here, because it's always small documents which have to be
converted (conference abstracts of half a page each).
--
------------------------------------------------------------------------
Thomas Ruedas
Institute of Meteorology and Geophysics, J.W.Goethe University Frankfurt
e-mail: ruedas@geophysik.uni-frankfurt.de
http://www.geophysik.uni-frankfurt.de/~ruedas/
------------------------------------------------------------------------
------------------------------
Date: Mon, 11 Sep 2000 23:04:52 GMT
From: interlocator@my-deja.com
Subject: simple question
Message-Id: <8pjoe6$jgr$1@nnrp1.deja.com>
How can I pass a value from one script like username to another script
to do more stuff with it?
Or at least can you tell me what this is called so I can look it up
myself. This has been the biggest problem for me, knowing what some
process is called to be able to learn it.
Thank you in advance.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 11 Sep 2000 15:31:44 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: This *should* be easy, string parsing question
Message-Id: <m3puma1xhr.fsf@dhcp11-177.support.tivoli.com>
Adam Trace Spragg <spragg@cs.ucdavis.edu> writes:
> Peter J Scott <peter@psdt.com> wrote:
> : %value = /([^=]+)=([^&]+)(?:&|$)/g;
>
> Would someone mind please adding a little English to this? I'm trying to
> learn regexps as best I can, and this one eludes me.
Here it is expanded:
%values = / # I usually use plurals for aggregates
( # start saving for $1
[^=] # any character other than "="
+ # one or more such characters
) # that's all for $1
= # match the literal "="
( # start saving for $2
[^&] # any character other than "&"
+ # one or more such characters
) # that's all for $2
(?: # start a non-saving group
& # match the literal "&"
| # or
$ # the end of the string
) # end of non-saving group
/g; # repeat the whole match as possible
Because this is in a list context (assignment to a hash), the /g
modifier causes the pattern to match repeatedly through the string.
On each match, two groups are saved:
1) everything before "="
2) everything after "=" and before "&" or the end of the string
So the result is a list of each parameter name and its associated
value, in that order. Assigning such a list to a hash "does the right
thing" and creates a key/value pair for each pair in the list.
Note that the much simpler:
%values = split /[=&]/;
is just as effective on this data, but the RE handles the (perhaps
undesirable) case of a parameter having a "&" in it. The split, on
the other hand, basically blows up if that happens (though if it
happens an even number of times, it doesn't blow up it just messes
up).
$_="here&is=some&bad=data";
The RE will simply take "here&is" as a parameter, while the split
doesn't treat "&" or "=" any different, so gets confused.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 11 Sep 2000 22:42:18 GMT
From: interlocator@my-deja.com
Subject: Re: two questions- help
Message-Id: <8pjn46$hra$1@nnrp1.deja.com>
> >I'm not lazy, I'm studying but don't know the words to be able to
find
> >these answers so I'll just describe my questions.
> >
> >I need to pass the "user" from one script to another script for
further
> >processing.
> >
> >And,
> >
> >I want to send two emails to the same person, one that has a thank
you,
> >and a separate one that has the password. I can send one email using
> >sendmail, but when I try to send another right after it it errs.
>
> Are you closing the filehandle used for sendmail before attempting to
> reopen it?
I thought I was but I must be doing it wrong, I'll double check
everything.
Thank you
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 11 Sep 2000 19:09:41 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: URI... what is this?
Message-Id: <njnqrso8n0qslh7ao9jp7b3t72n548j3nh@4ax.com>
---Where do I get one?
---I want to load a module (LWP... something something (bundle?)) and
Perl informs me that I need to have URI (something about "LWP without
URI wouldn't that be nice?") I can't seem to find this URI fella
anywhere.
---I have CPAN on a CD from redhat (I know it is old but I figured it
would be there since it seems like the URI is fairly commo abd
important.) but I can't find it.
---I just compiled 5.6 and (?) makefiled (?) it (all by myself, I
didn't even write you guys... :) ) and I would like this LWP module as
some scripts I would like to run need it.
---Help me be more useful in Perl.
Registered Linux user number 187055
------------------------------
Date: Mon, 11 Sep 2000 20:45:46 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: URI... what is this?
Message-Id: <brian-ya02408000R1109002045460001@news.panix.com>
In article <njnqrso8n0qslh7ao9jp7b3t72n548j3nh@4ax.com>, Lou Moran <lmoran@wtsg.com> posted:
> ---Where do I get one?
Boston.
> ---I want to load a module (LWP... something something (bundle?)) and
> Perl informs me that I need to have URI (something about "LWP without
> URI wouldn't that be nice?") I can't seem to find this URI fella
> anywhere.
oh, that Uri.
you didn't try very hard.
http://search.cpan.org/search?mode=module&query=URI
> ---Help me be more useful in Perl.
learn to use CPAN ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: 11 Sep 2000 23:30:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: why does foreach iterate on an undef variable?
Message-Id: <8pjpuc$n2u$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was NOT sent to Martien Verbruggen
<mgjv@tradingpost.com.au>],
who wrote in article <slrn8rp90s.m53.mgjv@martien.heliotrope.home>:
> > There is no other way to achieve what undef @array is doing: freeing
> > the storage accumulated in the array.
>
> Which is hardly ever what people intend.
Please do not put words in other people's mouths. What I see on
c.l.p.* is that sometimes they want it this way, sometimes the other way
around.
Ilya
------------------------------
Date: Mon, 11 Sep 2000 15:28:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: xml type file parsing help.
Message-Id: <MPG.1426fc77209932aa98ad58@nntp.hpl.hp.com>
In article <8pjehs$eic$1@server.cntfl.com> on Mon, 11 Sep 2000 16:14:31
-0400, Ric Smith <rickyfusion@nospamfusionserver.com> says...
> Sorry, I should've been more specific.
>
> I'm beginning with Reg Ex's and I need to assign the value between <chapnum>
> and </chapnum> in the following to a var named $chapnum.
>
> <chapnum>CHAPTER 798</chapnum>
>
> Would this work?
>
> $chapnum=~ s/<[\]chapnum>//;
>
> but sometimes the tags are on different lines like this:
>
> <sectbody>Whoever lives in an open state of adultery shall be
> guilty of a misdemeanor of the second degree, punishable as
> provided in s. 775.082 or s. 775.083. Where either of the parties
> living in an open state of adultery is married, both parties so
> living shall be deemed to be guilty of the offense provided for in
> this section.</sectbody>
<Off-topic>Really? Where are there still laws like that?!</Off-topic>
> If someone could point me in the right direction hopefully with a little bit
> of code.
Read the file into a scalar ($_ by choice) or, if it can be split into
sections according to a specific string, read it in a section at a time.
Read about the special variable $/ in perlvar for more information about
how to do this.
Then the following will pick out each inclusion from $_:
while (m!<chapnum>(.*?)</chapnum>!gs) {
print "$1\n";
}
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4292
**************************************