[9964] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3557 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 26 23:03:10 1998

Date: Wed, 26 Aug 98 20:00:19 -0700
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, 26 Aug 1998     Volume: 8 Number: 3557

Today's topics:
    Re: Code Style (Was: How to sort this associative array <zenin@bawdycaste.org>
    Re: I NEED A PASWORD IN CGI!!!!  HELP (brian d foy)
    Re: Is there a size limit on $ vars? (Martien Verbruggen)
    Re: MIME Type for files with .PL Extensions? <NOTHANKStbeaulieu@mediaone.net>
        need and INI File parser in perl <psuravar@cisco.com>
    Re: newbie question (Bob Trieger)
    Re: newbie question <NOTHANKStbeaulieu@mediaone.net>
        numeric operators <dan@fearsome.net>
    Re: Perl compiler <jhill@shamrockmedia.com>
    Re: Perl compiler (Abigail)
    Re: Perl compiler (Abigail)
    Re: Perl Cookbook, does anyone have it? (brian d foy)
    Re: Pretty HTML-izing of Perl source? <elharaty@/*blorp*/utdallas.edu>
    Re: question RE downloading webpages and parsing them. (Martien Verbruggen)
        Reading a binary file and converting it's data. <jimr@xnet.com>
    Re: Reading a binary file and converting it's data. <NOTHANKStbeaulieu@mediaone.net>
    Re: reading specific words from an Mp3 file <NOTHANKStbeaulieu@mediaone.net>
    Re: Threading/forking simple(?) programs <zenin@bawdycaste.org>
    Re: undump ported to Solaris <rra@stanford.edu>
        Unreadable Scripts? <ceci@bway.net>
    Re: Unreadable Scripts? (Martien Verbruggen)
    Re: What is it? (Tad McClellan)
    Re: why no true/false keywords? (Mark-Jason Dominus)
    Re: why no true/false keywords? (Abigail)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 27 Aug 1998 01:49:36 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <904182512.42120@thrush.omix.com>

Kevin Reid <kpreid@ibm.net> wrote:
: Just thought I'd list some of my formatting styles:
: my $self = bless {
:   param => 'value',
:   p2 => $input,
: }, $class;

        I'd line up the "=>"s, but that's me. :-)

: for ($i = 0; $i < maxval(); $i++) {
:   code;
: }
: if (
:   cond1 and
:   cond2 and
:   cond3
: ) {
:   code;
: }

        Putting the flow control keywords at the end is problematic if
        your conditions aren't very short:

        if (
            some condiontion and
            cond2 and
            some other condition that is long and
            something and
            yet another long condition or (
                foo and
                bar and
                dog
            )
        ) {
            code;
        }

        I personally find this much easier to read:

        if (
            some condiontion
            and cond2
            and some other condition that is long
            and something
            and yet another long condition
            or (
                foo
                and bar
                and dog
            )
        ) {
            code;
        }

: $win->sethook("hit", sub {
:   my ($self, $window) = @_;
:   code;
: });

        These I tend to pull out, but that's just me:
        
        $win->sethook (
            "hit" => sub {
                my ($self, $window) = @_;
                code;
             },
        );

        But of course it's not as compact and doens't add much in this
        case. -I mainly just don't like multiple closing brackets such
        as }); because they can't be lined up uniquely.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Wed, 26 Aug 1998 21:39:27 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: I NEED A PASWORD IN CGI!!!!  HELP
Message-Id: <comdog-ya02408000R2608982139270001@news.panix.com>
Keywords: from just another new york perl hacker

In article <1998082700310700.UAA21163@ladder01.news.aol.com>, crazy2u@aol.com (cRaZy2U) posted:

>hi I need a pasword protected web page which requires a login and a password if

use mod_perl or htaccess.

good luck :)

>you know how please e-mail me at crazy2u@erols.com

if you want to know how, read the documentation.


good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: Thu, 27 Aug 1998 02:26:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Is there a size limit on $ vars?
Message-Id: <rt3F1.1$2A.134@nsw.nnrp.telstra.net>

In article <jnlur6.hqg.ln@metronet.com>,
	tadmc@metronet.com (Tad McClellan) writes:

>   Best to avoid the shell and do it all from within perl:
> 
>    @files = <*.*>;  # see 'glob' in the perlfunc man page

That actually invokes the shell to do the wildcard expansion for you.
And the same goes for glob().

