[22071] in Perl-Users-Digest
Perl-Users Digest, Issue: 4293 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 20 00:06:09 2002
Date: Thu, 19 Dec 2002 21:05:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 19 Dec 2002 Volume: 10 Number: 4293
Today's topics:
Automate FTP access accounts? <netsharkserver@hotmail.com>
Re: Automate FTP access accounts? <xxxxxxx@xxx.xxx>
Re: Automate FTP access accounts? <jurgenex@hotmail.com>
Re: Automate FTP access accounts? <krahnj@acm.org>
Re: Automate FTP access accounts? <jurgenex@hotmail.com>
Can't find unicode character property definition <member@dbforums.com>
Re: comment on 2 or 4 spaces indentation <pkent77tea@yahoo.com.tea>
Re: DBI secure password <goldbb2@earthlink.net>
Re: DBI secure password (Tad McClellan)
Re: debug in cgi environment (indigoperl) ? <wsegrave@mindspring.com>
Don't understand the statement: 1; (Chris Charley)
Re: Don't understand the statement: 1; <ian@WINDOZEdigiserv.net>
Re: Don't understand the statement: 1; <mgjv@tradingpost.com.au>
enviroment variable set <happier_tj@hotmail.com>
Re: enviroment variable set <jurgenex@hotmail.com>
Re: extracting data from a column <goldbb2@earthlink.net>
Re: extracting data from a column <krahnj@acm.org>
Re: help: perl script to make all DNA sequence Nmers? ctcgag@hotmail.com
Re: help: perl script to make all DNA sequence Nmers? <goldbb2@earthlink.net>
HTAccess & Perl... <GPatnude@adelphia.net>
Re: HTAccess & Perl... <ian@WINDOZEdigiserv.net>
Re: HTAccess & Perl... <GPatnude@adelphia.net>
Re: HTAccess & Perl... <ian@WINDOZEdigiserv.net>
Re: Image creation/editing <willis3140@com.yahoo>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Dec 2002 01:04:14 GMT
From: "Netshark" <netsharkserver@hotmail.com>
Subject: Automate FTP access accounts?
Message-Id: <i0uM9.432525$QZ.67768@sccrnsc02>
Hello people.
I am trying to provide my visitors with free web space and want them to be
able to auto sign themselves up on the ftp server. My question is this. Is
there a scripting language that will allow the creation of an ftp account
automatically?
I have searched everywhere for the last 6 hours and cant seem to find
anything that will allow visitors to auto signup.
Any help is greatly appreciated.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.431 / Virus Database: 242 - Release Date: 12/17/2002
------------------------------
Date: Fri, 20 Dec 2002 01:41:52 GMT
From: "Brad" <xxxxxxx@xxx.xxx>
Subject: Re: Automate FTP access accounts?
Message-Id: <AzuM9.8771$I23.1001689@news1.east.cox.net>
"Netshark" <netsharkserver@hotmail.com> wrote in message
news:i0uM9.432525$QZ.67768@sccrnsc02...
> Hello people.
>
> I am trying to provide my visitors with free web space and want them to be
> able to auto sign themselves up on the ftp server. My question is this. Is
> there a scripting language that will allow the creation of an ftp account
> automatically?
>
> I have searched everywhere for the last 6 hours and cant seem to find
> anything that will allow visitors to auto signup.
>
> Any help is greatly appreciated.
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.431 / Virus Database: 242 - Release Date: 12/17/2002
>
>
This is not a perl question. Are you using Unix?, windows VMS or some other
OS? Would suggest asking that group as you will also need administrative
privileges or root access.
Brad
------------------------------
Date: Fri, 20 Dec 2002 03:00:45 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Automate FTP access accounts?
Message-Id: <xJvM9.58565$4W1.948@nwrddc02.gnilink.net>
Netshark wrote:
> Is there a scripting language that will allow the creation
> of an ftp account automatically?
A programming language that contains ftp as a language element?
I've never heard of such an animal. And there is I would question the mental
health of its designer because there is no way to include all the dozens and
dozens of networking protocol. And whenever there is a new protocol, is he
going to release a new version of the language? That's insane.
jue
------------------------------
Date: Fri, 20 Dec 2002 03:49:43 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Automate FTP access accounts?
Message-Id: <3E02930B.6ECF7F23@acm.org>
"Jürgen Exner" wrote:
>
> Netshark wrote:
> > Is there a scripting language that will allow the creation
> > of an ftp account automatically?
>
> A programming language that contains ftp as a language element?
> I've never heard of such an animal.
http://www.rebol.com/docs/core23/rebolcore-13.html#sect11.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Fri, 20 Dec 2002 03:58:40 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Automate FTP access accounts?
Message-Id: <QzwM9.26565$3t6.22344@nwrddc03.gnilink.net>
John W. Krahn wrote:
> "Jürgen Exner" wrote:
>>
>> Netshark wrote:
>>> Is there a scripting language that will allow the creation
>>> of an ftp account automatically?
>>
>> A programming language that contains ftp as a language element?
>> I've never heard of such an animal.
>
> http://www.rebol.com/docs/core23/rebolcore-13.html#sect11.
Wow, ok, never say never ;-)
jue
------------------------------
Date: Fri, 20 Dec 2002 03:49:38 +0000
From: blueice_sg7 <member@dbforums.com>
Subject: Can't find unicode character property definition
Message-Id: <2304305.1040356178@dbforums.com>
Hi,
I am attempting to install Image-Magick (version 5.5.2) on a Windows
98 machine.
After issuing the following command,
ppm install c:\ImageMagick\image-magick.ppd
I receive the error "Can't find unicode character property definition
via main->e or e.pl at unicode/IS/e.pl line 0".
Any ideas on how I should go about resolving this issue? I am using
ActivePerl version 5.6.1 build 633.
As I am very new to Perl, would greatly appreciate it if anyone could
offer any detailed advice. Thanks! :)
--
Posted via http://dbforums.com
------------------------------
Date: Thu, 19 Dec 2002 23:20:08 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: comment on 2 or 4 spaces indentation
Message-Id: <pkent77tea-D5192E.23042519122002@[10.1.1.10]>
In article <ba162549.0212182104.1de9265c@posting.google.com>,
kcline17@hotmail.com (Kevin Cline) wrote:
<snip>
> Four spaces is better because it discourages nesting control constructs
> too deeply. Two levels of nesting are enough for any one function.
:-) That has an air of all the wonderfully wrong things people have said
about computers over the years (640K; world market of 4 machines; why
would anyone want a computer at home; etc). I bet plenty of people will
now say "but just the other day I went to 4 levels of indent because the
logic of the function demanded it and it was Right in that context to
keep it all as one function" and similar. So I won't.
P, another smiley :-) just so it's obvious that in general I agree. It
is obvious isn't it? Hmm.
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Thu, 19 Dec 2002 20:25:49 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: DBI secure password
Message-Id: <3E02719D.52E6C34C@earthlink.net>
w i l l wrote:
>
> Hello,
>
> I'm writing a web app that uses DBI, I've read somewhere about
> securing the DB password by placing it in a file outside the web
> server so that crackers can't uuuummmm, crack your DB.
>
> What is a good way of implementing this?
[snip]
> require '/usr/home/user007/secure/thing'; # get file with pswd
>
> my $dbh = DBI->connect("$host", "$user", "$pass") || die $DBI::errstr;
I would suggest instead:
my ($dsn, $user, $pass) = do '/usr/home/user007/secure/thing.pl';
my $dbh = DBI->connect( $dsn, $user, $pass, {RaiseError => 1} )
or die "Error connecting to database: $DBI::errstr\n";
... other stuff here ....
And in /usr/home/user007/secure/thing.pl, you'd have:
use strict; use warnings;
my $dsn = 'DBI:mysql:dbname:host.ispr.com';
my $user = 'username';
my $pass = 'passwd';
($dsn, $user, $pass);
__END__
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: Thu, 19 Dec 2002 21:51:10 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: DBI secure password
Message-Id: <slrnb054te.20f.tadmc@magna.augustmail.com>
w i l l <willis3140@com.yahoo> wrote:
> my $dbh = DBI->connect("$host", "$user", "$pass") || die $DBI::errstr;
^ ^ ^ ^ ^ ^
perldoc -q vars
What's wrong with always quoting "$vars"?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 19 Dec 2002 22:28:36 -0600
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: debug in cgi environment (indigoperl) ?
Message-Id: <atu6dd$719$1@slb9.atl.mindspring.net>
"Peter Scott" <peter@PSDT.com> wrote in message
news:cLIJ9.146522$ea.2784964@news2.calgary.shaw.ca...
> In article <3DF6AA51.6401A926@attbi.com>,
> Eric Osman <os7man@attbi.com> writes:
> >in my case
> >the input is fields on a form from a web page.
> >
> >How the heck do you emulate such input in order to
> >test a perl file without the browser environment ?
>
> If you are in a situation where the suggestions given by others
> are insufficient (e.g., your program needs something on the
> server and you do not have a login to the server, or one of your
> input fields is a file upload), then about the only solution left
> for interactive debugging is to use ptkdb. That's provided the
> web server has X Window System client libraries for its Tk and
> you are using a machine that runs an X server, and various other
> caveats.
>
Hmm... Seems like overkill to me. ;-)
> This is probably only worth the effort if you really are unable to use
> command line testing.
>
ISTM that the OP's cgi environment, IndigoPerl, can be addressed as
"localhost"; so command line debugging and "on-line" debugging can be
pursued concurrently, unless a Win program, e.g., MS Word, and indeed,
Apache, has a lock on a file that is needed in the debugging process.
> (Hmm... I'd have thought that someone would have come up with a
> way to supply a value for a file upload field as a command line
> debugging input for CGI.pm by now, but I have been unable to find
> such a thing.)
Perhaps I'm missing your point, Pete, but
my $upload = param('upload');
appears to provide a way to get a value of 'upload' into a script that uses
CGI.pm. Now, from the command line,
perl upload.pl upload=filename
will pass the value of upload to $upload when the script is executed. Surely
you've seen this as a way to provide externally supplied data in named
parameters style.
Cheers.
Bill Segraves
------------------------------
Date: 19 Dec 2002 20:06:33 -0800
From: charley@pulsenet.com (Chris Charley)
Subject: Don't understand the statement: 1;
Message-Id: <4f7ed6d.0212192006.5e2ce6c2@posting.google.com>
Hello all
I'm hoping someone will be able to answer my question. I don't
understand the use of the statement:
1; (a one followed by a semicolon)
Its from "Programming Perl", 3rd Edition, on page 371, in the chapter
on Tied Variables. The code is:
package Tie::Counter;
sub FETCH { some code }
sub STORE { some code }
sub TIESCALAR {
some lines
of code
}
1; # if in module
I don't know what the 'if in module' comment means? What does the '1;'
statement do. I tried a search of this newsgroup's archives but had no
luck. Really appreciate it much if someone would explain this.
I am just learning Perl and have been checking this newsgroup
regularly and have found it helpful in my learning process.
Thanks in advance for any help with this question :-)
Chris
------------------------------
Date: Fri, 20 Dec 2002 04:10:15 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: Don't understand the statement: 1;
Message-Id: <c3650v8quafi23c83gank9k5rs4ume65pt@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on 19 Dec 2002 20:06:33 -0800,
charley@pulsenet.com (Chris Charley) managed to scribble:
> Hello all
> I'm hoping someone will be able to answer my question. I don't
> understand the use of the statement:
>
> 1; (a one followed by a semicolon)
>
> Its from "Programming Perl", 3rd Edition, on page 371, in the chapter
> on Tied Variables. The code is:
>
> package Tie::Counter;
> sub FETCH { some code }
> sub STORE { some code }
> sub TIESCALAR {
> some lines
> of code
> }
> 1; # if in module
>
> I don't know what the 'if in module' comment means? What does the
> '1;' statement do. I tried a search of this newsgroup's archives but
> had no luck. Really appreciate it much if someone would explain this.
>
> I am just learning Perl and have been checking this newsgroup
> regularly and have found it helpful in my learning process.
>
> Thanks in advance for any help with this question :-)
>
> Chris
AFAIK, it's a return value. Value of 1 would indicate 'true' hence "if
in module" (aka: true).
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPgKYkGfqtj251CDhEQJ4KQCfSwFfR61f21hvy5E3UgBI5nCYMtwAn0ZW
5EOSTRB4OFTvxv8Dn2GrxKwu
=+1ww
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Fri, 20 Dec 2002 04:16:56 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Don't understand the statement: 1;
Message-Id: <slrnb056hg.865.mgjv@verbruggen.comdyn.com.au>
On 19 Dec 2002 20:06:33 -0800,
Chris Charley <charley@pulsenet.com> wrote:
> package Tie::Counter;
> sub FETCH { some code }
> sub STORE { some code }
> sub TIESCALAR {
> some lines
> of code
> }
> 1; # if in module
>
> I don't know what the 'if in module' comment means? What does the '1;'
> statement do. I tried a search of this newsgroup's archives but had no
> luck. Really appreciate it much if someone would explain this.
Modules have to return a true value when loaded. Most commonly that
true value is generated by a 1; at the end of the module file although
I have seen (and used) others.
This is documented under require in the perlfunc documentation, and
also in the book from which you got this code fragment (I don't have
a copy handy, otherwise I'd find the page and chapter for you.)
Martien
--
|
Martien Verbruggen | That's not a lie, it's a terminological
Trading Post Australia | inexactitude.
|
------------------------------
Date: Fri, 20 Dec 2002 11:22:50 +0800
From: "happier" <happier_tj@hotmail.com>
Subject: enviroment variable set
Message-Id: <atu2em$2q2ep$1@ID-137585.news.dfncis.de>
I need to run my perl program in cron job and before running it must set
some enviroment variable,so I write a shell script as following.I add the
shell script into cron job.But
I get error messages when cron job finished.My perl program running
correctly if I set enviromen variable in command line.I make a EnvTest
variable to check if the shell script does work.After I run SetPerlEnv shell
script in command line,type env but found the EnvTest enviroment variable
doesn't exists.How can I set enviroment variable through shell script.
Thanks in advance
James Hou
## SetPerlEnv
## Initialize Environment Variables shell script
ORACLE_HOME=/usr/local/oracle
export ORACLE_HOME
PERL5LIB=/usr/local/nt1/lib
export PERL5LIB
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
EnvTest=/usr
export EnvTest
------------------------------
Date: Fri, 20 Dec 2002 03:39:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: enviroment variable set
Message-Id: <1iwM9.52379$_S2.31667@nwrddc01.gnilink.net>
happier wrote:
> I need to run my perl program in cron job and before running it must
> set some enviroment variable,so I write a shell script as following.I
> add the shell script into cron job.But
Why don't you set those env variables from your Perl script?
> I get error messages when cron job finished.My perl program running
> correctly if I set enviromen variable in command line.I make a EnvTest
> variable to check if the shell script does work.After I run
> SetPerlEnv shell script in command line,type env but found the
> EnvTest enviroment variable doesn't exists.How can I set enviroment
> variable through shell script.
If you want to do it the hard way please see the Unix FAQ.
You can find a reference in "perldoc -q environment", too.
jue
------------------------------
Date: Thu, 19 Dec 2002 21:00:45 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: extracting data from a column
Message-Id: <3E0279CD.EA42EEBB@earthlink.net>
Rick L. wrote:
>
> I have to weed through some log files for some specific data.
> Basically each log file is made up of 5 columns, all separated by
> spaces. Here is a short example of what the log files look like:
>
> number text text2 text3 http://testurl:80
> number text text2 text3 http://testurl2:443
>
> What I basically want to do is extract the URL from the 5th column,
> then strip off the "http://" and the ":80" or the ":443"
> I need to make this solution work for both linux and solaris systems.
> The few attempts I've made have failed. I can't seem to isolate that
> last column. Could anyone provide any help or point me in the right
> direction?
> I could easily do this with a shell script but I'm trying to teach
> myself perl so I want this script to be exclusively perl.
Assuming that all lines have both an http://, and a :port, then try this
one-liner:
perl -wlne 'print /\shttp://(\S*):\d+$/' file1 file2 ...
It can also be put into a .pl file, for convienence:
#!/usr/local/bin/perl -wln
print /\shttp://(\S*):\d+$/;
__END__
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: Fri, 20 Dec 2002 03:05:36 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: extracting data from a column
Message-Id: <3E0288B4.656550C5@acm.org>
Benjamin Goldberg wrote:
>
> Assuming that all lines have both an http://, and a :port, then try this
> one-liner:
>
> perl -wlne 'print /\shttp://(\S*):\d+$/' file1 file2 ...
^ ^^ ^
^ ^^ ^
> It can also be put into a .pl file, for convienence:
>
> #!/usr/local/bin/perl -wln
> print /\shttp://(\S*):\d+$/;
^ ^^ ^
^ ^^ ^
You're going to have to change those delimiters or escape the slashes. :-)
Another way to do it:
perl -lne'print+(split m!:(?://)?!)[-2]'
John
--
use Perl;
program
fulfillment
------------------------------
Date: 20 Dec 2002 01:39:22 GMT
From: ctcgag@hotmail.com
Subject: Re: help: perl script to make all DNA sequence Nmers?
Message-Id: <20021219203922.965$85@newsreader.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>
> Since I know how vec() works, I realized that this is because when vec
> treats a string as a vector of 32-bit numbers, it does so in a bigendian
> way.
I don't really know how vec works. I've played with a bit and it just
doesn't DWIM. So it was interesting figuring out how your corrected
code worked. I think I got it now, but apparently I don't know how
preincrement works, either. I assumed it did: evaluate
expression/variable, increment result and remember it, stuff result back
into expression/variable, return remembered result.
But by the fact that the preincrement on vec returns false on overflow, I
guess it goes something like: evaluate expression/variable, increment
results, stuff result back into expression/variable, re-evaluate
expression/variable and return result.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Thu, 19 Dec 2002 21:48:21 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: help: perl script to make all DNA sequence Nmers?
Message-Id: <3E0284F5.59CBC5C8@earthlink.net>
ctcgag@hotmail.com wrote:
>
> Benjamin Goldberg <goldbb2@earthlink.net> wrote:
> >
> > Since I know how vec() works, I realized that this is because when
> > vec treats a string as a vector of 32-bit numbers, it does so in a
> > bigendian way.
>
> I don't really know how vec works. I've played with a bit and it just
> doesn't DWIM.
Which, no offense, explains why you didn't spot what was wrong with my
code right away.
Personally, I think that if vec() were changed from 1 function, into 6
different functions (vec1, vec2, vec4, ... vec64), taking only a string
and an index, it would be a little more DWIM.
Or perhaps an even larger family of functions -- big and little endian,
signed and unsigned, or both of those properties.
If all that were done, I would write the increment as:
my $i = 0; 1 while ++vec32le $count, $i++;
And by being little-endian, it would be safe to use size-32 (or even 64,
except that my machine doesn't have 64 bit ints).
> So it was interesting figuring out how your corrected code worked. I
> think I got it now, but apparently I don't know how preincrement
> works, either. I assumed it did: evaluate expression/variable,
> increment result and remember it, stuff result back into
> expression/variable, return remembered result.
Try this:
perl -we "my $x = 1; print ++$x, ++$x"
> But by the fact that the preincrement on vec returns false on
> overflow, I guess it goes something like: evaluate
> expression/variable, increment results, stuff result back into
> expression/variable, re-evaluate expression/variable and return
> result.
Actually, it's more like:
1/ evaluate expression/variable, this results in an SV* object.
2/ increment the SV*
3/ return the SV*
If something later uses that SV* somehow, it uses SVPV or SVIV to fetch
the contents.
Which is why, with print ++$x, ++$x, you get the same value twice.
With vec, step (1) evaluates to an SV* object which has magic attached.
In step two, it fetches the contents of the SV* (through the magic,
which means it gets it from $count), increments that value (as a
number), and stores it back into the SV* (again, storing through the
magic, which thus modifies $count).
It the returns the SV*, and passes it to print(). The 'until' then
fetches the contents of the SV* (again, through the attached magic), and
as a result, you get the truncated integer result.
Note that the vec() expression itself only gets evaluated once -- but
since it's attached magic to the return value, that magic gets operated
on multiple times.
Suppose you have a function, foo(), which returns a reference which has
been blessed into a class with overloaded operators. When you do:
print ++(foo());
First, foo() gets called. It returns an object with overload magic.
Then the overloaded ++ gets called. Then, with the object that gets
returned, the overloaded '""' gets called. Note that foo() itself is
only called ONCE, but the magic gets called twice (more than that,
actually, if there is no '++' overloading, and only a '+' operator)
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: Fri, 20 Dec 2002 03:25:30 GMT
From: "codeWarrior" <GPatnude@adelphia.net>
Subject: HTAccess & Perl...
Message-Id: <K4wM9.34013$VA5.4254953@news1.news.adelphia.net>
Well -- I guess .htaccess is getting in my way... I have a Perl script to
upload PDF files to a .htaccess protected directory... My script (running as
anonymous) can mkdir's | mkpath's just fine... It even 'looks" as though it
is writing a file -->but it writes 0-byte files. Using telnet / cuteFTP I
discovered that I cannot:
-- chmod 0777 filename.pdf (on the files)
-- rm -f filename.pdf (on the files or rm -d on the directories)
-- unlink -f filename.pdf or unlink the directories
The server is freeBSD 4.5 / Apache with Perl5 and all of the usual CPAN
modules... I'm taking a (wild) stab at this and I believe that .htaccess is
causing the problem by intefering with the permissions...
Anyone have any suggestions on dealing with .htaccess from within a Perl
script ?
GP
------------------------------
Date: Fri, 20 Dec 2002 03:42:26 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: HTAccess & Perl...
Message-Id: <hb450vcjcq7pecckicq9gp1l4g8aet9fmj@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Fri, 20 Dec 2002 03:25:30 GMT, "codeWarrior"
<GPatnude@adelphia.net> managed to scribble:
> Well -- I guess .htaccess is getting in my way... I have a Perl
> script to upload PDF files to a .htaccess protected directory... My
> script (running as anonymous) can mkdir's | mkpath's just fine... It
> even 'looks" as though it is writing a file -->but it writes 0-byte
> files. Using telnet / cuteFTP I discovered that I cannot:
>
> -- chmod 0777 filename.pdf (on the files)
> -- rm -f filename.pdf (on the files or rm -d on the directories)
> -- unlink -f filename.pdf or unlink the directories
>
> The server is freeBSD 4.5 / Apache with Perl5 and all of the usual
> CPAN modules... I'm taking a (wild) stab at this and I believe that
> .htaccess is causing the problem by intefering with the
> permissions...
>
> Anyone have any suggestions on dealing with .htaccess from within a
> Perl script ?
>
> GP
>
>
chmod 0777 is a _very_ bad idea (especially if you're on shared
hosting).
You'll want to look for the HTTP_AUTHENTICATION headers (I think) for
using .htaccess protected areas.
Alternatively, of possible, drop the .htaccess and store the uploaded
files in a non Web accessible dir and then access the files from within
Perl.
I may be wrong.. but an idea =)
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPgKSEGfqtj251CDhEQIAHwCfWp313e4Grtmwg21K9b9JKYap2qsAoMnE
0nig71pVq5cNxktz2pYHVj3A
=+c2G
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Fri, 20 Dec 2002 04:08:49 GMT
From: "codeWarrior" <GPatnude@adelphia.net>
Subject: Re: HTAccess & Perl...
Message-Id: <lJwM9.34028$VA5.4262363@news1.news.adelphia.net>
"Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in message
news:hb450vcjcq7pecckicq9gp1l4g8aet9fmj@4ax.com...
> -----BEGIN xxx SIGNED MESSAGE-----
> Hash: SHA1
>
> In a fit of excitement on Fri, 20 Dec 2002 03:25:30 GMT, "codeWarrior"
> <GPatnude@adelphia.net> managed to scribble:
>
> > Well -- I guess .htaccess is getting in my way... I have a Perl
> > script to upload PDF files to a .htaccess protected directory... My
> > script (running as anonymous) can mkdir's | mkpath's just fine... It
> > even 'looks" as though it is writing a file -->but it writes 0-byte
> > files. Using telnet / cuteFTP I discovered that I cannot:
> >
> > -- chmod 0777 filename.pdf (on the files)
> > -- rm -f filename.pdf (on the files or rm -d on the directories)
> > -- unlink -f filename.pdf or unlink the directories
> >
> > The server is freeBSD 4.5 / Apache with Perl5 and all of the usual
> > CPAN modules... I'm taking a (wild) stab at this and I believe that
> > .htaccess is causing the problem by intefering with the
> > permissions...
> >
> > Anyone have any suggestions on dealing with .htaccess from within a
> > Perl script ?
> >
> > GP
> >
> >
>
> chmod 0777 is a _very_ bad idea (especially if you're on shared
> hosting).
>
> You'll want to look for the HTTP_AUTHENTICATION headers (I think) for
> using .htaccess protected areas.
>
> Alternatively, of possible, drop the .htaccess and store the uploaded
> files in a non Web accessible dir and then access the files from within
> Perl.
>
> I may be wrong.. but an idea =)
>
>
> Regards,
>
> Ian
>
> -----BEGIN xxx SIGNATURE-----
> Version: PGP Personal Privacy 6.5.3
>
> iQA/AwUBPgKSEGfqtj251CDhEQIAHwCfWp313e4Grtmwg21K9b9JKYap2qsAoMnE
> 0nig71pVq5cNxktz2pYHVj3A
> =+c2G
> -----END PGP SIGNATURE-----
>
> --
> Ian.H [Design & Development]
> digiServ Network - Web solutions
> www.digiserv.net | irc.digiserv.net | forum.digiserv.net
> Scripting, Web design, development & hosting.
Thanks for your input... I've been considering dropping the .htaccess for
the PDF library and re-locating it to a non-htaccess controlled directory
structure -- Web users already have to get past htaccess to get in....
I use chmod 0777 during development and then reset the script's to 0666
(exe) or 0775 (files)... in the productions environment...
------------------------------
Date: Fri, 20 Dec 2002 04:15:09 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: HTAccess & Perl...
Message-Id: <m5650vkbgeop1s7bpl8j99i7omtjo9ghhs@4ax.com>
Keywords: Remove WINDOZE to reply
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
In a fit of excitement on Fri, 20 Dec 2002 04:08:49 GMT, "codeWarrior"
<GPatnude@adelphia.net> managed to scribble:
> Thanks for your input... I've been considering dropping the .htaccess
> for the PDF library and re-locating it to a non-htaccess controlled
> directory structure -- Web users already have to get past htaccess to
> get in....
>
I have a gallery upload script I wrote in PHP for my IRC site. It
uploads images to a non web accessible dir, then I use GD to display
the image. This can be used in the same way for Perl and PDF I'm sure
(I've not attempted it in Perl personally or with PDF, so the actual
method used I can't comment on).
> I use chmod 0777 during development and then reset the script's to
> 0666 (exe) or 0775 (files)... in the productions environment...
If you're uploading to a shared server even for developing, 777 is
still (IMO) a bad choice as a user could _possibly_ read/write to your
file as you're developing. I don't know your servers config so it's
only a possability of course =)
To be (semi) safe, the "world" value should always be able to be set to
0. Depending on the server config.. the group value may also be able to
be 0 depending on the server config of course.
Regards,
Ian
-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3
iQA/AwUBPgKZr2fqtj251CDhEQIi4ACgwtuJOdfRWxGTMIVBRPhJllavnqwAniHz
Bp1He0nFE+drdoYV76WeoOR3
=u/ex
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Scripting, Web design, development & hosting.
------------------------------
Date: Fri, 20 Dec 2002 04:34:54 GMT
From: w i l l <willis3140@com.yahoo>
Subject: Re: Image creation/editing
Message-Id: <9cs40vs7s5cul6n5jo8b2u7m2ak1hpd2u1@4ax.com>
I saw an article about this once, I think they used GD.
Search www.perl.com., I might have read it there.
-Wi ll
On Thu, 19 Dec 2002 12:54:23 -0000, "DM" <daby55@NO23SPAM.com> wrote:
>I`ve had a look through the perl packages and can`t find anything that looks
>suitable. Basically I want to be able to create a new image (preferably a
>.png) and then paste other images into it images into it, one after the
>other (vertically). Any perl modules capable of doing this?
>
>
>
>
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.431 / Virus Database: 242 - Release Date: 17/12/2002
>
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 4293
***************************************