[9482] in Perl-Users-Digest
Perl-Users Digest, Issue: 3075 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 7 00:07:29 1998
Date: Mon, 6 Jul 98 21:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 6 Jul 1998 Volume: 8 Number: 3075
Today's topics:
Re: 5.004_69 win32 Glob problem <m.morley@NOSPAM.worldnet.att.net>
Re: Accessing UDB from perl? <eatonn@msn.com>
Array Size <azman@bnex.com>
Re: Array Size (Bob Trieger)
Re: Array Size <ljz@asfast.com>
Re: Array Size <tchrist@mox.perl.com>
Re: Array Size (Jeremy D. Zawodny)
Re: Array Size (Jeremy D. Zawodny)
Re: Array Size <danboo@negia.net>
Re: Array Size (Martien Verbruggen)
Re: Array Size (Martien Verbruggen)
Re: better way of getting the last modified file? <rra@stanford.edu>
Re: better way of getting the last modified file? <rra@stanford.edu>
Copying a file from one server to another <haq@dezine.net>
Re: Copying a file from one server to another (brian d foy)
Dynamic loading of perl modules embeded in C ddieder@my-dejanews.com
Re: flock() on Linux (Chip Salzenberg)
Re: flock() on Linux <tchrist@mox.perl.com>
Re: Help: testing cgi's locally (John Hocking)
How do I write data to a remote server? (John Hocking)
How to print the contents obtained by Net::FTP on line? userjeff@my-dejanews.com
Re: how to write to a root owned file using setuid in p (Martien Verbruggen)
Re: HTTP connections WITHOUT the libwww module? (Michael J Gebis)
Password script (Bee Pee)
Re: Password script (Martien Verbruggen)
Re: Perl and Files userjeff@my-dejanews.com
Perl Hack (off-topic crossposts), was: ISP Dialup lines (Clinton Pierce)
Re: Perl Modules for NT (Bob Trieger)
Re: POSIX/Perl question ? <spamsux-tex@habit.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 06 Jul 1998 22:39:16 -0400
From: Matthew Morley <m.morley@NOSPAM.worldnet.att.net>
To: Dominic Dunlop <domo@tcp.ip.lu>
Subject: Re: 5.004_69 win32 Glob problem
Message-Id: <6ns1on$k6r@bgtnsc02.worldnet.att.net>
Dominic,
Thanks, good suggestion. I implemented my own recursive function
that returns the same values that glob("$dir") does called
"myglob($dir, $depth, ...)" that looks pretty ugly but works well.
I count the "/" characters in a string using "tr" to keep track of the
recursion depth. Its amazing all the work (<*/*/*/*-*>) used do!
I heard somewhere that glob() is pretty inefficient so prehaps this
is a blessing in disguise. I also filed a trouble report to ActiveState
which they are probably expecting anyway.
> > Is there a more efficient way to return a list of subdirectories with
> > the 4-th level subdirectory matching in "*-*" (star dash star)?
> > without using globing?
>
> Personally, I'd use the File::Find module to select the target files.
> Unfortunately, it doesn't currently have a built-in emulation of GNU
> find's -maxdepth and -mindepth options, which would make your life
> really easy, but you should be able to code these yourself pretty
> easily. If File::Find works for you, that's great. But please don't
> let that stop you from submitting a bug report.
> --
> Dominic Dunlop
--
Matthew Morley
------------------------------
Date: Mon, 6 Jul 1998 21:55:23 -0500
From: "Nathan Eaton" <eatonn@msn.com>
Subject: Re: Accessing UDB from perl?
Message-Id: <uEKLjLVq9GA.285@upnetnews03>
Hemant Shah wrote in message <6nqs5r$kd$1@flood.xnet.com>...
>
>Folks,
>
> Is there a perl library/module I can use to access DB2 UDB on AIX?
I've been looking into this, and as best I can tell there is not. I've come
to the conclusion that the only way I'll be able to get something that works
is to either use DBD::ODBC with CLI, or talk the guy at IBM in Austin who
wrote DBD::DB2 (for DB2 common server version 2.x) into coming out with
something for UDB. I don't have his address here at the house, but I'll
look for it at work tomorrow.
------------------------------
Date: Mon, 06 Jul 1998 10:37:11 +0800
From: Azman Shariff <azman@bnex.com>
Subject: Array Size
Message-Id: <35A03857.173436FB@bnex.com>
I am no sure if this is asked before but after going thru the whole
newsgroup, I have not found an question based on this.
Q : How do i determine the size of an array as in how many elements
present @array[0] ... @array[?]
Azman
------------------------------
Date: Tue, 07 Jul 1998 02:35:50 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Array Size
Message-Id: <6ns1ma$npq$2@ligarius.ultra.net>
[ posted and mailed ]
Azman Shariff <azman@bnex.com> wrote:
-> I am no sure if this is asked before but after going thru the whole
-> newsgroup, I have not found an question based on this.
->
-> Q : How do i determine the size of an array as in how many elements
-> present @array[0] ... @array[?]
Please pick up a copy of `Learning Perl' or `Programming Perl'. All of the
questions you have asked in the last day or so are answered in both. If you
are strapped for cash, the answers can also be found in the FREE documentation
and FAQs that came with your perl distribution.
$#array will give you the last element.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: 06 Jul 1998 22:52:10 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Array Size
Message-Id: <ltsoke9xut.fsf@asfast.com>
Azman Shariff <azman@bnex.com> writes:
> I am no sure if this is asked before but after going thru the whole
> newsgroup, I have not found an question based on this.
>
> Q : How do i determine the size of an array as in how many elements
> present @array[0] ... @array[?]
Evaluating a list or an array in a scalar context will return the
number of elements. For example:
$a = @array;
After this statement, `$a' will contain an integer representing the
number of elements in `@array'.
There are times in Perl where something might mistakenly be thought to
be evaluated in a scalar context, when in actuality, it isn't. To
ensure that you get a scalar context when you really want one, you can
do this:
$a = scalar(@array);
Again, `$a' will contain an integer representing the number of
elements in `@array'.
In my Perl programs, I tend to use the `scalar' operator whenever I
want to get the number of elements in a list or an array. This is
often redundant, but it makes it clear to those people in the future
who might be trying to support my code that I'm intentionally wanting
a scalar context. Therefore, I recommend the use of `scalar' in cases
such as this.
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 7 Jul 1998 02:59:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Array Size
Message-Id: <6ns2vd$7i3$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Lloyd Zusman <ljz@asfast.com> writes:
:Evaluating a list or an array in a scalar context will return the
:number of elements.
No, sir. Not for the "list" notion. There *are* no lists
in scalar context.
--tom
--
You are the sponsor for the account andrew (Andrew Hume).
------------------------------
Date: 06 Jul 1998 23:01:53 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Array Size
Message-Id: <m3k95qxt26.fsf@peach.z.org>
sowmaster@juicepigs.com (Bob Trieger) writes:
> $#array will give you the last element.
The subscript of the last element.
$array[$#array];
will give you the last element.
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: 06 Jul 1998 22:57:26 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
To: azman@bnex.com
Subject: Re: Array Size
Message-Id: <m3r9zyxt9l.fsf@peach.z.org>
Azman Shariff <azman@bnex.com> writes:
> I am no sure if this is asked before but after going thru the whole
> newsgroup, I have not found an question based on this.
>
> Q : How do i determine the size of an array as in how many elements
> present @array[0] ... @array[?]
$arr_size = $#array + 1;
Of course, there's more than one way to do it.
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Mon, 06 Jul 1998 23:20:51 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Array Size
Message-Id: <35A19413.AF2D5CD3@negia.net>
Jeremy D. Zawodny wrote:
>
> Azman Shariff <azman@bnex.com> writes:
>
> > I am no sure if this is asked before but after going thru the whole
> > newsgroup, I have not found an question based on this.
> >
> > Q : How do i determine the size of an array as in how many elements
> > present @array[0] ... @array[?]
>
> $arr_size = $#array + 1;
>
> Of course, there's more than one way to do it.
whenever i see this i think it warrants an explanation that obtaining
the size in this manner, though typically safe, is coincidental. i
know it's rare to see code that actually modifies $[, but i think it's
important to note that a more consistent method would be:
$arr_size = $#array + 1 - $[;
which of course is uglier and more cumbersome than the very clean:
$arr_size = @array;
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: 7 Jul 1998 03:26:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Array Size
Message-Id: <6ns4gi$if0$4@comdyn.comdyn.com.au>
In article <35A03857.173436FB@bnex.com>,
Azman Shariff <azman@bnex.com> writes:
> I am no sure if this is asked before but after going thru the whole
> newsgroup, I have not found an question based on this.
So instead of doing some work yourself, you decided that you would let
us do the work? If you don't want to read all messages, just refer to
the perl faq and the perl documentation. If you then can't find it,
use a news archive line dejanews to find out if it has been asked
before. If you still can't find it, ask here. What makes you think we
don't mind doing your work for you?
> Q : How do i determine the size of an array as in how many elements
> present @array[0] ... @array[?]
This is in the perl documentation, in one of the documents that you
really _should_ read before even attempting programming in perl.
# perldoc perldata
[snip]
$#days # the last index of array @days
[snip]
If you evaluate a named array in a scalar context, it
returns the length of the array. (Note that this is not
true of lists, which return the last value, like the C comma
operator.) The following is always true:
[snip]
You see, if you had just read a few documentation pages, you would
have known.
Basic set of pages to read:
# perldoc perl
This will list all documentation, in an order which is roughly the
same as my list:
# perldoc perlsyn
# perldoc perldata
# perldoc perlop
# perldoc perlfunc
And of course:
# perldoc perlfaq
and related pages.
Slightly more advanced, but still basic knowledge:
# perldoc perlsub
# perldoc perlvar
# perldoc perlsub
# perldoc perlre
# perldoc perlmodlib
You can also buy a good book. http://www.perl.com has a good list
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I'm just very selective about what I
Commercial Dynamics Pty. Ltd. | accept as reality - Calvin
NSW, Australia |
------------------------------
Date: 7 Jul 1998 03:28:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Array Size
Message-Id: <6ns4lc$if0$5@comdyn.comdyn.com.au>
In article <ltsoke9xut.fsf@asfast.com>,
Lloyd Zusman <ljz@asfast.com> writes:
> Evaluating a list or an array in a scalar context will return the
> number of elements. For example:
# perldoc perldata
[snip]
If you evaluate a named array in a scalar context, it
returns the length of the array. (Note that this is not
true of lists, which return the last value, like the C comma
operator.)
[snip]
I recall someone here saying (you can guess who): 'There is no such
thing as a list in a scalar context'.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd. | crops where there ain't no crops.
NSW, Australia |
------------------------------
Date: 06 Jul 1998 20:14:13 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: better way of getting the last modified file?
Message-Id: <m3r9zyxshm.fsf@windlord.Stanford.EDU>
Larry Rosler <lr@hpl.hp.com> writes:
> Can the application not intercept $SIG{'__DIE__'} and $SIG{'__WARN__'}
> and send an appropriate message to its maintainer using sendmail (or an
> equivalent on Windows/DOS systems)?
Any software I'm using that I find automatically sending mail to *anyone*
without my explicit permission will be shot at dawn. No exceptions.
*Way* too much potential for abuse.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 06 Jul 1998 20:18:04 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: better way of getting the last modified file?
Message-Id: <m3ogv2xsb7.fsf@windlord.Stanford.EDU>
Martin Gregory <mgregory@asc.sps.mot.com> writes:
> Russ Allbery <rra@stanford.edu> writes:
>> Yup. You need to actually check your code against new releases of Perl
>> and against test suites, and that should be done with -w. But once
>> your code is out of your hands and in the hands of people who can't fix
>> it when they see warnings, there's no reason for the warnings.
> 1) What makes you think anyone can't fix it?
That isn't what I said. I said that there isn't any reason for the
warnings in the hands of people who can't fix it. So you're catering to
maybe 5% of your install base, most of the time, and the other 95% get
very confused.
I've had this happen with production code widely deployed at Stanford.
When we went to Perl 5.004 and it started generating warnings for
duplicate my declarations, the effect was several hundred people
repeatedly redoing what they were trying to do even though it had worked
successfully because they thought it was broken. Ugh.
> 2) How are you going to narrow down the problem 'over the phone' (via
> email etc) when they say 'This program doesn't do anything any
> more' ... wouldn't 'use of uninitialised variable at line xxx' be
> much more helpful?
Warnings in Perl most frequently don't point at things just breaking, they
point at either odd boundary cases not being handled correctly or at
something in Perl changing (like the deprecation of a keyword). In the
latter case, I can test and solve this myself just by testing my code
against a new version of Perl before releasing a new version of Perl for
it to run under.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Mon, 06 Jul 1998 20:51:47 -0500
From: Usman Ul Haq <haq@dezine.net>
Subject: Copying a file from one server to another
Message-Id: <35A17F33.41C6@dezine.net>
Hello,
Is anyone outhere have a perl script that copies files from one server
to another.
Thanks.
------------------------------
Date: Mon, 06 Jul 1998 22:27:24 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Copying a file from one server to another
Message-Id: <comdog-ya02408000R0607982227240001@news.panix.com>
Keywords: from just another new york perl hacker
In article <35A17F33.41C6@dezine.net>, Usman Ul Haq <haq@dezine.net> posted:
>Is anyone outhere have a perl script that copies files from one server
>to another.
i do (but probably not in the way that you want) can you elaborate?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers Travel Deals! <URL:http://www.pm.org/travel.html>
------------------------------
Date: Tue, 07 Jul 1998 01:18:40 GMT
From: ddieder@my-dejanews.com
Subject: Dynamic loading of perl modules embeded in C
Message-Id: <6nrt1f$o5g$1@nnrp1.dejanews.com>
I've been working a lot with embeded perl programs inside of C, with a good
deal of success. The problem is this: I am trying to use the Safe.pm
module. Safe.pm calls Opcode.pm, which wants to dynamically load some object
code apparently. This works nicely in my normal perl environment. But
inside the C program, it fails, complaining about how its version of perl
doesn't support dynamic loading. I did compile the C program with
perl -MExtUtils::Embed -e ccopts, and linked with its linking version.
I'm somewhat at a loss with this issue. I've tried various dynamic loading
flags such as -fPIC and the like, with no luck. Any help would be
appreciated. Thanks in advance,
Cheers.
-Dana
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 07 Jul 1998 00:00:18 GMT
From: chip@pobox.com (Chip Salzenberg)
Subject: Re: flock() on Linux
Message-Id: <6nrohb$kf$1@cyprus.atlantic.net>
According to fdc@cliwe.ping.de (Frank D. Cringle):
>You need to replace LOCK_EX+LOCK_NB with LOCK_EX|LOCK_NB. You think
>those 2 expressions should be identical (assuming there are no
>overlapping bits)? Me too. It isn't the case though.
Since + is a unary op, "+LOCK_NB" is taken as an argument to the
subroutine call LOCK_EX, a la "&LOCK_EX(+LOCK_NB)".
Since | is not a unary op, that interpretation is impossible, so the
code works like you'd expect: "&LOCK_EX() | &LOCK_NB()".
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"I brought the atom bomb. I think it's a good time to use it." //MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 7 Jul 1998 03:51:53 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: flock() on Linux
Message-Id: <6ns60p$b21$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
chip@pobox.com (Chip Salzenberg) writes:
:Since + is a unary op, "+LOCK_NB" is taken as an argument to the
:subroutine call LOCK_EX, a la "&LOCK_EX(+LOCK_NB)".
Which is a bug. Those should be void proto'd.
--tom
--
"Hey, did you hear Stallman has replaced /vmunix with /vmunix.el? Now
he can finally have the whole O/S built-in to his editor like he always wanted.
------------------------------
Date: Tue, 07 Jul 1998 03:29:21 GMT
From: joker@inlink.com (John Hocking)
Subject: Re: Help: testing cgi's locally
Message-Id: <35a39401.279887087@news.inlink.com>
On Sat, 04 Jul 1998 17:38:48 GMT, nasty-eye@nasty-eye.com wrote:
>I have Perl Win32 in my computer, and I thought that I could change
>some code(the path to perl, etc) and execute the cgi, but when I call
>the cgi from the form in the browser nothing happens.(I know the
>browser finds the cgi because I have no error message).
>
>I'd like to know if the only way to run cgi's is online.
>
Since you have perl for win32 running I suggest trying
Perl Builder from http://www.solutionsoft.com/perl.htm
Perl Builder is a powerful integrated development environment (IDE)
You can step through the execution of you code and watch the values of
variables.
Features as listed on there website
*****************************************************************************
The CGI Wizard allows anyone to create sophisticated CGI scripts
without programming. If you are a programmer, you can use the CGI
Wizard to automate many development tasks and then add your own code
as needed. The CGI Wizard will automatically generate code to:
Process any HTML form.
Validate user input.
Send email messages.
Generate HTML output.
The Integrated Editor/Debugger allows you to immediately test and
debug your code in an environment which is reminiscent of the top
visual development tools from Microsoft and Borland.
Standard debugging features: breakpoints, single step, watches, etc.
Color syntax highlighting.
"Tool Tip" variable inspection (just move the mouse over a variable
name to see its value).
Double click an error message to jump directly to the problem source
code line.
Desktop Testing/CGI Simulation: Test your scripts right within the
development environment! Perl Builder simulates CGI behavior visually
so you view the output from your script (HTML, email messages, etc.)
right on the desktop.
Supports both CGI and general purpose Perl development.
Fully Windowed (GUI) environment. You never need to work with the
command line.
Perl Builder requires Windows 95 or NT. No webserver is required; CGI
behavior is simulated on any desktop.
*******************************************************
There is a 30 day evalution copy available for download
Perl Buider can run your script (simulated) locally without a server.
One of the coolest features is for the non-programmer types (not me)
The Cgi-wizard will read in any HTML form and build a Customizible
Email Cgi script complete with data validtion
Give it a try
John Hocking
Sr. Programmer
StudioPointe Incorporated
http://www.studiopointe.com
mailto:johnh@studiopointe.com
------------------------------
Date: Tue, 07 Jul 1998 03:59:07 GMT
From: joker@inlink.com (John Hocking)
Subject: How do I write data to a remote server?
Message-Id: <35a198f3.281153252@news.inlink.com>
The company I work for creates CGI Administrative scripts that allow
our customer to add, update or remove content from their websites.
The scripts must write and modify data and html files.
The problem I am having is dealing with customers that host on remote
servers. It is often a hassle to get the ISP's to set up PERL 5
correctly. It seems every one of them is configured differently.
Solution: We created a server to host these Admin scripts.
the cleints have a secure login and all is great (almost)
Question: how do I write the data and Html files from our secure
server back to the clients remote server?
open(DATA,">http://www.remote.com/data/datafile.txt")
does not work even if the directory is given 777 permissions.
I can open files with relation addressing in perl but not absolute.
Is there a special syntax for it?
is there a way to use something like Net:FTP or similar to transfer
the files to the remote server?
Your help would be appreciated
John Hocking
Sr. Programmer
StudioPointe Incorporated
http://www.studiopointe.com
mailto:johnh@studiopointe.com
------------------------------
Date: Tue, 07 Jul 1998 02:06:08 GMT
From: userjeff@my-dejanews.com
Subject: How to print the contents obtained by Net::FTP on line?
Message-Id: <6nrvqg$u42$1@nnrp1.dejanews.com>
I would like to ask you a question on the Module:
Net::FTP. It might be trivial for experts.
Usual method for using Net::FTP is as follows.
use Net::FTP;
$ftp = Net::FTP->new("www.somewhere.com");
$ftp->login("ftp","me\@here.com");
$ftp->get("abc.txt");
$ftp->quit;
Then I have a file named abc.txt saved in my hard
disk. The thing I wish to do is I would like to
print the content of abc.txt on the screen without
saving it first into my hard disk. Is it possible?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 7 Jul 1998 02:56:22 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: how to write to a root owned file using setuid in perl?
Message-Id: <6ns2om$id3$1@comdyn.comdyn.com.au>
In article <6nrlmm$b95$1@nnrp1.dejanews.com>,
bthak@bascom.com writes:
> I need to be able to write to a file who is owned by root via web server
> (apache) running as apache. Can someone lead me in the right direction or
> point me where i can get good documentation on that.
# perldoc perlsec
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | You can't have everything, where would
Commercial Dynamics Pty. Ltd. | you put it?
NSW, Australia |
------------------------------
Date: 7 Jul 1998 01:58:30 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: HTTP connections WITHOUT the libwww module?
Message-Id: <6nrvc6$he0@mozo.cc.purdue.edu>
"David Thompson" <domainsource@usa.net> writes:
}Is it possible to retrieve a URL (and store for later parsing) WITHOUT
}using the LibWWW module?
You could probably open a socket to port 80 and grab the page
yourself. This solution is far from general--you can't possibly hope
to do things right in all cases without doing duplicating a huge
amount of work, and making a ton of mistakes in the process. However,
if enough things are constant, you could probably get a "good enough"
solution. (But don't fool yourself. This is a fragile solution, at
best.)
I haven't seen anyone mention calling an external utility (such as
lynx) to do the fetching for you, but this may also work for you.
(Hm...two answers of dubious quality and usefulness. Does this
actually get me any karma? I guess I'll see.)
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Tue, 07 Jul 1998 02:34:47 GMT
From: mail@moggy.com (Bee Pee)
Subject: Password script
Message-Id: <35a18936.1650343@dub-news.tpgi.com.au>
I'm lookin for a password script (free one preferrably) which will
protect a bunch of directories (not necessarily in the same root dir).
The real challenge is that I need it to work like this:
* User tries to open a file (or clicks on a link to the file) which is
in one of the protected directories.
* User is asked for Username/Password (popup screen or html page,
whatever).
* IF password is correct, user is transferred to the file they had
originally chosen to open... (as opposed to being transferred to a
default page in the protected dir).
I'd be really really grateful if someone out there could help with
this.
regards,
Brett
------------------------------
Date: 7 Jul 1998 03:29:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Password script
Message-Id: <6ns4nn$if0$6@comdyn.comdyn.com.au>
In article <35a18936.1650343@dub-news.tpgi.com.au>,
mail@moggy.com (Bee Pee) writes:
> I'm lookin for a password script (free one preferrably) which will
> protect a bunch of directories (not necessarily in the same root dir).
You also posted this to clp.modules. You should have crossposted. Go
there to see my answer.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: Tue, 07 Jul 1998 02:46:14 GMT
From: userjeff@my-dejanews.com
Subject: Re: Perl and Files
Message-Id: <6ns25m$27e$1@nnrp1.dejanews.com>
In article <6m14ff$lqs$1@nnrp1.dejanews.com>,
shawnporter@my-dejanews.com wrote:
>
> Jay,
>
> If you're having difficulty writing to a file from a CGI script written in
> Perl (or any language for that matter) you should make sure that the user
> running the CGI script has permission to write to that directory.
If not, is it possible to set such permission by the user?
>
> For more info, check:
> comp.infosystems.www.servers.*
> comp.infosystems.www.authoring.cgi
>
> --
> Shawn Porter
> http://www.rit.edu/~sjp6683
>
> --
> In article <6lvg0f$mio$1@chile.it.earthlink.net>,
> "Brent Verner" <REPLY_TO_damonbrent@earthlink.net> wrote:
> >
> >
> > Jay Hodges wrote in message <6lvdsn$mml$1@osh2.datasync.com>...
> > >I know this question will be answered easily, but here it goes. When
> > >writing a Perl cgi, how do I open a non-existent file for output?
> >
> > huh???
> >
> > output???
> >
> > if you open a file to write [ open (FILE, ">$filename"); ] the file will be
> > created automatically.
> >
> > i'm not sure what would happen if you opened a file to read [ open (FILE,
> > "<$filename"); ] that did not exist. { what could you possibly need to read
> > from a nonexistent file? }
> >
> > brent
> >
> > (remove 'REPLY_TO_' from address to email)
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 07 Jul 1998 01:04:58 GMT
From: cpierce1@deleteme.ford.com (Clinton Pierce)
Subject: Perl Hack (off-topic crossposts), was: ISP Dialup lines
Message-Id: <35a2bedb.506283786@wingate>
On 6 Jul 1998 18:49:59 GMT, zomboy <new.address@not.for.publication>
wrote:
>In alt.2600 Kira L. Brown <kbrown@neutralino.demon.com.uk> wrote:
>: In message <6nq80k$ja0$1@techftp.technion.ac.il>
>: s2845543@t2.technion.ac.il (Raz Uri ) wrote:
>
>:> Does anyone know how do ISPs (in general / any specific ISP) name
>:> their dialup lines ?
Pretty arbitrary. Mostly, something mnemonic so that seeing the
dialup line lookup in DNS they can reasonably track down where the
customer dialed in at. My old ISP wasn't too large so the lines were
cyc-port_.mica.net, where "_" was a port on a multiport dialup. For
my current ISP, Ameritech, there's a bit of regional information in
the name, and something to probably track down the specific dialup
POP.
>: You forgot an obhack, lamer.
>
>I had a good laugh over your post, because you flamed this guy for not having
>an obhack in a post that went to alt.hackers, but here in alt.2600 his post
>was one of the few, maybe one in a hundred, that was actually on topic.
>
>How come you people in the duct tape group are such snobs?
>
Not snobs. His post, because it contained no hack, was completely
off topic for alt.hackers. Crossposters beware, you've got to be
on-charter for all of the groups in your newsgroup line. He deserves
the title 'lamer' (small l) for the oversight. Or at least
clue-challenged.
Note the crosspost to comp.lang.perl.misc--what follows is on topic
there too, with an appropriate subject line change.
Obhack:
For a class I was teaching I needed some solutions to labwork the
students were doing. The solutions needed to be presentable in
HTML (because the class materials were marked up that way), but I
wanted them to contain valid perl programs. (So I could run them,
and be reasonably sure they worked and had no typos.)
Below is a sample. I can ALMOST get it to parse right in Bourne
shell. I'll leave that as an exercise for the reader. I'm keying
from memory, browsers reading news--beware:
<!-- Meaningless text, perl thinks its a glob >; # Perl sees this.
=item
close HTML comment started above. Browser doesnt see "item" -->
<H1>Any valid HTML here</H1>
<!-- =cut -->
# Works under Perl 5.004 Solaris 2.6
print "Hello, World!\n";
<!-- Another meaningless thingy >; # Perl sees a glob
=item
-->
<H1>More HTML Here</H1>
<!-- =cut -->
For me, this beats just including the HTML stuff in POD
comments because the POD comment headers don't show
up on the final page, this way.
Remove something from the address to reply in E-Mail.
Damned spammers...
------------------------------
Date: Tue, 07 Jul 1998 02:05:15 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Perl Modules for NT
Message-Id: <6nrvsv$n2b$1@ligarius.ultra.net>
[ posted and mailed ]
Don Mierzeski <donm@statsci.com> wrote:
-> Does anyone know if the Perl Modules exists for NT? In particular I'm
-> using the ctime module and the ftp module.
Perl modules exist! The majority don't exist for any certain platform, they
work on all. That is one of the reasons that most people use them.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Mon, 06 Jul 1998 18:31:01 +0800
From: Austin Schutz <spamsux-tex@habit.com>
Subject: Re: POSIX/Perl question ?
Message-Id: <35A0A765.3977@habit.com>
Dave Mencin wrote:
>
> I am trying to write a perl script that captures data from a series of
> serial devices. In order for these serial devices to "switch" from one
> to the other the expect DTR to drop as a hangup notification.
> I am using the POSIX module within Perl which clearly states that
> setting the baud rate of your open and selcted port(special file) to 0
> (or POSIX::B0 in this case) is meant to drop DTR. It does not do this in
> a consistent fashion - i.e it works under Solaris and not Linux. Does
> anybody know how I would begin to track down such a bug ?
I would first try stty 0 </dev/tty? >/dev/tty? and see if it
performs as you expect. I don't believe that it will. I had a similar
problem and ended up by using IO::Tty which performs whatever magic
was necessary to solve the problem I was having (trying to read an
EOF when closing a pty, similar sort of thing). You might try using
it on your serial port and seeing if it doesn't do the job for you.
Also, I think it's worth noting that flow control settings
like crtscts are non-POSIX.
Best of luck,
Austin
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3075
**************************************