[6425] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 50 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 4 21:17:30 1997

Date: Tue, 4 Mar 97 18:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 4 Mar 1997     Volume: 8 Number: 50

Today's topics:
     Re: @ interpolation in string context (Jason Red)
     Re: futur de perl et java-script <philipp@ntex.com>
     Re: Grabbing text of web pages using perl (Laurel Shimer)
     Re: Graphical Perl for Win32 <kaehny@execpc.com>
     Re: How to convert a GIVEN date string to seconds (Dave Thomas)
     How to create 666 file from www perl cgi? (Geoffrey Hebert)
     Re: How to spam - legitimately (Matthew Ahrens)
     Re: How to spam - legitimately (Matthew Ahrens)
     Re: How to spam - legitimately (Matthew Ahrens)
     Re: max string size. (Tom Harrington)
     Re: max string size. (Tad McClellan)
     More Exception handling <murali@internix.com>
     Need help building Cryptix-Perl <ysc@ssds.com>
     Pattern match/replace ? (Mark W. Manley)
     Re: Pattern match/replace ? (Tad McClellan)
     Re: pattern matching question <kaehny@execpc.com>
     Re: perl man pages (Nathan V. Patwardhan)
     PERL SendMail Function (DByersII)
     perl TCP/IP server <simardc@netc.net>
     Re: Public domain DES and other crypto code in Perl? <eay@mincom.com>
     Re: Redirecting output <nachtigall@edcserver1.cr.usgs.gov>
     Re: Simple tr/// (Justin C Lloyd)
     Subroutine Source? (Jason Red)
     Re: Using Perl with painful or carefree style? (Laurel Shimer)
     Why the Win32::GD isn't Working? <duke@uims01.ice.cycu.edu.tw>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Tue, 04 Mar 1997 18:29:30 -0600
From: jreed@itis.com (Jason Red)
Subject: Re: @ interpolation in string context
Message-Id: <jreed-0403971829310001@p75.itis.com>

> Hi-
> 
> I found myself kind of upset when this compiled:
> [snip]
> But this didn't:
> 
>  %hash = &subr;
>  print("POSTED: @POSTED\n");
> 
>  sub subr {
>     @POSTED = ('hiya', 'friya');
>     return (One => 1);
>  }
> [snip]
> -Ken Williams
>  ken@forum.swarthmore.edu

It seems a very odd bug. If the second bit is executed twice, it doesn't
work the first time, but it does the second (within one session). If only
I remembered the syntax for the symbol tables (or had my Camel with me...)
some further insight might be possible...

---Pascal


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

Date: Tue, 04 Mar 1997 15:34:57 -0800
From: "Philip A. Prindeville" <philipp@ntex.com>
Subject: Re: futur de perl et java-script
Message-Id: <331CB1A1.59C4@ntex.com>

> In comp.lang.perl.misc,
>     abigail@ny.fnx.com writes:
> :On 21 Feb 1997 17:57:30 GMT, Tom Christiansen wrote in comp.lang.perl.misc:
> :
> :++                            our lex loci hereabouts is that postings
> :++ be in English rendered
> :
> :*ploink*
> :
> :I've always seen Usenet as being a international medium. Too bad there
> :are still arrogant people who think it's a US-only thingy.
> 
> The net is certainly international.  But as I said in the cited posting,
> apart for those newsgroups in the national hierarchies and the odd
> soc.culture group, the language of exchange on Usenet is English.  Do you
> deny that?  English is the world's #1 second language, which means that,
> even apart from national demographics, that postings in English will
> reach the most people.

Hold on now.  First, a lot of people get flamed for asking imprecise
questions and "wasting everyone's time".  If the only way for them to
express themselves precisely is in some other language, but you are
prohibiting them from doing so, then they are in a lose/lose situation.

Second (or "b", as Paul Reiser would say), is that some of these foreign
language postings *do* contain code snippets, and we all being Perl
gurus
(;-), can understand what is being expressed fluently.  So, we can skip
the
noise (language X which we don't speak) and jump directly to the source.

Of course, some people flame "idiots" that can't be bothered to pick up
a
perl FAQ or camel book, but don't think twice about consulting a
dictionary
for some foreign language.

> If you really want this to become a Newsgroup of Babel, then I'd be sehr
> feliz to continue my polyglot postings that quasi no one can legere.  :-)

