[17997] in Perl-Users-Digest
Perl-Users Digest, Issue: 157 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 27 14:05:31 2001
Date: Sat, 27 Jan 2001 11:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <980622308-v10-i157@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 27 Jan 2001 Volume: 10 Number: 157
Today's topics:
$ in character class <amir_e_a@netvision.net.il>
Re: $ in character class (Garry Williams)
Apple <jane__millson@hotmail.com>
Re: Basic string question <bkennedy99@home.com>
Benchmark Module Flaws <godzilla@stomp.stomp.tokyo>
Re: Calling rsync with "system" does not work (Otto Wyss)
Re: Calling rsync with "system" does not work (Abigail)
Re: Calling rsync with "system" does not work <uri@sysarch.com>
Re: Comparing multiple values <jdf@pobox.com>
Re: Comparing multiple values <uri@sysarch.com>
Re: Converting a CSV file to a array <abe@ztreet.demon.nl>
Re: Email Forwarding in Perl (Abigail)
Finding a char in string <Yazum@Hotmail.com>
Re: Finding a char in string <james@NOSPAM.demon.co.uk>
Get/install ReadKey.pm from CPAN -- HowTo? (at)msn.(dot)(deletethis)
Re: Get/install ReadKey.pm from CPAN -- HowTo? <jdf@pobox.com>
Re: Get/install ReadKey.pm from CPAN -- HowTo? (at)msn.(dot)(deletethis)
Re: hash question <amir_e_a@netvision.net.il>
Re: Hello. I'm back. <clpmisc@newton.digitalspace.net>
Re: help on getting parameter value of GET <tony_curtis32@yahoo.com>
https problems <rob@megagiga.com>
module to backup database <leekembel@hotmail.com>
Re: MS Access <jtjohnston@courrier.usherb.ca>
Re: MS Access MSherrill@compuserve.com
Re: perl editors (Abigail)
PROBLEM with SPRITE.PM aminl@my-deja.com
Quick RegExp Question <nospam@nospam.edu>
Text:CSV can't handle german characters <marc.beck@bigfoot.com>
Use module with path name bug <bfoddy@mn.mediaone.net>
Re: Use module with path name bug <uri@sysarch.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 26 Jan 2001 19:05:57 +0200
From: "Amir E. Aharoni" <amir_e_a@netvision.net.il>
Subject: $ in character class
Message-Id: <94saps$g01$1@news.netvision.net.il>
Hi there
I'm trying to write a re that will match VMS error messages in this style:
Disk _$1$DKC301: error count increased to 5 from 3
Disk LAURA$DKA100: has less than 15% free blocks
As you may have guessed, _$1$DKC301: is a device name, and can change;
LAURA$DKA100: is also a device name (while LAURA is the computer name) and
the numbers at the end can obviously change too. It will suffice me to know
that the string begins with the word Disk and 1 space, continues with a
valid device name, 1 more space, some words after that, and then the word
"increased" or the word "free". I also want to keep the device name and the
word "increased" or "free" in $1 and $2.
Finally, _for_the_sake_of_simplicity_, let's presume that a valid device
name consists of _any_ sequence of letters, digits, dollar signs and
underscores, with an optional colon at the end.
The Regexes chapter in the Camel Book says that most meta-characters lose
their meta-ness in square brackets and doesn't mention the dollar sign among
the exceptions, so i tried this:
/^Disk ([$\w]+:?) .+(increased|free)/
... but it doesn't work. The buck is the problem. I also tried
[\w$]+:?
[\w\$]+:?
[\$\w]+:?
None of them worked.
If the device name was, let's say, DKA200: (without the dollar sign), this
would match:
[\w]+:?
Furthermore, if there was some other character, let's say tilde (~) instead
of the buck, ~1~DKA200: would match this re:
[\w~]+:?
Any suggestions? Thanks in advance.
(Better yet, if anyone knows a regex that will precisely match a valid VMS
disk device name, i would be even more
thankful)____________________________________________________________
Amir Elisha Aharoni
"First the salad then the meat then the vegetables..........
Wait - bring all my food at one time on the same plate!
What kinda music u play? GOOD KIND." - Oliver Lake
------------------------------
Date: Sat, 27 Jan 2001 15:03:40 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: $ in character class
Message-Id: <grBc6.954$GF2.34953@eagle.america.net>
On Fri, 26 Jan 2001 19:05:57 +0200, Amir E. Aharoni
<amir_e_a@netvision.net.il> wrote:
>I'm trying to write a re that will match VMS error messages in this style:
>
>Disk _$1$DKC301: error count increased to 5 from 3
>Disk LAURA$DKA100: has less than 15% free blocks
[snip]
> so i tried this:
>
>/^Disk ([$\w]+:?) .+(increased|free)/
>
>... but it doesn't work. The buck is the problem. I also tried
>
>[\w$]+:?
>[\w\$]+:?
>[\$\w]+:?
>
>None of them worked.
[snip]
Really?
$ perl -wle 'print q(_$1$DKC301:) =~ /^[\$\w]+:?$/ ? "matched" : "missed"'
matched
$
You must escape the dollar to prevent an attempt to interpolate a
variable. I think you may have fooled yourself.
--
Garry Williams
------------------------------
Date: Sat, 27 Jan 2001 13:06:45 -0500
From: "Jane Millson" <jane__millson@hotmail.com>
Subject: Apple
Message-Id: <94v2oe$e6r$3@slb0.atl.mindspring.net>
Is there a version of Perl for Apple computers?
------------------------------
Date: Sat, 27 Jan 2001 16:14:30 GMT
From: "Ben Kennedy" <bkennedy99@home.com>
Subject: Re: Basic string question
Message-Id: <GtCc6.11064$49.1368521@news1.rdc2.pa.home.com>
"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:3A71BE2E.54DE5970@stomp.stomp.tokyo...
> You may test this in two ways.
> Issue a print command and enclose
> your @Array in quotes, to maintain
> spaces between elements:
>
> print "@Array";
For a quick dump of array contents for debug purposes I use a join()
command, something like
print ">>>>>", join('~',@Array), "===\n";
does the trick fine - better than relying on spaces in an interpolated array
--Ben Kennedy
------------------------------
Date: Sat, 27 Jan 2001 11:02:57 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Benchmark Module Flaws
Message-Id: <3A731B61.F4C753FF@stomp.stomp.tokyo>
I am using the benchmark module written by Jarkko Hietaniemi,
under both ActivePerl as a straight Perl program and under
Apache as a cgi application.
I have yet to successfully run "cmpthese" per documentation
for this benchmark module. Regardless of changes I make,
an "Undefined subroutine $main::cmpthese...." error is
always returned.
His timethis and timethese work ok, but never cmpthese.
Have you successfully run cmpthese? What syntax did
you use to run this?
This is a partial data return:
.... 1.32 CPU) @ 757575.76/s (n=1000000)
I have noticed this pattern of numbers for
code runs per second more than is accountable.
This pattern of repeating alternating numbers,
such as shown, 757575.76, other patterns such
as 636363.64 .. 585858.59 and others of this
repeating pattern nature, are being returned
far more than is logically accountable.
With two significant decimal place returns,
random probability indicates, for large batch
runs which I have performed, this repeating
pattern should be returned less than one-tenth
of one percent of batch runs. This pattern is
being returned, ranging from twenty to thirty
percent of batch runs. Are you experiencing
this oddity which shouldn't be taking place?
These two problems, cmpthese not working and
these repeating numerical patterns, has caused
me to suspect Benchmark is flawed to such a
degree, it is unrealiable and data returned
may have an unacceptable error rate.
Have you, or do you know of anyone, who has
run benchmark against more professional timing
devices to test accuracy and margin of error?
Any estimate on benchmark's true margin of error?
Is it within plus or minus five percent?
Thanks.
Godzilla!
------------------------------
Date: Sat, 27 Jan 2001 15:54:42 +0100
From: otto.wyss@bluewin.ch (Otto Wyss)
Subject: Re: Calling rsync with "system" does not work
Message-Id: <1enwgi4.100pmcua3e388N%otto.wyss@bluewin.ch>
> >> @args = (qw(-aPv --include-from .listfile), $serverdir, $workdir);
> >> my $rc = system("rsync", @args);
> >>
> > Why are you useing qw(...) instead of "..."?
>
> qw() splits the string given up by whitespace and generates a list. The
> above is equivalent to
>
> @args = ("-aPv", "--include-from", ".listfile", $serverdir, $workdir);
>
My first try was
@args = ("-aPv", "--include-from .listfile", $serverdir, $workdir);
so just missing the ", " between include-from and .listfile. It amazes
my the rsync chokes on this. I wrongly concluded all options had to be
in the same argument.
[...]
> (my version of rsync doesn't have a -P option, so I'm assuming you meant
> -p)
>
Version 2.4.6 does, at least man tells it. -P is the same as --partial
[...]
>
> Give it a try. And, do read the documentation I pointed to, if you
> haven't already. It basically says a lot of the same stuff I say in
> here.
>
Could you give me the pointers to the documentation again, I can't find
them anymore. I did try the following befor I started this thread:
perldoc -q backticks told me I need to look at system
perldoc -q system told everthing else but nothing about system()
perldoc -f system was not clear enough for me
perldoc -q `string` did not work
Of course I haven't tried "string" without backticks.
O. Wyss
------------------------------
Date: 27 Jan 2001 15:35:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Calling rsync with "system" does not work
Message-Id: <slrn975qlc.nea.abigail@tsathoggua.rlyeh.net>
Otto Wyss (otto.wyss@bluewin.ch) wrote on MMDCCVI September MCMXCIII in
<URL:news:1enw5k8.yafc3p1a538yzN%otto.wyss@bluewin.ch>:
== > > @args=("rsync", "-aPv --include-from .listfile", "$serverdir",
== > > "$workdir");
== > > print "@args\n";
== > > system (@args);
== > > produces allways the error "illegal option --".
== >
== > Either it's all one string for the shell, or then the command and
== > each option have to be separate scalars, so that perl can start
== > the command itself and hand over to it each argument. But the line
== > above mixes up the two methods.
== >
== I know everthing in one string does work, splitting up doesn't. There is
== definitly something wrong in the comunication between perl and rsync
== (see my other posts).
==
If everything in one strings work, then use one string. No need to ask
further.
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: Sat, 27 Jan 2001 17:41:59 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Calling rsync with "system" does not work
Message-Id: <x7lmrwuc2g.fsf@home.sysarch.com>
>>>>> "OW" == Otto Wyss <otto.wyss@bluewin.ch> writes:
>> > @args=("rsync", "-aPv --include-from .listfile", "$serverdir",
>> > "$workdir");
>> > print "@args\n";
>> > system (@args);
>> > produces allways the error "illegal option --".
>>
>> Either it's all one string for the shell, or then the command and
>> each option have to be separate scalars, so that perl can start
>> the command itself and hand over to it each argument. But the line
>> above mixes up the two methods.
>>
OW> I know everthing in one string does work, splitting up doesn't. There is
OW> definitly something wrong in the comunication between perl and rsync
OW> (see my other posts).
you don't know that because you haven't split up the arguments
PROPERLY. read up on exec(2) in any unix. it does NOT SPLIT arguments
for you IN ANY WAY, SHAPE OR FORM. the shell does split on white space
and perl will only do that if ONE string is passed to system and it has
no shell meta chars. there are a bunch of conditions mentioned there and
you are breaking some. most unix programs expect EACH option string to
be passed as a SINGLE exec argument. they DON'T do any more splitting on
white space. so your passing in "-aPv --include-from .listfile" means
THAT string is checked if it is a valid option by rsync and it isn't so
it barf all over your lap like it should.
so please stop saying there is something wrong between perl and
rsync. it is only your argument list to system which is wrong.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 27 Jan 2001 10:40:44 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Comparing multiple values
Message-Id: <lmrxover.fsf@pobox.com>
The WebDragon <nospam@nospam.com> writes:
> perl -MCPAN -e shell
> cpan> install Quantum::Superpositions
FWIW, Quantum::Superpositions is also available via the ppm utility
for Redmondites.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 27 Jan 2001 17:27:12 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Comparing multiple values
Message-Id: <x7r91oucr3.fsf@home.sysarch.com>
>>>>> "TW" == The WebDragon <nospam@nospam.com> writes:
TW> I watched this whole entire thread unfold and saw absolutely NO ONE
TW> respond to Damien Conway's extremely useful suggestion, therefore I
TW> reiterate:
what do you call this followup, chopped liver?
*****************
>>>>> "DC" == Damian Conway <damian@cs.monash.edu.au> writes:
DC> I'm late to this thread, so I'm not sure if anyone has yet suggested:
DC> use Quantum::Superpositions;
DC> if ($somevar == any(3,4,8,9)) {
DC> ...
DC> }
we all did in an alternate universe. you are the only one who did it in
this one.
:-)
*****************
if Q:S gets into perl6 and is done efficiently (even not in constant
time!) i am sure it will become a very popular feature.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sat, 27 Jan 2001 18:02:04 +0100
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Converting a CSV file to a array
Message-Id: <6jt57t80jmiuekrl6tppc5io5468gjkvg1@4ax.com>
On Sat, 27 Jan 2001 14:32:27 +0100, "Marc Beck" <marc.beck@bigfoot.com>
wrote:
> Hello,
>
> I got CSV file from my PIM and want to convert it to a SQL table.
>
> Every field containing a value is sourrounded by "" and each one is
> separated by a , .
> i.e.:
> "field1","field2","field3","field4"
> "somevalue1","somevalue2",,"somevalue4"
Use the DBI with DBD::CSV if you want to do simple SQL statements
directly on the file (no need to convert).
[ snip of things that don't involve SQL ]
> P.S.: I couldn't find a module with CPAN that does this job. Is there
> one?
Stange, I got 5 modules when I typed CSV in the little box at:
http://search.cpan.org/
One of them was also mentioned in the FAQ answer:
perldoc -q delimited
Found in d:\usr\lib\pod\perlfaq4.pod
How can I split a [character] delimited string except when inside
[character]? (Comma-separated files)
--
Good luck,
Abe
perl -le '$_=sub{split//,pop;print pop while@_};&$_("rekcah lreP rehtona
tsuJ")'
------------------------------
Date: 27 Jan 2001 15:35:45 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Email Forwarding in Perl
Message-Id: <slrn975qmh.nea.abigail@tsathoggua.rlyeh.net>
D Unsworth (dun@druwmg.u-net.com) wrote on MMDCCVI September MCMXCIII in
<URL:news:3a72cc69.2642228@news.u-net.com>:
%% Hi
%%
%% I am looking for a Perl script which will allow me to foward an email
%% with attachments to several other email addresses. Any help will be
%% most welcome.
http://search.cpan.org
HTH. HAND.
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
------------------------------
Date: Sat, 27 Jan 2001 16:21:15 GMT
From: Henrik Thostrup Jensen <Yazum@Hotmail.com>
Subject: Finding a char in string
Message-Id: <h9t57tsfi6qqka584g1hbmd6n2l1t3tiof@4ax.com>
I've browsed through most of the perl cd bookshelf, without finding a
prober solution of my problem
I've need to find a certain char (";") in a string and remove all that
is after the char. The only way i've been able to do this so far is by
making the string into an array, searching through the array for the
char and thereafter splitting the string at the char location.
There have to be an easier way
And yes, i am a newbie with perl
------------------------------
Date: Sat, 27 Jan 2001 17:52:27 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Finding a char in string
Message-Id: <ant271727313fNdQ@oakseed.demon.co.uk>
In article <h9t57tsfi6qqka584g1hbmd6n2l1t3tiof@4ax.com>,
Henrik Thostrup Jensen <URL:mailto:Yazum@Hotmail.com> wrote:
>
> I've need to find a certain char (";") in a string and
> remove all that is after the char.
This sounds like stripping comments from assembler.
Let's say you have your sting in a variable called
$string then:
$string =~ s/;.*/;/s;
will leave only what is up to the first semicolon in $string
and removes everything after it. You need to read up on
Perl's regular expressions, they are very useful for this
kind of thing.
--
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: Sat, 27 Jan 2001 09:15:06 -0500
From: "Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com>
Subject: Get/install ReadKey.pm from CPAN -- HowTo?
Message-Id: <uskVksGiAHA.359@cpmsnbbsa07>
Hi All,
Question:
I'm a long-time but very-light Perl user of ActiveState Perl 5.006 under
Win200Pro/SP1.
I happily managed to download and successfully build, install and use my
first package: Term::ReadKey from CPAN using the accompanying instruction,
with just one change: using nmake rather than make.
In the course of doing that I discovered ActiveState's PPM (Perl Package
Manage) which I used to get/install the XML-DOM package. Very smooth
process. But I can't find any documentation on it.
Any suggests about where to look would be appreciated.
Regards,
Richard
------------------------------
Date: 27 Jan 2001 11:00:48 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Get/install ReadKey.pm from CPAN -- HowTo?
Message-Id: <bsstouhb.fsf@pobox.com>
"Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com> writes:
> In the course of doing that I discovered ActiveState's PPM (Perl Package
> Manage) which I used to get/install the XML-DOM package. Very smooth
> process. But I can't find any documentation on it.
You can't find any docs on which: the PPM utility, or XML::DOM? Docs
for both are in the same place, viz. the HTML documentation that comes
with ActiveState perl. Go to your Start menu, select "Programs", and
you'll find (depending on the release) either "ActivePerl" or
"ActiveState ActivePerl", inside which is the link to all of your
documentation.
Or, you could open up a command prompt like a *real* programmer, and
type
C:\> perldoc XML::DOM
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 27 Jan 2001 13:29:46 -0500
From: "Richard Muller" <rlmuller(at)msn.(dot)(deletethis).com>
Subject: Re: Get/install ReadKey.pm from CPAN -- HowTo?
Message-Id: <#DKL56IiAHA.341@cpmsnbbsa09>
Hi Jonathan,
Thanks for responding to my (ambiguous) question.
> You can't find any docs on which: the PPM utility, or XML::DOM? Docs
XML::DOM
> ... Start | "Programs" | "ActiveState ActivePerl"
I had looked at the ActiveState documentation (which, equivalently, I had
started by double-clicking the Perl\Html\Index.html). But I couldn't find
any XML entries in it -- for one thing, there's no built-in search
mechanism. Could you suggest a path in it?
> C:\> perldoc XML::DOM
That worked great, of course, but I didn't like paging though it with the
SpaceBar, so I streamed it out to a text file which I could then view with
Notepad, Wordpad, Word, whatever:
perldoc XML::DOM > I:\_Notes\Perl\XML_DOM_Doc.txt
Again, thanks for your help.
Richard
------------------------------
Date: Fri, 26 Jan 2001 22:25:11 +0200
From: "Amir E. Aharoni" <amir_e_a@netvision.net.il>
Subject: Re: hash question
Message-Id: <94smfg$jt4$1@news.netvision.net.il>
Todd Ahlstrom <todda@xmission.com> wrote:
> I am new to perl, and I am having a problem getting something to work.
> I have reread the hash section in the book I am using, but I cannot
> figure this out. I have a hash that contains item, color, and qty
> values. The keys are named item1...item6 color1...color6 qty1...qty6.
> What I want to happen is if the value of a qty key is zero, to delete
> the corresponding item and color keys. Example: qty4's value is 0 then
> I would want to delete item4 and color4. I figured I could do this with
> some simple loops, but I can't get it to actually work. I can get it to
> compile and run, but it never deletes the keys I want deleted. this is
> a sample of code I have tried:
>
> for($i=1; $i<7; $i++){
> if ($hash{qty$i}==0){
> delete $hash{item$i, color$i}; }
> }
>
> Being new to perl I was unsure of a few things, if the scope of $i would
> extend into the if loop. I tried declaring $i before the for statement
> to deal with this, but it didn't help. Also, I have been a little
> unclear on what quotes to use on the key values in the loops. I have
> tried both single and double, but neither helped. If I inadvertently
> typed a syntax error into this sample code, I apologize. the actual code
> I have tried does compile fine, I just need some help deciding how to
> make this work properly.
a checklist for you, keep it for a bad day:
%hash : a complete hash
%hash{somekey} : error
$hash{"somekey"} : the value at key somekey
$hash{somekey} : same as above -- the quotes are added magically for
one-worded keys
$hash{qq(somekey)} : still the same
$hash{q(somekey)} : still the same
$hash{'somekey'} : still the same
$hash{some other key} : will give you a weird error -- you must use quotes
in multi-worded keys
$hash{"some other key"} : the value at key "some other key"
($hash{key1}, $hash{key2}, $hash{key3}) : a list of three values
@hash{"key1", "key2", "key3"} : a shorthand for the above (note the @!)
@hash{qw(key1 key2 key3)} : yet shorter for the above (note that there are
no commas), but it won't work with multi-word keys
delete @hash{qw(key1 key2 key3)} : deletes values at keys key1, key2, key3
Good luck!
____________________________________________________________
Amir Elisha Aharoni
"First the salad then the meat then the vegetables..........
Wait - bring all my food at one time on the same plate!
What kinda music u play? GOOD KIND." - Oliver Lake
------------------------------
Date: Sat, 27 Jan 2001 19:53:30 +0100
From: "Philip Newton" <clpmisc@newton.digitalspace.net>
Subject: Re: Hello. I'm back.
Message-Id: <icp57tsl1fmvtp46id41vau4cg3ld8l3fe@4ax.com>
On Fri, 19 Jan 2001 14:09:51 GMT, tadmc@augustmail.com (Tad McClellan) wrote:
> I collect perl-related scorefiles (several have been posted here
> in the past, some I requested in email), I wouldn't have thought
> to look in an article with this Subject though...
Could you make them available? For example, put them on a web or ftp site
somewhere? (Or would you send them by email on request?)
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: 27 Jan 2001 09:29:53 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: help on getting parameter value of GET
Message-Id: <87elxpypvy.fsf@limey.hpcc.uh.edu>
>> On Sat, 27 Jan 2001 15:20:15 +0800,
>> "Vinai Prakash" <vinaip@singnet.com.sg> said:
> Hi, I am trying to get the input of a form displayed in
> the cgi program. But all I get is errors. The program
> runs fine with simulated parameters, but dosen't run on
> Tripod or my PC well. Note that Tripod supports cgi-bin.
> On my PC, the output of the Submit button is almost like
> a dump of my perl program [...]
You haven't configured your web server properly. (Nothing
to do with perl at all, this same problem would turn up
with any language.)
Try going to comp.infosystems.www.authoring.cgi and/or
comp.infosystems.www.servers.YOURPLATFORMHERE where you'll
be able to find people who can assist in setting up CGI on
your web server.
hth
t
--
Eih bennek, eih blavek.
------------------------------
Date: Sat, 27 Jan 2001 20:25:27 +0200
From: "Rob" <rob@megagiga.com>
Subject: https problems
Message-Id: <94v41l$fel$1@news3.inter.net.il>
I'm trying to connect to a secure server but keep getting this error..
501 Protocol scheme 'https' is not supported
I've installed openssl, Crypt::SSLeay and the LWP modules but no luck..
Anyone know what I've missed??
Thanks.
------------------------------
Date: Sat, 27 Jan 2001 15:36:22 GMT
From: "Studio 51" <leekembel@hotmail.com>
Subject: module to backup database
Message-Id: <WVBc6.161$V22.177370@news4.rdc1.on.home.com>
Hello, I'm a bit curious about OOP, and so I'm writing my own module. I'm
starting by writing a module that backs up an SQL database to a text file,
and restores it again. Is there a module that already does this? I quick
search of CPAN didn't find anything. I don't care if it does exist, I'm
writing it mostly to learn, but I would be interested to see it.
LKembel
------------------------------
Date: Sat, 27 Jan 2001 10:03:49 -0500
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: Re: MS Access
Message-Id: <3A72E355.27ED19AB@courrier.usherb.ca>
Is there a way to open/append Microsoft Access files?
> Intermediate User question :)
>
> I need enough code to be able to open and display a couple of
> lines in a Microsoft Access file called db1.mdb, in a table called
> QuizData, that looks a bit like this:
>
> No Questions A IsACorr AnsA B IsBCorr AnsB C IsCCorr AnsC D IsDCorr AnsD
> Timer SoundFile
> 1 How ____ you? A 0 Am B 0 Is C 1 Are D 0 20 clip1.rpm
>
> Before, I used a simple text file delimited by ||
>
> 1||How ____ you?||A||0||Am||B||0||Is||C||1||Are||D||0||||20||clip1.rpm||
>
> and used this code below. What will I have to do differently with MS
> Access?
> Can I specify a specific line number in my Access table?
> For that matter, how could I improve the code below?
>
> I'd really appreciate some help and/or some code.
>
> Thanks,
>
> John
> ###################################################################
> ###################################################################
> open(QUESTIONSFILE, "$datafile") || die "I can't open $datafile\n";
> @Questions = <QUESTIONSFILE>;
> close QUESTIONSFILE;
>
> $QMax=0;
> foreach $ThisQuestion (@Questions)
> {
> $QMax++;
> }
>
> if ($QNum > $QMax)
> {
> foreach $ThisQuestion (@Questions)
> {
> @TempData = split (/\|\|/, $ThisQuestion);
> if($TempData[0] eq $QNum)
> {
> print "<TR>\n";
> print "<TD><B>$TempData[0]</B></TD><TD
> COLSPAN=2><B>$TempData[1]</B></TD>";
> print "</TR>\n";
> #etc.
> }
> }
------------------------------
Date: Sat, 27 Jan 2001 16:53:41 GMT
From: MSherrill@compuserve.com
Subject: Re: MS Access
Message-Id: <3a72fc2a.11662609@news.compuserve.com>
On Fri, 26 Jan 2001 19:36:32 -0500, jtjohnston
<jtjohnston@courrier.usherb.ca> wrote:
>I need enough code to be able to open and display a couple of
>lines in a Microsoft Access file called db1.mdb, in a table called
>QuizData, that looks a bit like this:
perldoc dbi
--
Mike Sherrill
Information Management Systems
------------------------------
Date: 27 Jan 2001 15:38:12 GMT
From: abigail@foad.org (Abigail)
Subject: Re: perl editors
Message-Id: <slrn975qr4.nea.abigail@tsathoggua.rlyeh.net>
Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMDCCVI September
MCMXCIII in <URL:news:slrn975670.v2s.mgjv@martien.heliotrope.home>:
-- On 27 Jan 2001 04:59:36 GMT,
-- Rich Lafferty <rich@bofh.concordia.ca> wrote:
-- > In comp.lang.perl.misc,
-- > Kevin Michael Vail <kevin@vaildc.net> wrote:
-- >> In article <94np7f$483$1@nnrp1.deja.com>, hanja <hanja@my-deja.com>
-- >> wrote:
-- >>
-- >> > Out of curiousity, what editor do you use to write your scripts?
-- >>
-- >> On Unix: vi
-- >> On Windoze: UltraEdit
-- >> On MacOS: BBEdit
-- >
-- > So comPLEX! :-)
-- >
-- > On Unix: emacs
-- > On Windows: emacs
-- > On MacOS: emacs
-- >
-- > Extrapolate as necessary.
--
-- emacs is not an editor. It's a universe.
--
-- Unix: vim
-- Windows: vim
-- MacOS: vim
--
-- Extrapolate as necessary.
Unix: vile, vi, nvi, vim, ed, depending on what's installed.
Windows: I don't do Windows.
MacOS: I don't do MacOS.
Abigail
--
perl -le 's[$,][join$,,(split$,,($!=85))[(q[0006143730380126152532042307].
q[41342211132019313505])=~m[..]g]]e and y[yIbp][HJkP] and print'
------------------------------
Date: Sat, 27 Jan 2001 16:38:17 GMT
From: aminl@my-deja.com
Subject: PROBLEM with SPRITE.PM
Message-Id: <94uthp$1q$1@nnrp1.deja.com>
Hello,
I have set up SPRITE.PM (version 3.21) to read data from a flat file
delimited by "::" .... I run a "for" loop to print out data retrieved
from the select statement.
foreach $record (@data)
{
print $record<BR>";
}
However I only get [ARRAY(0x81636bc)] outputted (I only am selecting
one record)... I tried setting up an array within the script without
using SPRITE.PM (just for testing), and used the same for loop
construct , and it prints fine.....
How do I get at the data???
Thanks,
Amin
aminlalji@globalenviro.com
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sat, 27 Jan 2001 08:58:11 -0800
From: "Paul Burney" <nospam@nospam.edu>
Subject: Quick RegExp Question
Message-Id: <94uuaa$710$1@carroll.library.ucla.edu>
I'm trying to write a small filter that will take an HTML file and
remove the top and bottom. That is, everything until the end of the
<body> tag and everything after the last </body> tag.
Here's what I was trying:
> #!/usr/local/bin/perl -i.old -p -w
>
> use diagnostics;
> use strict;
>
> $/ = '';
> s/(.*?)(<body)([^>]+)(>)(.*)(<\/body)(.*?)/$5/gims;
The script doesn't give any error messages at all. It does copy the
file specified on the command line to filename.old but it doesn't seem
to change the contents of the file at all.
I assume it's just a problem with the Reg Exp because I tried the
following and it worked as expected:
> s/(body)/new${1}stuff/gims;
I appreciate any help you can offer.
Sincerely,
Paul Burney
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Burney
Webmaster and Internet Developer
Educational Technology Unit
Graduate School of Education and Information Studies
University of California, Los Angeles
(310) 825-8365
<webmasterNOSPAM@gseisNOSPAM.ucla.edu>
<http://www.gseis.ucla.edu/>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------
Date: Sat, 27 Jan 2001 19:03:46 +0100
From: "Marc Beck" <marc.beck@bigfoot.com>
Subject: Text:CSV can't handle german characters
Message-Id: <94v2rf$f4kl8$1@ID-23826.news.dfncis.de>
Hello,
I just integrated the Text::CSV::parse method into my Script to convert =
a CSV to a SQL-Table.
The Problem with this module is that it won't handle any strings =
containing =E4, =F6, =FC or any other special german characters.
How can does the CSV module have to be modified so it will work?
cu Marc
------------------------------
Date: Sat, 27 Jan 2001 17:50:14 GMT
From: Brian Foddy <bfoddy@mn.mediaone.net>
Subject: Use module with path name bug
Message-Id: <3A7309A2.E726ACED@mn.mediaone.net>
I'm having a problem on what should be one of the simpliest issues.
I can't get the "use" command to bring in a module from a directory
not in the normal INC path, or from the PERL5LIB path.
For a trivial example:
#!/usr/local/bin/perl
use HTTP::Request::Common
'/apps/soc/util/lib/perl5/lib/site_perl/5.005/';
print "Hello World\n";
will result in:
Can't locate HTTP/Request/Common.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris
/usr/local/lib/perl5/site_perl/5.005 .) at ././use.pl line 2.
BEGIN failed--compilation aborted at ././use.pl line 2.
but the directory
/apps/soc/util/lib/perl5/lib/site_perl/5.005/HTTP/Request
contains Common.pm with 444 permissions and dir execute perms.
I'm using Perl 5.005_03 for sun4-solaris.
If I set the dir above in PERL5LIB, it works (without the dir on the
use).
This syntax is documented everywhere as being valid. I need to use
this syntax because our sysadmins don't want anything but basic libs
loaded in the standard PERL dirs, and its difficult to ensure the
PERL5LIB
variable is always set for every process.
NOTE: After writing this note, I wondered if the fact that /apps is
a soft link to /export/dvl/ would have anything to do with it, and sure
enough, if I change the path to the raw filesystem mount point, it
works.
Is this known? Sounds like a bug to me... Any other workaround?
Brian
------------------------------
Date: Sat, 27 Jan 2001 18:02:05 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Use module with path name bug
Message-Id: <x7hf2kub4y.fsf@home.sysarch.com>
>>>>> "BF" == Brian Foddy <bfoddy@mn.mediaone.net> writes:
BF> #!/usr/local/bin/perl
BF> use HTTP::Request::Common
BF> '/apps/soc/util/lib/perl5/lib/site_perl/5.005/';
BF> This syntax is documented everywhere as being valid. I need to use
where is this documented? it doesn't work as arguments passed to a use
command are passed to the import method of that used class. it has
nothing to do with the location of the module.
you want to do:
use lib '/apps/soc/util/lib/perl5/lib/site_perl/5.005/';
before
use HTTP::Request::Common ;
BF> Is this known? Sounds like a bug to me... Any other workaround?
sure it is a bug. but in YOUR program.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.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 V10 Issue 157
**************************************