[30678] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1923 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 14 18:09:44 2008

Date: Tue, 14 Oct 2008 15:09:09 -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, 14 Oct 2008     Volume: 11 Number: 1923

Today's topics:
    Re: "\!" appears on new line <tim@burlyhost.com>
    Re: "\!" appears on new line <tim@burlyhost.com>
    Re: 'extracting' from a string via regular expressions? <tim@burlyhost.com>
    Re: <Help> How to use routines from another perl script <tim@burlyhost.com>
    Re: command line with -e <tim@burlyhost.com>
    Re: data file <hirenshah.05@gmail.com>
    Re: data file <tzz@lifelogs.com>
    Re: data file <glex_no-spam@qwest-spam-no.invalid>
    Re: GETDATA to POSTDATA <tim@burlyhost.com>
    Re: Help: How to process output of a program <tim@burlyhost.com>
    Re: how to close STDIN <ced@blv-sam-01.ca.boeing.com>
    Re: how to use system call within a cgi script <tim@burlyhost.com>
    Re: how to use system call within a cgi script <g_r_a_n_t_@bugsplatter.id.au>
    Re: how to use system call within a cgi script <tim@burlyhost.com>
    Re: Odd behaviour with has key - wide character <tim@burlyhost.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 14 Oct 2008 12:08:12 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: "\!" appears on new line
Message-Id: <A66Jk.18$Gz2.12@newsfe19.iad>

April wrote:

> print $wholething, $wholething2, "\!", "\n";
> 
> Thank you
> !
> 
> How can I get them on the same line?

I assume that the $wholething2 variable has a new line in it, because it
should work.  Why are you escaping \ the ! character?  Are you running
this on the command line or something?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 12:10:28 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: "\!" appears on new line
Message-Id: <F86Jk.19$Gz2.2@newsfe19.iad>

Tim Greer wrote:

> April wrote:
> 
>> print $wholething, $wholething2, "\!", "\n";
>> 
>> Thank you
>> !
>> 
>> How can I get them on the same line?
> 
> I assume that the $wholething2 variable has a new line in it, because
> it
> should work.  Why are you escaping \ the ! character?  Are you running
> this on the command line or something?

Disregard my reply, I didn't see your follow up posts until after I had
replied.  Looks like you understand the issue now.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 14:22:25 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: 'extracting' from a string via regular expressions?
Message-Id: <n48Jk.31$Gz2.11@newsfe19.iad>

sseelenluft@gmail.com wrote:

> Hi,
> I was modifying code written by others when something stopped working.
> I was using a construct like:
> $string=~ m@PartOne(.*)PartTwo@;
> to find and extract everything between 'PartOne' and 'PartTwo', and I
> swear it was working. Then I moved to a different string and it
> stopped working (and now the first example also stopped working).
> Below is a not-working test-case:
> 
> #! /usr/bin/perl
> 
> use strict;
> 
> # Definition of variables
> my $line;
> my $file;
> 
> # Read file
> @ARGV = qw# test2.csv #;
> while (defined($line = <>)) {
> $file .= $line;
> }
> 
> $file=~ m@TEMPLATES(.*)ONLY@;
> 
> print $file . "\n";
> 
> The file test2.csv contains just one sentence: 'IMPORTANT: THESE
> TEMPLATES MAY ONLY BE USED WITH THE WRITTEN PERMISSION'
> Therefore, the code above should print simply 'MAY' (possibly with the
> spaces), but it prints the whole sentence.
> 
> Finding the word 'TEMPLATES' works fine, a la:
>   if ($file=~ m@TEMPLATES@) {
>     print "It matched!" . "\n";
>     }
> works fine.
> 
> So, what am I missing here?
> Thanks.

Did you mean: $file =~ s@TEMPLATES(.*)ONLY@$1@;

I won't get into the other issues at this point, but it looks like
that's your problem.  You were only looking for a match (in which case
you don't need to (capture) the match), then perhaps you meant to say
$file = $1 if $file =~ m@TEMPLATES(.*)ONLY@.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 11:26:36 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: <Help> How to use routines from another perl script
Message-Id: <wv5Jk.14$1r2.1@newsfe01.iad>

Peter J. Holzer wrote:

