[23101] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5322 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 6 00:05:50 2003

Date: Tue, 5 Aug 2003 21:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 5 Aug 2003     Volume: 10 Number: 5322

Today's topics:
    Re: $name getting changed to $_ <usenet@expires082003.tinita.de>
    Re: [regex] Can't get it to be ungreedy <matthew.garrish@sympatico.ca>
    Re: Brand New to Perl <emschwar@ldl.fc.hp.com>
    Re: Bug or feature: using array references <mgjv@tradingpost.com.au>
    Re: Bug or feature: using array references <REMOVEsdnCAPS@comcast.net>
    Re: CGI.pm and foreach <REMOVEsdnCAPS@comcast.net>
        Convert UFT-8 to unicode? <schmidt.2002@gmx.de>
    Re: Convert UFT-8 to unicode? <jurgenex@hotmail.com>
    Re: Cplex hangs in Perl system command <rubin@msu.edu>
        dbd::csv and soap::lite <sonet.all@msa.hinet.net>
        extract from html (Lydia Shawn)
        Final "Flocking" Script (Chas Friedman)
        pack/unpack bits <ambrice@yahoo.com>
    Re: pack/unpack bits <kha@rogers.com>
        Trying to select range for Excel chart <member35066@dbforums.com>
    Re: Variables Definition File <REMOVEsdnCAPS@comcast.net>
    Re: wwwboard post file permissions <bwalton@rochester.rr.com>
    Re: wwwboard post file permissions <mgjv@tradingpost.com.au>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 5 Aug 2003 23:03:13 GMT
From: Tina Mueller <usenet@expires082003.tinita.de>
Subject: Re: $name getting changed to $_
Message-Id: <bgpd3g$rakih$1@ID-24002.news.uni-berlin.de>

Brian wrote:
> I am stumped here - Can someone look at my code and tell me why my
> $name variable is being changed to what is stored in $_?  Thx.

you mean @name variable, not $name, i think. anyway, ...

> foreach(@name) {

change that to:

foreach my $x (0..$#name) {

and...

[...]

> 			$x++;

leave out this.

background: for() localizes the $_ variable. while(<FH>)
sets $_ to the current line and does *not* localize it.
but why are you iterating over @name with for() and then
don't use the current element, anyway? if you need the current
number of the element, iterate over the indizes explicitly,
as shown avove.

hth, tina
-- 
http://www.tinita.de/     \  enter__| |__the___ _ _ ___
http://Movies.tinita.de/   \     / _` / _ \/ _ \ '_(_-< of
http://www.perlquotes.de/   \    \ _,_\ __/\ __/_| /__/ perception
- my mail address expires end of august 2003 -


------------------------------

Date: Tue, 5 Aug 2003 20:44:16 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: [regex] Can't get it to be ungreedy
Message-Id: <vbYXa.2512$_a4.473133@news20.bellglobal.com>


"Jane Doe" <jane.doe@acme.com> wrote in message
news:2k00jvk8eopcsnb49bkgffjt43rv4156hp@4ax.com...
> On Mon, 4 Aug 2003 19:39:21 -0400, "Matt Garrish"
>
> Thank you very much for your help :-) Unfortunately, since the regex
> engine in Privoxy doesn't seem to allow running an external program to
> handle a given filter entry, I'm stuck. Bah, I can live with this :-)
>

Are you trying to rewrite the code for filtering, or are you just trying to
add a regex to a filter file? If the latter, you're probably pretty limited
in what you're ever going to accomplish.

Also, if you are just trying to write a line for your filter file, is there
any reason you need to remove the full <tr>...</tr> section? If you're just
looking to strip something from your email, why not just match Item2 and
remove it? It would probably make your life a whole lot easier, and an empty
row in the table probably isn't going to kill you... : )

Matt




------------------------------

Date: Tue, 05 Aug 2003 18:26:32 -0600
From: Eric Schwartz <emschwar@ldl.fc.hp.com>
Subject: Re: Brand New to Perl
Message-Id: <etoptjj1vif.fsf@wormtongue.emschwar>

"Alan J. Flavell" <flavell@mail.cern.ch> writes:
> The problem with using the documentation for that is that each is a
> piece of the jigsaw, but the beginner has no idea at first just how
> the pieces could fit together.

Exactly.  Which is why I'd think _Learning Perl_, and then a pointer
to perldoc at the end should be sufficient.  But okay, I'm an elitist,
and since I already know Perl, it's probably not fair for me to
comment on the Camel any longer (though I will be getting the perl6
camel, most likely).

> Once that stage is over, I'd have thought that an electronic copy of
> the documentation with adequate text search facilities would beat any
> dead-trees version with whatever terms the indexer chose to index.

From a technical writer friend of mine: "No electronic search can take
the place of a skilled indexer."  The whole point of the index is that
you index on things that aren't necessarily in the text-- after all,
how many times do we say 'just use perldoc <foo>' and the OP replies
with, "I'd never have though to look for <foo>; I was looking for
<bar>"?

> No offence meant to the actual book in question, I must stress - just
> a general comment.

Likewise. :)

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


