[11484] in Perl-Users-Digest
Perl-Users Digest, Issue: 5084 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 8 01:07:19 1999
Date: Sun, 7 Mar 99 22:00:15 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 7 Mar 1999 Volume: 8 Number: 5084
Today's topics:
Array of Array???? lufan@hotmail.com
Re: Array of Array???? (Ronald J Kimball)
Re: command line arguments <amwalker@gate.net>
FAQ 2.17: Where do I send bug reports? <perlfaq-suggestions@perl.com>
Re: Lynux <amwalker@gate.net>
Need advice on perl-ptx-emacs application (David Combs)
Re: newbie problem with *s (regular expression matching (Ronald J Kimball)
Re: newbie problem with *s (regular expression matching <rick.delaney@home.com>
OLE, DBI-ODBC conflicts? <lynn@swcp.com>
Re: perl targeted url redirection. <tlehrer@spectrumdynamic.com>
Re: perlcc (Ronald J Kimball)
Re: POST bug in latest LWP/libwww (1.82) - clarificatio <jbattikha@highsynth.com>
Re: Printing to multiple Filehandles simultaneously mike808@mo.net
Re: Serial Communications using Perl <jkirving@mosquitonet.com>
Re: SID identification for CDs... <cassell@mail.cor.epa.gov>
Re: suid (Paul Kimoto)
Re: Verifying URL's with perl. lufan@hotmail.com
What's the best way to store uncontrolled data? (Steve .)
Re: What's the best way to store uncontrolled data? (Sam Holden)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 08 Mar 1999 13:09:29 -0800
From: lufan@hotmail.com
Subject: Array of Array????
Message-Id: <36E43C89.341C@hotmail.com>
hi,
How to make a PERL array contains several pointers to
others arrays ? All 2 arrays are scalable.
Here is what I think of it,
array1 -> {a,b,c,d,e,f ...}
array1{a} -> {1,2,3,4 ..}
array1{b} -> {4,1,2,3,4 ..}
thanks ;)
------------------------------
Date: Mon, 8 Mar 1999 00:58:03 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Array of Array????
Message-Id: <1dobozt.1sy0x1mte90qaN@bay3-379.quincy.ziplink.net>
<lufan@hotmail.com> wrote:
> How to make a PERL array contains several pointers to
> others arrays ? All 2 arrays are scalable.
Please refer to the following Perl documentation:
perlref
perllol
perldsc
If you're still unsure how to do it, let us know.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 07 Mar 1999 21:57:48 -0500
From: Aaron Walker <amwalker@gate.net>
To: Ronald J Kimball <rjk@linguist.dartmouth.edu>
Subject: Re: command line arguments
Message-Id: <36E33CAB.FBB87A7E@gate.net>
Someone else provided me with a solution more geared towards what I was
talking about.
The arguments to the program is the ARGV array.
for example: ./progname first second third
$ARGV[0] would be "first", $ARGV[1] would be "second", etc.
Thanks for your help,
Aaron
Ronald J Kimball wrote:
> Aaron Walker <amwalker@gate.net> wrote:
>
> > how do you setup command line arguments in perl?
>
> The Getopt modules might answer your question.
>
> perldoc Getopt::Std
> perldoc Getopt::Long
>
> There are others, but those are the main two.
>
> Oh, there's also Perl's -s command line option:
>
> --
> #!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
> perl -e'for(sort keys%main::){print if $$_ eq 1}
> ' -s -- -' Just' -' another ' -'Perl ' -'hacker
> ' http://www.ziplink.net/~rjk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: 7 Mar 1999 21:12:43 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 2.17: Where do I send bug reports?
Message-Id: <36e34e3b@csnews>
(This excerpt from perlfaq2 - Obtaining and Learning about Perl
($Revision: 1.30 $, $Date: 1998/12/29 19:43:32 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq2.html
if your negligent system adminstrator has been remiss in his duties.)
Where do I send bug reports?
If you are reporting a bug in the perl interpreter or the modules
shipped with perl, use the *perlbug* program in the perl
distribution or mail your report to perlbug@perl.com .
If you are posting a bug with a non-standard port (see the answer
to "What platforms is Perl available for?"), a binary
distribution, or a non-standard module (such as Tk, CGI, etc),
then please see the documentation that came with it to determine
the correct place to post bugs.
Read the perlbug(1) man page (perl5.004 or later) for more
information.
--
I've got plenty of inputs and outputs. I don't need the video. --Andrew Hume
------------------------------
Date: Sun, 07 Mar 1999 22:03:21 -0500
From: Aaron Walker <amwalker@gate.net>
To: Matt <info@blue.uk.com>
Subject: Re: Lynux
Message-Id: <36E33DF9.B2356FED@gate.net>
You probably have it on your system already... try typing "whereis perl"
or "which perl".
If not, then you can download it in a certain file format, depending on
which distribution you
are using. For example, Redhat uses the Redhat Package Manager (.rpm)
and debian uses (.deb).
Try looking at the web page of your distribution or if you have a CD,
try looking there.
Hope this helps,
Aaron
Matt wrote:
> Where can I get software for running perl on Lynux
>
> Matt
------------------------------
Date: Mon, 8 Mar 1999 04:02:13 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Need advice on perl-ptx-emacs application
Message-Id: <dkcombsF89CJq.L8u@netcom.com>
Here is something I just posted to solaris, a question
that STARTED OUT being about ptx -- but re a PERL
plus EMACS application.
Maybe some of you will have a "better idea" about
how I can do these massive edits -- AND where each
one has to be LOOKED AT and THOUGHT ABOUT (quickly, lets
hope!) before allowing it to be done.
It is at least an INTERESTING application -- how
to make MASSIVE changes to a MASSIVE manual (written
via Scribe, that once-CMU late '70s super-duper
system, STILL far better than latex, blah, blah, MS word, etc,
and completely text based, inputtable via vi, emacs, etc.
Anyway, here it is. (ignore the ptx stuff -- although
I do leave it in, since in fact ptx might have some
use with perl applications -- maybe even THIS one).
Newsgroups: comp.unix.solaris
Subject: PTX: anyone have some REAL doc on it?
Summary:
Followup-To:
Distribution:
Organization: ICGNetcom
Keywords:
Cc:
ptx -- permuted index. The man page isn't real helpful,
assumes you already know what it does, and especially
what neat things it is used for.
I've heard that Kernighan's Software Tools contains
something about it (under a different name) or about
something similar.
Maybe we could collect together various concepts about
it, and various uses of it, from people here who use it,
and then stick all that, rewritten, into the FAQ.
I have an application that SEEMS like it might be useful
to use for, but I don't know enough.
What I wan't to do is to make a MASSIVE number of edits
to a 1000 page manual.
Now, I have a scheme by which I can take a list
like that (but MUCH longer), munge it via a perl program
to produce (a piece of) another perl program,
that will run through all the text of the manual,
and output it (well, a different example) like this:
let us --> let's
here is --> here's # If occurs MID-sentence.
Here is --> Here's # If STARTS a sentence.
here are --> here's
there is --> there's
there are --> there's
that is --> that's
they are --> they're
she would --> she'd
he would --> he'd
you would --> you'd
You have to --> You've got to
you have --> you've
we have --> we've # This is a comment.
what is --> what's # This is another comment.
@@greetings --> @@hello # See if handles Scribe's "@"-sign.
greetings --> @@hello
, and convert them into the perl-language lines:
elsif ($curLine =~ s/\blet us\b/\@XXX let us \@YYY let's \@ZZZ/) {;}
elsif ($curLine =~ s/\bhere is\b/\@XXX here is \@YYY here's \@ZZZ/) {;}
elsif ($curLine =~ s/\bHere is\b/\@XXX Here is \@YYY Here's \@ZZZ/) {;}
elsif ($curLine =~ s/\bhere are\b/\@XXX here are \@YYY here's \@ZZZ/) {;}
elsif ($curLine =~ s/\bthere is\b/\@XXX there is \@YYY there's \@ZZZ/) {;}
elsif ($curLine =~ s/\bthere are\b/\@XXX there are \@YYY there's \@ZZZ/) {;}
elsif ($curLine =~ s/\bthat is\b/\@XXX that is \@YYY that's \@ZZZ/) {;}
elsif ($curLine =~ s/\bthey are\b/\@XXX they are \@YYY they're \@ZZZ/) {;}
elsif ($curLine =~ s/\bshe would\b/\@XXX she would \@YYY she'd \@ZZZ/) {;}
elsif ($curLine =~ s/\bhe would\b/\@XXX he would \@YYY he'd \@ZZZ/) {;}
elsif ($curLine =~ s/\byou would\b/\@XXX you would \@YYY you'd \@ZZZ/) {;}
elsif ($curLine =~ s/\bYou have to\b/\@XXX You have to \@YYY You've got to \@ZZZ/) {;}
elsif ($curLine =~ s/\byou have\b/\@XXX you have \@YYY you've \@ZZZ/) {;}
elsif ($curLine =~ s/\bwe have\b/\@XXX we have \@YYY we've \@ZZZ/) {;}
elsif ($curLine =~ s/\bwhat is\b/\@XXX what is \@YYY what's \@ZZZ/) {;}
elsif ($curLine =~ s/\b@greetings\b/\@XXX @greatings \@YYY @hello \@ZZZ/) {;}
elsif ($curLine =~ s/\bgreetings\b/\@XXX greatings \@YYY @hello \@ZZZ/) {;}
and then run the manual-files through that, and THEN, via EMACS and
its QUERY REPLACE, via:
FROM-REGEXP: "@XXX \(.*\) @YYY \(.*\) @ZZZ"
TO-STRING: "\2"
simply say y or n to each one, running through the
manual by now filled with stuff @XXX foo @YYY fubar @ZZZ in the
middle of sentences, etc.
---
What I want to do is set it up so I can maybe do more
than just one subst per line; but that means I better
watch out for nested substs.
I thought that maybe PTX would help me figure out which
strings of from and to words COULD have that ill effect, and
that for THOSE, I'd have to do it via an "elsif" series, so that
one and only one got done -- but that there'd be some "safe"
ones, that could get done WITHOUT the elsif logic, that is,
REGARDLESS of whether ANY OTHER subst had gotten done
on the same line.
(There is also the issue of what ORDER in which to
apply these substs -- I guess "longest first" isn't a bad
rule, for those sets with similar words.)
--- back to ptx:
But ptx seems to concatenate the separate lines together,
as if it were one long sentence, and then work on that.
I am also confused why although MOST words appear in
that alpha-sorted column, SOME of them DON'T -- they appear
to the left or right side on other lines, but never
alpha-sorted.
Any ideas, suggestions, tutorials, doc -- ANYTHING?
If there's no decent tutorial doc on ptx, I guess we'd
better develop it here, in this newsgroup, and then
publicize it somehow, ie that it exists.
I volunteer to put the various responses together into
something hopefully making sense -- that is, once I
understand it myself!
Especially useful would nifty tricks and applications with it.
Maybe we could make a gnu "info" file for it?
Thanks!
David
------------------------------
Date: Sun, 7 Mar 1999 23:16:30 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: newbie problem with *s (regular expression matching in win32)
Message-Id: <1dobkax.95ic7m1kdw8oxN@bay3-379.quincy.ziplink.net>
Scott Carpenter <Sorry@No.Reply.Due.To.Spam> wrote:
> In "Learning Perl" (The llama book), there is an exercise in chapter 7
> that says to create a regular expression that matches "any number of
> backslashes followed by any number of asterisks (any number might be
> zero)"
>
> I thought to use /\\*\**/ which is also the answer given in the book.
> When I tested it I didn't quite get what I expected:
>
> $_ = 'fff\\\\****';
> /\\*\**/;
> print $&;
>
> There wasn't a match. The f's are just thrown in as filler.
Yes, there was. The f's are what is throwing you off.
$_ = 'fff\\\\****';
if (/\\*\**/g) { # /g so pos() doesn't get reset
print "Matched '$&', pos() is ", pos($_), "\n";
}
__END__
Matched '', pos() is 0
There are zero slashes and zero asterisks at the beginning of the
string, so that's what is matched.
There's nothing to force the regex engine to look later in the string.
$_ = '\\\\****';
if (/\\*\**/g) { # /g so pos() doesn't get reset
print "Matched '$&', pos() is ", pos($_), "\n";
}
__END__
Matched '\\****', pos() is 6
Now there are two backslashes and four asterisks at the beginning of the
string, so that's what is matched.
HTH!
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 08 Mar 1999 04:45:52 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: newbie problem with *s (regular expression matching in win32)
Message-Id: <36E357E9.B91DB472@home.com>
Scott Carpenter wrote:
>
> In "Learning Perl" (The llama book), there is an exercise in chapter 7
> that says to create a regular expression that matches "any number of
> backslashes followed by any number of asterisks (any number might be
> zero)"
>
> I thought to use /\\*\**/ which is also the answer given in the book.
> When I tested it I didn't quite get what I expected:
>
> $_ = 'fff\\\\****';
> /\\*\**/;
> print $&;
>
> There wasn't a match. The f's are just thrown in as filler.
There was a match. It matched the null string before the first 'f'. If
there was no match then $& would be undefined and you would get a use of
uninitialized value warning. At least you would if using -w, which you
should.
In general you should alway test the success of matches.
print "matched '$&'\n" if /\\*\**/;
>
> If I tried /\\+\*+/ the print statement returned the expected match:
> \\****
>
> I took out the f's, and then suddenly it worked correctly with the *
> pattern. It also didn't matter if there were f's or a's or my name,
> scott, at the beginning of the string -- the * grouping pattern
> didn't work.
When you allow the pattern to match nothing it will do just that if
that's the first thing it comes upon. Although the * is greedy, it does
not mean to find the longest match in the string. It just means to
match as much as possible as early in the string as possible. Or
rather, the regex engine will start at the left of the string and try to
match from there. If it can't it will move one character to the right
and try again.
So /\\*\**/ can match as early as before the first 'f' and the most it
can match there is the null string. But the earliest /\\+\*+/ can match
is after the f's (since it is looking for at least one '\') and the most
it will match there is '\\\\****'.
Read the section on Backtracking in perlre.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sun, 07 Mar 1999 21:15:52 -0700
From: Lynn Wilson <lynn@swcp.com>
Subject: OLE, DBI-ODBC conflicts?
Message-Id: <36E34EF8.FB5E4352@swcp.com>
I've written a rather large body of perl code that opens an Excel workbook and
manipulates it. I've also written a DBI-ODBC interface to an Access database.
If I open the spreadsheet first and leave it open, the 'connect' operator with
the ODBC fails. It works fine if I close the OLE prior to opening the ODBC.
I'm running perl, version 5.005_02 built for MSWin32-x86-object (ActiveState)
on a WinNT sp4 machine. Is this normal behavior? If I rewrite the spreadsheet
code to use DBI-ODBC techniques, will I be able to use both objects
simultaneously?
Suggestions welcomed...
Lynn
lynn@swcp.com
------------------------------
Date: Sun, 07 Mar 1999 21:31:36 -0700
From: Thomas Lehrer <tlehrer@spectrumdynamic.com>
Subject: Re: perl targeted url redirection.
Message-Id: <36E352A8.ECD5F597@spectrumdynamic.com>
I'm sorry that I mistook this for a perl question. I spent a couple hours
trying to figure out why this wasn't working. I'm relatively new to the
perl/cgi programming arena, so I guess I got a little anxious and jumped to a
conclusion that it was a problem with perl.
btw Thank you for the advice.
------------------------------
Date: Mon, 8 Mar 1999 00:58:03 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: perlcc
Message-Id: <1dobp2n.ppe78c1oxc3n2N@bay3-379.quincy.ziplink.net>
Mark D. Sholund <msholund@bigfoot.com> wrote:
> I have written some scripts which I've tried to compile with perlcc on a
> Linux system. When I run the resultant executable, I keep getting an
> error saying that I am trying to modify a read-only value on line #...
> The line in question consists of
>
> while (<STDIN>){
>
> Does anybody have any idea about why I get this error?
Do you get the same error when you run the original, uncompiled script
with perl?
Here's one way to get that error:
foreach ('a', 'b', 'c') {
while (<STDIN>) {
print "ok!\n";
}
}
__END__
Modification of a read-only value attempted at - line 5.
foreach aliases the iterator to each element of the list, so that
modifying the iterator variable also modifies the original element.
--
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
perl -e'for(sort keys%main::){print if $$_ eq 1}
' -s -- -' Just' -' another ' -'Perl ' -'hacker
' http://www.ziplink.net/~rjk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: Mon, 08 Mar 1999 00:35:32 -0500
From: Jihad Battikha <jbattikha@highsynth.com>
Subject: Re: POST bug in latest LWP/libwww (1.82) - clarification
Message-Id: <36E361A3.E3DB1A49@highsynth.com>
Regarding my recent posting about the possible POST/redirect bug in the
latest LWP, I did a poor job of indicating the specific versions of
libwww:
libwww-perl-5.10 works fine
libwww-perl-5.36 has the problem
The versions of Perl I've tested this problem with are Perl for Win32
builds 509 and 513. Platforms tested on are Windows95, Windows98, and
WindowsNT SP3.
I'm too thick to track the granular differences between the 2
distributions, I just know that one works and the other doesn't.
libwww-perl-5.36 is currently being distributed with the latest releases
from ActiveState so reverting to an older bundle to avoid the problem
becomes annoying.
~jihad
--
<>>>===========================================================<<<>
Jihad Battikha <jbattikha@highsynth.com> http://www.highsynth.com
-=< graphics . 2d/3d animation . illustration . web authoring >=-
<>>>===========================================================<<<>
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html.
<>>>===========================================================<<<>
------------------------------
Date: Mon, 08 Mar 1999 05:37:16 GMT
From: mike808@mo.net
Subject: Re: Printing to multiple Filehandles simultaneously
Message-Id: <7bvnmb$9k4$1@nnrp1.dejanews.com>
There is, sort of. CGI::LogCarp. It writes output to multiple streams for
logging, debugging, and error handling of CGI apps. However, it's not quite
as to-the-point as your solution for the reader's question. Yours is more
elegant, I might add. I've been scared of 'tie' up to now. It does magic I
haven't taken the time to understand and grok fully.
In article <F84o3D.JD5@world.std.com>,
aml@world.std.com (Andrew M. Langmead) wrote:
> Gavin Sherlock <sherlock@genome.stanford.edu> writes:
> >for ($i=0; $i<100; $i++){
> > print {$file[$i]} "Stuff to print";
> >}
> >but is there a way of omitting the for loop
> You could hide the loop in a module that implements perl's tied
> filehandle interface:
> tie *ALL, MultiHandle, *STDOUT, *STDOUT or die;
> print *ALL "Stuff to print";
> with an implementation of MultiHandle that would look like this:
> package MultiHandle;
> sub TIEHANDLE {
> my ($class, @files) = @_;
> bless [ @files ], $class;
> }
> sub PRINT {
> my ($self, @args) = @_;
> for my $handle (@$self) {
> print $handle @args;
> }
> }
> I thought there was a CPAN module that did this, but I can't find it
> now.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 08 Mar 1999 04:47:46 GMT
From: Ken Irving <jkirving@mosquitonet.com>
Subject: Re: Serial Communications using Perl
Message-Id: <7bvkpg$7b3$1@nnrp1.dejanews.com>
In article <7bu7ib$319$1@nnrp1.dejanews.com>,
wrnelson@my-dejanews.com wrote:
> I am just starting on a project that will use a computer to control
> electrical devices. I am most familiar with Perl, so I'd like to use it if
> possible. Also, I'd like to use an I80X86 running Linux if possible. Is
> there a way to handle serial communication under perl? Where could I find
> more information on this? Thanks!
A high level option would be to use the Expect module and cu.
Ken
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 05 Mar 1999 09:24:49 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
To: Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com>
Subject: Re: SID identification for CDs...
Message-Id: <36E01361.68CD66C6@mail.cor.epa.gov>
Ketan Patel wrote:
>
> I'm not sure if this is the right place to ask this question, but I
> figure if I need it for a perl script, perhaps someone else did too...
I guess I'd better be the one to tell you. I'm sorry, but this is
*not* the right ng for this sort of question. You'll have to go ask
in a group dedicated music CD's. I hope you have good luck when you
find the right ng.
Now... When you find out how to read the unique SID and you write that
Perl program, and you hit a snag, then come on back here and ask.
If you didn't have your e-mail address munged, you would have gotten
an e-mail from gnat giving you a host of helpful Perl hints that would
save you hours of your time and also help you produce a request to
this ng which would make everyone's life better.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
> Every book published has a unique identification number printed on it
> (ISBN number) and this is the number used by sites such as Amazon and
> others to keep track of their books...
>
> It seems as though music CDs also have a unique number (SID number), and
> sites such as CDNow and Amazon also use this number to keep track of
> items...
>
> Finding a book's ISBN number is as simple as looking at the back cover,
> but does anyone know how to find out a CD's SID number? Is it related
> to the UPC code in any way? Any ideas?
>
> Thanks!
------------------------------
Date: 7 Mar 1999 23:20:30 -0500
From: kimoto@lightlink.com (Paul Kimoto)
Subject: Re: suid
Message-Id: <slrn7e6k0e.2r1.kimoto@perdita.antigonus.net>
In article <Pine.SUN.3.96.990307165732.4851A-100000@light.lightlink.com>,
Homer Wilson Smith wrote:
> proggy.c
> proggy* which is set uid root chmod 4710
> proggy.pl
>
> proggy.c calls proggy.pl and is compiled into proggy*
>
> Proggy.pl contains the usual lines necessary for secure
> running of suid scripts. It also contains.
>
> system ("cp file1 file2");
>
> This works fine.
Here the argument contains no shell metacharacters, and so is split into
words and passed to execvp(3).
> However
> system ("id && cp file1 file2");
> system ("id ; cp file1 file2");
Here the argument contains shell metacharacters, so is passed to
"/bin/sh -c" (see "perldoc -f exec").
Now, the man page for bash(1) (assuming, as usual, that it's the
Linux /bin/sh) says
bash> If the shell is started with the effective user (group) id
bash> not equal to the real user (group) id, and the -p option
bash> is not supplied, no startup files are read, shell func-
bash> tions are not inherited from the environment, the SHEL-
bash> LOPTS variable, if it appears in the environment, is
bash> ignored, and the effective user id is set to the real user
bash> id. If the -p option is supplied at invocation, the
bash> startup behavior is the same, but the effective user id is
bash> not reset.
There's your problem: bash is resetting euid to the real uid.
--
Paul Kimoto <kimoto@lightlink.com>
------------------------------
Date: Mon, 08 Mar 1999 12:13:09 -0800
From: lufan@hotmail.com
Subject: Re: Verifying URL's with perl.
Message-Id: <36E42F55.61AA@hotmail.com>
Eric Bohlman wrote:
>
> chames@my-dejanews.com wrote:
> : In article <7bpk52$f0m$1@nnrp1.dejanews.com>,
> : sidney_roberts@my-dejanews.com wrote:
> : > I have a list of url's and I need to check three things. First, did I get
> : > a response back from the server. Second, was the file found or not? Third
> : > (and this is important), was the response that I got back binary or text
> : > data?
>
> : I'd use the following:
>
> : use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua -> timeout(10);
> : #in seconds $ua -> max_size(1); # this should be max size in kB of document
> : (text,img, whatever) - but it doesn't work correctly :-(
>
> : my $req = HTTP::Request->new('HEAD',"$url");
>
> : if ($res->is_success) { # because not only 200 is ok
> : #print "ok $i - ".$res->code." \n";
> : }
> : else {
> : #print "Error: " . $res->status_line . "\n";
> : }
>
> This can result in false alarms because some servers can be configured to
> refuse HEAD requests. Therefore, if the HEAD request fails it's a good
> idea to try a GET request before giving up.
QUESTION: How can I get to know the file size, last update date, etc ??
thanks in advance ;)))
------------------------------
Date: Mon, 08 Mar 1999 04:13:29 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: What's the best way to store uncontrolled data?
Message-Id: <36e34de2.35735503@news.enteract.com>
I have a perl script that will store data people input from command
line questions. Each person's data will be stored in some format.
The problem is I can't do it comma delimited because some of the
questions are open ended, so they can put basically anything they want
in there, which could screw up any reading of the data. How is the
best way to store data in this case? Any/all possibilities welcome.
Thanks.
Steve
Remove nospam when responding through email.
------------------------------
Date: 8 Mar 1999 04:26:25 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: What's the best way to store uncontrolled data?
Message-Id: <slrn7e6kbh.fbu.sholden@pgrad.cs.usyd.edu.au>
On Mon, 08 Mar 1999 04:13:29 GMT, Steve . <syarbrou@nospam.enteract.com> wrote:
>I have a perl script that will store data people input from command
>line questions. Each person's data will be stored in some format.
>The problem is I can't do it comma delimited because some of the
>questions are open ended, so they can put basically anything they want
>in there, which could screw up any reading of the data. How is the
>best way to store data in this case? Any/all possibilities welcome.
>Thanks.
It depends on how you are going to use the data. If it is only used by other
perl scripts, then the simplest method is use Data::Dumper or Storable.
I like Data::Dumper even though it is significantly slower, since it
outputs the data in a nice readable format that is easy for me to
edit in a text editor if need be. You read it back in with 'do' or
'eval' depending upon circumstances.
A very simple format to parse is to use something similar to mail
headers (RFC822 I think). You might have to encode newlines though.
--
Sam
In case you hadn't noticed, Perl is not big on originality.
--Larry Wall
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5084
**************************************