> On 2008-10-07 23:01, Tim Greer <tim@burlyhost.com> wrote:
>> Hans Mulder wrote:
>>> Tim Greer wrote:
>>>> Petr Vileta (fidokomik) wrote:
>>>>> require "/var/myroutines/ex1.pl;
>>>> 
>>>> || die, or die, or use eval.
>>> 
>>> Why use "die?  "Require" already "die"s when something is wrong.
>>> 
>>> Were you thinking of "do", perhaps?
>>> 
>>
>> I was actually making a point about the error (typo) he made in his
>> example... as in "what did you want it to do here?" in an attempt at
>> humor.
>>
>> Notice:
>>
>> require "/var/myroutines/ex1.pl;
>>
>> is missing the closing ".
> 
> That, however, would be caught at compile time, so the presence or
> absence of "die" wouldn't make a difference.
> 
> hp

Yes it would.  And indeed, die wouldn't make a difference.  This is why
I mentioned the attempt at humor.  Pardon that it just caused
confusion.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 12:27:55 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: command line with -e
Message-Id: <0p6Jk.23$_B6.20@newsfe12.iad>

April wrote:

> 
> I managed to make the following work on my pc:
> 
> perl -e "print \"Hello world\n\""
> 
> should I be able to also assign value to $_ and then verify it,
> possibly in this way just for quick checking?
> 
> tried the following but seems not working:
> 
> perl -e "$_=2"
> 
> perl -e "print \"$_2\n\""

Each instance of the separate perl commands are individual from each
other.

perl -e 'my $a = "b"' is going to be completely different from perl -e
'my $a = "c"'

Were you looking to declare an ENV variable on the command line and then
have it be used in the perl command, perhaps?  I.e., COMPILER=gcc and
then use that in the script or something?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 13:00:35 -0700 (PDT)
From: "friend.05@gmail.com" <hirenshah.05@gmail.com>
Subject: Re: data file
Message-Id: <e6c41a8e-4fc6-48fa-ab1e-4a9b1a2f5abd@z6g2000pre.googlegroups.com>

On Oct 10, 2:31=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> "friend...@gmail.com" <hirenshah...@gmail.com> wrote:
> >> jue- Hide quoted text -
>
> >> - Show quoted text -
>
> What is this "Hide quoted text - Show quoted text" nonsense?
>
> >IF I use
>
> >$idtable{"$ip|$code"}++; #record this ip-code combination
>
> >will this not replace previous valuse if same key(ip-code) comes
> >again ?
>
> Of course it does, that is the whole purpose. Or how do you suggest to
> count the number of occurences if not by replacing the previous number
> with the new number?
>
> jue

Hi,

Above code gives me count for each IP+Code combination.

Now I also want to store time of each IP+Code in hash array.

So that later I can look for time if I have IP+Code.


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

Date: Tue, 14 Oct 2008 16:06:20 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: data file
Message-Id: <86k5caj38z.fsf@lifelogs.com>

On Tue, 14 Oct 2008 13:00:35 -0700 (PDT) "friend.05@gmail.com" <hirenshah.05@gmail.com> wrote: 

f0c> On Oct 10, 2:31 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>> "friend...@gmail.com" <hirenshah...@gmail.com> wrote:
>> >> jue- Hide quoted text -
>> 
>> >> - Show quoted text -
>> 
>> What is this "Hide quoted text - Show quoted text" nonsense?
>> 
>> >IF I use
>> 
>> >$idtable{"$ip|$code"}++; #record this ip-code combination
>> 
>> >will this not replace previous valuse if same key(ip-code) comes
>> >again ?
>> 
>> Of course it does, that is the whole purpose. Or how do you suggest to
>> count the number of occurences if not by replacing the previous number
>> with the new number?

f0c> Above code gives me count for each IP+Code combination.

f0c> Now I also want to store time of each IP+Code in hash array.

f0c> So that later I can look for time if I have IP+Code.

I think you want:

#!/usr/bin/perl

use warnings;
use strict;
use Data::Dumper;

sub add_time
{
 my $byIP = shift @_;
 my $key  = shift @_;
 my $time = shift @_;

 push @{$byIP->{$key}}, $time;

 print Dumper $byIP;
}

my $data = {};

add_time($data, "123 567", 100);
add_time($data, "123 567", 120);
add_time($data, "123 567", 140);
add_time($data, "234 678", 200);
add_time($data, "345 789", 300);