------------------------------

Date: 05 Aug 2003 22:56:06 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Bug or feature: using array references
Message-Id: <slrnbj0dg8.js6.mgjv@verbruggen.comdyn.com.au>

On 05 Aug 2003 17:37:01 +0100,
	Brian McCauley <nobull@mail.com> wrote:
> tadmc@augustmail.com (Tad McClellan) writes:
> 
>> Uli Tuerk <ulit_see_signature@fs.tum.de> wrote:
>> 
>> > 	foreach my $array_entry (@{$search_array_ref}) {
>> > 		$array_entry =~ s/\+//;
>> 
>> Perl's foreach is described in perlsyn.pod:
>> 
>>    If any element of LIST is an lvalue, you can modify it by 
>>    modifying VAR inside the loop.
>> 
>> You are modifying VAR inside the loop.
> 
> I seem to recall in some previous version of Perl, this didn't work
> when VAR was a lexical variable.

I tested 5.004, 5.004_0[345], 5.005_0[123], 5.6.1 and 5.8.1, and all
give the same result. 5.003 gives em a syntax error, as expected (my
keyword in loop specification didn't exist then). If the code is
changed to:


        my @words = ('a+b', 'A+B');
        my $search_array_ref = \@words;

        print "@words \n";

	my $array_entry;
        foreach $array_entry (@{$search_array_ref}) {
                $array_entry =~ s/\+//;
                # do more with $array_entry...
        }

        print "@words \n";

then 5.003 behaves in the same way as the others. I don't have older
versions of perl available to test with (except for 4, which doesn't
have lexicals).

> Am I imagining things?  If not can anyone recall when did it change?

What you say rings a vague bell with me, which is why I started all
those tests. I do seem to vaguely recall that at some point there were
differences between lexical and package loop variables, but I can't
really remember anything. Maybe we're both imagining things, or maybe
it was simply a problem with one of the development releases, and it
was discussed on p5p.

Martien
-- 
                        | 
Martien Verbruggen      | +++ Out of Cheese Error +++ Reinstall
Trading Post Australia  | Universe and Reboot +++
                        | 


------------------------------

Date: Tue, 05 Aug 2003 18:50:34 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Bug or feature: using array references
Message-Id: <Xns93CEC9BEC13DAsdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

tadmc@augustmail.com (Tad McClellan) wrote in 
news:slrnbj06vb.fi6.tadmc@magna.augustmail.com:

> Being in perlsyn.pod is not the "background".
> 
> It is one of the std docs that you should be reading end-to-end
> twice a year. I do.

In the smallest room in your house, no doubt!   :-)

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPzBCoWPeouIeTNHoEQKG4ACg6dtOP9y8dKXukfeuXmp4dMyO/iQAoNRK
+nrB3HjEqLSkMNj/fqqOJgXP
=MtpC
-----END PGP SIGNATURE-----


------------------------------

Date: Tue, 05 Aug 2003 18:46:42 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: CGI.pm and foreach
Message-Id: <Xns93CEC916F7CEAsdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"W K" <hyagillot@tesco.net> wrote in
news:bgogno$ai0$1@sparta.btinternet.com: 

> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnbiv8ib.eqf.tadmc@magna.augustmail.com...
>> Eric J. Roode <REMOVEsdnCAPS@comcast.net> wrote:
>>
>> > Do learn about map; don't worry if you don't "get" it right away.
>>
>>
>> ... because you can always rewrite a map() or grep() as a foreach().
> 
> Is there a particularly good reason for using "map()" ?
> 
> I always think that foreach has more scope to add extras in the block,
> and is less confusing to the poor old C programmers who sometimes look
> at my code.

Aw, to heck with them if they can't learn The Perl Way.  ;-)

map() is nice because you can use it in expressions.  It can make many 
things shorter and nicer.

Instead of:
    @lines = <FILE>;
    foreach (@lines) {
        chomp;
        $_ = uc;
    }

you can do:
    @lines = map {chomp; uc} <FILE>;

And of course, you can chain things together with map, as in the famous 
Schwartzian transformation:

    @sort = map $_->[0], sort {$a->[1] cmp $b->[1]} map [$_, f($_)], @in;

As Tad pointed out, this can be done with foreach(), but it's uglier.

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPzBBs2PeouIeTNHoEQJ9cQCg20tXexBpqi1X83LvcmqVKtT2i5gAniN0
eA5xjIxQ/LAQ8nQWL6ekQI72
=vOPL
-----END PGP SIGNATURE-----


------------------------------

Date: Wed, 06 Aug 2003 03:10:31 +0200
From: Andreas Schmidt <schmidt.2002@gmx.de>
Subject: Convert UFT-8 to unicode?
Message-Id: <oprtgljtgck05e3a@News.CIS.DFN.DE>

Hi,

my CGI script receives UTF-8 strings, like "0xE2 0x82 0xAC" for the Euro 
symbol.

However, the unicode for this symbol is 0x20AC.

How can I convert from UTF-8 to Unicode?

I'd like to do sth like:

if( $str =~ m/\x{20AC}/ ){
	print "used euro";
}

but first, I have to convert "0xE2 0x82 0xAC" to Unicode, of course...

Thanks for every hint!
Andi



------------------------------

Date: Wed, 06 Aug 2003 01:47:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Convert UFT-8 to unicode?
Message-Id: <F6ZXa.5318$uw6.2981@nwrddc02.gnilink.net>

Andreas Schmidt wrote:
> my CGI script receives UTF-8 strings, like "0xE2 0x82 0xAC" for the
> Euro symbol.
> However, the unicode for this symbol is 0x20AC.
> How can I convert from UTF-8 to Unicode?

Text::Iconv does a good job in converting between pretty much any encoding.

jue




------------------------------

Date: 5 Aug 2003 22:15:13 GMT
From: "Paul A. Rubin" <rubin@msu.edu>
Subject: Re: Cplex hangs in Perl system command
Message-Id: <Xns93CEB96406E0Dquantoid@35.8.2.20>

wei_zhao2000@hotmail.com (Wei) wrote in
news:2673a9d5.0308051402.18ff70b@posting.google.com: 

> Although I fixed the problem, I think it's also an issue in cplex 
> itself, because it didn't show any error message for the missing 
> input file.
> 

CPLEX callable library routines (and Concert technology) will *never* 
display an error message, as far as I know.  If they encounter a problem 
they are programmed to recognize, they will usually let you now by 
returning a nonzero status value.  So you need to be fairly diligent about 
capturing the integer return code from a library routine (or calling the 
getStatus() or getCplexStatus() member function using Concert) and making 
sure it's not telling you something's wrong.

When CPLEX hits a problem it's not programmed to handle through a return 
value, it will typically throw an exception.  So you can surround the calls 
by try{} blocks, catch(...){} the results and look for exceptions (if you 
have reason to fear any).

Or are you saying that a CPLEX routine hung without returning a status 
value and without throwing an exception?  *That* would be a CPLEX bug.

-- Paul


------------------------------

Date: Wed, 6 Aug 2003 10:07:24 +0800
From: <sonet.all@msa.hinet.net>
Subject: dbd::csv and soap::lite
Message-Id: <bgpnrh$id8@netnews.hinet.net>

sorry !! my english is very poor. i got some trouble ! please help !
if $vars is constant in Bridge.pm then the process is right!
ps:DBD::CVS  V0.2002
============================================================================
============
use SOAP::Lite+trace => all ;

my $s=SOAP::Lite
->uri('Bridge')
->proxy('http://127.0.0.1/perlsoap/soapserver.html')
->DB2AD('1');


  unless ($s->fault) {
    print $s->result();
  } else {
    print join ', ',
      $s->faultcode,
      $s->faultstring;
  }
============================================================================
=============
use SOAP::Transport::HTTP;
use FindBin qw($Bin);

SOAP::Transport::HTTP::CGI
 ->dispatch_to("Bridge")
 ->handle;
============================================================================
=============
package Bridge;
use DBI;
use FindBin qw($Bin);
sub new {
   bless {}, shift;
};

sub DB2AD{
($self,$vars)=@_;
my $dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=\t;f_dir=$Bin})
          || return "100\t$DBI::errstr-" . "$signature\n";