Pienso que poder leer tus postings.  Je pense que je peux bien lire tes
postings.  Ick denk dat ick lecht ur posting caan.  (sp?)

Alright, so my spanish, french, and dutch aren't perfect.  But then I
make mistakes in Perl too...

> How many rec.humor.funny postings to see in Swahili?  Ever wonder why?
> Because the goal of Usenet is communication.  If you aren't understood,
> then you've failed.  Why do you think there exist perl groups like
> de.comp.lang.perl?
> 
> --tom

So, the fact that my Perl code has the odd bug means I should give it up
because I've failed to make myself understood by the computer?

-Philip


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

Date: Tue, 04 Mar 1997 15:42:19 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: Grabbing text of web pages using perl
Message-Id: <autopen-0403971542190001@l72.d22.quake.net>

In article <5f7fqc$ko2@lastactionhero.rs.itd.umich.edu>,
hutchin@news-server.engin.umich.edu (Timothy B. Hutchinson) wrote:

> Oops -- my news programme messed up my e-mail address -- it's actually
>   hutchin@umich.edu.
> 
> Timothy B. Hutchinson  wrote:
> : Is there a relatively easy way -- or a publicly available script --
> : which would allow me to grab the text of a web page and append it 
> : to a file?  In other words, the input for a filehandle would be the
> : web page -- is this possible?


Ever since I've read this I've been trying to find a reference made in one
of the UC Berkley Extension Perl workshops  I took last year to 'slurping'
a file. I have the impression it might be a CPAN thing. Still cannot find
the note I made about it. But it seems like it would be a handy thing to
me too.

Does that ring a bell w/ anyone else?

Laurel

-- 
        The Reader's Corner: Mystery, Romance, Fantasy 
     Short stories, excerpts, themes and resources 
        http://www.autopen.com/index.shtml 
     Subscribe to our free StoryBytes publication
Current Mermaids Issue at http://www.autopen.com/mermaids.shtml


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

Date: Tue, 04 Mar 1997 19:28:00 -0600
From: Mark Kaehny <kaehny@execpc.com>
Subject: Re: Graphical Perl for Win32
Message-Id: <331CCC20.65DA@execpc.com>

scott@lighthouse.softbase.com wrote:

> 
> I doubt anyone is going to do much more than port an existing
> widget-language like Java or Tk/Tcl to Win32. The monumental task of
> making Win32 API calls available in perl doesn't seem like it would be
> worth it. All you could do is write old-style C + SDK programs, and in
> this age of visual tools like Delphi and C++ Builder, who wants that?
> The monumental effort of providing a widget-library similar to java.awt
> doesn't seem worth it either. Maybe someone with too much time on their
> hands will create "Visual Perl" with an MFC-like Perl OOP library for
> UI widgets. I doubt it!

Have you actually looked at the documentation that comes with 
activewares Perl for Win 32 port? All that stuff is already in there!
It is very easy to wrap perl around library calls and it has been done. 
Makes writing the programs like writing the C programs though...
MRK


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

Date: 5 Mar 1997 00:02:33 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: How to convert a GIVEN date string to seconds
Message-Id: <slrn5hpdqa.79s.dave@fast.thomases.com>

On Tue, 04 Mar 1997 09:44:32 -0500, Fu-Chiang (Rich) Tsui
<tsui@cbmi.upmc.edu> wrote:

> Hi there,
> 
>    Does anyone know how to convert a given date string, say 1/4/97, to
> number of seconds since 1/1/1970 in Perl5.001UNIX?  Thank you in
> advance.


Look in CPAN for Date:: modules

Dave

-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Wed, 05 Mar 1997 00:28:40 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: How to create 666 file from www perl cgi?
Message-Id: <5fidsl$1p8$1@news3.microserve.net>

I want to create a file with a perl cgi script that is initiated from
the web.

If I create the file as the owner with 666 permissions from my telnet
account, everything works fine.  I can then open with ">filename"

Open works only if I created the file!  I want the cgi to create the
file.  Seems as though security is stopping me.

Any help appreciated thanks. 

email please soccer@microserve.net



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

Date: Tue, 04 Mar 1997 22:48:09 GMT
From: matt@callnet.com (Matthew Ahrens)
Subject: Re: How to spam - legitimately
Message-Id: <331ea338.250298471@news.alt.net>