# perldoc perlop
[snip]
     Because globbing invokes a shell, it's often faster to call
     readdir() yourself and do your own grep() on the filenames.
     Furthermore, due to its current implementation of using a
     shell, the glob() routine may get "Arg list too long" errors
     (unless you've installed tcsh(1L) as /bin/csh).
[snip]

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Wed, 26 Aug 1998 22:50:48 -0400
From: "Todd B" <NOTHANKStbeaulieu@mediaone.net>
Subject: Re: MIME Type for files with .PL Extensions?
Message-Id: <6s2hkg$8hl$1@wbnws01.ne.highway1.com>

i don't think mime has anything to do with pl files.  you wouldn't want to
return the contents of a pl file would you?  you want it to execute on the
server, not be returned.

it has to be executable or configured via file extension on an nt box.



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

Date: Wed, 26 Aug 1998 18:29:12 -0700
From: Prasad Suravarapu <psuravar@cisco.com>
Subject: need and INI File parser in perl
Message-Id: <35E4B668.38A3@cisco.com>

If there is an INI type configuration file parser in perl,
I need it. Don't want to re-invent the wheel.

I am talking about the kind 
--------
[abc]
sh=ghh
gh=hj

;second set
[xyz]
bn=sd
sdds=sdjdsj sds
 .
 .
etc.
----------

Thanks,
Prasad

--
Prasad Suravarapu
Cisco Systems, Inc.
408-526-7997


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

Date: Thu, 27 Aug 1998 02:13:01 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: newbie question
Message-Id: <6s2fhf$klb$1@ligarius.ultra.net>

Justin Kidder <jrkst34+@pitt.edu> wrote:
-> I'm installing a message board script from off the web, but it didn't
-> work.  So I ran it with the command "perl -w" and I got the following
-> error:

There are 3 places to look for help on problems with cgi scripts you 
downloaded from the net and c.l.p.m isn't one of them:

- The documentation that came with the script.
- The author of the script.
- news:comp.infosystems.www.authoring.cgi


-> "my" may clash with future reserved word at multipageboard.cgi line 769.
-> Syntax error in file multipageboard.cgi at line 769, next 2 tokens "my
-> ("
-> Execution of multipageboard.cgi aborted due to compilation errors.
-> 
-> Here is my result of "perl -v":
-> 
-> This is perl, version 4.0

You need to upgrade your perl. 4.0 contains assorted security holes, 
memory leaks and is not y2k compliant among other things such as being 
obsolete.

-> Can anyone help me out here and tell me how to fix it?  I've never
-> really studied perl before, and I don't want to have to learn the whole
-> language to install this one script.  Thanks so much to whoever can help

You are definately barking up the wrong tree. c.l.p.m is for perl 
programmers, not people who don't want to study perl.

Good luck.

Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: Wed, 26 Aug 1998 22:54:18 -0400
From: "Todd B" <NOTHANKStbeaulieu@mediaone.net>
Subject: Re: newbie question
Message-Id: <6s2hr6$8kr$1@wbnws01.ne.highway1.com>

newbies aren't welcome here - we are considered to be the scum of the earth
amongst the elitest perl snobs.

we are more than welcome to spend our money on their books, but don't try to
ask any questions.

regardless of the question, if there is written doc on it somewhere, in some
form, we are not allowed to ask it.  for some reason we are expected to know
what to look up and read every line of doc before attempting to code or to
ask a single question.

aren't internet newsgroups just wonderful?



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

Date: Thu, 27 Aug 1998 02:36:05 +0100
From: "Daniel Adams" <dan@fearsome.net>
Subject: numeric operators
Message-Id: <904181795.747.0.nnrp-10.c2deb1c5@news.demon.co.uk>

Hi,

I'm throwing myself to the mercies of the clpm ng, unable to get my head
around a problem I seem to be having with numeric operators and the like. I
am trying to be a model Usenet citizen, and I have made every effort in this
post to improve upon my earlier efforts which provided insufficient
information. I have included comments in my code, I have said what I
expected the script to do, what it actually does, and included my code at
the foot of the message - I hope someone feels inspired to help!

I'll explain what is meant to happen, then explain what actually happens
(the problem!) , and finally print the code is at the foot of this message
for reference (please bear in mind its not the whole script, just the
relevant parts.

What is Meant to Happen: Let me say that the aim of (this part of the)
script is simply to go to one of two subroutines ("success" or "fail") based
largely on whether certain files exist. When I feed the script information
intending to make the script reach subroutine "success" it works as
expected. (I have tested subroutine "fail" also and, if it works properly,
_when reached_.)

What Actually Happens:  When I feed the script information (through a form
on the web) intending to make it reach subroutine "fail" it times out to the
browser, and it does nothing when executed via telnet - I think there is
some horendous loop going on somewhere which it is unable to break out of,
but I can't find it in the code. I know the code is slightly sloppy, but I'm
very new to Perl, so my apologies. Heartfelt thanks in advance to anybody
who helps me out with this:

Code:
############################

$FORM{$name} = $value;

$year = $FORM{'year'};
$month = $FORM{'month'};
$day = $FORM{'day'};
$path = $FORM{'path'};

# set $day_found to $day
$day_found = $day;

# set $expire to $day minus seven
$expire = $day - 7;

# go to subroutine "find_out"
&find_out;

sub find_out {
# see if the file exists. If it does, go to subroutine "success" (this works
fine)
if (-e "/disk1/usr//public_html/archive/$year/$month/$day_found/index.htm")
{ &success; }
# if the file doesn't exist, then go to subroutine "not"
else { &not; }
exit;
}

sub not {
# if $day_found has been decremented to a value of 0, then go to subroutine
"prev_month"
if ($day_found =~ 0) { &prev_month; }
# if $day_found is not 0, but is equal in value to variable $expire, then go
to subroutine "fail"
elsif ($day_found == $expire) { &fail; }
# if none of the above conditions are met, decrement variable $day_found by
one and then...
else { $day_found--; }
# go to subroutine "find_out"
&find_out;
exit;
}

sub prev_month {
# decrement the numerical value of variable $month by one
$month--;
# increment variable $day_found by 31
$day_found += 31;
# increment variable $expire by 29
$expire += 29;
# Return to subroutine "find_out"
&find_out;
exit;
}

############################

--

Dan Adams
dan@fearsome.net
http://fearsome.net




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

Date: Wed, 26 Aug 1998 09:17:43 -0700
From: Jeff Hill <jhill@shamrockmedia.com>
Subject: Re: Perl compiler
Message-Id: <35E43527.BC7C9FEF@shamrockmedia.com>

Give me a break, sicophants.  The guy lost his cool.

Lily Y. Fu wrote:

> Your accuse was completely wrong and groudless.
> I didn't want them to read the text, simply
> because I have password embedded in the program
> in clear text.
>
> I would appreciate you guys help me out
> on "protecting the password" issue...
>
> I downloaded a "Perl Compiler"
> but had some difficulty to make it work.
>
> thanks,
>
> Lily
>
> Tom Christiansen wrote:
> >
> >  [courtesy cc of this posting sent to cited author via email]
> >
> > In comp.lang.perl.misc, "Lily Y. Fu" <lily@tigr.org> writes:
> > :I have a perl program, I want to compiler it into binary
> > :so that users of the program will not be able to
> > :read it as clean text.
> > :
> > :How can I do it?
> >
> > You simply don't give them the program.  Then they can't read it.
> >
> > I just don't understand this culture of hoarding and obfuscation.
> > Your program is almost certainly worth nothing anyway -- is it now?
> > What's so great about it anyway?  So just give it away.  Or put an
> > explicit copyright on it and a restriction that says it can't be used
> > for profit or some such.
> >
> > But why are you trying to stop others from learning?  That's *evil*.
> > Let's just burn books instead.  Or take away Perl unless you pay for it.
> > Or restrict access to its documentation.  Is that what you'd like
> > to see the world come to?  What you're talking about is anti-science,
> > anti-usenet, and anti-perl.  That is the spirit that gives us fleeceware
> > in all its wicknessless, not the spirit that gave us the open freeware
> > that runs the net.
> >
> > You lose karma points by withholding.  You gain prestige not by what
> > you sell nor by what you buy, but rather by what you freely give away
> > to others, and how beautiful and useful that thing is.  While you are
> > certainly under no obligation to do so, neither are we under any sort of
> > obligation to help you in your embarrassing pursuit of shameful hoarding.
> > I do not wish you luck, because I am morally opposed to the choice you
> > are attempting to make.
> >
> > Just give it away, Lily, and become famous if it's a wonderful program.
> >
> > --tom
> > --
> > As far as the laws of mathematics refer to reality, they are not
> > certain; and as far as they are certain, they do not refer to reality.
> >                 --Albert Einstein
>
> --
> Lily Fu
> The Institute for Genomic Research
> Voice Mail: (301) 838-3557
> Email: lily@tigr.org



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

Date: 27 Aug 1998 02:07:20 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl compiler
Message-Id: <6s2f0o$8oq$2@client3.news.psi.net>

William D. Reardon (wdr1@pobox.com) wrote on MDCCCXXI September MCMXCIII
in <URL: news:EyBGrw.Ax7@midway.uchicago.edu>:
++ In article <EyAMJB.3uw@world.std.com>,
++ Andrew M. Langmead <aml@world.std.com> wrote:
++ >A pasword hidden inside a program is not an element of a secure system.
++ 
++ 	Several people so far have said this.  I understand if people
++ have access to the script, binary, whatever, it's insecure in that
++ people could look it, log in, etc.  
++ 	But simply have a password in script renders it unsecure
++ without any qualifications?  This is don't understand.  I've written a
++ few CGI's that access a database & allow a user to look up information
++ over the web.[1]

If noone is able to read the script, then there's no problem.
But then, there's no need to compile it to hide it from someone.


Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")\n-> define ("foldoc", "perl")) [0] -> print'


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

Date: 27 Aug 1998 02:05:34 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl compiler
Message-Id: <6s2ete$8oq$1@client3.news.psi.net>

George Kuetemeyer (george.kuetemeyer@mail.tju.edu) wrote on MDCCCXXI
September MCMXCIII in <URL: news:35E47940.6B4ABB1A@mail.tju.edu>:
++ 
++ 
++ Abigail wrote:
++ 
++ > yong (yong@shell.com) wrote on MDCCCXX September MCMXCIII in
++ > <URL: news:35E2EAEF.6B9E6443@shell.com>:
++ > ++ I don't know why everybody assumes Lily's hiding source code is because
++ > ++ she doesn't want to let others pirate her "property of knowledge". One
++ > ++ can also hide the source code for security reason since it may contain
++ > ++ passwords.
++ >
++ > Which is the case, and which is bad as well.
++ >
++ 
++ We've started using the perl2exe compiler for reasons other than $$ or securi
++ basically want to run production and test instances of scripts on the same bo
++ perhaps with different releases of Perl. The easiest way to do this is to com
++ the scripts on other system(s) and then simply move the executables to the ta
++ machine. That way each instance has its own Perl environment - no conflicts t
++ worry about - either with standard or home grown packages.
++ 


Ease of distribution is in my opinion a good reason to use the compiler.


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Wed, 26 Aug 1998 21:40:39 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <comdog-ya02408000R2608982140390001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6s29q2$mag$1@nnrp1.dejanews.com>, dturley@pobox.com posted:

>checking my amazon order status twice a day!

maybe i should put my second copy on one of those auction script sites ;)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>


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

Date: 27 Aug 1998 00:53:31 GMT
From: Emaddin M El-Haraty <elharaty@/*blorp*/utdallas.edu>
Subject: Re: Pretty HTML-izing of Perl source?
Message-Id: <6s2amb$adu$2@news.utdallas.edu>

Albert W. Dorrington <awdorrin@mail.delcoelect.com> wrote:

: In article <35D7990F.F978730F@pegasus.rutgers.edu>, Donovan Rebbechi <elflord@pegasus.rutgers.edu> writes:
: :> Corbett J. Klempay wrote:
: :> > 
: :> > Hi there..I'm wondering if anyone is aware of (and can point me to) any
: :> > tools (probably in Perl themselves, I'd assume) that, given Perl source,
: :> > output pretty HTML files (syntax highlighted, basically).  I have seen a

I am interested in something similar to this but I am not sure that it is
available.
Is there a script that would translate a perl script (or group of perl
scripts) in html that would contain links each function and variable
definition.

This is similar to that c2html script that I found on CPAN.
Basically it used output from ctags to create the html+links and then
placed then in a nice html/ dir.

I assume one can be made with the output of ptags.
I might be interested in making one but do not want to reinvent the 
wheel. I assume if we have a c2html it is quite possible that we
have a perl2html somewhere?


emad el-haraty
Famous Last Words:


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

Date: Thu, 27 Aug 1998 02:48:43 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: question RE downloading webpages and parsing them.
Message-Id: <fO3F1.5$2A.134@nsw.nnrp.telstra.net>

There really was no need to post this four times.

In article <35E48D87.FD3C5B74@west.sun.com>,
	DAVID PIZZO <david.pizzo@West.sun.com> writes:
> I need to through a script, download a web page, save it locally and

use libwww, also known as LWP. Get it from CPAN: http://www.perl.com/CPAN/

while you're there, check out the list of modules.

> parse it. then take the data I want from it and create a new web page. I

HTML::Parser, available from CPAN

> know how to parse the page and create a new one, I just don't know how

Oh, you're already parsing it :). Forget the HTML::Parser module then.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Wed, 26 Aug 1998 20:18:04 -0500
From: Jim Rendant <jimr@xnet.com>
Subject: Reading a binary file and converting it's data.
Message-Id: <35E4B3CB.56D0B568@xnet.com>

I need to read a binary file that contains binary data. How do I do
this?

The file is from HP OpenView. It's data collect by the SNMP collecter.
While SNMPCOLDUMP dumps the data into an ascii file I would much rather
read it and manipulate it myself.

any help is appreciated...Thanks in advance



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

Date: Wed, 26 Aug 1998 22:48:04 -0400
From: "Todd B" <NOTHANKStbeaulieu@mediaone.net>
Subject: Re: Reading a binary file and converting it's data.
Message-Id: <6s2hfb$86e$1@wbnws01.ne.highway1.com>

i believe there is little distinction between binary and ascii files.

the standard <FILEHANDLE> read routine reads up to the next EOL char, which
you can change.  you can simply loop, reading the entire file into a var,
appending it each iteration.

or

there are seek and read() functions, as in c.



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

Date: Wed, 26 Aug 1998 22:49:29 -0400
From: "Todd B" <NOTHANKStbeaulieu@mediaone.net>
Subject: Re: reading specific words from an Mp3 file
Message-Id: <6s2hi0$87s$1@wbnws01.ne.highway1.com>

try to use the seek() and read() functions.  i believe you can specify a
negative value to wrap around.



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

Date: 27 Aug 1998 01:52:54 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Threading/forking simple(?) programs
Message-Id: <904182710.59131@thrush.omix.com>

Duke <duke@co.kittitas.wa.us> wrote:
> Sometimes it seems that bar(1) takes longer than foo(2) and my blocking
> doesn't seem to take that into account.
        >snip<
> If I block on waitpid($$) also then won't I just hang
> forever since the original PID won't be done?

        The foo(2) child exits when it's done.  If/when the foo(2) child
        finishes first, a "Zombie" or "defunct" process will be left in the
        process table until its parent (the main program) waits for it.

        So, even if foo(2) does finish first, bar(1) is free to reap foo's
        pid at any time.  In this case, waitpid() won't block because foo
        is done and its pid is ready to be reaped, which should be fine.

        Look at it this way (dots are working code):

        Time------------------------------------>
        foo.....foo...  foo.....foo....
                bar.....bar..   bar.......bar...
                        ^       ^         ^
                        wait    wait      wait

        Thus, we sync our access regardless of who takes longer to run,
        because waitpid() returns when foo is done or immediately if foo
        is already done before we called waitpid().
-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 26 Aug 1998 16:46:18 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: undump ported to Solaris
Message-Id: <m3g1ejwblh.fsf@windlord.Stanford.EDU>

In comp.lang.perl.moderated, eric saxe <esaxe@SDSC.EDU> writes:

> I was wondering if anyone has had luck in finding (or porting) a version
> of "undump" for SunOS 2.5/Solaris platform.  Most of the versions i've
> come across seem to be for BSD platforms, or are so old such that I
> can't compile them.

I don't believe that anyone is still even attempting to maintain an undump
apart from emacs, and emacs does its own somewhat weird things that
probably aren't appropriate for Perl.  (It doesn't have a separate
binary.)  undump is highly platform-specific code, I think most of the
existing implementations all broke when the world switched to ELF, and
there really isn't much motivation these days for people to try to make it
work.

> It sure would be nice to have a working version (our TeX distribution
> didn't have one) in my Perl toolbox.

It's unsurprising that TeX doesn't have it, since TeX was fixed so as to
not require undump to generate TeX binaries a long time ago.  (Instead,
virtex loads the memory files directly.)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Wed, 26 Aug 1998 22:12:25 -0400
From: "David" <ceci@bway.net>
Subject: Unreadable Scripts?
Message-Id: <6s2fbf$fpm$1@camel19.mindspring.com>

Now I'm a beginner at Perl and this may sound stupid and and I may get
flames but I need to know.  Is there any way to make it so that your scripts
are unreadable but still executable to people that have FTP access to your
host?  Cause I'd like it so that people that use the same host as me can't
take a look at my scripts.  Well now's probably the time for all those
flames :).

Thanks,
David




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

Date: Thu, 27 Aug 1998 02:52:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Unreadable Scripts?
Message-Id: <QR3F1.6$2A.134@nsw.nnrp.telstra.net>

In article <6s2fbf$fpm$1@camel19.mindspring.com>,
	"David" <ceci@bway.net> writes:
> Now I'm a beginner at Perl and this may sound stupid and and I may get
> flames but I need to know.  Is there any way to make it so that your scripts
> are unreadable but still executable to people that have FTP access to your
> host?  Cause I'd like it so that people that use the same host as me can't
> take a look at my scripts.  Well now's probably the time for all those
> flames :).