To get the actual count (you'll rarely need this):

sub get_time_count
{
 my $byIP = shift @_;
 my $key  = shift @_;

 return scalar @{$byIP->{$key}};
}

Note how add_time and get_time_count both operate on @{$byIP->{$key}}.
That's the key to the data structure: an array reference, dereferenced
when you need it so.

Ted


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

Date: Tue, 14 Oct 2008 16:12:32 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: data file
Message-Id: <48f50b41$0$89875$815e3792@news.qwest.net>

friend.05@gmail.com wrote:
> On Oct 10, 2:31 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>> "friend...@gmail.com" <hirenshah...@gmail.com> wrote:
>>>> jue- Hide quoted text -
>>>> - Show quoted text -
>> What is this "Hide quoted text - Show quoted text" nonsense?
>>
>>> IF I use
>>> $idtable{"$ip|$code"}++; #record this ip-code combination
>>> will this not replace previous valuse if same key(ip-code) comes
>>> again ?
>> Of course it does, that is the whole purpose. Or how do you suggest to
>> count the number of occurences if not by replacing the previous number
>> with the new number?
>>
>> jue
> 
> Hi,
> 
> Above code gives me count for each IP+Code combination.
> 
> Now I also want to store time of each IP+Code in hash array.

Really??  What is a 'hash array'?

> 
> So that later I can look for time if I have IP+Code.

Thanks for telling us what you want to do.  What's your question?

If you understand how to set the value using the above,
but don't know how to set it to another value, then you
might want to start at the beginning and learn about the
variable types, otherwise you'll never really be able to
read or write very useful code.

perldoc perlintro

and for data structures like 'hashes of arrays' look through

perldoc perldsc

Or get/read one of the many books.

http://books.perl.org/



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

Date: Tue, 14 Oct 2008 12:03:02 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: GETDATA to POSTDATA
Message-Id: <I16Jk.16$Gz2.12@newsfe19.iad>

Daniel Kaplan wrote:

> Hi,
> 
> I have a page that the server redirects to incase of an SQL Inject
> attempt. The thing is, because of the rewrite rule (something beyond
> my
> understanding) the page won't work properly.  Call it directly, it
> works, call it via the rule, not so much.
> 
> What does work is if in that new page, I redirect it to another copy
> of that page, and then it works.
> 
> But here is my problem:
> 
> I cannot redirect it with the same URL because that triggers the
> redirect rule (again, written in the server OS), and therefore my Perl
> redirect just loops.
> 
> So my question is:
> 
> Can I take that URL I have, and somehow pass it to my copy with the
> data in
> the URL now in POSTDATA format?  Because POSTDATA won't trigger the
> redirect rule.
> 
> Many thanks ahead, as always.

I don't understand your question?  I assume you're saying that some
anti-SQL injection security rule is set in a rewrite or mod_security
rule set, where if it detects a certain URI/query_string, it will
redirect/fail to protect the script?  If you allow POST instead of GET,
it sounds like all the attacker has to do, is use POST to pass their
data to your insecure script and that it defeats the purpose of the
security rules.  Of course, all bets are off if the script is insecure
anyway.  Is this something your host is imposing or something you have
set up?  Anyway, unless I'm misunderstanding your question, and I don't
know how this relates to Perl, to be honest, yes, you should be able to
do what you're asking... but should you?  Things sound a little "all
over the place".
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 14:12:34 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Help: How to process output of a program
Message-Id: <6X7Jk.49$wH6.42@newsfe09.iad>

Amy Lee wrote:

> Hello,
> 
> How to process output of a program? For example, I want to parse the
> output of /sbin/lspci program.
> 
> Thanks.
> 
> Amy

Open with a pipe for read, or consider something like IPC::Open*. Read
the information about "Bidirectional Communication with Another
Process" in the docs.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 13:58:27 -0700 (PDT)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: how to close STDIN
Message-Id: <89ceaaed-03ef-414a-bba3-7d516d5ae8f5@g17g2000prg.googlegroups.com>

On Oct 14, 3:11 am, Larry <dontmewit...@got.it> wrote:
> In article
> <fc07a2f4-3ec0-48d4-bb4a-fb1ea2671...@r37g2000prr.googlegroups.com>,
>
>  "C.DeRykus" <c...@blv-sam-01.ca.boeing.com> wrote:
> > Of course, this won't alleviate the data push,
> > but at least you'll be failing gracefully with
> > the appropriate status.
>
> that's what I'm worring about...

Reviewing CGI docs,  I think the problem may
be that you'll need to set $CGI::POST_MAX and
check cgi_error before you start reading, eg

use CGI;
my $q = new CGI();
$CGI::MAX_POST = ...;

my $q = CGI->new;
if ( my $error = $q->cgi_error ) {
    print $q->start_html, $error,...
    exit;
}


Hopefully only a partial transfer has occurred before CGI.pm
sees the content length and throws an error. Here're the
relevant lines from CGI.pm:

if (($POST_MAX > 0)
   && ($content_length > $POST_MAX)) {
  #discard the post, unread
  $self->cgi_error(
     "413 Request entity too large");
  ...
}

--
Charles DeRykus


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

Date: Tue, 14 Oct 2008 12:24:09 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: how to use system call within a cgi script
Message-Id: <ul6Jk.21$_B6.8@newsfe12.iad>

Grant wrote:

> On 11 Oct 2008 23:25:58 GMT, John Bokma <john@castleamber.com> wrote:
> 
>>ReggieC <ktrchang@gmail.com> wrote:
>>
>>> Hi there,
>>> 
>>> I have to execute an executable from a CGI script written in perl. 
>>> I cannot do that even
>>> with a very simple test like:
>>> $result = system("mkdir test1");
>>> $result = system("mkdir ", "test1");
>>> exec('mkdir test1');
>>
>>Read perldoc -f exec
>>
>>Remove the exec, and try again, does it now work?
>>
>>> but always got 500 Internal Service Error.
>>
>>Always copy error messages, don't type them yourself.
> 
> Oops, I meant to add an example, this is from a .cgi here (awk):
> ...
>         # create a unique output filename
>         cmd = "mktemp public/cc2ip.XXXXXX"; cmd | getline out;
>         close(cmd)
> 
>         # make the output filename world writable and append .txt
>         system("touch " out " && chmod a+rw " out " && mv " out " "
>         out ".txt") out = out ".txt"
> ...

You probably don't want to make it world writable unless you have a good
reason, assuming they even need that those of permissions.


> 
> The matching web directory:
> -r-sr-xr-x 1 grant wheel  3104 2008-10-05 09:07 cc2ip.cgi*
> -rwxrwxr-x 1 grant wheel 11570 2008-10-12 06:35 index.html*
> -rwxrwxr-x 1 grant wheel   444 2008-10-05 09:07 lookup-ip*
> drwxrwxrwx 2 grant wheel   184 2008-10-12 00:02 public/
> drwx-w---- 2 grant wheel   128 2008-10-12 11:32 server/

Glad to see nothing is setguid there. 

World write is indeed sometimes needed for some people, and is fine if
they aren't on a shared server, but I'd just recommend against it if
you're on a server that other users are on.

Anyway, yeah, just check the logs, print the proper header for CGI and
be sure to check your calls and catch (and log or report) any
errors/failures.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Wed, 15 Oct 2008 07:24:43 +1100
From: Grant <g_r_a_n_t_@bugsplatter.id.au>
Subject: Re: how to use system call within a cgi script
Message-Id: <agv9f4tbghv7di04ad4er2o5ofqk7903n0@4ax.com>

On Tue, 14 Oct 2008 12:24:09 -0700, Tim Greer <tim@burlyhost.com> wrote:

>Grant wrote:
>
>> On 11 Oct 2008 23:25:58 GMT, John Bokma <john@castleamber.com> wrote:
>> 
>>>ReggieC <ktrchang@gmail.com> wrote:
>>>
>>>> Hi there,
>>>> 
>>>> I have to execute an executable from a CGI script written in perl. 
>>>> I cannot do that even
>>>> with a very simple test like:
>>>> $result = system("mkdir test1");
>>>> $result = system("mkdir ", "test1");
>>>> exec('mkdir test1');
>>>
>>>Read perldoc -f exec
>>>
>>>Remove the exec, and try again, does it now work?
>>>
>>>> but always got 500 Internal Service Error.
>>>
>>>Always copy error messages, don't type them yourself.
>> 
>> Oops, I meant to add an example, this is from a .cgi here (awk):
>> ...
>>         # create a unique output filename
>>         cmd = "mktemp public/cc2ip.XXXXXX"; cmd | getline out;
>>         close(cmd)
>> 
>>         # make the output filename world writable and append .txt
>>         system("touch " out " && chmod a+rw " out " && mv " out " "
>>         out ".txt") out = out ".txt"
>> ...
>
>You probably don't want to make it world writable unless you have a good
>reason, assuming they even need that those of permissions.

Oh, in this case the first .cgi hands off (after validation of parms) to 
another script which is run as 'nobody' :/  Hence the world writable public 
directory.  Several attempts to merge both scripts resulted in far slower 
performance, awk is funny like that.

But there's nothing else inside public except for a blank index.html to 
thwart the curious ;)