On 27 Feb 1997 04:54:19 -0000, shields@crosslink.net (Michael Shields)
wrote:

>In article <5esrht$77t@nntp1.u.washington.edu>,
>William R. Somsky <somsky@dirac.phys.washington.edu> wrote:
>> Hmm... "email" as what I'd call a "substansive" noun I've heard:
>> "I got _some_ email".  It's like "The postman delivered some mail"
>> or "I drank some water".
>> 
>> But "email" as what I'd call an "objective" noun I haven't heard:
>> "I got _an_ email".  That'd be like "The postman delivered a mail"
>> or "I drank a water".
>
>I ate some cake.  I ate a cake.

Although "I drank a water" sounds bad, and is probably not standard English,
there are other cases where one noun can be both substansive and objective.

For example, you can drink "some Coke", or you can drink "a Coke", which
means that you drink "a can of Coke". By making it objective you force it
into the standard quanta.

I believe that the intent of distinguishing between substansive and
objective is to distinguish between something which can not have its
smallest parts counted, and something which can.

For example, water molecules can not traditionally be counted, therefore,
you drink "some water" and not "some waters" or "a water". Although you can
count grains of sand, you still talk about "some sand", and not "some
sands", or "a sand". Rather you talk about "some grains of sand", or "a
grain of sand". Apples, on the other hand, can be counted, so you eat "5
apples", or "some apples", or "a apple" but not "some apple".

Things such as "apple pie" can be both. You eat "some apple pie", "some
apple pies", "5 apple pies", or "a apple pie".

To conclude, I do not mean to confuse you, but rather to point out that
there are nouns which are both substantive and objective, or one or the
other. There is not a standard which requires the noun "email" to behave
identically to "mail". I think that only time will tell which usage becomes
preferred.


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

Date: Tue, 04 Mar 1997 23:32:10 GMT
From: matt@callnet.com (Matthew Ahrens)
Subject: Re: How to spam - legitimately
Message-Id: <3320b0b7.253753222@news.alt.net>

On 1 Mar 1997 00:58:00 GMT, per@erix.ericsson.se (Per Hedeland) wrote:

>In article <pudge-ya02408000R2702971056090001@news.idt.net>
>pudge@pobox.com (Chris Nandor) writes:
>>Alright, here's a new one (name withheld, posted to comp.lang.perl.modules):
>>
>>#You can send me by email
>>
>>Now THAT would be an interesting trick ... ;-)
>
>Missed RFC 1437?:-)

no, it just prooves that the poster really *is* just an AI computer program
that some grad student at MIT wrote for his thesis.

--matt


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

Date: Tue, 04 Mar 1997 23:30:32 GMT
From: matt@callnet.com (Matthew Ahrens)
Subject: Re: How to spam - legitimately
Message-Id: <331fa7de.251488606@news.alt.net>

On 3 Mar 1997 21:55:07 -0800, rigoleto@kaiwan009.kaiwan.com (Mike Zorn)
wrote:
>   I agree.  (Though I have been known to work on several CGIs
>simultaneously.  In Perl.  Of course)

I'm not sure if you wrote this to point it out or not, but I find it
interesting that acronyms are often not the grammatical equivalent of their
expansions. For example, you said that you work on "several CGIs". However,
there is only one Common Gateway Interface. Perhaps you meant that you "work
on several programs which communicate via the CGI"? I know I am guilty of
this one.

How about, "I need to get cash at the ATM machine." Now, this is a little
more obviously bad form, because the "Automated Teller Machine machine"
doesn't make much sense (at least, not to me :).

Also, "FTP" is often made into a verb, as in "Just FTP the upgrade.", using
FTP to mean "transfer using the File Transfer Protocal".

Just a little side note on the use of the English language.

--matt


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

Date: 4 Mar 1997 22:09:29 GMT
From: tph@longhorn.uucp (Tom Harrington)
Subject: Re: max string size.
Message-Id: <5fi6ip$l1r6@eccws1.dearborn.ford.com>

Tom Phoenix (rootbeer@teleport.com) wrote:

: Hmmm... That code isn't syntactically valid, so I'm sure _that_'s not your
: code. But try this anyway.

