[23638] in Perl-Users-Digest
Perl-Users Digest, Issue: 5845 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 22 11:06:33 2003
Date: Sat, 22 Nov 2003 08:05:07 -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 Sat, 22 Nov 2003 Volume: 10 Number: 5845
Today's topics:
Avoiding running a process twice <dodgynewsgroups@ewildgoose.demon.co.uk>
Re: Bit counting benchmarks Was: count of 1s in a binar (Anno Siegel)
Re: Comments on parsing solution. <uri@stemsystems.com>
Re: Comments on parsing solution. (Anno Siegel)
dumb newbie question (or newbie dumb question) <jerry_c48@cordollisonline.com>
Re: dumb newbie question (or newbie dumb question) (Jay Tilton)
Re: Executing Perl from PHP <abigail@abigail.nl>
Re: Executing Perl from PHP <jwillmore@remove.adelphia.net>
Re: first line in each file in a dir <eddhig22@yahoo.com>
Re: first line in each file in a dir <eddhig22@yahoo.com>
Re: first line in each file in a dir <kuujinbo@hotmail.com>
Re: first line in each file in a dir <jwillmore@remove.adelphia.net>
Re: fork question <ben@liddicott.com>
Listing Functions Called In A Script <hal@thresholddigital.com>
Re: Listing Functions Called In A Script <krahnj@acm.org>
Re: Need a simple script that deletes files older than (Tad McClellan)
Re: Newbie Question: Best way to Extract Post Hashes? <ben@liddicott.com>
Re: Newbie Question: Best way to Extract Post Hashes? <jwillmore@remove.adelphia.net>
Re: Newbie Question: Best way to Extract Post Hashes? <REMOVEsdnCAPS@comcast.net>
Re: Protecting Source code of a perl script <jwillmore@remove.adelphia.net>
Re: Protecting Source code of a perl script (Anno Siegel)
question about Net::FTP (may)
Send a single ICQ message <no-spam@sonic.net>
what does "/usr/bin/perl: relocation error:" mean? (Sara)
Re: what does "/usr/bin/perl: relocation error:" mean? (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Nov 2003 15:43:35 GMT
From: "Ed W" <dodgynewsgroups@ewildgoose.demon.co.uk>
Subject: Avoiding running a process twice
Message-Id: <HuLvb.514884$be.71024@news.easynews.com>
This is almost certainly an FAQ quality question and I appologise in
advance, but could anyone point me to some references on how to avoid
allowing the user to run multiple instances of my app. I'm looking for
something cross platform, Win32 and linux.
The idea is that the app is a socket app and users will confuse themselves
if they can fire up multiple instances simultaneously. I would like to
detect that there already a running instance and if so, then bail out.
The root seems to be to find a nice generic way of checking the process
table? What are the best modules for this under Win32?
Thanks for any pointers
Ed W
------------------------------
Date: 22 Nov 2003 13:04:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Bit counting benchmarks Was: count of 1s in a binary number
Message-Id: <bpnmtk$fja$1@mamenchi.zrz.TU-Berlin.DE>
Michele Dondi <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
> On 12 Nov 2003 17:13:07 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
> Siegel) wrote:
>
> >> I'll do some benchmarks when I get a minute. I'm curious how it compares
> >> with a lookup table.
> >
> >Okay, here are the promised benchmarks.
>
> BTW: the thread from which this one originated and this one are
> jointly one of the best discussions I've read (and took part to)
> recently here on clpm. It may constitute the basis of a case study for
> an exposition or something similar...
Not an attempt to revive this thread (it *was* a good one), I just want
to mention that I have code that compiles, in either Perl or C, the
mask/shift/add-method (thread-insiders know what I mean) according to
the current word length. By itself it doesn't quite make a CPAN module,
but if anyone wants to make use of it, it's at
http://www.tu-berlin.de/zrz/mitarbeiter/anno4000/clpm/bench.bitcount
It's in the form of a benchmark, but the relevant code is easily extracted.
Anno
------------------------------
Date: Sat, 22 Nov 2003 05:07:26 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Comments on parsing solution.
Message-Id: <x7k75t56up.fsf@mail.sysarch.com>
>>>>> "TA" == Tore Aursand <tore@aursand.no> writes:
TA> On Thu, 20 Nov 2003 19:42:35 -0600, Eric J. Roode wrote:
>>> my @files = ();
>>> my %seen = ();
>>
>> Why not simply
>>
>> my @files;
>> my %seen;
>>
>> ?
>> Less typing, less chance for typos.
TA> You have a point, of course. My personal style, however, implies that I
TA> set each variable when I declare them. Even if it's not necessary, and
TA> even when they're empty.
my has a runtime effect of clearing variables.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 22 Nov 2003 12:20:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Comments on parsing solution.
Message-Id: <bpnk9j$e8g$1@mamenchi.zrz.TU-Berlin.DE>
Uri Guttman <uri@stemsystems.com> wrote in comp.lang.perl.misc:
> >>>>> "TA" == Tore Aursand <tore@aursand.no> writes:
>
> TA> On Thu, 20 Nov 2003 19:42:35 -0600, Eric J. Roode wrote:
> >>> my @files = ();
> >>> my %seen = ();
> >>
> >> Why not simply
> >>
> >> my @files;
> >> my %seen;
> >>
> >> ?
> >> Less typing, less chance for typos.
>
> TA> You have a point, of course. My personal style, however, implies that I
> TA> set each variable when I declare them. Even if it's not necessary, and
> TA> even when they're empty.
>
> my has a runtime effect of clearing variables.
Ah, but Tore knows that. His style rule says to initialize every variable,
whether it needs it or not. That's how I read his remark, and it's what
I did for a long while too.
I don't do it anymore. For one, every redundant statement in a source
leaves a nagging doubt whether the author perhaps *thought* it necessary,
thereby revealing a lack of acquaintance with the language. A good style
should build confidence that the author knows what they're doing, not under-
mine it.
Another reason for not always initializing is that you can tell the reader
something by initializing only where necessary. In saying:
my $x = 0;
# some code involving $x
print $x;
I'm giving a subtle hint that "some code ..." may *not* set $x under some
circumstances. Without the initialization the reader knows that I believe
$x will always be set. Always initializing all variables takes this bit of
expressiveness away.
Anno
------------------------------
Date: Sat, 22 Nov 2003 15:38:11 GMT
From: "Jerry C." <jerry_c48@cordollisonline.com>
Subject: dumb newbie question (or newbie dumb question)
Message-Id: <3FBF82DD.9F5E448E@cordollisonline.com>
Hi, I have the following code which finds and prints the first 2 digits
in a string. I'm trying to make it more efficient. Here's the code:
$sentence = "January 23, 1992";
if ($sentence =~ /\d\d/) { $sentence = "$&"; }
print $sentence;
If I know that "$sentence" will ALWAYS have a two digit date, is there a
way I can get rid of the "if - then" statement and just have it print
$sentence??? I tried this, and it doesn't work:
$sentence = "January 23, 1992";
$sentence = /\d\d/;
print $sentence;
I'm just trying to make my script slightly more efficient by getting rid
of that "if - then" statement.
Thanks,
-Jerry
p.s. I really appreciate your help! If you could answer this question,
too, it would be greatly appreciated: In Perl Version 5.6.1, this code
worked, but in version 5.8.0, it no longer works. Any idea why?
$sentence = "January 23, 1992";
$sentence =~ s/[^\d]+//g;
$sentence = substr($sentence,0,2);
$sentence =~ s/\b0//;
print $sentence;
------------------------------
Date: Sat, 22 Nov 2003 16:03:56 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: dumb newbie question (or newbie dumb question)
Message-Id: <3fbf8635.131673048@news.erols.com>
"Jerry C." <jerry_c48@cordollisonline.com> wrote:
: Subject: dumb newbie question (or newbie dumb question)
In future, please choose a Subject line that describes the subject of the
article, not yourself or the quality of the article. See the clpm posting
guidelines at http://mail.augustmail.com/~tadmc/clpmisc.shtml .
: Hi, I have the following code which finds and prints the first 2 digits
: in a string. I'm trying to make it more efficient. Here's the code:
:
: $sentence = "January 23, 1992";
: if ($sentence =~ /\d\d/) { $sentence = "$&"; }
: print $sentence;
:
: If I know that "$sentence" will ALWAYS have a two digit date, is there a
: way I can get rid of the "if - then" statement and just have it print
: $sentence??? I tried this, and it doesn't work:
:
: $sentence = "January 23, 1992";
: $sentence = /\d\d/;
: print $sentence;
Add capturing parentheses to the regex and assign the return from m// in
list context to $sentence.
($sentence) = $sentence =~ /(\d\d)/;
: p.s. I really appreciate your help! If you could answer this question,
: too, it would be greatly appreciated: In Perl Version 5.6.1, this code
: worked, but in version 5.8.0, it no longer works. Any idea why?
:
: $sentence = "January 23, 1992";
: $sentence =~ s/[^\d]+//g;
: $sentence = substr($sentence,0,2);
: $sentence =~ s/\b0//;
: print $sentence;
"It no longer works" does nothing to describe the problem.
What should the code do that it does not?
What does the code do that it should not?
------------------------------
Date: 22 Nov 2003 09:53:34 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Executing Perl from PHP
Message-Id: <slrnbrucgu.el5.abigail@alexandra.abigail.nl>
Dan Anderson (dan@mathjunkies.com) wrote on MMMDCCXXXV September MCMXCIII
in <URL:news:m2n0ap5a79.fsf@syr-24-59-76-83.twcny.rr.com>:
)) Abigail <abigail@abigail.nl> writes:
))
)) > Dan Anderson (dan@mathjunkies.com) wrote on MMMDCCXXXIV September
)) > MCMXCIII in <URL:news:m23cchzbqe.fsf@syr-24-59-76-83.twcny.rr.com>:
)) > []
)) > [] I have a PHP frontend to a Perl script. Currently the PHP
)) > [] script opens up the Perl script and posts what to do, and the Perl
)) > [] script outputs the results, and that's how they communicate. I find
)) > [] it very inefficient though, and was curious, does anyone know of a way
)) > [] to run Perl from inside of PHP?
)) > []
)) > [] I know that PHP has a system call -- sort of like back ticks
)) > [] in perl -- but it can be disabled depending on the way PHP is set up.
)) > [] Anyone know another way?
)) >
)) >
)) > That would be PHP questions, now wouldn't they?
))
)) Well it seemed reasonable to assum that since perl is easily
)) integrated with other languages that somebody might have written a
)) module in CPAN or would know something about it.
CPAN has Perl modules, not PHP modules.
Abigail
--
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";
------------------------------
Date: Sat, 22 Nov 2003 11:30:19 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Executing Perl from PHP
Message-Id: <20031122063019.0f3c0634.jwillmore@remove.adelphia.net>
On Sat, 22 Nov 2003 03:55:06 GMT
Dan Anderson <dan@mathjunkies.com> wrote:
> Abigail <abigail@abigail.nl> writes:
>
> > Dan Anderson (dan@mathjunkies.com) wrote on MMMDCCXXXIV September
> > MCMXCIII in
> > <URL:news:m23cchzbqe.fsf@syr-24-59-76-83.twcny.rr.com>:[]
> > [] I have a PHP frontend to a Perl script. Currently
> > the PHP[] script opens up the Perl script and posts what to
> > do, and the Perl[] script outputs the results, and that's how
> > they communicate. I find[] it very inefficient though, and was
> > curious, does anyone know of a way[] to run Perl from inside of
> > PHP? []
> > [] I know that PHP has a system call -- sort of like
> > back ticks[] in perl -- but it can be disabled depending on the
> > way PHP is set up.[] Anyone know another way?
> >
> >
> > That would be PHP questions, now wouldn't they?
>
> Well it seemed reasonable to assum that since perl is easily
> integrated with other languages that somebody might have written a
> module in CPAN or would know something about it.
Right ......
Perl modules, written in Perl, to execute/access/etc PHP. If that's
the case, we can assist. *Not* the other way - as your post suggests
("I have a PHP front end to a Perl script").
Go to http://search.cpan.org/ if you would like to search for a Perl
module that will execute/access/etc. PHP.
Post to a PHP group if going the other way.
Have a good day :-)
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
You never know how many friends you have until you rent a house
<on the beach.
------------------------------
Date: Sat, 22 Nov 2003 17:30:20 +1100
From: Edo <eddhig22@yahoo.com>
Subject: Re: first line in each file in a dir
Message-Id: <3FBF027C.6010206@yahoo.com>
Glenn Jackman wrote:
> Edo <eddhig22@yahoo.com> wrote:
>
>> opendir(DIR, "/.../");
>> my @files = readdir(DIR);
>> closedir(DIR);
>> foreach my $file (@files) {
>> open FL, $file or die $!;
>> print <FL>, "\n";
>> }
>
>
> readdir does not prepend the directory name onto the filename. Try:
> my $dir = '/...';
> opendir DIR, $dir or die "can't opendir $dir: $!\n";
> my @files = map "$dir/$_", readdir DIR;
> closedir DIR;
>
my $dir = '/some/good/path';
opendir DIR, $dir or die "can't opendir $dir: $!\n";
my @files = map "$dir/$_", readdir DIR;
closedir DIR;
foreach my $file (@files) {
open FL, $file or die $!;
print <FL>,"\n";
}
perl prog/files
can't opendir /some/good/path: No such file or directory
~$
------------------------------
Date: Sat, 22 Nov 2003 17:33:17 +1100
From: Edo <eddhig22@yahoo.com>
Subject: Re: first line in each file in a dir
Message-Id: <3FBF032D.1080908@yahoo.com>
Edo wrote:
> Glenn Jackman wrote:
>
>> Edo <eddhig22@yahoo.com> wrote:
>>
>>> opendir(DIR, "/.../");
>>> my @files = readdir(DIR);
>>> closedir(DIR);
>>> foreach my $file (@files) {
>>> open FL, $file or die $!;
>>> print <FL>, "\n";
>>> }
>>
>>
>>
>> readdir does not prepend the directory name onto the filename. Try:
>> my $dir = '/...';
>> opendir DIR, $dir or die "can't opendir $dir: $!\n";
>> my @files = map "$dir/$_", readdir DIR;
>> closedir DIR;
>>
>
>
> my $dir = '/some/good/path';
> opendir DIR, $dir or die "can't opendir $dir: $!\n";
> my @files = map "$dir/$_", readdir DIR;
> closedir DIR;
>
> foreach my $file (@files) {
> open FL, $file or die $!;
> print <FL>,"\n";
> }
>
> perl prog/files
> can't opendir /some/good/path: No such file or directory
> ~$
>
Ok, it worked after I changed the /some/good/path to some/good/path but
it prints the whole file and I want to print only the first line.
thanks
------------------------------
Date: Sat, 22 Nov 2003 16:30:27 +0900
From: ko <kuujinbo@hotmail.com>
Subject: Re: first line in each file in a dir
Message-Id: <bpn3h0$mg2$1@pin3.tky.plala.or.jp>
Edo wrote:
> Glenn Jackman wrote:
[snip]
> my $dir = '/some/good/path';
> opendir DIR, $dir or die "can't opendir $dir: $!\n";
> my @files = map "$dir/$_", readdir DIR;
> closedir DIR;
>
> foreach my $file (@files) {
> open FL, $file or die $!;
> print <FL>,"\n";
> }
>
> perl prog/files
> can't opendir /some/good/path: No such file or directory
> ~$
>
The error message is there for a reason - as John Krahn has already
pointed out, @files contains *everything* from the directory, including
the entries for the current directory '.' and the parent directory '..'.
So your script dies on the first iteration of foreach because you're
trying to open a *directory*. You should at least use a simple filter:
my @files = grep { -f } readdir(DIR);
Type 'perldoc -f -X' from your shell for an explanation of the '-X file
tests'
Please read all of the responses in the thread. The last print statement
will print the *entire* file, not the first line. See either John's or
Uri Guttman's post for an explanation.
HTH - keith
------------------------------
Date: Sat, 22 Nov 2003 08:59:59 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: first line in each file in a dir
Message-Id: <20031122035959.21e4221b.jwillmore@remove.adelphia.net>
On Sat, 22 Nov 2003 17:33:17 +1100
Edo <eddhig22@yahoo.com> wrote:
<snip>
> Ok, it worked after I changed the /some/good/path to some/good/path
> but it prints the whole file and I want to print only the first
> line.
Please take the time to *read* the other posts to this thread (like
Uri's and John's). They answered *why* this is happening already.
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Death is life's way of telling you you've been fired. -- R.
Geis
------------------------------
Date: Sat, 22 Nov 2003 14:23:04 +0000 (UTC)
From: "Ben Liddicott" <ben@liddicott.com>
Subject: Re: fork question
Message-Id: <bpnrg8$fde$1@titan.btinternet.com>
Hi Bruno,
I have found fork() to be unreliable on ActivePerl, in the same way as =
you. Can I suggest you use system(1, $0, @some_args), which creates an =
entirely fresh process on Win32, unless there is too much stuff to =
reasonably fit into @some_args?
See system in perlport for more on this.
Since you suggest you are simply dividing up the work, I'd suggest this =
would be OK. You can have each write intermediate results to individual =
files, then collect the information together after they all finish.
--=20
Cheers,
Ben Liddicott
"bruno" <bskorepa@yahoo.com> wrote in message =
news:f542e1ac.0311200912.7c43f1e6@posting.google.com...
> I have a script that goes over an alphabetical list of symbols.
> To speed things up I fork.
> In each thread I load a list of symbols. When the last symbol is done,
> I get a GPF: "Attempt to free unreferenced scalar"
>=20
> system win2000, activeperl 5.8
> The script runs OK when not forking.
------------------------------
Date: Sat, 22 Nov 2003 05:35:14 GMT
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Listing Functions Called In A Script
Message-Id: <mACvb.273194$Fm2.287062@attbi_s04>
I can't remember much about this, but I thought I remembered a reference
somewhere to a program or utility that would scan a Perl script and list
the functions/subroutines it called and which modules each one was in. Is
there a utility like this? If so, what's it called?
Thanks.
Hal
------------------------------
Date: Sat, 22 Nov 2003 06:53:40 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Listing Functions Called In A Script
Message-Id: <3FBF07F0.D66FBC57@acm.org>
Hal Vaughan wrote:
>
> I can't remember much about this, but I thought I remembered a reference
> somewhere to a program or utility that would scan a Perl script and list
> the functions/subroutines it called and which modules each one was in. Is
> there a utility like this? If so, what's it called?
perldoc B::Xref
John
--
use Perl;
program
fulfillment
------------------------------
Date: Fri, 21 Nov 2003 23:06:10 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Need a simple script that deletes files older than 30 days
Message-Id: <slrnbrtrm2.7q2.tadmc@magna.augustmail.com>
Tintin <me@privacy.net> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnbrt97f.7cc.tadmc@magna.augustmail.com...
>> Chris Gregory <christian_gregory2002@yahoo.com> wrote:
>>
>> > Is there a script that deletes files older than 30 days
>>
>>
>> You could write one in about 10 lines of Perl.
>
> or one command if cygwin is installed.
or one little Perl program, even on Redmondware:
http://www.perl.com/language/ppt/src/head/index.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 22 Nov 2003 10:34:27 +0000 (UTC)
From: "Ben Liddicott" <ben@liddicott.com>
Subject: Re: Newbie Question: Best way to Extract Post Hashes?
Message-Id: <bpne3j$em9$1@titan.btinternet.com>
See the CGI group of modules.
# perldoc CGI
In general, the documentation which comes with a distribution is very =
good, and is accessible through the perldoc command.
For more information:
# perldoc perldoc
--=20
Cheers,
Ben Liddicott
"Andrew" <awilhite@cableone.net> wrote in message =
news:9b7dcecd.0311211429.3c7a7735@posting.google.com...
> Hello,
>=20
> I am a Perl newbie and I was wondering if anyone could tell me the
> best way to extract expected post keys and values from websites?
------------------------------
Date: Sat, 22 Nov 2003 11:23:37 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Newbie Question: Best way to Extract Post Hashes?
Message-Id: <20031122062337.0ae9d09a.jwillmore@remove.adelphia.net>
[THIS is top posting - please DON'T do this]
On Sat, 22 Nov 2003 10:34:27 +0000 (UTC)
"Ben Liddicott" <ben@liddicott.com> wrote:
> See the CGI group of modules.
>
> # perldoc CGI
This is a *single* module - not a "group". There are other modules
that have the prefix "CGI", but this command will provide
documentation for a *single* module.
<snip>
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Those of you who think you know everything are very annoying to
those of us who do.
------------------------------
Date: Sat, 22 Nov 2003 06:28:04 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Newbie Question: Best way to Extract Post Hashes?
Message-Id: <Xns943B4C29BB375sdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
awilhite@cableone.net (Andrew) wrote in news:9b7dcecd.0311211429.3c7a7735
@posting.google.com:
> Hello,
>
> I am a Perl newbie and I was wondering if anyone could tell me the
> best way to extract expected post keys and values from websites? is
> there an easy way to extract the expected post/value from a web site
> with the intention of using the information to write an agent or
> spider script for? Does anyone know of way to automatically gather it
> and post dynamically?
I have been a web programmer for eight years, and I have no clue what you
mean by "expected post keys and values". Can you give some more details
about what you are trying to do?
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP79Wl2PeouIeTNHoEQK1hACfX+Z6OXkItewefV39bPOaMIBAAj4AoMP+
iKKbBa3dkinz64meSFD/DG6c
=Xn84
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 22 Nov 2003 09:23:17 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Protecting Source code of a perl script
Message-Id: <20031122042302.1e3397d0.jwillmore@remove.adelphia.net>
On 21 Nov 2003 09:19:11 -0800
wherrera@lynxview.com (Bill) wrote:
> Ben Morrow <usenet@morrow.me.uk> wrote in message
> news:<bpku88$4q8$1@wisteria.csv.warwick.ac.uk>...
> > > Actually this is a very frequent scenario.
> > > Or would you trust your personal medical files to the admin of
> > > the hospital computer?
> >
> > I would (implicitly) trust him not to look at them unless it was
> > strictly necessary. Or I would trust the hospital to sack him if
> > he did.
>
> This is actually a situation where obscurity is useful, not to keep
> away truly prying eyes, but to keep from accidental exposure of
> confidential data. There is a reason that changing rooms and shower
> stalls have doors or curtains, even if they do not lock :). I keep
> some data on a public server encrypted, even though a determined
> administrator could crack the encryption with only a day's work. (A
> non-administrator could not crack it without years of work, we
> hope.)
You're *protecting* the data, not *obscuring* the data. So, if
someone takes your hard drive, you know there's data on the hard
drive, but can't read it because it's *protected*. You didn't *hide*
the data, you *protected* the data through encryption.
The OP wanted to *obscure* (or *hide*) the data by changing the format
of the script. Running 'strings' may yield vital information
contained in the script turned binary. So, just changing the format
of the script to *hide* the code is a weak way to *protect* the code.
It's a subtle, but important, difference.
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
The optimum committee has no members. -- Norman Augustine
------------------------------
Date: 22 Nov 2003 11:25:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Protecting Source code of a perl script
Message-Id: <bpnh3b$c0c$1@mamenchi.zrz.TU-Berlin.DE>
<ctcgag@hotmail.com> wrote in comp.lang.perl.misc:
> "Eric J. Roode" <REMOVEsdnCAPS@comcast.net> wrote:
> > Hash: SHA1
> >
> > ctcgag@hotmail.com wrote in news:20031120131044.987$Ih@newsreader.com:
> >
> > > rgarciasuarez@free.fr (Rafael Garcia-Suarez) wrote:
> > >> Forget about it.
> > >>
> > >> Moreover, security through obscurity just does not work.
> > >
> > > I think security by obscurity is about the only thing that does
> > > work. The obscurity of the private key is how public/private key
> > > systems work. The obscurity of the password is how most log-on
> > > authentication systems work.
> >
> > That is not what is meant by "security by obscurity".
>
> I just think it's kind of cheating to coerce the language into making
> your argument for you. When something you think should be open is not,
> that is labelled obscurity, while when something you think should not be
> open is not, that is labelled security. So then when you say not to do
> security by obscurity, it's really just saying "don't do that which you
> shouldn't do."
There is a little more content in the distinction than security-good,
obscurity-bad. Security is designed, obscurity happens while you're
doing something else. Compilation is a good example for the latter.
What makes obscurity "bad" is that there is no way of telling how safe
it actually is. Since a chain can't be stronger than its weakest link,
it's not good to have a link of unknown strength in your chain.
Anno
------------------------------
Date: 22 Nov 2003 07:43:50 -0800
From: lornazh@sina.com (may)
Subject: question about Net::FTP
Message-Id: <7cb3aaec.0311220743.16b7c228@posting.google.com>
one of Net::FTP's constructor is new(HOST[,OPTIONS]),how to use the
Firewall & FirewallType options?
------------------------------
Date: Sat, 22 Nov 2003 12:51:43 GMT
From: Eric S Ma <no-spam@sonic.net>
Subject: Send a single ICQ message
Message-Id: <MPG.1a28fb67e925b6989680@news.sf.sbcglobal.net>
I need to send single messages to another ICQ client. There is no need
to get any response back from the client. I tried Net::ICQ but to no
avail. My code is as follows:
use Net::ICQ;
my $icq = Net::ICQ->new(MYUSERID, PASSWORD, "login.icq.com", 5190);
$icq->connect();
die "Unable to connect" if ! $icq->connected();
my $params = { 'type' => 1,
'text' => 'Hello world',
'receiver_uin' => HISUSERID
};
$icq->send_event('CMD_SEND_MESSAGE', $params);
$icq->start();
Any help is appreciated.
Eric --
------------------------------
Date: 22 Nov 2003 04:45:30 -0800
From: genericax@hotmail.com (Sara)
Subject: what does "/usr/bin/perl: relocation error:" mean?
Message-Id: <776e0325.0311220445.53188050@posting.google.com>
Perl was running fine on this box last night, now I get this error:
./user.pl
/usr/bin/perl: relocation error:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so:
undefined symbol: Perl_rxres_fr
uhhhhh.. OK? I searched news for "Perl_rxres_fr" - is this the first
time this ever happened?
Thanks!
G
------------------------------
Date: 22 Nov 2003 13:34:38 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: what does "/usr/bin/perl: relocation error:" mean?
Message-Id: <bpnole$gfn$1@mamenchi.zrz.TU-Berlin.DE>
Sara <genericax@hotmail.com> wrote in comp.lang.perl.misc:
> Perl was running fine on this box last night, now I get this error:
>
> ./user.pl
> /usr/bin/perl: relocation error:
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so:
> undefined symbol: Perl_rxres_fr
>
>
> uhhhhh.. OK? I searched news for "Perl_rxres_fr" - is this the first
> time this ever happened?
It's not a Perl error, your system can't load Perl, or probably something
Perl wants to load dynamically. Does perl run by itself (/usr/bin/perl
-e '')? What non-core modules does "user.pl" use? Could there be a
version mixup?
The prefix "Perl_" was introduced to some of the symbols in the perl core
rather late in the game, and some XS modules have taken even longer to
catch up. There may still be some that haven't.
Anno
------------------------------
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 5845
***************************************