[17234] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4656 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 18 18:15:50 2000

Date: Wed, 18 Oct 2000 15:15:24 -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: <971907324-v9-i4656@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 18 Oct 2000     Volume: 9 Number: 4656

Today's topics:
    Re: Rijndael in Perl <dido@pacific.net.ph>
    Re: Rijndael in Perl <dido@pacific.net.ph>
    Re: Search, pad, replace (Craig Berry)
    Re: Search, pad, replace <godzilla@stomp.stomp.tokyo>
    Re: Sort Help Needed <godzilla@stomp.stomp.tokyo>
    Re: space <gellyfish@gellyfish.com>
    Re: Statistics for comp.lang.perl.misc <gellyfish@gellyfish.com>
        variable -> html <danielxx@bart.nl>
    Re: variable -> html <tina@streetmail.com>
    Re: Why '12 13 14' =~ /1./g  match only 12 ? (Ilya Zakharevich)
    Re: Why '12 13 14' =~ /1./g  match only 12 ? <bart.lateur@skynet.be>
    Re: Why doesn't PERL like Gunnar <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 19 Oct 2000 03:13:44 +0800
From: Dido Sevilla <dido@pacific.net.ph>
Subject: Re: Rijndael in Perl
Message-Id: <39EDF668.313192@pacific.net.ph>

"Tony L. Svanstrom" wrote:
> 
> Anyone that knows if Rijndael exists in Perl yet and/or if someone's
> working on it?
> 

Well, I've been working on a Crypt-CBC-compatible module that uses
Rijndael, but I'm learning how to program Perl modules while I'm at it,
so progress is somewhat slow.  It uses (er...will use) my own Rijndael C
implementation, which is somewhat less flexible than the original fast C
versions available from the Rijndael website (only thing it doesn't
support yet is variable block sizes), but is definitely licensed under
either LGPL or Artistic License, as opposed to the somewhat questionable
licensing for the original Rijndael reference specs available on the
website i.e. there is no word on that on the website or auxiliary files
in the tarball, so we must assume that these implementations are not
freely usable except as reference code.

If anyone wishes to help me a little here, drop me a line.

--
Rafael R. Sevilla <dido@pacific.net.ph>         +63 (2)   4342217
ICSM-F Development Team, UP Diliman		+63 (917) 4458925
OpenPGP Key ID: 0x0E8CE481


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

Date: Thu, 19 Oct 2000 05:43:49 +0800
From: Dido Sevilla <dido@pacific.net.ph>
Subject: Re: Rijndael in Perl
Message-Id: <39EE1995.36049106@pacific.net.ph>

Dido Sevilla wrote:
> 
> "Tony L. Svanstrom" wrote:
> >
> > Anyone that knows if Rijndael exists in Perl yet and/or if someone's
> > working on it?
> >
> 
> Well, I've been working on a Crypt-CBC-compatible module that uses
> Rijndael, but I'm learning how to program Perl modules while I'm at it,
> so progress is somewhat slow.  It uses (er...will use) my own Rijndael C

Er...It's done now.  I'll get the thing uploaded to PAUSE stat, but in
the meantime, you can download it here:

http://home.pacific.net.ph/~dido/Crypt-Rijndael-0.01.tar.gz

--
Rafael R. Sevilla <dido@pacific.net.ph>         +63 (2)   4342217
ICSM-F Development Team, UP Diliman		+63 (917) 4458925
OpenPGP Key ID: 0x0E8CE481


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

Date: Wed, 18 Oct 2000 20:20:30 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Search, pad, replace
Message-Id: <sus1geg6adjif5@corp.supernews.com>

DesQuite (desquite@hotmail.com) wrote:
: Thanks.  You're an asshole.

Thanks.  You're a killfile entry.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Wed, 18 Oct 2000 14:28:18 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Search, pad, replace
Message-Id: <39EE15F2.9898DEEC@stomp.stomp.tokyo>

DesQuite wrote:
 
> My skills in Perl are limited and I'm on a tight schedule to 
> get my solution finished.  Otherwise I'd try to learn all of
> this from the perlman.  


> Any help is greatly appreciated.


Your article doesn't make a lick of sense.


> I have a string somewhere in a file that looks like this:
 