$sql='select
serial,signature,source,functioncode,usrname,passwd,modifydatetime,retry,cn
from dsalterDB where serial > ' . "\'$vars\'";


$sth = $dbh->prepare($sql);
$sth->execute();
$sth->bind_columns(\$serial,\$signature,\$source,\$functioncode,\$usrname,\$
passwd,\$modifydatetime,\$retry,\$cn);
 while($sth->fetch()) {

$Result.="$serial\t$signature\t$source\t$functioncode\t$usrname\t$passwd\t$m
odifydatetime\t$retry\t$cn\n";
 }

return $Result;


};
1;




------------------------------

Date: 5 Aug 2003 17:47:40 -0700
From: apfeloma@hotmail.com (Lydia Shawn)
Subject: extract from html
Message-Id: <1240b4dc.0308051647.685dde59@posting.google.com>

hi,
how can i extract the number between text1 and text2 in input.html
only the first time it occurs ignoring the rest?
preferably input.html would be a URL that stops downloading once a
match has occured, that would save a lot of bandwidth..
i guess html::parser would provide an option to work with a file while
it's downloading (?)

example
----

input.html:

bla..
text1 555 text2
bla 
bla
text1 6000 text2
bla
EOF


output.txt
555


thanks for your help,
peter


------------------------------

