[16980] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4392 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 20 21:10:27 2000

Date: Wed, 20 Sep 2000 18:10:12 -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: <969498612-v9-i4392@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 20 Sep 2000     Volume: 9 Number: 4392

Today's topics:
    Re: NT File Attribute - archive <elephant@squirrelgroup.com>
    Re: OT! Sports colors (Was: Re: Can you store a conditi (Martien Verbruggen)
    Re: OT! Sports colors (Was: Re: Can you store a conditi (Jerome O'Neil)
    Re: Perl economy (Craig Berry)
    Re: Perl Online Questions Updated <amonotod@netscape.net>
    Re: Perl Online Questions Updated (Tim)
        perl URL download from a site that needs a cookie jbalding@hotmail.com
        Portability of Perl/Tk programs? <nospam@david-steuber.com>
    Re: Pure perl encrypt/decryption? (Mark-Jason Dominus)
        recursive renaming <ghrose@unm.edu>
    Re: recursive renaming <anmcguire@ce.mediaone.net>
        Redirecting output from executable into a variable <mike@esterling.co.uk>
        Redirecting the output of an exe into a variable <mike@esterling.co.uk>
    Re: Shortest code for Fibonacci? (Abigail)
        xs help requested <elijah@workspot.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 21 Sep 2000 10:14:57 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: NT File Attribute - archive
Message-Id: <MPG.1433fe0c1d820c4f9897c1@localhost>

H C wrote ..
>jason wrote:
>
>>   [ posted to comp.lang.perl.misc and CCed to tanya_ellis@hotmail.com ]
>
>> please try not to ask the same question twice .. I've already answered
>> this in the other thread that you started entitled "Archive File
>> Attribute on NT"
>
>Again, you could have sent your response to Tanya alone, but you had to make
>sure everyone else knew how smart you are...

umm - seeing as others have pointed out the valid reasons for posting 
here as well as CCing .. my only response to you is -> why did you post 
instead of just emailing me ?

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 20 Sep 2000 22:13:32 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: OT! Sports colors (Was: Re: Can you store a condition in a variable?)
Message-Id: <slrn8sidjs.hc9.mgjv@verbruggen.comdyn.com.au>

On Wed, 20 Sep 2000 11:07:02 -0700,
	Larry Rosler <lr@hpl.hp.com> wrote:
> 
> I understand why Brazil's colors might be green and yellow, given their 
> flag.  But the Aussies' colors are incomprehensible, given their flag's 
> red, white and blue, as a good descendant of Mother England.  Perhaps 
> someone can explain.

\begin{offtopic}

Australia's colours are actually officially called green and gold (as
noted upthread) although they are almost always in actuality green and
yellow. They have been (officialy) in use since 1984.

The colours are taken from the golden wattle, which is a native
Australian flower, and a little later (1988) became Australia's floral
emblem.

\end{offtopic}

Don't think I've ever been this far offtopic before.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.   | make up 3/4 of the population.
NSW, Australia                  | 


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

Date: Wed, 20 Sep 2000 22:30:59 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: OT! Sports colors (Was: Re: Can you store a condition in a variable?)
Message-Id: <DUay5.771$zo2.284895@news.uswest.net>

Larry Rosler <lr@hpl.hp.com> elucidates:

>> How odd. The topic of how almost no sports teams had yellow as a
>> color, it was always gold, was raised in Frank DeFord's (sp?)
>> commentary today on Morning Edition on NPR. Virginia Military Academy
>> has a school color of yellow, too.
> 
> University of Michigan has 'maize' and blue!  (It looks gold to me, 
> though.)

Georgia Tech carries the Yellow Jacket as their mascot, yet their colors 
are white and gold.

Must be the gold.

-- 
"Civilization rests on two things: the discovery that fermentation 
produces alcohol, and the voluntary ability to inhibit defecation.  
And I put it to you, where would this splendid civilization be without 
both?" --Robertson Davies "The Rebel Angels" 


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

Date: Thu, 21 Sep 2000 00:21:40 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl economy
Message-Id: <ssil4krcqsnhe1@corp.supernews.com>

scott@mobinfo.com.au wrote:
: Is there a more succinct way to do this:
: 
: $a = '/home/scott/inc /usr/include /home/scott/program/include'

Using $a (and $b) as general-purpose variables is unwise; they have
special semantics in sort blocks.

: x join(' ', map({ $_ = '-I' . $_ } split(/\s+/, $a)))
: 0  '-I/home/scott/inc -I/usr/include -I/home/scott/program/include'

  $a =~ s!(^| )/!$1-I/!g;

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


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

Date: Wed, 20 Sep 2000 21:56:35 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Perl Online Questions Updated
Message-Id: <8qbbq6$o83$1@nnrp1.deja.com>

In article <8qb9hh$l99$1@nnrp1.deja.com>,
  cd_root@my-deja.com wrote:
> We've also corrected some typos thanks to the watchful eyes of
> pervious visitors. :-)
   ^^^
HA!

amonotod

--
    `\|||/                     amonotod@
      (@@)                     netscape.net
  ooO_(_)_Ooo________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 20 Sep 2000 23:09:18 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: Perl Online Questions Updated
Message-Id: <8FB5BFF68indigodimcom@166.93.207.145>

cd_root@my-deja.com wrote in <8qb9hh$l99$1@nnrp1.deja.com>:

>We've added over 100 more questions to our perl related online database
>at:
>
>           http://www.networkessentials.com/certified/perl

Augh.  Hope you are up to date on obscure pack params.

-T


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

Date: Wed, 20 Sep 2000 22:22:46 GMT
From: jbalding@hotmail.com
Subject: perl URL download from a site that needs a cookie
Message-Id: <8qbdat$q2l$1@nnrp1.deja.com>

I'm attempting to develop an internal web page that displays
information from a heterogenous set of external data sets. Several of
the sources only make their data available on the web. With an
application like webcopy or a simple perl script it's relatively easy
to download the majority of the pages I need offline. On one site,
however, you have to initially go through a Javascript login page to
get to the data. On subsequent logins it reads information stored in a
cookie to validate my login.

Does anyone have any idea how I can get at this data offline using
perl? Downloads for the other sites are being scheduled using a cron
job and I'd like to do the same for this site. Is there an easy way of
scripting access to a site that requires a cookie?

Thanks,

John


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 21 Sep 2000 01:03:42 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Portability of Perl/Tk programs?
Message-Id: <m3og1isgif.fsf@solo.david-steuber.com>

I'm considering using Perl/Tk for an application that will use a GUI
and the IO::Socket and possibly other modules.  I would like this
application to be able to run under Win32 and Mac as well as
Linux/Unix platforms.  Are there any gotchas I should be aware of?  I
already know that there is no fork in Windows.

Oh, how portable are the various crypt modules and the MD5 digest
module?  Can I expect them to be available?

I know these questions are very generic.  I am at the conceptual stage
right now.

-- 
David Steuber | Perl apprentice, Apache/mod_perl user, and
NRA Member    | general Internet web wannabe.
ICQ# 91465842  (Using Micq 0.4.6 under Linux)

It's time to be free: http://www.harrybrowne2000.org


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

Date: Wed, 20 Sep 2000 19:27:07 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Pure perl encrypt/decryption?
Message-Id: <39c934c5.3235$19e@news.op.net>

In article <MPG.14317ae9c5de7dc3989687@nntp.onyx.net>,
Andy Flisher  <andrew.flisher@onyx.net> wrote:
>there's no guarantee that you're gonna get 8 chars back.  

OK, I checked.  Blowfish is a block cipher with a 64-bit block, which
means that the input is 64 bits and the output is 64 bits, and if you
don't get 8 characters out every single time, the implementation is
seriously broken, and should not be used at all.

        http://www.counterpane.com/blowfish.html




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

Date: Wed, 20 Sep 2000 16:13:16 -0700
From: george <ghrose@unm.edu>
Subject: recursive renaming
Message-Id: <200920001613160944%ghrose@unm.edu>

i am trying to change many filenames in many directories

the script below worked in one dir.

#!/usr/bin/perl

while(<*>) {

$oldname = $_;

s/moretime/lesstime/;

rename $oldname, $_;

}

how can in get it to go throught a bunch of dirs recursivily?


any help would be appreciated
thanks

george


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

Date: Wed, 20 Sep 2000 17:41:16 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: recursive renaming
Message-Id: <Pine.LNX.4.21.0009201739440.3179-100000@hawk.ce.mediaone.net>

On Wed, 20 Sep 2000, george quoth:

g> i am trying to change many filenames in many directories

[ snip script ]

g> how can in get it to go throught a bunch of dirs recursivily?

use File::Find; # perldoc File::Find for details

anm
-- 
<(@)> ; $/ = q;;; for $" ( map $_ && chr() => split m~[\D+ <(@)>
<(@)> ]~ => <DATA> ) { print "@{ [ '' => '' ] }" } __END__ <(@)>
<(@)>   74 117 115 116 32 97 110 111 116 104 101 114 32    <(@)>
<(@)>      80 101 114 108 32 72 97 99 107 101 114 10       <(@)>



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

Date: Wed, 20 Sep 2000 14:31:22 +0100
From: "mike" <mike@esterling.co.uk>
Subject: Redirecting output from executable into a variable
Message-Id: <%W2y5.9136$ly4.74060@NewsReader>

Hi,
How can I get the output of an exe file into a variable in perl so I can
display it in a cgi page.
I have it working with the open command so it displays the output straight
away but I can't find out how to put that into a variable instead of
displaying it.
Cheers,
            Mike

mike@esterling.co.uk




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

Date: Wed, 20 Sep 2000 14:14:39 +0100
From: "mike" <mike@esterling.co.uk>
Subject: Redirecting the output of an exe into a variable
Message-Id: <iH2y5.10283$pi.91036@NewsReader>

Hi,
I want to redirect the output of a program (analog) into a variable, I can
display the output on screen using the open command but need it in a
variable.
Cheers




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

Date: 20 Sep 2000 23:17:04 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Shortest code for Fibonacci?
Message-Id: <slrn8sih99.5fq.abigail@alexandra.foad.org>

Jim Cook (jcook@strobedata.com) wrote on MMDLXXVII September MCMXCIII in
<URL:news:39C915D2.525DB093@strobedata.com>:
~~ 
~~ Large power answer 8.820213377741e+273


Well, you omit most of the answer. Yes, it's fairly trivial to come
up with the first k digits of the answer. But that's just an approximation,
not an answer.


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: 21 Sep 2000 00:59:50 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: xs help requested
Message-Id: <eli$0009202029@qz.little-neck.ny.us>

I'm trying to make some C encryption functions available to perl,
but my code ends up segfaulting.

My C functions look like:

typedef struct mykey {
	unsigned char key[KEY_BYTES];
} mykey_t;

int   crypt(char *in, int inlen, char **out, int *outlen, mykey_t *key);
int decrypt(char *in, int inlen, char **out, int *outlen, mykey_t *key);

The space for the output gets malloc'ed in the C code. For crypt()
outlen > inlen unless there is an error, due to a header and
(sometimes) padding.

I'd like to have a perl interface like:

	my $text = "This is some text. It can have nulls (\0) in it.";
	my $key  = "\0\cA\cB\cC";

	my $crypt   =   crypt($text,  $key);

	my $decrypt = decrypt($crypt, $key);

	# $crypt eq $decrypt

Eventually I'd also like:

	my $err = crypt(undef, $key);

	# $err eq undef


Without knowing a lot about what I am doing, but based on looking at
how Compress::LZO does xs stuff, I've come up with a function block
for crypt in my .xs file:

MODULE = Crypt::Mine   PACKAGE = Crypt::Mine   PREFIX = X_

PROTOTYPES: DISABLE

SV *
X_crypt(sv, svkey)
    PREINIT:
        SV *       sv;
        STRLEN     len;
        SV *       svkey;
        STRLEN     keylen;
        mykey_t    key;
        char*      keystr;
        char*      in;
        char*      out;
        char*      wrkmem;
        int        in_len;
        int        out_len;
        int        new_len;
        int        pad;
        int        err;
        int        i;
    CODE:
        in = (int*) SvPV(sv, len);
        keystr = (int*) SvPV(svkey, keylen);
        for (i=0; i < KEY_BYTES; i++) {
          if (i < keylen) {
            key.key[i] = keystr[i];
          } else {
            key.key[i] = '\0';
          }
        }
        in_len = len;
        pad = (DATA_BYTES - (in_len % DATA_BYTES)) % DATA_BYTES;
        out_len = in_len + pad + HEAD_SIZE;
        RETVAL = newSV(out_len);
        err = encrypt(in,in_len,&out,&new_len,&key);
        if (err != 0 || new_len != out_len)
        {
            SvREFCNT_dec(RETVAL);
            XSRETURN_UNDEF;
        }
        SvCUR_set(RETVAL,new_len);
    OUTPUT:
        RETVAL


And there is a very similar one for decrypt. But since I get segfaults
just using crypt, I don't think it will help to post that one.

Does this look right? Any suggestions?

Elijah
------
tried looking at the xs code of Crypt::Blowfish, too


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4392
**************************************


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