> <garbage> ($myVar       ) <garbage>


Ok so far, except you already know the location of
this string; it's your file.

 
> I need code that will:

> 1. search for the string value "$myVar" and find the length 
> between "(" and ")"

GAK! You already know the length of $myVar and already know
the length of space padding. It's your script and your file,
why do you need to find what you already know?


> 2. replace everything between "(" and ")"  with the value of $myVar
> padded with blanks up to the length just found.

This changes nothing. Your $myVar and the padding you show,
when replaced with $myVar and the padding measured, will
result in precisely with which you started; ($myVar       )

Do you mean print the 'value' of $myVar followed by the
total pure character count of ($myVar       ) in spaces?
This is, the value of $myVar followed by thirteen spaces?

 
> I'm trying to replace $myVar with it's value and keep the
> length between the "(" and ")" constant.

Under circumstances where $myVar is changed, you are first
measuring the total length of $myVar and your space padding.
As an example, your total length is ten, initially measured.
You change $myVar to a length which is twenty. Your script
scratches it head and says,

"Uhhh... wait. I am suppose to make this ten in length."

Now what?


Even less sensible, if you are trying to measure the length
of the expression " $myVar " rather than as the value of
$myVar, it's length is obvious; six. Your space padding
is equally obvious; seven. Total length is thirteen and
determined with no need for a script, but a need to use
at least one toe in counting.

Same senseless problem exists. You have a total length
of thirteen based on pure character count rather than
the value of $myVar. What happens if the 'value' of
$myVar equals or exceeds thirteen?