:     {
:         local($/);
:         open FILE, "test.txt" or die "Couldn't open file: $!";
:         $store = <FILE>;	# Slurp in whole file

Does the lack of any file-size check imply that Mohammed was right in
thinking that strings can take on any length, subject only to memory
size limits?  This seems to be the case, but I need to be sure; I have 
a similar situation where I may get strings into the tens of kb, and 
I *really* don't want to have the script break.  [I am unfortunately 
still on Perl 4.0.1.8 if it makes a difference in this case].

--
Tom Harrington ------- tph@rmii.com ------- http://rainbow.rmii.com/~tph
    "You can be what you want to be, Let your soul and your body and
          your mind be free"  -The Shamen, "Move any Mountain"
-> Fractal Kit:  http://rainbow.rmii.com/~tph/fractalkit/fractal.html <-


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

Date: Tue, 4 Mar 1997 18:21:06 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: max string size.
Message-Id: <i9eif5.o44.ln@localhost>

Tom Harrington (tph@longhorn.uucp) wrote:
: Tom Phoenix (rootbeer@teleport.com) wrote:

: : Hmmm... That code isn't syntactically valid, so I'm sure _that_'s not your
: : code. But try this anyway.

: :     {
: :         local($/);
: :         open FILE, "test.txt" or die "Couldn't open file: $!";
: :         $store = <FILE>;	# Slurp in whole file

: Does the lack of any file-size check imply that Mohammed was right in
: thinking that strings can take on any length, subject only to memory
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: size limits?  This seems to be the case, but I need to be sure; I have 
: a similar situation where I may get strings into the tens of kb, and 
: I *really* don't want to have the script break.  [I am unfortunately 
: still on Perl 4.0.1.8 if it makes a difference in this case].


That's right. Perl strings are limited only by your (virtual)
memory...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Tue, 4 Mar 1997 22:29:43 GMT
From: Murali Donthireddy <murali@internix.com>
Subject: More Exception handling
Message-Id: <331CA257.624@internix.com>

I tried the exception handling example in the perlsub manpage
(Thanks Ken)
(I never knew until now that user written subroutines could be
 called without enclosing arguments in parentheses. I thought it
 it was bultin function magic.)

First, I couldn't get the exception example to work until I changed 
sub catch (&$) { @_}
to
sub catch (&$) { $_[0]};

Any explanantion?


Then I tried to extend the example to include a finally block.
I think it works. I would like to hear comments on it, and whether
it can be improved.
Also, can anyone tell me why the keyword "return" is required in
the catch subroutine? I thought return was optional. But
I get weird behavior if I delete the keyword.

My code:

#!/usr/local/bin/perl -w
# I believe that to mimic JAVA semantics(amit@jpmorgan.com),
# the finally block must be
# executed before the catch block
# and any exception in the finally block replaces the earlier exception
sub try (&$) {
    my($try,$cf) = @_;
    ($catch,$finally) = @$cf;
    #print "catch = ", $catch, "\n";
    eval { &$try };
    $err = $@;
    eval { &$finally;};
    if ($@) {
	$err = $@;
    }
    if ($err) {
	local $_ = $err;
	&$catch;
    }
}
sub catch (&$) {return \@_}
sub finally(&) { $_[0]}
sub throw { die @_}
#
try {
    print "begin\n";
    throw "phooey";
    print "end\n"; # Not executed
} catch {
    /phooey/ and print "unphooey\n";
} finally {
    print "finally\n";
};


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

Date: Tue, 04 Mar 1997 18:49:36 -0500
From: Yun-seng Chao <ysc@ssds.com>
Subject: Need help building Cryptix-Perl
Message-Id: <331CB510.2C@ssds.com>

Help!

I've downloaded the Systemics Cryptix-perl package and keep running
into the same problem I saw with their Crypt-DES and Crypt-IDEA 
modules located in the CPAN archive.  I can't find any documentation.
I've looked at all the obvious system include files and directories.

Anyway, the problem is that des.h includes only <sys/types.h> and
then tries to typedef u_int8_t and u_int32_t.  They claim to have
this working under Solaris 2.[45] but I can't find any header file
in the /usr/include subtree that has these two names.