>> The matching web directory:
>> -r-sr-xr-x 1 grant wheel  3104 2008-10-05 09:07 cc2ip.cgi*
>> -rwxrwxr-x 1 grant wheel 11570 2008-10-12 06:35 index.html*
>> -rwxrwxr-x 1 grant wheel   444 2008-10-05 09:07 lookup-ip*
>> drwxrwxrwx 2 grant wheel   184 2008-10-12 00:02 public/
>> drwx-w---- 2 grant wheel   128 2008-10-12 11:32 server/
>
>Glad to see nothing is setguid there. 

No, that's what the C security wrapper is for!  
>
>World write is indeed sometimes needed for some people, and is fine if
>they aren't on a shared server, but I'd just recommend against it if
>you're on a server that other users are on.

I have full control of the server here, and in any case it's unlikely 
somebody could guess the random name of an ephemeral (sp?) file that is 
purged after only 2 days.  And methods other thn get|head result in 403.
>
>Anyway, yeah, just check the logs, print the proper header for CGI and
>be sure to check your calls and catch (and log or report) any
>errors/failures.

When I'm doing web development I have three logging terminals open: 
access_log, error_log and rewrite.log.

Grant.
-- 
http://bugsplatter.id.au


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

Date: Tue, 14 Oct 2008 14:30:32 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: how to use system call within a cgi script
Message-Id: <Zb8Jk.44$vs7.36@newsfe04.iad>