Date: Wed, 6 Aug 2003 03:08:06 +0000 (UTC)
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Final "Flocking" Script
Message-Id: <bgprem$lui$1@geraldo.cc.utexas.edu>



__________
You wrote:
>Thanx you to everyone who has been helping with my flocking issue.  
>.................
>#!/usr/bin/perl
>
>#use strict;
>#use warnings;
>use 5.004;
>use Fcntl qw(:DEFAULT :flock);
>
>open (FH, "<data.txt") or die "Can't open file: $!";
>flock (FH, LOCK_EX) or die "Can't lock file: $!";
>$data=<FH>;
>chomp ($data);
>($total,$opened,$followed)=split(/\|/,$data);
>close(FH);
>
>$opened = $opened + 1;
>
>sysopen(FH, "data.txt", O_WRONLY | O_CREAT) or die "can't open filename:
>$!";
>flock (FH, LOCK_EX) or die "can't lock filename: $!";
 ..........

 I always worried about having the open and lock statements separate. I had
the idea (possibly wrong) that there could be some time lag between
execution of the 2 statements, and the file could change during that time.
(In the particular example you consider, this might be unlikely.)
I usually do something like:

 .............
use Fcntl ':flock'; # import LOCK_* constants
use Fcntl ':DEFAULT';
use POSIX;
sub lock {
    flock F, LOCK_EX;
    # and, in case someone appended <-----
    # while we were waiting...      <------    (This is from perl docs.)
    seek F, 0, 2;                  #<-----------
}