This is not a perl question, but a quesiton about file access
permissions, which depends on your platform. Assuming that's some unix
variant:

chmod 711 script.pl

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Wed, 26 Aug 1998 17:29:05 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What is it?
Message-Id: <h722s6.mrr.ln@metronet.com>

hoangngo@usa.net wrote:

: I am new to Perl i often see something like this at the end of a file:

: sub mysub
: {
: 	code...
: 	code...
: }

: 1;

: What is that "1;"? I can't find an explaination anywhere?


   Finding the explanation is not as easy as it should be, but...


   1) Try taking it out and "use"ing it.

   2) See the error message

   3) Look up the error message in the 'perldiag' man page, which
      describes all of the messages that perl might issue:


------------------------
=item %s did not return a true value

(F) A required (or used) file must return a true value to indicate that
it compiled correctly and ran its initialization code correctly.  It's
traditional to end such a file with a "1;", though any true value would
do.  See L<perlfunc/require>.
------------------------


  
--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 26 Aug 1998 21:11:21 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: why no true/false keywords?
Message-Id: <6s2bnp$fbf$1@monet.op.net>

In article <6s1q97$mlt$11@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>I personally find
>    if ($condition) { ... }
>much more readable than
>    if ($condition == TRUE) { ... }
>
>but if you want FORTRAN, you know where to find it.