I've used both an older copy (3.0) of ProC and the latest GCC, hoping
one of them has a modified types.h with these two names (and another
- u_int16_t) defined.  I also couldn't find any common header file
that came as part of cryptix-perl that has these names defined.

Am I missing another package, or does the RSAref library contain
these definitions?

Any help would be appreciated.

--
Yun-seng Chao                             E-Mail: ysc@ssds.com
SSDS Inc.                                  Phone: (937) 429-2091
2290 Lakeview Dr.   Suite E.                 Fax: (937) 429-9508
Beavercreek, Ohio 45431


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

Date: Tue, 4 Mar 1997 23:46:49 GMT
From: mwm3q@jefferson.village.Virginia.EDU (Mark W. Manley)
Subject: Pattern match/replace ?
Message-Id: <E6JM21.36F@murdoch.acc.Virginia.EDU>

Hello, I'm working with large SGML files and need to know how to do
quick search and replaces.  What I've been trying to do is replace
series of tags.  For instance, I have:

<ref>
 <1></1>
 <2></2>
</ref>
<other stuff>
<ref>
 <1></1>
 <2></2>
<ref>
<more stuff>
<ref>
and so on...

I want to replace <ref> and everything inside those tags with the simply
<bibl></bibl>.  I have tried "s/\s*<ref>.*<\/ref>/\n <bibl><\/bibl>/sg;"
but it takes the absolute first <ref> tag and the absolute last </ref>
tag and deletes everything in between, which means I lose not only the
information that I want to lose, but the <other stuff> that I need to
preserve.  Does anyone know how to restrict the search function so that
it only replaces what I need replaced?  I'd really appreciate it..  

Please send any ideas by email.  My newsreader acts bizarre at times and
malfunctions badly.

Thanks!
MM (mwm3q@virginia.edu).


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

Date: Tue, 4 Mar 1997 18:18:39 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Pattern match/replace ?
Message-Id: <v4eif5.o44.ln@localhost>


[ emailed, posted ]


Mark W. Manley (mwm3q@jefferson.village.Virginia.EDU) wrote:
: Hello, I'm working with large SGML files and need to know how to do
: quick search and replaces.  What I've been trying to do is replace
: series of tags.  For instance, I have:

: <ref>
:  <1></1>
:  <2></2>
: </ref>
: <other stuff>
: <ref>
:  <1></1>
:  <2></2>
: <ref>
  ^^^^^

1) Is this supposed to be and end tag?

Then you want non-greedy matching:

---------------
#!/usr/bin/perl -w


$_=<<ENDSGML;
<ref>
 <1></1>
 <2></2>
</ref>
<other stuff>
<ref>
 <1></1>
 <2></2>
</ref>
ENDSGML

print;
print "\n\n";

s#<ref>.*?</ref>#<bibl></bibl>#sg;
#        ^
#        ^

print;
---------------



2) Or are <ref> elements allowed to be nested inside of <ref> elements?

Then you'll need a real parser with a stack.

If #2 applies, then I would probably parse it with 'nsgmls' and
work on the ESIS output from that to re-generate the transformed
SGML.


: <more stuff>
: <ref>
: and so on...

: I want to replace <ref> and everything inside those tags with the simply
: <bibl></bibl>.  I have tried "s/\s*<ref>.*<\/ref>/\n <bibl><\/bibl>/sg;"
: but it takes the absolute first <ref> tag and the absolute last </ref>
: tag and deletes everything in between, which means I lose not only the
: information that I want to lose, but the <other stuff> that I need to
: preserve.  Does anyone know how to restrict the search function so that
: it only replaces what I need replaced?  I'd really appreciate it..  



--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Tue, 04 Mar 1997 19:50:54 -0600
From: Mark Kaehny <kaehny@execpc.com>
Subject: Re: pattern matching question
Message-Id: <331CD17E.496@execpc.com>

Lee William Jones wrote:

