[19779] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1974 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 21 18:05:35 2001

Date: Sun, 21 Oct 2001 15:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1003701908-v10-i1974@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 21 Oct 2001     Volume: 10 Number: 1974

Today's topics:
    Re: Disk size with perl (Mark Jason Dominus)
        ez program question <michael@onair.com>
    Re: ez program question (Chas Friedman)
    Re: File I/O (Mark Jason Dominus)
        Hex characters like a form submit? <me@REMOVETHIStoao.net>
    Re: Hex characters like a form submit? (Tad McClellan)
    Re: Hex characters like a form submit? <me@REMOVETHIStoao.net>
    Re: Hex characters like a form submit? <me@REMOVETHIStoao.net>
    Re: Hex characters like a form submit? <s_grazzini@hotmail.com>
    Re: How can I send an html formatted email, preferably  <bart.lateur@skynet.be>
    Re: How to display text file in cgi-bin? <mail@mail.com>
    Re: How to display text file in cgi-bin? <tony_curtis32@yahoo.com>
    Re: How to display text file in cgi-bin? <mail@mail.com>
    Re: Perl <-> Java <chawig@eplus-online.de>
    Re: Pls, help me with XML parser!!! <bart.lateur@skynet.be>
        Printing tif files <Francis.Derive@wanadoo.fr>
        store file descriptor in hash <jens@irs-net.com>
    Re: store file descriptor in hash (Garry Williams)
    Re: store file descriptor in hash <jens@irs-net.com>
    Re: store file descriptor in hash (Mark Jason Dominus)
        traversing directories <ashley@pcraft.com>
    Re: Writing and reading encrypted string (password) (Xeno Campanoli)
    Re: Writing and reading encrypted string (password) (Xeno Campanoli)
        xsub - does anything work? <rtrahan@monmouth.com>
    Re: xsub - does anything work? (Mark Jason Dominus)
    Re: xsub - does anything work? <joe+usenet@sunstarsys.com>
    Re: xsub - does anything work? <rtrahan@monmouth.com>
    Re: xsub - does anything work? <rtrahan@monmouth.com>
    Re: xsub - does anything work? <dan@tuatha.sidhe.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 21 Oct 2001 18:11:04 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Disk size with perl
Message-Id: <3bd30fb8.123a$388@news.op.net>

In article <1103_1003667198@buxtehude>,
Fredegar  <fredegar@haftmann-online.de> wrote:
>I want to determine how much disk space is actually free on a floppy
>disc. Any solutions? (for Linux/Unix, platform-indepent solution
>preffered of course)

A.  Parse the output of    qx{df /mnt/floppy}