Grant wrote:

> On Tue, 14 Oct 2008 12:24:09 -0700, Tim Greer <tim@burlyhost.com>
> wrote:
> 
>>Grant wrote:
>>
>>> On 11 Oct 2008 23:25:58 GMT, John Bokma <john@castleamber.com>
>>> wrote:
>>> 
>>>>ReggieC <ktrchang@gmail.com> wrote:
>>>>
>>>>> Hi there,
>>>>> 
>>>>> I have to execute an executable from a CGI script written in perl.
>>>>> I cannot do that even
>>>>> with a very simple test like:
>>>>> $result = system("mkdir test1");
>>>>> $result = system("mkdir ", "test1");
>>>>> exec('mkdir test1');
>>>>
>>>>Read perldoc -f exec
>>>>
>>>>Remove the exec, and try again, does it now work?
>>>>
>>>>> but always got 500 Internal Service Error.
>>>>
>>>>Always copy error messages, don't type them yourself.
>>> 
>>> Oops, I meant to add an example, this is from a .cgi here (awk):
>>> ...
>>>         # create a unique output filename
>>>         cmd = "mktemp public/cc2ip.XXXXXX"; cmd | getline out;
>>>         close(cmd)
>>> 
>>>         # make the output filename world writable and append .txt
>>>         system("touch " out " && chmod a+rw " out " && mv " out " "
>>>         out ".txt") out = out ".txt"
>>> ...
>>
>>You probably don't want to make it world writable unless you have a
>>good reason, assuming they even need that those of permissions.
> 
> Oh, in this case the first .cgi hands off (after validation of parms)
> to
> another script which is run as 'nobody' :/  Hence the world writable
> public
> directory.  Several attempts to merge both scripts resulted in far
> slower performance, awk is funny like that.
> 

I would agree, that is fine.  I just meant that I wouldn't recommend
that on a shared server with other users (this is fine if the system
isn't shared by potentially malicious users or other users that might
have insecure scripts that malicious users could use as a gateway into
the server).  However, for your own server, an unprivlieged user is
better (as you're doing and know), and I did realise after I posted,
that your were making an example of an existing script and not actually
suggesting they allow world write if they don't need to.  Forgive me
for misreading your follow up.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Tue, 14 Oct 2008 14:09:32 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Odd behaviour with has key - wide character
Message-Id: <hU7Jk.47$wH6.4@newsfe09.iad>

Jon Combe wrote:

> Does the letter "v" have any significance when creating a hash key?
> The following code snippet does not behave as I expect it to:-
> 
> #!/usr/bin/perl -w
> 
> %H = (v365, 3);
> print keys %H;
> 
> When run it outputs
> 
> Wide character in print at wide.pl line 4.
> Å­
> 
> When the key name is changed to "va365" it prints "va365" as I expect.
> What is special about just v followed by numbers?
> 
> Jon.

Are you asking what the difference between v and "v" is?  the "va365"
example is in double quotes. 365, 3 and v365, 3 are two different
things, unless you meant "v365", 3.  Did you mean v365 => 3, ?  Looks
like you have a bareword otherwise.  Were your working and non working
examples literal?
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 1923
***************************************


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