sub unlock {
    flock F, LOCK_UN;
}
 
 if (sysopen(F,$file, O_WRONLY)){
lock();}
 .............

 That way, the open and lock is "atomic". I wonder if this is actually
necessary. The perl docs show some examples where the open and lock are
in separate statements, so I thought that should be OK. But I once did
some tests of locking in which I appended, say, 100 times to a file with
a script using open and lock separately and then in a single statement, and
it seemed to make some difference - there were occasionally some errors
when the open and lock were in separate statements. However, this could have
been for some other reason...I was never totally sure...
 I'd be interested in any comments about this!
                      chas
  



------------------------------

Date: Tue, 05 Aug 2003 18:36:10 -0700
From: "Aaron Brice" <ambrice@yahoo.com>
Subject: pack/unpack bits
Message-Id: <pan.2003.08.06.01.36.10.137859@yahoo.com>

I have a problem with using unpack to separate out some arbitrary bits
from some binary data received using some wacky protocol.  The first bit
of the binary message is the "rbit", the next 15 bits is the device id,
etc.  What I'd like to use is unpack() to map the bits to various
variables such as:

#!/usr/bin/perl

$msg = pack ("H*", "8000ffff");

($rbit, $dev, $buffer) = unpack("B1B15B*", $msg);

print "rbit: $rbit\n";
print "devid: $devid\n";
print "buffer: $buffer\n";

I would expect this to have rbit set to 1, devid set to 000000000000000,
and buffer set to 1111111111111111.  Instead, the result is:

rbit: 1
devid: 000000001111111
buffer: 11111111

It seems like the "B1" token in the unpack template reads a whole byte and
gives the first bit of it, the B15 token reads the next two bytes and
gives the first 15 bits of them, and B* gets the rest, which is only one
byte left.  There's a lot of missing bits there!  Is there a way for me to
use unpack() to do what I want without having to use a more awkward
masking and shifting sytem?

Thanks,
Aaron



------------------------------

Date: Wed, 06 Aug 2003 03:35:25 GMT
From: Kien Ha <kha@rogers.com>
Subject: Re: pack/unpack bits
Message-Id: <1I_Xa.110180$rsJ.13524@news04.bloor.is.net.cable.rogers.com>

Aaron Brice wrote:
> I have a problem with using unpack to separate out some arbitrary bits
> from some binary data received using some wacky protocol.  The first bit
> of the binary message is the "rbit", the next 15 bits is the device id,
> etc.  What I'd like to use is unpack() to map the bits to various
> variables such as:
> 
> #!/usr/bin/perl
> 
> $msg = pack ("H*", "8000ffff");
> 
> ($rbit, $dev, $buffer) = unpack("B1B15B*", $msg);
> 
> print "rbit: $rbit\n";
> print "devid: $devid\n";
> print "buffer: $buffer\n";
> 
> I would expect this to have rbit set to 1, devid set to 000000000000000,
> and buffer set to 1111111111111111.  Instead, the result is:
> 

($rbit, $dev, $buffer) = unpack "A1A15A*", unpack "B*", $msg;


-- 
Kien



------------------------------

Date: Tue, 05 Aug 2003 23:42:00 +0000
From: hansioux <member35066@dbforums.com>
Subject: Trying to select range for Excel chart
Message-Id: <3205065.1060126920@dbforums.com>


Hi,

This is probably not an "perl" question, but I am writting this in perl,
so I gave it a shot.

I have created a excel spreadsheet using the Win32::ole..

I am trying to create a excel chart,

but instead of charting column A all the way through column J
I just want to chart column A and column J.

$Range = $Sheet->Range("A1:J10")->Select();  only gives the whole thing.
Unfortunately, this is the only kind of examples I can find on the web.