if (length ($myVar) >= 13)
 { print "($myVar)";
else
 { print "($myVar$how_many_spaces)"; }


This variable $how_many_spaces comes about
as following discussed.

Under better circumstances, you would initially measure
the total length of the 'value' of $myVar plus space 
padding per your pre-written file. The difference between
the two,

total length minus the value of $myVar

would be a variable, $how_many_spaces

Any time you print this format,

print "($myVar$how_many_spaces)";

However, $how_many_spaces is not needed. You already
know how many spaces are present. Type them in.

Nonetheless, your article doesn't make a lick of sense.
You hold this file. You know the total character numerical
length of $myVar plus your spaces shown. I don't understand
why you don't use the logic shown in my snippet immediately
above. You already know everything needed. Put it to use.
Simple print the value of $myVar followed by an already 
known thirteen spaces or no spaces, something, I guess.
Who the F-word knows.


Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: Wed, 18 Oct 2000 11:08:40 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Sort Help Needed
Message-Id: <39EDE728.6ED0496B@stomp.stomp.tokyo>

Larry Rosler wrote:
 
> Godzilla! wrote:

> > $input = "warrenh    ¦10202000 warren    hal
> >           udontquit  ¦10112000 todd      gar
> >           tim.glaze  ¦10172000 tim       gla
> >           teamesteem ¦10252000 andy      bee
> >           ellenm     ¦10162000 ellen     mur
> >           stetson    ¦10152000 jeffry    ste
> >           scoping    ¦10302000 judy      bar
> >           customcoat ¦10012000 carl      pen
> >           crusaderra ¦10182000 j.e.      mac";

> > @Array = split (/\n/, $input);

> > @New_Array = map { $_ -> [0] } sort { $a -> [1] <=> $b -> [1] }
> >              map { [$_, (split /¦/) [1]] } @Array;
 
> That is not a proper date sort, as one would discover in a few months.


Proper enough to work perfectly, this year, next
year and perhaps the following year, if a person
using this code actually understands and knows
how to use Perl effectively.

I suppose a decent Perl hacker could take care of
this "one" in a few months, if she or he is silly
enough to carry over data from a previous year
into a next year.

Yours is a valid point however, which cannot
be simply ignored but can be simply remedied
as is the case with many scripts dealing with
sorting data base dates, as you know.

Rather sci-fi to have to reach into the future
to bring a problem back to the present.


Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: 18 Oct 2000 07:07:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: space
Message-Id: <8sjenk$a0p$1@orpheus.gellyfish.com>

On Tue, 17 Oct 2000 07:57:40 -0400 default wrote:
> How much space will 5.6.0 take up on a unix box?
> 

On my machine the total including the source is about 36Mb .

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: 18 Oct 2000 07:43:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <8sjgq2$a3m$1@orpheus.gellyfish.com>

On Mon, 16 Oct 2000 14:56:17 -0000 Greg Bacon wrote:
> 
> Top 10 Posters by Volume
> ========================
> 
>   (kb)   (kb)  (kb)  (kb)
> Volume (  hdr/ body/ orig)  Posts  Address
> --------------------------  -----  -------
> 
>  432.7 (  0.8/431.8/238.6)      1  "Wayne Paterson" <waynep@staff.intekom.com>

WTF ? I must have missed that.

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Wed, 18 Oct 2000 18:28:12 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: variable -> html
Message-Id: <0ZlH5.11923$_2.62233@typhoon.bart.nl>

I wanna use a variable let's say the string "document." in a html page as
variable $vari1
though using this string there may not be a space behind the document.
so the print out must be
document.Layer1.Left





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

Date: 18 Oct 2000 20:48:51 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: variable -> html
Message-Id: <8sl2bj$kn9mq$4@ID-24002.news.cis.dfn.de>

hi,
In comp.lang.perl.misc Daniel van den Oord <danielxx@bart.nl> wrote:
> I wanna use a variable let's say the string "document." in a html page as
> variable $vari1

easy:
$vari1 = "document.";

> though using this string there may not be a space behind the document.
> so the print out must be
> document.Layer1.Left

what's the problem?
does
   print $vari1."Layer1.Left";
not work on your system?

tina

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: 18 Oct 2000 19:59:21 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Why '12 13 14' =~ /1./g  match only 12 ?
Message-Id: <8skvep$ma1$1@charm.magnus.acs.ohio-state.edu>
Keywords: context,match,jari

[A complimentary Cc of this posting was sent to Jari Aalto+mail.emacs
<jari.aalto@poboxes.com>],
who wrote in article <wk66mqjrhk.fsf@blue.sea.net>:
> In scalar context as if I had written
> 
>     print "Matched: $1\n" if "12 13 14" =~ /(1.)/g;
> 
> Now the /g has no effect in the regexps?

It has.  But it is different from the effect in the list context.  See
the docs for details.

Ilya



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

Date: Wed, 18 Oct 2000 20:22:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why '12 13 14' =~ /1./g  match only 12 ?
Message-Id: <bd1sus4mli35cck0m7nafcjbnf2cj9pfqo@4ax.com>

Jari Aalto+mail wrote:

>    Isn't /g is supposed to scan the whole line? Why then the $1
>    only contains the fist match? This is activestate perl 616/Win32
>
>        $_ = "12 13 14";
>
>        /(1.)/g;
>
>        print "Match: $1\n";
>
>    --> Match: 12

	Replace the last two lines with:

	while(/(1.)/g) {
	    print "Match: $1\n";
	}
-->
	Match: 12
	Match: 13
	Match: 14

So, yes, //g in scalar context only matches once. AT A TIME. You can
repeat the attempt to match it in a loop.

If you want all the matches at once, use //g in list context.

	$_ = "12 13 14";
	@matches = /(1.)/g;
	$" = ", ";
	print "Matches: @matches\n";
-->
	Matches: 12, 13, 14

-- 
	Bart.


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

Date: 18 Oct 2000 07:04:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Why doesn't PERL like Gunnar
Message-Id: <8sjegi$9vu$1@orpheus.gellyfish.com>

On Tue, 17 Oct 2000 09:48:06 +0200 Peter Prinz wrote:
> 
> Hi there!
> 
> The following script tries to match two different strings with
> themselves.
> The first string ("\\Johannes") matches itself, the second string 
> ("\\Gunnar") does not! 
> Can anyone tell me why?
> 
> #!/usr/bin/perl
> 
> $A = "\\Johannes";
> $B = "\\Gunnar";
> 

Use single quotes or double the backslashes ie '\\\\'.

> print "$A: ", ($A =~ $A);
> print "\n";
> print "$B: ", ($B =~ $B);

This is not what you mean to do.  I think you mean :

 print "$A: ", ($A eq $A);
 print "\n";
 print "$B: ", ($B eq $B);

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

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


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