[30592] in Perl-Users-Digest
Perl-Users Digest, Issue: 1835 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 3 21:09:43 2008
Date: Wed, 3 Sep 2008 18: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 Wed, 3 Sep 2008 Volume: 11 Number: 1835
Today's topics:
Re: "Selling" Perl (i.e. getting the boss to let me ins <veatchla@yahoo.com>
Re: "Selling" Perl (i.e. getting the boss to let me ins <d a v i d . e v e r s o n @ h p . c o m>
Re: "Selling" Perl (i.e. getting the boss to let me ins <john@castleamber.com>
Re: "Selling" Perl (i.e. getting the boss to let me ins <cartercc@gmail.com>
Re: "Selling" Perl (i.e. getting the boss to let me ins <newsposter625@gmail.com.invalid>
Re: "Selling" Perl (i.e. getting the boss to let me ins <newsposter625@gmail.com.invalid>
Re: "Selling" Perl (i.e. getting the boss to let me ins <newsposter625@gmail.com.invalid>
Re: "Selling" Perl (i.e. getting the boss to let me ins <tzz@lifelogs.com>
Re: "Selling" Perl (i.e. getting the boss to let me ins <news1234@free.fr>
Re: CLPM - a help group? cstith@gmail.com
Re: FAQ 6.18 Why don't word-boundary searches with "\b" <hansmu@xs4all.nl>
Find changes or differences in 2 text files <bill@ts1000.us>
Re: Find changes or differences in 2 text files <fawaka@gmail.com>
Re: Find changes or differences in 2 text files <bill@ts1000.us>
Re: How to check the size of each files that are being xhoster@gmail.com
Re: How to check the size of each files that are being (fidokomik\)
Re: newbie also <jimsgibson@gmail.com>
Threads and sharing global variable anguyen@redhat.com
Re: Threads and sharing global variable <fawaka@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 03 Sep 2008 11:02:13 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <XeednXjeq7aYKCPVnZ2dnUVZ_hCdnZ2d@supernews.com>
P B wrote:
> Hello,
>
> I'd like to install ActivePerl on a Windows XP machine specifically to
> run a particular script. The "problem" is that the admins in charge of
> the PC are very cautious about what is installed and the security
> implications of everything (as they should be).
>
> I thought I recalled seeing a perlfaq specifically regarding this issue,
> but several `perldoc -q' searches and a perusal of the perlfaqs posted
> here were fruitless. (Besides the sort of general "How do I convince
> others to use Perl?")
>
> Can anyone provide a link or perhaps a little narrative about why Perl
> is safe and secure to install (I'm talking about the Perl interpreter,
> specifically the ActivePerl build here, not any scripts that may be
> run).
>
> Also, the script that I'd like to run if I do get Perl installed uses
> WWW::Mechanize. Are there any links, resources, opinions, or first-hand
> experiences as to the security implications of this particular module?
>
> Thanks,
>
> PB
>
You "sell" the installation of Perl by tying it to a business need,
show it's value and how Perl allows you to meet the business need.
--
Len
------------------------------
Date: Wed, 3 Sep 2008 10:15:19 -0700
From: "Dave Everson" <d a v i d . e v e r s o n @ h p . c o m>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <g9mgng$ks9$1@usenet01.boi.hp.com>
Look for a new job. Seriously, if you work in an environment in which
installing Activestate Perl requires permission you probably aren't in a
place that will let you be successful.
--
Dave E.
------------------------------
Date: 3 Sep 2008 17:24:50 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <Xns9B0E7E481A105castleamber@130.133.1.4>
"Dave Everson" <d a v i d . e v e r s o n @ h p . c o m> wrote:
> Look for a new job. Seriously, if you work in an environment in which
> installing Activestate Perl requires permission you probably aren't in a
> place that will let you be successful.
IMNSHO that's quite an over the top statement.
--
John http://johnbokma.com/ - Hacking & Hiking in Mexico
Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html
------------------------------
Date: Wed, 3 Sep 2008 11:11:17 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <3dc669d6-ec84-45eb-8c22-b1b7ed6135ee@j22g2000hsf.googlegroups.com>
On Sep 3, 10:39=A0am, P B <newsposter...@gmail.com.invalid> wrote:
All languages are simply tools, nothing more. As such, you need to
relate a job and a tool. If all you do is pound in nails, you don't
need a wrench. If you fasten bolts, you need a wrench, not a hammer.
Your manager will probably tell you that you should use the 'best'
tool for the job. 'Best' can mean many things, e.g., the tools that
you have are better than the tools that you don't have, the tools that
are cheaper are better than the more expensive tools, the tools backed
by a big company (i.e., Microsoft) are better than those not backed by
a big company (i.e., Perl), and so on. I once had the experience of a
manager giving thumbs down on a Linux server because he didn't know
it, and I couldn't argue with the logic that a tool that you know how
to use is 'better' than a tool you don't know how to use.
Perl is very good for some jobs, passable for others, and horrible for
other jobs. If Perl is the 'best' tool for a particular job, you need
to make the case. If you can't make the case, use whatever other tool
you have.
As far as I know, an ordinary user can install Perl and run Perl
scripts without the permission or intervention of the administrative
user. If you are dealing with some kind of firewall, that raises
different issues. If push comes to shove, you can always grab the
sources and compile it. I assume that your sysadmin doesn't have a
problem with C?
CC
------------------------------
Date: Wed, 03 Sep 2008 14:32:04 -0400
From: P B <newsposter625@gmail.com.invalid>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <4q13p5xfgb.ln2@homer.soren625.no-ip.org>
On 2008-09-03, John Bokma <john@castleamber.com> wrote:
> P B <newsposter625@gmail.com.invalid> wrote:
>> I'd like to install ActivePerl on a Windows XP machine...
>> [snip]
> You have limited access rights, and Perl will run with your rights.
> Hence it doesn't provide you with any magic.
That's just the answer I was looking for. Thanks, that will do it.
> If your admins don't get it, they shouldn't admin computers in the
> first place.
They aren't technically admins (only in the sense that they're in charge
of the computers and network, in fact that is one of their minor
duties.) The organization in question is not an IT shop at all, but
rather a (very) small community-based non-profit organization. They're
just erring on the side of caution. (They even require a password to
access the web via Internet Explorer on this special use workstation I
want to install Perl on.) I realize that their caution is probably born
primarily of ignorance, but at least they know enough to be cautious.
In any case, armed with your concise response, I can enlighten them and
they will assuredly indulge my desire to install Perl.
--
REST:
P: Linus Torvalds
S: Buried alive in email
-- from /usr/src/linux/MAINTAINERS
------------------------------
Date: Wed, 03 Sep 2008 14:40:13 -0400
From: P B <newsposter625@gmail.com.invalid>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <d923p5xphb.ln2@homer.soren625.no-ip.org>
On 2008-09-03, l v <veatchla@yahoo.com> wrote:
> P B wrote:
>> I'd like to install ActivePerl on a Windows XP machine ...
>> [snip]
> You "sell" the installation of Perl by tying it to a business need,
> show it's value and how Perl allows you to meet the business need.
Yeah, I got that much from `perlfaq -q convince' but I have already
successfully shown these people how Perl effectively meets a business
need. They agree, but they are still reserved when it comes to
installing things they're not familiar with. It's my job (in this case)
to make them familiar with the security implications of a Perl
installation.
Regards,
PB
--
You are not dead yet. But watch for further reports.
------------------------------
Date: Wed, 03 Sep 2008 14:46:49 -0400
From: P B <newsposter625@gmail.com.invalid>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <pl23p5x9ib.ln2@homer.soren625.no-ip.org>
On 2008-09-03, John Bokma <john@castleamber.com> wrote:
> "Dave Everson" <d a v i d . e v e r s o n @ h p . c o m> wrote:
>> Look for a new job. Seriously, if you work in an environment in
>> which installing Activestate Perl requires permission you probably
>> aren't in a place that will let you be successful.
> IMNSHO that's quite an over the top statement.
Agreed. See my followup upthread. While I (sort of) agree with Dave in
principle, we're talking about people who are simply not familiar with
Perl--or, for that matter, any sort of language or runtime--at all. I've
already said it elsewhere: they're just erring on the side of caution.
As soon as I'm able to allay their doubts and fears, they'll be fine
with it.
--
It's later than you think.
------------------------------
Date: Wed, 03 Sep 2008 14:30:07 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <86ljy9do3k.fsf@lifelogs.com>
On Wed, 03 Sep 2008 10:39:16 -0400 P B <newsposter625@gmail.com.invalid> wrote:
PB> Also, the script that I'd like to run if I do get Perl installed uses
PB> WWW::Mechanize. Are there any links, resources, opinions, or first-hand
PB> experiences as to the security implications of this particular module?
I have not heard of any issues with WWW::Mechanize. It's stable,
reliable, and does only the operations you ask for (except for redirects
IIRC).
Ted
------------------------------
Date: Thu, 04 Sep 2008 02:02:56 +0200
From: nntpman68 <news1234@free.fr>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <48bf25b0$0$15533$426a34cc@news.free.fr>
P B wrote:
> Hello,
>
> I'd like to install ActivePerl on a Windows XP machine specifically to
> run a particular script. The "problem" is that the admins in charge of
> the PC are very cautious about what is installed and the security
> implications of everything (as they should be).
>
Perhaps you could try to explain following:
Perl is 'just another interpreting language on your PC' and doesn't have
any specific security implications.
If they wanted to be safe, they had to forbid the execution of any
executable / script / macro not installed by them.
The damage you can do is done by the script you write and (rather)
independent of the language you implemented it in. (exceptions: the
script's runtime environment is a sandboxed or has other special
security features)
If you don't write servers and if you don't execute / eval anything
downloaded from unknown / external net works you're rather safe.
N
------------------------------
Date: Wed, 3 Sep 2008 11:23:08 -0700 (PDT)
From: cstith@gmail.com
Subject: Re: CLPM - a help group?
Message-Id: <a1ee4369-c33b-4026-b67b-474ff812970c@e39g2000hsf.googlegroups.com>
On Aug 6, 7:25=A0pm, Adam Worrall <worrall+u...@cs.bris.ac.uk> wrote:
> RedGrittyBrick wrote:
> > If I said "comp.lang.perl.misc is not a place for discussing pet
> > allergies" would I be legislating my own belief?
>
> No you would obviously be wrong, as the charter clearly states that this
> group is for all things Perl and discussions of "pet allergies" is
> clearly off topic. But that is no where near the same as saying "this is
> not a help desk" which is a personal view that is not something the
> charter (for this or it's predecessor group) had written.
>
You would obviously be wrong in your hasty reading and response to
that sentence. He/She said something and you agreed, but you called
him/her obviously wrong. Look through the flames, please, to see your
screen clearly.
------------------------------
Date: Wed, 03 Sep 2008 23:32:31 +0200
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: FAQ 6.18 Why don't word-boundary searches with "\b" work for me?
Message-Id: <48bf0300$0$182$e4fe514c@news.xs4all.nl>
John W. Krahn wrote:
> RedGrittyBrick wrote:
>> PerlFAQ Server wrote:
>>> You can also use the complement of \b, \B, to specify that there
>>> should
>>> not be a word boundary.
>>> In the pattern /\Bam\B/, there must be a word character before
>>> the "a"
>>> and after the "m". These patterns match /\Bam\B/:
>>> "llama" # "am" surrounded by word chars
>>> "Samuel" # same
>>> These strings do not match /\Bam\B/
>>> "Sam" # no word boundary before "a", but one after "m"
>>> "I am Sam" # "am" surrounded by non-word chars
>> If /\Bam\B/ differs from /\wam\w/ maybe an example could be added to
>> illustrate this. If not, perhaps there is a better example of the use
>> of \B?
> /\Bam\B/ matches two characters while /\wam\w/ matches four characters.
> $ perl -le'$_ = "Samuel"; s/\Bam\B/ex/; print'
> Sexuel
> $ perl -le'$_ = "Samuel"; s/\wam\w/ex/; print'
> exel
Additionally, \W can match when there's no \w around:
$ perl -lw
$_ = "++"; # Look Ma: no \w!
s/\B/Here/g; # Find matches
print;
__END__
Here+Here+Here
$
Hope this helps,
-- HansM
------------------------------
Date: Wed, 3 Sep 2008 11:09:42 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Find changes or differences in 2 text files
Message-Id: <1c307b07-51a3-43d4-88da-8a096a840f15@z72g2000hsb.googlegroups.com>
Is there a simple perlish way (or module) of comparing 2 text files
(or 2 strings containing their contents) and determining what is
different between the two? These text files are straight text, not
data of any type. Something along the lines of Diff without having to
shell out to it (unless Difff is faster).
Bill H
------------------------------
Date: 03 Sep 2008 18:20:28 GMT
From: Leon Timmermans <fawaka@gmail.com>
Subject: Re: Find changes or differences in 2 text files
Message-Id: <48bed56c$0$191$e4fe514c@news.xs4all.nl>
On Wed, 03 Sep 2008 11:09:42 -0700, Bill H wrote:
> Is there a simple perlish way (or module) of comparing 2 text files (or
> 2 strings containing their contents) and determining what is different
> between the two? These text files are straight text, not data of any
> type. Something along the lines of Diff without having to shell out to
> it (unless Difff is faster).
>
> Bill H
Please try CPAN before asking these kinds of questions. If you did, you
would have found Text::Diff, which does exactly what you are asking for.
Regards,
Leon Timmermans
------------------------------
Date: Wed, 3 Sep 2008 11:57:33 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: Find changes or differences in 2 text files
Message-Id: <c2b446b7-46f0-4084-8fdc-2f971f18712b@w7g2000hsa.googlegroups.com>
On Sep 3, 2:20=A0pm, Leon Timmermans <faw...@gmail.com> wrote:
> On Wed, 03 Sep 2008 11:09:42 -0700, Bill H wrote:
> > Is there a simple perlish way (or module) of comparing 2 text files (or
> > 2 strings containing their contents) and determining what is different
> > between the two? These text files are straight text, not data of any
> > type. Something along the lines of Diff without having to shell out to
> > it (unless Difff is faster).
>
> > Bill H
>
> Please try CPAN before asking these kinds of questions. If you did, you
> would have found Text::Diff, which does exactly what you are asking for.
>
> Regards,
>
> Leon Timmermans
Leon
Thanks for the tip - FYI searching for any variation of:
Find changes or differences in 2 text files
Finds nothing on Cpan. The search engine on there is very limited. I
would need to know what I am looking for to find what I am looking
for. And if I search for Diff, I get 124 different modules to dig
through.
Bill H
------------------------------
Date: 03 Sep 2008 15:56:18 GMT
From: xhoster@gmail.com
Subject: Re: How to check the size of each files that are being uploaded
Message-Id: <20080903115620.264$33@newsreader.com>
"tower.grv@gmail.com" <tower.grv@gmail.com> wrote:
> Hello.
> I am developing cgi perl script for uploading files with uploading
> progress bar.
> Now i have script that do this good.
How does it work? Does it use a separate frame for the monitoring?
> While uploading i must to know total size of the file that is being
> uploaded.
> It is not problem becouse there is global variable
> $ENV{CONTENT_LENGTH} that contains the lenght of the attachment.
>
> The problem is when 2 or more files are bieng uploaded.
>
> How can i know the size of each file?
Strictly on the server, you can't. At least not until each file is done
being sucked down by the server and the next "multipart/form-data" starts
arriving.
You might be able to craft some javascript running on the client side that
will check on the local file size and encoded it into the form submission.
But I don't see the point. As a user, I'd want to know when the upload is
likely to be done. What do I gain by knowing what each individual
component is doing?
> I use CGI->new(\&hook) method to catch file uploading process.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Thu, 4 Sep 2008 01:17:49 +0200
From: "Petr Vileta \(fidokomik\)" <stoupa@practisoft.cz>
Subject: Re: How to check the size of each files that are being uploaded
Message-Id: <g9n64h$tjo$1@adenine.netfront.net>
tower.grv@gmail.com wrote:
> Hello.
> I am developing cgi perl script for uploading files with uploading
> progress bar.
> Now i have script that do this good.
> While uploading i must to know total size of the file that is being
> uploaded.
> It is not problem becouse there is global variable
> $ENV{CONTENT_LENGTH} that contains the lenght of the attachment.
>
> The problem is when 2 or more files are bieng uploaded.
>
> How can i know the size of each file?
> I use CGI->new(\&hook) method to catch file uploading process.
Partial solution is to use javascript to check file sizes before user click on
Send button. But be sure to warn users which have javascript disabled in
browser. It is very simple:
<body>
<noscript>
<div style="border: 2px solid red">You have not javascript enabled, please
enable it.</div>
</noscript>
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>
-- Posted on news://freenews.netfront.net - Complaints to news@netfront.net --
------------------------------
Date: Wed, 03 Sep 2008 16:31:13 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: newbie also
Message-Id: <030920081631137693%jimsgibson@gmail.com>
In article <yyTtk.2$393.0@trnddc05>, NEAL ZIERKE <deniserz@verizon.net>
wrote:
> I'm just learning perl, so that said.
>
> question is.
>
>
> If I have file names in directory like /mydir/abcd12e.fgh ,,, in unix system
>
> I wish to test the "12" part of filenames. I understand and lot of examples
> on net for directory stuff ( File::Find::name )
>
> I wish to test against other file names that will look the same but the 12
> would be different ( this is the version of the file ) , say it might look
> like this /mydir/abcd45e.fgh, where as this is newest version.
>
> What is the easiest way to test those 2 char's of file name in perl
What are you trying to test? You can extract the digits using a regular
expression:
$file = '/mydir/abcd12e.fgh';
if( $file =~ /^(.+)(\d+)(.+)$/ ) {
my $ver = $2;
print "Version $ver of file $1..$3\n";
}
> So like
>
> use File::Find;
> find(\&myprocessing,"startdir");
> sub myprocessing
> {
> if ( "test the "12" vs the "45" )
> {
> "move the new to old file code "
> }
> }
find will only have one file name at a time. You can save the file
names in a global array and process the contents of the array after you
have called find. For efficiency, extract the version numbers and put
the remainder of the file name in a hash as you traverse the array,
which will allow you to easily check if two versions of the same file
exist in the directory (untested):
my @files;
find( sub( push(@files,$File::Find::name) ), $startdir);
my %versions;
for my $file ( @files ) {
if( $file =~ /^(.+)(\d+)(.+)$/ ) {
my $name = "$1$3";
my $ver = $2;
if( exists $versions{$name} ) {
print "Versions $ver and $versions{$name} exist for $name\n";
# do whatever processing needed
}else{
$versions{$name} = $ver;
}
}
}
--
Jim Gibson
------------------------------
Date: Wed, 3 Sep 2008 09:44:02 -0700 (PDT)
From: anguyen@redhat.com
Subject: Threads and sharing global variable
Message-Id: <654be608-6d78-4f0c-9781-d7ef0a4a4d56@l42g2000hsc.googlegroups.com>
Hi,
I am having a global array @gDone, and after spawning a number
threads, each would set the corresponding element to TRUE to signify
it has done its work so the parent thread could stop waiting.
It seems like the update of @gDone is not seen in the parent thread.
The print of $gDone[$tid] is always either FALSE or undef, depending
on how I set it in the parent thread.
Can someone help providing an explanation for this?
Anh-
------------------------------
Date: 03 Sep 2008 18:15:17 GMT
From: Leon Timmermans <fawaka@gmail.com>
Subject: Re: Threads and sharing global variable
Message-Id: <48bed434$0$191$e4fe514c@news.xs4all.nl>
On Wed, 03 Sep 2008 09:44:02 -0700, anguyen wrote:
> Hi,
> I am having a global array @gDone, and after spawning a number threads,
> each would set the corresponding element to TRUE to signify it has done
> its work so the parent thread could stop waiting. It seems like the
> update of @gDone is not seen in the parent thread. The print of
> $gDone[$tid] is always either FALSE or undef, depending on how I set it
> in the parent thread. Can someone help providing an explanation for
> this? Anh-
You haven't posted any code, did you use thread::shared?
Leon Timmermans
------------------------------
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 1835
***************************************