Now, I know I can copy and paste this two columns together on to a new
sheet, but that kind of defeats the purpose.

Please give me a pointer, thanks!

--
Posted via http://dbforums.com


------------------------------

Date: Tue, 05 Aug 2003 18:40:40 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Variables Definition File
Message-Id: <Xns93CEC810FE50Dsdn.comcast@206.127.4.25>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

schaltung@hotmail.com (Schaltung) wrote in 
news:1b56a114.0308051326.e16823b@posting.google.com:
 ...
> Currently, my perl scripts read the file 'variables.def' and they
> "load" the variable values from there (using brute force parsing).
> 
> My question is: is there an easier way to implement this? I wish
> 'variables.def' file could look like this:
>         $var1= 23;
>         $var1= 45;
>           ...
> ... and I simply imported those variable values to my scripts.
> 
> I appreciate any of your hints.
> Antonio

Try my Config::Vars module.
http://search.cpan.org/author/ROODE/Config-Vars-0.01/Vars.pm

- -- 
Eric
$_ =  reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPzBAUGPeouIeTNHoEQJNnACfRyzMmK3I9mDqDDeVQ0PEAe05IVMAoMTP
uHLz3DIitZOhhVqr6Uzwsvy4
=6iB2
-----END PGP SIGNATURE-----


------------------------------

Date: Tue, 05 Aug 2003 22:55:09 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: wwwboard post file permissions
Message-Id: <3F3035C2.7040305@rochester.rr.com>

Mark Stewart wrote:

> My wwwboard posts are "owned" by user 99 with the permission of 644. I 
> can get the files chown'd to my username and change the permissions, but 
> how can I get wwwboard to create new posts with a permission that also 
> allows me to edit the files if I want too, and still let the web script 
> update the file? Would 664 do, or would it have to be 666? The directory 
> is 777 btw.
> 
> I've editing existing perl scripts and creating small ones myself, but 
> I'm not sure if these changes could be done within the script or if the 
> server config would have to be change somehow.
> 

And your Perl question is?  Perhaps you should ask this on a Unix 
newsgroup.  Or maybe a CGI newsgroup.  But it has nothing to do with Perl.

-- 
Bob Walton



------------------------------

Date: 05 Aug 2003 23:02:46 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: wwwboard post file permissions
Message-Id: <slrnbj0dsn.js6.mgjv@verbruggen.comdyn.com.au>

On Tue, 05 Aug 2003 04:19:31 GMT,
	Mark Stewart <spam12@64spam.com> wrote:
> My wwwboard posts are "owned" by user 99 with the permission of 644. I 
> can get the files chown'd to my username and change the permissions, but 
> how can I get wwwboard to create new posts with a permission that also 
> allows me to edit the files if I want too, and still let the web script 
> update the file? Would 664 do, or would it have to be 666? The directory 
> is 777 btw.

You do not have a Perl question. Instead you have a question about CGI
and web server environments. I suggest you ask in one of the groups in
the comp.infosystems.www.* hierarchy.

When you do, make sure to include information about your web server
and your OS.

\begin{offtopic}

Since you talk about chown, I'm assuming you're using some sort of
Unix or Unix-like OS.

If you really want to create files with fully open permissions, so
that _anyone_ can fiddle with them, read up on the umask function in
the perlfunc documentation. You will want to use a umask of 0. If
you're in the same group as the user the web server runs as, you can
use 02, but this is unlikely.

> I've editing existing perl scripts and creating small ones myself, but 
> I'm not sure if these changes could be done within the script or if the 
> server config would have to be change somehow.

It probably does. or maybe you just need to run your web server as a
different user. 

I get the feeling that you need to learn a bit more about Unix
security as well as about web server environments. Perl doesn't really
come into this at all.

\end{offtopic}

Martien
-- 
                        | 
Martien Verbruggen      | 
Trading Post Australia  | values of Beta will give rise to dom!
                        | 


------------------------------

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



------------------------------

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 5322
***************************************


home help back first fref pref prev next nref lref last post