B.  Write an XS module that provides an interface to statfs().
    (I'm surprised that there doesn't seem to be one already, but `man
     perlxstut' has detailed instructions for doing exactly this.)

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sun, 21 Oct 2001 20:11:08 GMT
From: Mike Ritner <michael@onair.com>
Subject: ez program question
Message-Id: <3BD32CC2.712E8B5A@onair.com>

Hi all,
I know this is ez to do, but can't find my perl book to look up syntax.
what I am looking to do is use a cgi script to forward to a webpage.
ie  when someone clicks a text link, it will call on "link.cgi"  and
then that script will send them to the appropriate URL.

Please besides posting to this would you also send me an e-mail to
mritner@hotmail.co  thanks in advance!

M00k3y



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

Date: Sun, 21 Oct 2001 20:55:22 GMT
From: friedman@math.utexas.edu (Chas Friedman)
Subject: Re: ez program question
Message-Id: <3bd3360f.22306828@news.itouch.net>

On Sun, 21 Oct 2001 20:11:08 GMT, Mike Ritner <michael@onair.com>
wrote:

>Hi all,
>I know this is ez to do, but can't find my perl book to look up syntax.
>what I am looking to do is use a cgi script to forward to a webpage.
>ie  when someone clicks a text link, it will call on "link.cgi"  and
>then that script will send them to the appropriate URL.
>
>Please besides posting to this would you also send me an e-mail to
>mritner@hotmail.co  thanks in advance!
>
>M00k3y
>
You can print the "Location" header in your script. e.g.:
print "Location: http://www.somepage.html","\n\n";
(The email address you gave seems incorrect.)
                            chas


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

Date: Sun, 21 Oct 2001 18:22:07 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: File I/O
Message-Id: <3bd3124f.1284$370@news.op.net>

In article <3BD1CFB9.A5E1CABA@telus.net>,
Neal E. Coombes <Neal.Coombes@telus.net> wrote:
>In the blow code, $name never makes it into testfile.txt which contains
>the text "some pattern" within it.

It works fine for me, as long as you are expecting 'some name' to
overwrite part of the next line in the file.  For example:

Before:

        a
        b
        some pattern
        ABCDEFGHABCDEFGHABCDEFGHABCDEFGH
        c

After:

        a
        b
        some pattern
        some name
        CDEFGHABCDEFGHABCDEFGH
        c


Are you sure your pattern is matching?  I notice that you didn't show
us the real code, so if your pattern were defective we would not
notice that.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sun, 21 Oct 2001 17:06:00 GMT
From: "Graham W. Boyes" <me@REMOVETHIStoao.net>
Subject: Hex characters like a form submit?
Message-Id: <Xns914166DEFB58515497002270367234@24.2.10.79>

Hi- need to convert characters in a string that are not valid for use in a 
file name to Hex so that I can use the string in a file name.

Basically, I want to translate a string like az?: to az%3F%3A.

Thanks!
Graham W. Boyes
-- 
Health warning: diet soft drinks, Equal sweetener and NutraSweet contain the 
artificial sweetener Aspartame WHICH CAN CAUSE CANCER, DIABETES, OBESITY, 
EYE DISEASE, PARKINSON'S AND MORE.  Read more here: http://www.dorway.com/




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

Date: Sun, 21 Oct 2001 18:34:24 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Hex characters like a form submit?
Message-Id: <slrn9t62j8.9ud.tadmc@tadmc26.august.net>

Graham W. Boyes <me@REMOVETHIStoao.net> wrote:

>Hi- need to convert characters in a string that are not valid for use in a 
>file name 


What characters are not valid in filenames?

Depends on your OS, which you have not shared with us.

On Unix for instance, there are only 2 characters that cannot
be in a filename (slash and nul (47 and 0 decimal)).


>to Hex so that I can use the string in a file name.
>
>Basically, I want to translate a string like az?: to az%3F%3A.


Since you don't define "valid" characters, we get to make up
our own definition. The below will work with a definition
I chose rather arbitrarily:


  s/(\W)/ sprintf '%%%X', ord $1/ge;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 21 Oct 2001 20:00:47 GMT
From: "Graham W. Boyes" <me@REMOVETHIStoao.net>
Subject: Re: Hex characters like a form submit?
Message-Id: <Xns91418480E302315497002270367234@24.2.10.79>

Tad McClellan, you are hereby charged with writing the following:
>>Hi- need to convert characters in a string that are not valid for use
>>in a file name 

> What characters are not valid in filenames?

Okay, say, any character that's not a letter or number.

Graham W. Boyes
-- 
Health warning: diet soft drinks, Equal sweetener and NutraSweet contain the 
artificial sweetener Aspartame WHICH CAN CAUSE CANCER, DIABETES, OBESITY, 
EYE DISEASE, PARKINSON'S AND MORE.  Read more here: http://www.dorway.com/




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

Date: Sun, 21 Oct 2001 20:02:55 GMT
From: "Graham W. Boyes" <me@REMOVETHIStoao.net>
Subject: Re: Hex characters like a form submit?
Message-Id: <Xns914184DD4437615497002270367234@24.2.10.79>

> Tad McClellan, you are hereby charged with writing the following:
>>>Hi- need to convert characters in a string that are not valid for use
>>>in a file name 
> 
>> What characters are not valid in filenames?
> 
> Okay, say, any character that's not a letter or number.

Which is exactly what you gave me.  Thanks!  Works great.

Graham W. Boyes
-- 
Health warning: diet soft drinks, Equal sweetener and NutraSweet contain the 
artificial sweetener Aspartame WHICH CAN CAUSE CANCER, DIABETES, OBESITY, 
EYE DISEASE, PARKINSON'S AND MORE.  Read more here: http://www.dorway.com/




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

Date: Sun, 21 Oct 2001 21:17:38 GMT
From: "Steve Grazzini" <s_grazzini@hotmail.com>
Subject: Re: Hex characters like a form submit?
Message-Id: <SXGA7.27587$T5.5950536@typhoon.nyc.rr.com>

"Graham W. Boyes" <me@REMOVETHIStoao.net> wrote:

[snip]

> Basically, I want to translate a string like az?: to az%3F%3A.

[snip]

You could also check out URI::Escape.

-Steve




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

Date: Sun, 21 Oct 2001 16:40:56 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How can I send an html formatted email, preferably using Net::SMTP?
Message-Id: <inu5ttgn64gvkoff82qamsra3dmug8002n@4ax.com>

Jon Feldhammer wrote:

>I'm having a very hard time sending an email that a html enabled mail
>program will read as html.  I assume it has to do with the header line
>Content-Type: text/plain which needs to be Content-Type: text/html ... I
>can't seem to figure out how to change that line, or maybe that isnt' the
>problem.

No. You need to send the mail in MIME format.

Use the module MIME::Lite. It lets you use NET::SMTP as the mailer.

-- 
	Bart.


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

Date: Sun, 21 Oct 2001 12:34:01 -0500
From: Jerry McEwen <mail@mail.com>
Subject: Re: How to display text file in cgi-bin?
Message-Id: <6j16tt0648u4a3jcoqko5ecmp30ms2daud@4ax.com>

On Sun, 21 Oct 2001 05:12:22 GMT, Andrew Cady <please@no.spam> wrote:

>Jerry McEwen <mail@mail.com> writes:
>
>> On Sat, 20 Oct 2001 05:07:51 GMT, Andrew Cady <please@no.spam>
>> wrote:
>>
>> > Jerry McEwen <mail@mail.com> writes:
>> >
>> > > I have a shopping cart several levels deep in my cgi-bin
>> > > directory and orders get written to a file in a sub-folder. We
>> > > have SSL and I want my client to be able to access orders.txt
>> > > via https, but Perl (or maybe the server's config?) prevents the
>> > > file from being displayed.
>> > >
>> > > My host tells me that I will have to get a script to display it,
>> > > but I can't find one. Any thoughts? Thanks!
>> >
>> > You can use this one, which I haven't tested:
>
>[...]
>
>Ignoring the looming danger of off-topicality...
>
>> Gee, I can't get this to work.
>
>What's it do instead of working?  Please be precise, don't make me
>guess.
>

'Sorry about that.

My cgi contains this:
#!/bin/sh
printf "Content-type: text/plain\n\n";
cat "orders.txt";
# EOF
Permissions on this file are 755 and other CGI's in the folder work.

The error message in the browser is this:'

Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster@(domain).com and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.

More information about this error may be available in the server error
log.

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

Apache/1.3.14 Server at (domain).com Port 80

Thank you again!

>> I understand the difference between full and local path, but do I
>> need the actual local path on the server, or is it more like this?
>>
>> domainname.com/cgi-bin/shop/protected/orders.txt
>
>You want the local path to the file.  It should start with a "/".
>Perhaps something like /var/www/cgi-bin/... or
>/home/yourname/cgi-bin/...  Make sure the permissions on the script
>are correct.  Are you getting the Content-type header?  If not, then
>this isn't a perl problem, and you should ask your web host for help.
>
>BTW please don't post upside-down (put the quoting first).




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

Date: Sun, 21 Oct 2001 12:51:59 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: How to display text file in cgi-bin?
Message-Id: <87g08cswxs.fsf@limey.hpcc.uh.edu>

>> On Sun, 21 Oct 2001 12:34:01 -0500,
>> Jerry McEwen <mail@mail.com> said:

>> Ignoring the looming danger of off-topicality...

> My cgi contains this: #!/bin/sh printf "Content-type:
> text/plain\n\n"; cat "orders.txt"; # EOF Permissions on
> this file are 755 and other CGI's in the folder work.

Not relevant to perl.  You don't need the ; at line's-end
either.  And "echo" is more usual than "printf" when
there's no interpolation.

> The error message in the browser is this:'

> Internal Server Error The server encountered an internal
> error or misconfiguration and was unable to complete
> your request.  Please contact the server administrator,
> webmaster@(domain).com and inform them of the time the
> error occurred, and anything you might have done that
> may have caused the error.

Well, did you do this?

This entire thing has nothing to do with perl.

comp.infosystems.www.servers.apache may well be more
on-topic

-- 
Oh!  I've said too much.  Smithers, use the amnesia ray.


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

Date: Sun, 21 Oct 2001 14:57:29 -0500
From: Jerry McEwen <mail@mail.com>
Subject: Re: How to display text file in cgi-bin?
Message-Id: <r2a6tt0thct8uqbjergcb532t6lvpg73qr@4ax.com>

According to the other replies, this has everything to do with Perl.
Nonetheless, I visited comp.infosystems.www.servers.apache and found
nothing relative.

I think you need to ignore this thread if it bothers you. Thank you.

On Sun, 21 Oct 2001 12:51:59 -0500, Tony Curtis
<tony_curtis32@yahoo.com> wrote:

>>> On Sun, 21 Oct 2001 12:34:01 -0500,
>>> Jerry McEwen <mail@mail.com> said:
>
>>> Ignoring the looming danger of off-topicality...
>
>> My cgi contains this: #!/bin/sh printf "Content-type:
>> text/plain\n\n"; cat "orders.txt"; # EOF Permissions on
>> this file are 755 and other CGI's in the folder work.
>
>Not relevant to perl.  You don't need the ; at line's-end
>either.  And "echo" is more usual than "printf" when
>there's no interpolation.
>
>> The error message in the browser is this:'
>
>> Internal Server Error The server encountered an internal
>> error or misconfiguration and was unable to complete
>> your request.  Please contact the server administrator,
>> webmaster@(domain).com and inform them of the time the
>> error occurred, and anything you might have done that
>> may have caused the error.
>
>Well, did you do this?
>
>This entire thing has nothing to do with perl.
>
>comp.infosystems.www.servers.apache may well be more
>on-topic



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

Date: Sun, 21 Oct 2001 22:30:50 +0200
From: Martial Chateauvieux <chawig@eplus-online.de>
Subject: Re: Perl <-> Java
Message-Id: <3BD3307A.6090707@eplus-online.de>

The Java Perl module released in version 4.0 is very good. I am using it 
in production. It alows to call Java methods via an intermediate server 
writen in Java.

Martial Chateauvieux

Richard Trahan wrote:

> I would like to get Perl and Java speaking. What are my options?
> I'd like solutions on both Windoze and Linux.
> 
> I already know about sockets. I'm interested in some sort of thread-
> safe shared object, like .dll or .so files. Has anyone done either of
> these successfully?
> 
> I'm trying to escape from the M$ stranglehold, so I'd like to use
> MinGW or other GCC, especially since these are known to be well-behaved
> with Java JNI files, and can produce both dll's and so's.  The XSUB 
> system on Perl is strongly yoked to MS Visual C++ (e.g., Makefile.PL
> outputs a file that contains many features readable only by MS nmake), 
> and the whole XS system in general seems to be in a state of disarray.
> SWIG offers more promise, if I can only decipher the documentation. The
> once-touted JPL (Java Perl Lingo) tool seems to have been withdrawn
> (it was payware in 1997, then open source), and net chat indicates
> that this was a very buggy product anyway.
> 
> Restated with less babble, I'm trying to find a toolset that will
> permit me to glue Perl and Java, sans Gates. Any suggestions will
> incur my unending gratitude. (Well, for a while, anyway.)
> 



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

Date: Sun, 21 Oct 2001 15:30:44 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Pls, help me with XML parser!!!
Message-Id: <qmp5ttcuf90eml64t0gaa56rv7nk99pn2t@4ax.com>

Master Vip wrote:

>Why XML::Parser::Expat doesn't recognize windows-1251 encoding?
>I have Active Perl Build 509. Should I install a newer version?
>Or maybe someone can tell me where I can find xml parser without
>this disadvantage.

You can expand the possibilities of XML::Parser. There's a module set
for that: XML::Encoding, available on CPAN. Plus, the character encoding
tables can be gotten from unicode.org's FTP and/or HTTP site, somewhere
under <http://www.unicode.org/Public/MAPPINGS/VENDORS/>.

See also a message by me on the MacPerl mailing list for a simpler
approach to generate the single-byte character sets encoding files, from
the text files you can get from unicode.org.
<http://bumppo.net/lists/macperl-modules/2000/04/msg00017.html>

-- 
	Bart.


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

Date: 21 Oct 2001 19:06:33 +0200
From: "Francis Derive" <Francis.Derive@wanadoo.fr>
Subject: Printing tif files
Message-Id: <B7F8CD49-17B87A@80.9.48.118>

Bonjour !

It would be helpful a lot to automatically send to the printer these tif
image files from a perl script.
Anyone has an idea of how to do it ?

Merci beaucoup.

Francis






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

Date: Sun, 21 Oct 2001 17:45:22 +0200
From: Jens Luedicke <jens@irs-net.com>
Subject: store file descriptor in hash
Message-Id: <9quqmh$f8$01$1@news.t-online.com>

hi ...

Can I store an an file descriptor for later usage,

        $self->{input_fd} = new IO::Handle;

so this will work?

        print $self->{input_fd} $foo;

I want to create a bunch of IO::Handles in the
new method, because most methods need them.

-- 
Jens Luedicke
jens@irs-net.com


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

Date: Sun, 21 Oct 2001 16:12:18 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: store file descriptor in hash
Message-Id: <slrn9t5sv2.o9b.garry@zfw.zvolve.net>

On Sun, 21 Oct 2001 17:45:22 +0200, Jens Luedicke <jens@irs-net.com>
wrote:

> Can I store an an file descriptor for later usage,
> 
>         $self->{input_fd} = new IO::Handle;


Sure.  IO::Handle::new() returns a reference, so it can be the value
in a hash element.  

By the way, what happened when you tried it?  


> so this will work?
> 
>         print $self->{input_fd} $foo;



Well, what happened when you tried this?  When you received an error,
did you check the perlfunc manual page for the function that you are
using (print)?  It specifically addresses this issue.  

-- 
Garry Williams


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

Date: Sun, 21 Oct 2001 18:20:45 +0200
From: Jens Luedicke <jens@irs-net.com>
Subject: Re: store file descriptor in hash
Message-Id: <9qusos$sr4$07$1@news.t-online.com>

Hi ...

When I tried it, I got an syntax error. Missing operator.

I practised some RTFM and checked the IO::Handle perldoc,
and found a solution ...

$self->{input_fd}->print($foo);

A little more object-oriented ... a like that.

Garry Williams wrote:

> Well, what happened when you tried this?  When you received an error,
> did you check the perlfunc manual page for the function that you are
> using (print)?  It specifically addresses this issue.
> 

-- 
Jens Luedicke
jens@irs-net.com


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

Date: Sun, 21 Oct 2001 18:15:13 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: store file descriptor in hash
Message-Id: <3bd310b1.1256$206@news.op.net>

In article <9quqmh$f8$01$1@news.t-online.com>,
Jens Luedicke  <jens@irs-net.com> wrote:
>hi ...
>
>Can I store an an file descriptor for later usage,
>
>        $self->{input_fd} = new IO::Handle;

Yes.


>so this will work?
>
>        print $self->{input_fd} $foo;

There is a syntactic problem here.

It will work if you do:

        $fh = $self->{input_fd};
        print $fh $foo;

or

        print {$self->{input_fd}} $foo;
        

You should not refer to an IO::Handle object as a file descriptor.  It
is a file handle, not a file descriptor.  A file descriptor is an
integer.  A filehandle contains a file descriptor and some additional
information.




-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: Sun, 21 Oct 2001 13:52:26 -0600
From: "Ashley M. Kirchner" <ashley@pcraft.com>
Subject: traversing directories
Message-Id: <3BD3277A.29B43E08@pcraft.com>


    I have the following script to play MP3s on my server:

#!/usr/bin/perl

srand;
for (;;)
{
  @f = <*.mp3>;
  @s=();
  (push(@s,splice(@f,rand @f,1))) while (@f);
  map {system ("/usr/freeware/bin/amp","-p",$_) && exit;} @s;
}

    However, I'm going to start splitting up my collections into
subdirectories, ala:

    /mp3s/<artist>/<album>/<songs>

    How can I have that same script, sitting in the root /mp3s
directory, be able to traverse the whole tree and do the same thing it's
doing now (which is randomly pick a song and play it)?

--
H | "Life is the art of drawing without an eraser." - John Gardner
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:ashley@pcraft.com>   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin    .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave, #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.




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

Date: 21 Oct 2001 20:25:17 GMT
From: xeno@eskimo.com (Xeno Campanoli)
Subject: Re: Writing and reading encrypted string (password)
Message-Id: <9qvavd$c3t$1@eskinews.eskimo.com>

Say, there's some RSA and DSS stuff for Perl too on CPAN, aren't there?  I've
never used them, but they must be there.  I'd recommend that.  Then you've got
serious class encryption.  Probably look under modules on CPAN under ciphers or
encryption.  I think I'll go do it right now in fact.  I'll be back to this 
thread if I get time.

Falk P. (paule.p-deleteme-@gmx.de) wrote:
: Hi Lars,

: >can someone perhaps give me a hint on how I could store a password in
: >some config file encrypted?
: >The password should be written by the perl program (e.g. call the perl
: >prog with a special parameter and the password), and the perl program
: >must be able to read and decrypt the password in normal run.

: i think it would be better not to decrypt the passwords in order to
: test if the given password is correct.

:  i think its better to hash the passwords - e.g. with the
: MD5-algorithm (Digets::MD5) -> just compare the hash-value of the
: given value with the stored hash-value (and associate the hash's to an
: login :)

: this should result in a higher level of security, because even if the
: file which contains all the passwords is lost, nobody can restore the
: passwords because they'r 1-way encrypted (hash-values).

: hope it helped a bit, much luck.


: -----------
: falk


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

Date: 21 Oct 2001 20:44:16 GMT
From: xeno@eskimo.com (Xeno Campanoli)
Subject: Re: Writing and reading encrypted string (password)
Message-Id: <9qvc30$c9t$1@eskinews.eskimo.com>

Xeno Campanoli (xeno@eskimo.com) wrote:
: Say, there's some RSA and DSS stuff for Perl too on CPAN, aren't there?  I've
: never used them, but they must be there.  I'd recommend that.  Then you've got
: serious class encryption.  Probably look under modules on CPAN under ciphers or
: encryption.  I think I'll go do it right now in fact.  I'll be back to this 
: thread if I get time.

To answer my own question, yeah, I just went over there and it's all under 
security and encryption.  I do agree with the guy who said your main object
should be to make a digest or hash and match it, as otherwise you'll just be
using a password to see a password, adding the extra shakey step of making it
visible to use it, which in itself is bad.  

When I was there I downloaded blowfish, which does give you encryption, and it's
something I'd been wanting to look at.  It's not a digest algorithm though, and
nor are RSA nor DSS, which are also on there and which I mention above.  Sorry,
but I was in "neato" mode rather than my best "be helpful" mode.  Okay, I'll
work on it.  I can't think of any other digest algorithm, but MD5 should be
fine.  I'll have to play with that too tonight.  

Best wishes.  Xeno


: Falk P. (paule.p-deleteme-@gmx.de) wrote:
: : Hi Lars,

: : >can someone perhaps give me a hint on how I could store a password in
: : >some config file encrypted?
: : >The password should be written by the perl program (e.g. call the perl
: : >prog with a special parameter and the password), and the perl program
: : >must be able to read and decrypt the password in normal run.

: : i think it would be better not to decrypt the passwords in order to
: : test if the given password is correct.

: :  i think its better to hash the passwords - e.g. with the
: : MD5-algorithm (Digets::MD5) -> just compare the hash-value of the
: : given value with the stored hash-value (and associate the hash's to an
: : login :)

: : this should result in a higher level of security, because even if the
: : file which contains all the passwords is lost, nobody can restore the
: : passwords because they'r 1-way encrypted (hash-values).

: : hope it helped a bit, much luck.


: : -----------
: : falk


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

Date: Sun, 21 Oct 2001 11:22:59 -0700
From: Richard Trahan <rtrahan@monmouth.com>
Subject: xsub - does anything work?
Message-Id: <3BD31283.EF0D76ED@monmouth.com>

Has anyone gotten anything at all, however simple, to even compile
on Windoze, using the instructions in perlxstut or perlxs?

And while I'm at it, has anyone gotten anything at all, however simple,
to even compile on Windoze, with SWIG?

Please post a complete set of sample files, or zip them to me.

I have found that absolutely none of the examples in Perl or SWIG work,
when following their instructions. If I am wrong, mea culpa. If I am
right, why do the Perl porters allow their baby to be sullied by
vaporware?

More generally, is there any software, anywhere, of any type, written
by anyone for any purpose, that actually works? Please point me to it
so I can study it for my edification.


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

Date: Sun, 21 Oct 2001 17:09:40 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: xsub - does anything work?
Message-Id: <3bd30152.1055$3a5@news.op.net>

In article <3BD31283.EF0D76ED@monmouth.com>,
Richard Trahan  <rtrahan@monmouth.com> wrote:
>Has anyone gotten anything at all, however simple, to even compile
>on Windoze, using the instructions in perlxstut or perlxs?

Visit http://cpan.valueclick.com/modules/00modlist.long.html.
There is a list of Perl modules.  Each is accompanied by a 4-letter
code.  If the third letter is 'c', then the module contains XS code.
Many of these modules work under Windows.

In particular, there are many modules in the section "Microsoft
Windows Modules" that use XS.  One would expect that these would work
under Windows if anything does:

        http://cpan.valueclick.com/modules/00modlist.long.html#ID22_MicrosoftW

You may also want to look into

        http://search.cpan.org/search?dist=CookBookA

and

        http://search.cpan.org/search?dist=CookBookB

Which are samples of simple XS-interface functions.


>I have found that absolutely none of the examples in Perl or SWIG work,
>when following their instructions. 

"It didn't work" is probably the least useful trouble report you can give.
By saying "It didn't work" you completely rule out the possibility
that anyone will be able to point out that your problem is minor and
easily repaired.  All anyone can really do is shrug and say "Well, it
works for everyone else."

>More generally, is there any software, anywhere, of any type, written
>by anyone for any purpose, that actually works? Please point me to it
>so I can study it for my edification.

http://www.qmail.org/

Works great.



-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


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

Date: 21 Oct 2001 13:10:41 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: xsub - does anything work?
Message-Id: <m3hess9awe.fsf@mumonkan.sunstarsys.com>

Richard Trahan <rtrahan@monmouth.com> writes:

> Has anyone gotten anything at all, however simple, to even compile
> on Windoze, using the instructions in perlxstut or perlxs?

[...]

> More generally, is there any software, anywhere, of any type, written
> by anyone for any purpose, that actually works? Please point me to it
> so I can study it for my edification.

perldoc seems to work on most platforms, but unfortunately it 
requires some human intervention.  Have you tried reading

  % perldoc perlwin32

?  It seems to me that building, configuring, and installing your 
own perl would be much tougher than getting the examples from 
perlxstut to work.  How did you accomplish that?

-- 
Joe Schaefer          "Perish the Universe, provided I have my revenge."
                                               -- Cyrano de Bergerac



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

Date: Sun, 21 Oct 2001 16:28:21 -0700
From: Richard Trahan <rtrahan@monmouth.com>
Subject: Re: xsub - does anything work?
Message-Id: <3BD35A15.853FC1C5@monmouth.com>

Mark Jason Dominus wrote:
> 
> Visit http://cpan.valueclick.com/modules/00modlist.long.html.
> There is a list of Perl modules.  Each is accompanied by a 4-letter
> code.  If the third letter is 'c', then the module contains XS code.
> Many of these modules work under Windows.
> 
> In particular, there are many modules in the section "Microsoft
> Windows Modules" that use XS.  One would expect that these would work
> under Windows if anything does:
(snip)

But you didn't answer the question. I know there are lots of modules
that claim to have been written with XS, but I want to talk to 
someone who has actually done it. The fact that insiders and Perl
porters who know the guts of these systems can get it to work is
irrelevant to the great unwashed. The simple truth is that by following
the directions found in the various perl docs and other sources,
XS cannot be made to work, and it really doesn't matter that there 
exists a lot of modules that claim to have been built with it.

> >I have found that absolutely none of the examples in Perl or SWIG work,
> >when following their instructions.
> 
> "It didn't work" is probably the least useful trouble report you can give.
> By saying "It didn't work" you completely rule out the possibility
> that anyone will be able to point out that your problem is minor and
> easily repaired.  All anyone can really do is shrug and say "Well, it
> works for everyone else."
> 

I understand your point, but more importantly, do you understand mine?
If you can take even the first example in perlxstut and get it to
compile on Windows 9X, then I want to talk to you, but apprently you
have no experience whatever with this system. But just to satisfy your
curiosity, the very first example in perlxstut, using Visual C++ nmake 
on Windows 98, gives the following error:

Code is not inside a function (maybe last function was ended by a blank
line followed by a statement on column one?) my Mytest.xs, line 6.

I copied the code verbatim from perlxstut, and tried tweaking the
aberrant line, with no success.

The fact that you may be able to to figure out what's wrong is
besides the point. I claim the XS system is not working if the
documentation falsely describes it. I should not be required to
be an expert in make or perlguts to fixed these things; that's why
there are tools writers and developers who rely on them.

In addition, in the make file output my Makefile.PL, there is a
comment that might lead one to suspect that gnu make should also
work with this file. Au contraire. Gnu make chokes on a line
containing "<<", which it apparently does not recognize. I've
noticed that there are numerous other dependencies on Microsoft
nmake contained within the generated makefile, which I find rather
odd, given the open source nature of Perl.

As for SWIG, the very first example on the Introduction page of the
manual fails to compile, complaining that it cannot find "swig.swg",
even though that file is where it's supposed to be (in <installdir>/
Lib), and also it cannot find "t18.swg". Also, if the example is
built using the Visual C++ project files supplied for it,
that fails because it runs out of environmental space, among a
host of other reasons (I'm running with 384MB memory). I'm referring
to swigwin-1.3.9, the latest release.

Oh, and BTW, I corresponded with the author of perlxstut a couple
of times; his email address has recently stopped working, but he
said he had not kept perlxstut up to date for a long time because
there didn't seem to be much demand for it. That opens another
issue which will get me royally flamed if I comment on it, so I
won't. I'll just let all you hackers thunk on it.

> >More generally, is there any software, anywhere, of any type, written
> >by anyone for any purpose, that actually works? Please point me to it
> >so I can study it for my edification.
> 
> http://www.qmail.org/

> 
> Works great.
> 
Great. Send me the source code. Or better, post it.


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

Date: Sun, 21 Oct 2001 16:32:31 -0700
From: Richard Trahan <rtrahan@monmouth.com>
Subject: Re: xsub - does anything work?
Message-Id: <3BD35B0F.E2060442@monmouth.com>

Joe Schaefer wrote:
> 
> Richard Trahan <rtrahan@monmouth.com> writes:
> 
> ?  It seems to me that building, configuring, and installing your
> own perl would be much tougher than getting the examples from
> perlxstut to work.  How did you accomplish that?
> 

Easy. I let ActiveState do it for me.

Application preogrammers should not have to build their own compilers
and whatnot. ActivePerl is good enough for me; I don't need any
bizarre things that require recompilation, and that will probably
yield an unstable system for all the effort.

I do expect that when the Perl folks allow modules to be part of
the standard distribution, that they will work, and I claim they do
not, at least the XS part.

See my reply to Mark Dominus.


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

Date: Sun, 21 Oct 2001 20:43:07 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: xsub - does anything work?
Message-Id: <vrGA7.114822$NT3.11958396@news1.rdc1.ct.home.com>

Richard Trahan <rtrahan@monmouth.com> wrote:
> But you didn't answer the question. I know there are lots of modules
> that claim to have been written with XS, but I want to talk to 
> someone who has actually done it.

I've done it, though at this point I doubt I count as a member of "the
great unwashed". Used to, though, when I started writing XS modules.

The XS docs are geared very much towards Unix and Unixy platforms. They
are *not* geared towards Windows in any of its flavors. And you're right,
they suck. Rather badly in spots, less so in others.

For windows, make sure you read the windows-specific docs, and have the
recommended compiler and make tool. Using a different compiler than the
one your perl was built with will probably lead to a great deal of pain.

Next, do what pretty much everyone else does--snag a simple module with XS
code that you know works on your platform, rip out its guts, and add in
your own. Some people can start from first principles, but most of us find
it easer to work from an existing module.

					Dan


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

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


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