I don't think they have that in FORTRAN:

	IF X .EQ. Y .AND. Z .GE. 11 THEN GOTO 110

Maybe you are thinking of Pascal?

I always have to laugh when I see someone write

	if ($condition == TRUE) ...

because I wonder why they didn't write 

	if (($condition == TRUE) == TRUE) ...

instead.

To me, this is the reductio ad absurdem for Boolean constants.



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

Date: 27 Aug 1998 02:24:35 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: why no true/false keywords?
Message-Id: <6s2g13$97v$1@client3.news.psi.net>

Tom Christiansen (tchrist@mox.perl.com) wrote on MDCCCXXI September
MCMXCIII in <URL: news:6s1s6a$93j$1@csnews.cs.colorado.edu>:
++ In comp.lang.perl.misc, 
++     "Saurus" writes:
++ :	Say true keyword converts to 1 and false keyword to
++ :NULL or some such arrangement.
++ 
++ No, that would be bad.  Bad bad bad.
++ 
++     http://language.perl.com/style/slide13.html


Uhm, that's about the silly use of comparing TRUE/FALSE with a 
(potential) boolean expression.


But is the use of TRUE/FALSE wrong in, for instance:

sub some_check_sub {
    ....
    if (condition) {
        return FALSE;
    }
    ...
    if (other condition) {
        return TRUE;
    }
    ...
    return FALSE;
}


At least it's clear only a true/false value will be returned, where
as 'return 1' and 'return 0' might throw someone off thinking it will
be used in an arithmetic expression. There is nothing magical about
0/undef/'' that makes them perfect candidates for FALSE. 

It's not hard to imagine a modified perl with true booleans and
a boolean context.


What about

   use constant  SUCCESS                     =>  0;
   use constant  ILLEGAL_DOGMA               =>  1;
   use constant  TOO_MANY_RHYMING_FUNCTIONS  =>  2;
   use constant  UGLY_COLOUR_COMBINATION     =>  3;
   use constant  MISC_ERROR                  =>  4;


Is that wrong too? The degenerated case only uses 0 and 1.



I wouldn't easily use TRUE/FALSE myself, but calling it "bad, bad, bad"?
No. And your slide doesn't really convince me. 



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Addition/s) [0]'


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 3557
**************************************

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