> I'm trying to do a relaxed pattern match -- i.e. given a string
> sequence, return position(s) where it matches at least x characters in
> the string.
> 
> I checked the camel book, but didn't see any operators or syntax for
> something of this sort (perhaps I'm just blind).  Short of enumerating
> the possibilities with wildcards filled in (a VERY ugly option) or
> writing another short program to enumerate them for me 

I'm lost... Tell me if this is what you are after. You want to find
places in one string where at least $x characters match the start
of a second.

so why not just $one =~ /substr($second,0,$x)/e with appropriate
parens or catching.

or just
$teststr = substr($second,0,$x);
then use teststr. I have a feeling you are asking more than this,
what what more is unclear...
MRK


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

Date: 5 Mar 1997 00:14:38 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: perl man pages
Message-Id: <5fidte$qor@fridge-nf0.shore.net>

SRI (ss51@columbia.edu) wrote:

: This seems to be for the 4.0 version. But I checked /usr/local/man/man1
: and /usr/local/lib/perl5/man/man3 and they all are brand new. Where are
: the old man pages hiding? Also there are two executables 'perl' and
: 'perl5.003' in /usr/local/bin. Are they the same?

Try a: perl -v.  If it's anything less than 5.003, you know that it's old.
You might also try diff perl perl5.003.

--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: 4 Mar 1997 23:34:02 GMT
From: dbyersii@aol.com (DByersII)
Subject: PERL SendMail Function
Message-Id: <19970304233300.SAA01658@ladder01.news.aol.com>

Can anyone give me some help on using the SendMail function?  I've
attempted to use it in an HTML page and it doesn't function properly.  Is
there a special .dll file that must be resident on my NT Web Server?  Any
help with syntax and background would be greatly appreciated.

Thanks


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

Date: Tue, 04 Mar 1997 17:58:36 -0500
From: Christian Simard <simardc@netc.net>
Subject: perl TCP/IP server
Message-Id: <331CA91C.4EAB@netc.net>

Hi, i'v downloaded the "Programming Perl" archive available at O'reilly
& Associate's ftp site. The archive contains a Perl program named
"server" that implement a TCP/IP server. The problem is that i cannot
get it work under my SGI Indigo 2 (IRIX 5.3) and on my Sun Netra
(Solaris 2.4) workstations, but it worked fine under my Sun IPC (SunOS
4.1.3) other machine! On the first two i got the following error
message: "socket: Protocol not supported at ... line ...." I'v printed
the protocol that the program want to use and I got 6. This protocol is
listed in my /etc/protocols. What's wrong with it?

thanks for your help,

Christian.


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

Date: Wed, 05 Mar 1997 09:15:10 +1000
From: Eric Young <eay@mincom.com>
Subject: Re: Public domain DES and other crypto code in Perl?
Message-Id: <331CACD1.2B8F88B6@mincom.com>

Andrew Haley wrote:
> 
> Paul Rubin (phr@netcom.com) wrote:
> : In article <5ff7r3$cmi$1@news.eecs.umich.edu>,
 ....
> : >We would like to be able to have a self-contained program where each
> : >user has all of the code, including the crypto, locally. So, are
> : >there any packages WRITTEN IN PERL for DES, etc.?
> 
> : Huh?  What's wrong with the user compiling the C functions in with
> : their programs?  DES and other bit twiddling algorithms sound painful
> : in Perl.
> 
> Not every user has a C compiler.  Besides, if all you're doing is
> encrypting an authenitcation ticket the user won't perceive any
> difference between C and PERL.  It shouldn't be hard to translate DES
> from C to PERL.

Have a look at des.pl in libdes (ftp://ftp.psy.uq.oz.au/pub/Crypto/DES).
Back in 1991 I did a trivial translation of my C des code to perl 4.

On my pentium 100 under linux I get about 2k bytes/sec :-).

eric


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

Date: Tue, 4 Mar 1997 23:05:15 GMT
From: Neal Nachtigall <nachtigall@edcserver1.cr.usgs.gov>
To: Brandon@byu.edu
Subject: Re: Redirecting output
Message-Id: <331CAAAB.16F6@edcserver1.cr.usgs.gov>

Brandon Pulsipher wrote:
[clip]

> Anyone have a way I can turn off/redirect the output while this system()
> call does its thing, then return output to normal?  The line of code is
> below( I am using NT Perl):
> 
>   if (system("ftp -s:source.ftp")  {print LOG "Error: blah blah";die}

Possibly 2 ways (unsure if either will work for you):
 on unix:
   system("ftp -s:source.ftp 1> /dev/null 2> /dev/null");
     may be something similar on NT to redirect stdout and stderr

 or:
   `ftp -s:source.ftp 2>&1`; #this was in the blue camel unsure of pg #
   print LOG "Error: blah" if ($? != 0);

HTH,
--
Neal L. Nachtigall * nealnach@dlgef.cr.usgs.gov 
Hughes STX (EROS Data Center)

No wonder nobody comes here--it's too crowded. -Yogi Berra


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

Date: 1 Mar 1997 18:13:33 GMT
From: lloyd@cs.fsu.edu (Justin C Lloyd)
Subject: Re: Simple tr///
Message-Id: <5f9rkd$iab@news.fsu.edu>

Ken Schrock (kens@cannet.com) wrote:
: I am new to Linux but played with Perl under NT...
: If I do MAN XXX > FILE I get stuff that looks like...
: 
: N\bNA\bAM\bME\bE
:        ps - report process status
: 
: S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
: 
: So I thought fine, I will use Perl tr/// 
: To get this garbage out, 
: But I appear to be holding my mouth wrong. <g>
: Will someone please help me?
: 
: -- 
: Ken Schrock
: kens@cannet.com
: Solutions Software

Those backspace characters can be taken care of much easier with the following
command:

man XXX | col -b > file

Check the man page for 'col'.

JcL

-- 
Justin C. Lloyd ______________________________________________________________
Graduate Teaching Assistant                phone: 904/644-0559
Department of Computer Science             email: lloyd@cs.fsu.edu
Florida State University                   www:   http://www.cs.fsu.edu/~lloyd

                                 P + L = :)


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

Date: Tue, 04 Mar 1997 18:27:22 -0600
From: jreed@itis.com (Jason Red)
Subject: Subroutine Source?
Message-Id: <jreed-0403971827230001@p75.itis.com>

Is there any way, in the middle a script, to see the perl code associated
with a subroutine? (particularly if the sub was defined in the middle of
an eval?)

I'm just certain I missed seeing this in the FAQ or in the debugger source
somehweres...

---Pascal


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

Date: Tue, 04 Mar 1997 15:33:04 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: Using Perl with painful or carefree style?
Message-Id: <autopen-0403971533040001@l72.d22.quake.net>

In article <01bc2295$a3e6ba90$928d389d@miyu>, "Sam Inala"
<sami@microsoft.com> wrote:

> I recently read an article by Larry Wall in the _Linux_ magazine.
> In it, he describes Perl as a language which may be used in
> multiple styles. You may use it to write quick and dirty scripts, 
> or you can be a somber, serious software engineer, and 
> use -w, use strict, and include function prototypes.
> 
> I must enjoy pain. I have always used these even for the
> shortest scripts. To my mind, such features always save time.
> Not using them simply asks for hidden problems. Are there
> people out there who actually practice both a carefree
> style and a somber style? Or is it that Perl may be used
> by two kinds of programmers, the fastidious ones and
> (dare I say it) the sloppy ones?
> 
> -- 


Now who is going to admit to being sloppy?

Well - you are probably right. Even when building an example, a prototypes
or a q & dirty one time pieces of code you may spend less time debugging.

But when you're first learning the language perhaps it helps to just learn
the big guts first and then go back and find that the body holds together
better w/ sinew and muscle.

Laurel-who's-been-known-to-leave-out-die-to-her-regret

-- 
        The Reader's Corner: Mystery, Romance, Fantasy 
     Short stories, excerpts, themes and resources 
        http://www.autopen.com/index.shtml 
     Subscribe to our free StoryBytes publication
Current Mermaids Issue at http://www.autopen.com/mermaids.shtml


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

Date: Wed, 05 Mar 1997 00:37:11 +0800
From: duke <duke@uims01.ice.cycu.edu.tw>
Subject: Why the Win32::GD isn't Working?
Message-Id: <331C4FB7.BD9@uims01.ice.cycu.edu.tw>

Hi....

  I'm trying to use the Win32::GD. I have installed the "GD.PM" and 
  "GD.pll".I try to test the GD module. 
  So,I do follow instructions.

  c:\lang\perl\gd>perl TEST.PL
  Error: Parse exception
  ^^^^^^^^^^^^^^^^^^^^^^

  Why?? 

  How do I solve the problem?
  Can you give some option for me?

  Thanks in advance!
  Duke

  duke@uims01.ice.cycu.edu.tw


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 97)
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.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.

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

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