[16838] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4250 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 7 18:05:31 2000

Date: Thu, 7 Sep 2000 15:05:14 -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: <968364313-v9-i4250@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 7 Sep 2000     Volume: 9 Number: 4250

Today's topics:
    Re: "dashed" params... <uri@sysarch.com>
        [Q] Matching newlines using . and /s <apandey@u.washington.edu>
        Beginner question about extracting data from file (Sean McAfee)
    Re: Beginner question about extracting data from file <g.soper@soundhouse.co.uk>
    Re: Beginner question about extracting data from file <g.soper@soundhouse.co.uk>
    Re: Beginner question about extracting data from file <lr@hpl.hp.com>
    Re: Beginner question about extracting data from file <lr@hpl.hp.com>
    Re: calling javac from perl and capturing system output (Malcolm Dew-Jones)
        confusing error msg (jazz)
    Re: fgrep -i  "greek_word" DOES NOT WORK <thestas@dolnet.gr>
    Re: fgrep -i  "greek_word" DOES NOT WORK <care227@attglobal.net>
    Re: flock() and waiting for the FILEHANDLE (Mark-Jason Dominus)
        Help Wanted: Perl modify job <webmistress@net-aid.com>
    Re: how to  encrypt source code? (Tony L. Svanstrom)
    Re: how to  encrypt source code? <yanick@babyl.sympatico.ca>
    Re: How? Read a file from another server? <webmaster@cobnet.com>
    Re: HTML subroutines <bart.lateur@skynet.be>
        install / compile error <john@eagleinfosystems.com>
    Re: install / compile error <randy@theoryx5.uwinnipeg.ca>
    Re: Is this a bug or a feature? <christopher_j@uswest.net>
        New advanced log analyzer annoucement (Perl CGI) <eldy@ifrance.com>
    Re: newbie: redirect problem <brian+usenet@smithrenaud.com>
    Re: No thread work. <dan@tuatha.sidhe.org>
    Re: Perl 5.6.0 on BSDI 4.0... build problem. (Nobody)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 07 Sep 2000 21:58:34 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "dashed" params...
Message-Id: <x7aedjkgoo.fsf@home.sysarch.com>

>>>>> "EB" == Eric Bohlman <ebohlman@netcom.com> writes:

  EB> Uri Guttman (uri@sysarch.com) wrote:
  EB> : 
  EB> : 	$foo_arg = $args{'-foo'} || $default_foo ;
  EB> : 
  EB> : that works unless you want to be able to pass in a false value to
  EB> : $foo_arg. then use:
  EB> : 
  EB> : 	$foo_arg = exists $args{'-foo'} ? $args{'-foo'} : $default_foo ;

  EB> Better yet:

  EB> my $self=shift;

  EB> my %args=(-foo=>$default_foo, -bar=>$default_bar, -baz=>$default_baz, @_);

i have done that when i have many args. also many times i want the args
in individual vars to pass and mung around. so i still have to grab
them. if i use the default values idea, i sometimes put them in a static
hash and assign that with @_ as you show.

my %default = ( -foo => $default_foo,
		-bar => $default_bar,
		-baz => $default_baz,
) ;

sub blarg {

	my $self = shift ;
	my %args = ( %default, @_ ) ;


it looks cleaner that way too. i use both depending on my use of the
args and how many there are.

uri


-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 7 Sep 2000 14:20:09 -0700
From: Anshuman Pandey <apandey@u.washington.edu>
Subject: [Q] Matching newlines using . and /s
Message-Id: <Pine.A41.4.21.0009071418390.33222-100000@vergil01.u.washington.edu>


Hello,

I have a small program which processes text found within a specified 
delimiter. The program is supposed to modify text found only between 
"{\macro" and "}", e.g. "{\macro abcdef}.  Here is the program:

	while (<>) {
	   s/\{\\macro (.*?)\}/transform()/gse;
	   print;
	}

	sub transform {
	    $text = $1;
	    $text =~ tr/abc/xyz/;
	    "{\\macro $text}";
	}

However, the program works only on text which does not contain newlines. 
The program fails to do the transformation on text like:

	{\macro abcdef
            fedcba}

I understand that "." does not match newlines unless the "s" operator is
specified. I also added the "m" operator to the operator list, but that
did not grant success either. I have checked the documentation found in
perlre and perlop, and according to what I've read, the above code should
work. Is there something that I have overlooked?

Thank you.

Regards,
Anshuman Pandey





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

Date: Thu, 07 Sep 2000 21:51:00 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Beginner question about extracting data from file
Message-Id: <85Ut5.2562$O5.51183@news.itd.umich.edu>

In article <MPG.14205c5c8ef332e98ad2f@nntp.hpl.hp.com>,
Larry Rosler  <lr@hpl.hp.com> wrote:
>The right direction is a two-dimensional data structure, a hash-of-hash-
>references keyed off the user names.  The user names needn't be repeated 
>in the hashes that contain the associated values (password and alias).

>/([^,]+),\s+([^,]+),\s+"([^@]+)/ and
>    @{$users{$1}{@fields[1, 2]}} = ($2, $3) while <DATA>;

Was the above array assignment perhaps meant to be:

@{$users{$1}}{@fields[1,2]} = ($2, $3)

?  As written, @fields[1,2] is a list in scalar context, and so evaluates
to just $fields[2].  The code also creates a data structure that is a
hash-of-hash-of-array, not a hash-of-hash as advertised.

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Thu, 07 Sep 2000 17:01:32 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Beginner question about extracting data from file
Message-Id: <49fa5ec9f3g.soper@soundhouse.co.uk>

In article <39B6BB4D.4E708F65@motorola.com>,
   Matthew Stoker <matt.stoker@motorola.com> wrote:
> Geoff Soper wrote:
> > 
> > If I have a simple file in the format:
> > 
> > user, password, alias
> > rod, abc, "rod@hotmail.com"
> > jane, def, "jane@excite.com"
> > freddy, ghi, "freddy@bigfoot.com"
> > 
> > How can I get them into the format of
> > 
> > $fields(1)="user"
> > $fields(2)="password"
> > $fields(3)="alias"
> > 
> > %user="rod,jane,freddy"
> > 
> > $password(rod)="abc"
> > $password(jane)="def"
> > $alias(freddy)="freddy"
> > 
> > I hope this makes sense and would be most grateful if somebody could
> > point me in the right direction.
> > 
> > Many thanks

> A good description of implementing complex data structures can be found
> in chapter 2 of "Advanced Perl Programming" by Sriram Srinivasan (from
> O'Reilly). The book describes using hashes of hashes, hashes of arrays
> and arrays of arrays to set up a data structure like you seem to want.
> There is some discussion about the trade offs of various structures. 

I'm considering using hashes of hashes. I'm also thinking that I need to
make provision to be able to sort the sets of data according to one of the
fields other than the name i.e. sort them by alias. Although I'm not
currently concerned how to do this I need to know that this would be
possible in the future with hashes of hashes.

Thanks for your advice

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Thu, 07 Sep 2000 17:04:38 +0100
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Beginner question about extracting data from file
Message-Id: <49fa5f1441g.soper@soundhouse.co.uk>

In article <MPG.14205c5c8ef332e98ad2f@nntp.hpl.hp.com>,
   Larry Rosler <lr@hpl.hp.com> wrote:
> The right direction is a two-dimensional data structure, a hash-of-hash-
> references keyed off the user names.  The user names needn't be repeated 
> in the hashes that contain the associated values (password and alias).

As I asked of another reply would it then be possible to sort the sets of
data by a field other than the user name or would this require another
structure type?

>     perldoc perldsc

> Here is some compactly-writtten code to play with.  I don't have time to 
> write a detailed explanation.  Breaking it down into beginner-level code 
> may be instructive as an exercise.

It may well be instructive but also near impossible having not yet written
a single piece of Perl! 
:-)

Thanks

-- 
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/


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

Date: Thu, 7 Sep 2000 13:04:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Beginner question about extracting data from file
Message-Id: <MPG.142194b56d828e2398ad35@nntp.hpl.hp.com>

In article <49fa5f1441g.soper@soundhouse.co.uk> on Thu, 07 Sep 2000 
17:04:38 +0100, Geoff Soper <g.soper@soundhouse.co.uk> says...
> In article <MPG.14205c5c8ef332e98ad2f@nntp.hpl.hp.com>,
>    Larry Rosler <lr@hpl.hp.com> wrote:
> > The right direction is a two-dimensional data structure, a hash-of-hash-
> > references keyed off the user names.  The user names needn't be repeated 
> > in the hashes that contain the associated values (password and alias).
> 
> As I asked of another reply would it then be possible to sort the sets of
> data by a field other than the user name or would this require another
> structure type?

You can readily sort by the contents of any member or members of the 
subhashes.

For example, using the previous code, to sort the hash %users by the 
'alias' field:

    my @sorted = sort { $a->{alias} cmp $b->{alias} }  keys %users;

> >     perldoc perldsc
> 
> > Here is some compactly-writtten code to play with.  I don't have time to 
> > write a detailed explanation.  Breaking it down into beginner-level code 
> > may be instructive as an exercise.
> 
> It may well be instructive but also near impossible having not yet written
> a single piece of Perl! 
> :-)

Then try to write it yourself, using the Perl you know and learn along 
the way.

The problem itself is quite typical of how to manage a two-dimensional 
data set.  Using the modules recommended by Jeff Zucker is another 
approach, but then you have to learn a bit of SQL as well as the Perl.

> Thanks

You're welcome.  "Have the appropriate amount of fun!" (The Larry)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 7 Sep 2000 13:20:16 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Beginner question about extracting data from file
Message-Id: <MPG.14219858f670c76a98ad36@nntp.hpl.hp.com>

In article <MPG.142194b56d828e2398ad35@nntp.hpl.hp.com> on Thu, 7 Sep 
2000 13:04:46 -0700, Larry Rosler <lr@hpl.hp.com> says...
> In article <49fa5f1441g.soper@soundhouse.co.uk> on Thu, 07 Sep 2000 
> 17:04:38 +0100, Geoff Soper <g.soper@soundhouse.co.uk> says...
> > In article <MPG.14205c5c8ef332e98ad2f@nntp.hpl.hp.com>,
> >    Larry Rosler <lr@hpl.hp.com> wrote:

 ...

> You can readily sort by the contents of any member or members of the 
> subhashes.
> 
> For example, using the previous code, to sort the hash %users by the 
> 'alias' field:
> 
>     my @sorted = sort { $a->{alias} cmp $b->{alias} }  keys %users;

Sorry, that is wrong.  Either replace 'keys' by 'values', or $a and $b 
by $users{$a} and $users{$b}.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 7 Sep 2000 12:18:52 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: calling javac from perl and capturing system output
Message-Id: <39b7ea1c@news.victoria.tc.ca>

smehta60@my-deja.com wrote:
: Hello all:

: I am using a dinosaur version of perl (5.004 on NT) and am trying  to
: do the following in my perl script:

: @myArray = `javac Test.java`;

: My Test.java (a hello world app) has some compile errors and I want to
: capture that output(i.e the java compile errors) in myArray so that I

On NT you can redirect stderr (I assume the compile errors go there).

From NT command line
	javac Test.java 2> stderr_output
	javac Test.java 1> all_output  2>&1   (note order is important)

Presumably in perl, something like
	@myArray = `javac Test.java 2>&1`

might work.  Or you could try 
	system("javac Test.java 2>$temp_file");
	open TEMP_FILE, $temp_file or die $!;

though its possible that NT just won't redirect when run outside of its
native command line (I've had that problem with another product running a
system-like command). 



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

Date: Thu, 07 Sep 2000 16:37:19 -0400
From: jazztoneSPAMME@earthlink.net (jazz)
Subject: confusing error msg
Message-Id: <jazztoneSPAMME-0709001637190001@tritone.csbmb.princeton.edu>

Hello, I get the following error message for the bit of code below. The
portion of code that
causes the error is marked with <<. When I remove that, no more error. I
don't understand
what the error is about, or why it's occuring at a nonexistent line 65535.
Thanks.

----

Value of <HANDLE> construct can be "0"; test with defined() at
/usr/people/roger/bin/np1 line 65535.

----

#!/usr/sbin/perl -w

###   get presets
print "Would you like to enter each value individually  (enter 'e') or use
presets (enter the name of the preset file and return)?\n";

chomp($select = <STDIN>);

if ($select eq 'e') {
    print "Enter the slice thickness.\n";
    chomp($sliceThicknessOblique = <STDIN>);
} else {
    $cntr = 0;
    while ($line  = <PRESETS>) {             <<
       $line =~s/.*\t//;                     <<
       chomp($line);                         <<
       $presets[$cntr] = $line;              <<
       $cntr ++;                             <<
    }                                        <<
}


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

Date: Thu, 7 Sep 2000 21:51:52 +0300
From: "Theodore Stassinos" <thestas@dolnet.gr>
Subject: Re: fgrep -i  "greek_word" DOES NOT WORK
Message-Id: <8p8o76$1dve$1@ulysses.noc.ntua.gr>

Listen my friend. Fistly i 'd like to thank you for your concern about my
problem.

Unfortunately, the fact that you don't understand what is the problem it
improves that you cannot help. Thanks anyway.

But to make it clear to you, just for the reference of course is that , i
don't want to change the structure and filosophy of the entire program just
because a unix command doesn't work. I believe that perl, in which i have
written the program, has some methods to do the job.

Maybe by converting the hexadecimal lowercase characters comming in Greek
(%e1-%f9)  to their uppercase equivalents (%c1-d9) and the opposite would do
the job. Or even after the "pack" instruction which converts the hexadecimal
values to their character equivalent , i could produce for each greek word,
two other, one in uppercase and one in lowercase.

I am just looking for the way, a normal expression using s// or something
else.You see i don't have much experience in Perl.

So, as you see my friend my question has a big relevance to this perl
newsgroup and i am really sorry that you did not understood  it.

"Abigail" <abigail@foad.org> wrote in message
news:slrn8rfl7c.vlt.abigail@alexandra.foad.org...
> Theodore Stassinos (thestas@dolnet.gr) wrote on MMDLXIV September
> MCMXCIII in <URL:news:8p8guf$1823$1@ulysses.noc.ntua.gr>:
> && Hi.
> && I've developed a small search engine using Perl, for an ads newspaper.
> &&
> && Although it works fine when it is for English words I have problem when
the
> && user inputs greek words in the search area.
> &&
> && As a matter of fact the unix instruction "fgrep" does work properly
only
> && with english words.
> && When i give "fgrep -i "greek_word" it returns the ads which contain the
> && exact greek word. The -i does not word.
> &&
> && I am using the POST method to fetch the data, and for each word i
receive in
> && the search area, i give the instruction fgrep -i  -n "word_to_find" .
> &&
> && I wonder if you could suggest me a way to avoid this problem .
>
>
> Sure. Don't use fgrep. Or, alternatively, only search for words in an
> empty file, and you'll find a same success rate for English and Greek
> words.
>
> Is there any relevance of your posting to this newsgroup?
>
>
> Abigail
> --
>
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD
=>(
>
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0
=>0
>
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$r[$#r];$=-=$#r}fo
r(;
>
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCIII=>=>=>=>=>=>=>
=>'




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

Date: 07 Sep 2000 18:59:54 GMT
From: Drew Simonis <care227@attglobal.net>
Subject: Re: fgrep -i  "greek_word" DOES NOT WORK
Message-Id: <39B7E328.9BC38A23@attglobal.net>



Theodore Stassinos wrote:
> 
> Hi.
> I've developed a small search engine using Perl, for an ads newspaper.
> 
> Although it works fine when it is for English words I have problem when the
> user inputs greek words in the search area.

(...)
 
> I wonder if you could suggest me a way to avoid this problem .
> 
> Thank you in advance


This is just the sort of thing that locales are usefull for.
I'm not sure you can get around the problem when you are using
external commands, but there are modules for Perl that will,
within your program, help nicely.  If you want to change the
behaviour of fgrep, you'll be best served asking in a UNIX 
specific group.


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

Date: Thu, 07 Sep 2000 18:07:29 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: flock() and waiting for the FILEHANDLE
Message-Id: <39b7d961.40e3$3df@news.op.net>

See perlfaq8, "How do I timeout a slow event?"


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

Date: Thu, 07 Sep 2000 19:17:41 GMT
From: Donna Zoerner <webmistress@net-aid.com>
Subject: Help Wanted: Perl modify job
Message-Id: <39B7E91E.4269A98@net-aid.com>

Hello,

I am looking for someone to modify a script(s) for me that I have
running on a site http://www.net-aid.com/ for a reasonable price. Please
let me know if you can do this. I would be willing to pay task by task
if you care to put a price tag on each task, or the whole competed job
when it is finished and tested. Please answer this email personally to
webmistress@net-aid.com.

1. Converted data over to mySQL.

2. The user receives a email to confirm his ad. Then the user has to
click on a link in his/her mail box. Clicking on the link will place the
users ad. I would like for the script to check to see if the users ad
has already been placed, so they can not click on the link repeatedly
entering the same ad over and over (driving me crazy).

3. I would like for user to be able to view their ad that they just
placed by clicking on a link on the thank you page that is displayed
after they click on the link in the confirmation email.

4. When a user searches ads, I would like for only 20 or 25 ads to be
displayed (if you have another suggestion on the number let me know). I
would want as many ads per page that would work well), then there be a
next link at the bottom of the page to display the next set(s).
Something like: prev 12345 next. Like what you see when you use a search
engine. I would like this to be on all the search pages. As ads are
being placed of course the script would need to add new pages and
navigation numbers.

5. If a user does not upload a picture, but still clicks on the upload a
picture link at http://www.net-aid.com/personals/photo.htm instead of
the I have no photo link the script still tries to upload a pic. Then
when searches are done, a broken image is displayed. I would like this
fixed.

6. What  happens to the temp files if a user never clicks on the link
to  place their ad? Is that running okay, or does it need to be modified
in any way? Maybe the user can have up to 14 days to place the ad
otherwise the temp files are deleted by the script. If  they click on
the link after the expired time they can be invited to place another ad.
A button maybe could be placed in the admin. area where I can clean them
up ever so often.

7. Something  set up where a user can sign up to have new ads emailed to
them in their category of choice from when a new user places a ad
running as ads are being place.  Like some type of ad notify thing? I
would want it based on the search criteria. I would want this a stand
alone thing where the user can return to delete it, sign up for it or
modify it from the index page.

8. When a user deletes their ad, their email address is removed from the
members email list which is what I need, but it is also removed from the
news letter list as well. I would like it to remain on the news letter
list. I would like for the user to be able to come to the site and
remove their email address from the news letter themselves if they like
from my index page, as well as being able to remove it myself. As a
second option to take care of this problem, if it would be better, I
could somehow harvest
the news letter email address from the admin. area once in a while, and
use something like subscribeme (I can setup subscribeme).

9. I would like to delete a member by using their email address (like I
can by their user name right now). This way I can delete old ads that
email is kicked back to me from the members email address. As of now I
have not tried to use the email form in the Administrator Utilities; I
am hoping that this is a way I can find and remove ads with outdated
email address.

10. Create HTML/E-Mail Templates. Pages and mail bodies that are
presented as outputs from a script in the form of templates, which are
stored in separate HTML or text files. These can be viewed in a normal
web-browser or text editor, and changed directly by myself.

I look forward to hearing from you.

Best Regards,
Donna Zoerner







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

Date: Thu, 7 Sep 2000 20:06:29 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: how to  encrypt source code?
Message-Id: <1eglue6.1vifa2cl99ipsN%tony@svanstrom.com>

DT <dsa@dassda.com> wrote:

> I tried but all encrypted source code read:  Vyznev vf n n zbgure shpxre

*PLONK*


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


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

Date: Thu, 07 Sep 2000 18:37:41 GMT
From: Yanick Champoux <yanick@babyl.sympatico.ca>
Subject: Re: how to  encrypt source code?
Message-Id: <VfRt5.219996$Gh.4809849@news20.bellglobal.com>

Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
: I was shocked! How could Ilmari Karonen <iltzu@sci.invalid>
: say such a terrible thing:
:>In article <MPG.14192197ddf92e989682@news.cyberway.com.sg>, DT wrote:
:>>how to  encrypt source code?  thanks!
:>
:>  perl -pey+a-zA-Z+n-za-mN-ZA-M+ <source_file >encrypted_file
:>
:>For even better encryption, repeat the process.

: I prefer the ISO standard rot12:

: perl -pey=a-zA-Z=m-za-lM-ZA-L=

: It is backwards compatible with rot13. All you need to do is repeat 13
: times. This also illustrates the most important factor in its security:
: it is non-symmetric. Yes, to decrypt rot12 is 26 times as difficult as
: it is to encrypt. I recommend everyone should upgrade their mission
: critical systems to rot12 as soon as possible before the US DoD makes it
: illegal to export. Tell your friends! You too can have military grade
: encryption for a low, low price! rot12 saved my marriage! It slices! It
: dices! rot12 is the best thing since Perl!! Visit our website at
: www.rot12.com for amazing customer appraisals! rot12 is the best program
: ever written in perl*! rot12 is probably y2k compliant! It compiled, we
: shipped! You missed out on the internet craze, don't miss out on rot12!

: * by me. Offer void where prohibited.

While rot12 delivers everything it promises -- standard compliance, 
compatibility with rot13, rock-solid encryption and a must
praised marital-saving feature -- it does not address all the
issues of modern-day industry. One particular feature is missing
from this cleverly-crafted encryption program, a feature that 
would have transformed this already awesome tool into the 
penultimate marketable encryption mechanism.

This feature is limited evaluation time. Sure, with rot12
you can keep too-curious eyes away from your code, but once
your code is given away, it is given away forever. Now
imagine you could encrypt your scripts /and/ make sure it
couldn't run more than a certain amount of days. The applications
are endless: demos, sharewares, license management, job security.
Your moral sense is the only limit!

All this, and not much more, is offered by a next generation
Perl enscrypt*, obfuscomatic.pl(tm):

#! /usr/bin/perl -p
# obfuscomatic.pl - your one-way ticket to the Perl Obfuscation Contest ;)
# usage: obfuscomatic days_before_expiration script.pl > encrypted.pl
BEGIN{$x='s!.!chr(ord($&)+1+0)!eg;';$t=shift@ARGV;}
END{$x=~s/\+/-/;$x=~s#0#'time()/'.(time+$t*86400)#e;
print"\n$0\n$x\$SIG{'__WARN__'}=sub{}; eval or die 
\"Evaluation time expired\\n\";"}
$.==1 and $_.="\$_ = <<'$0';\n" and next; eval$x;
__END__

* An enscrypt being, of course, a script that encrypt. 

Joy,
Yanick (who probably will burn in hell for that)

-- 
                    $_ = 'eatYerno Plteh khaer. cr';
                           $S++ ; $oS = ++$S ;
eval 's~'. ( '('. '.'x$S++ .')' ) x $oS . '~$' . $oS-- .'$'. $oS++ .'~g'
                until $S > int sqrt length and print;


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

Date: Thu, 07 Sep 2000 20:55:53 GMT
From: leonardz <webmaster@cobnet.com>
Subject: Re: How? Read a file from another server?
Message-Id: <8p8vcd$i9c$1@nnrp1.deja.com>


> # yadda yadda yadda, then use your $resultpage as you will
> #  to use FTP, simply use an FTP url
> #  (i.e.
> "ftp://username:password@ftp.server.com/dir/anotherdir/filename.ext")

Thanks for the replies, but are you saying this?

@DataFile = ();
$FileName="ftp://username:password@ftp.server.com/dir/anotherdir/filenam
e.ext";
open (DATAFILE, "<$FileName");

??

>> Don't do unchecked opens.

This is my file, I know what is in it, however it is located on another
server for space saving reasons. I am guessing you are suggesting I
check it in case someone has tampered with it?

Again thanks for the replies.  I am not new to Perl, however I am new
accessing files.

leonardz




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


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

Date: Thu, 07 Sep 2000 20:31:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: HTML subroutines
Message-Id: <bnufrso6of9imo90sa4furu2ma1b255lsq@4ax.com>

xlr6drone@my-deja.com wrote:

>I want to use the print <<"label"; shortcut for the HTML instead of
>printing it line by line.
>
>When I try to run the script I get an error stating:
>
>Can't find string terminator "HTML code" anywhere before EOF at ../subr/
>header_footer.lib line 3.

Your string terminator hould be on a line on it's own, wit hNO EXTRA
WHITESPACE, neither on the left, nor on the right.

This works:

	print <<"END OF HTML";
	<html>
	etc.
END OF HTML

This doesn't:

	print <<"END OF HTML";
	<html>
	etc.
	END OF HTML

-- 
	Bart.


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

Date: Thu, 7 Sep 2000 14:49:23 -0400
From: "John Menke" <john@eagleinfosystems.com>
Subject: install / compile error
Message-Id: <39b7e336$1_2@news.eclipse.net>

I'm getting the following error running MCPAN to install the Storable
package, does anybody know how to fix it?


LINK : fatal error LNK1181: cannot open input file "oldnames.lib"
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~6\VC98\BIN\link.exe' : return
cod
e '0x49d'
Stop.





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

Date: 7 Sep 2000 21:13:42 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: install / compile error
Message-Id: <8p90e6$n9q$1@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc, John Menke <john@eagleinfosystems.com> wrote:
> I'm getting the following error running MCPAN to install the Storable
> package, does anybody know how to fix it?

> LINK : fatal error LNK1181: cannot open input file "oldnames.lib"
> NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~6\VC98\BIN\link.exe' : 
> return code '0x49d'
> Stop.

Assuming that "oldnames.lib" is on your system, did you run VC++'s
vcvars32.bat (to set various environment variables) before trying
to compile? Also, in Perl's Config.pm (in \Perl\lib?), are the paths 
to the various C-specific things set to match your system?

best regards,
randy kobes


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

Date: Thu, 7 Sep 2000 11:09:38 -0700
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: Is this a bug or a feature?
Message-Id: <wRQt5.179$M06.118146@news.uswest.net>


"Larry Rosler" <lr@hpl.hp.com> wrote:
> If you're going to clean it up, do it all the way.
>
> #!/usr/bin/perl -w
> use strict;
>
> main();
>
> sub main {
>     for (my $v = 10; $v > 0; --$v) {
>         print $v > 5 ? "One\n" : "Two\n"
>     }
> }


Sorry, I'm not one of the believers that think the trinary
conditional operator is a "good thing".

Besides, I _assume_ that he wants to put something more
complicated in there.  Otherwise, he could use my original
code of.

print "One\n" x 5;
print "Two\n" x 5;




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

Date: Thu, 7 Sep 2000 21:20:38 +0200
From: "Eldy" <eldy@ifrance.com>
Subject: New advanced log analyzer annoucement (Perl CGI)
Message-Id: <8p8pnd$hm8$1@wanadoo.fr>

AWStats 2.21 (Free CGI perl) was released this month.
It shows you advanced web statistics, that webalyzer or perlwebstats didn't
show you, and add new features. Easy to use (one big perl script), i'm
interesting in all your feedbacks to make it better.
AWStats and sources are free (Public Domain GPLicense).

See a demo at
http://perso.wanadoo.fr/l.destailleur/awstats.html






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

Date: Thu, 07 Sep 2000 16:36:54 -0400
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: newbie: redirect problem
Message-Id: <brian+usenet-E815D1.16365407092000@news.panix.com>

In article <8p55mc$erh$1@news.ihug.co.nz>, "[WarLocK]" 
<mindless@ihug.co.nz.nospam> wrote:

> "macdo" <hmacdonald@europarl.eu.int> wrote in message
> news:39B60EBC.9BF7663A@europarl.eu.int...
> > No - I'm afraid all this does is display in my browser the string
> > "Location: http://www.somewhere.com\n\n"

> did you make sure to use double inverted commas (") not single (') as
> backslashed characters are not interpreted in single inverted commas.

is it unclear from that snippet?  perhaps you were resonding
to something else, but you posted your reply before the quoted
text and did not trim out the irrelevant bits so it is not clear
to whom or to what you directed that comment.

even then, some characters can be escaped in single quoted 
strings, so your comment is not strictly correct although
it does not affect this situation.

-- 
brian d foy


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

Date: Thu, 07 Sep 2000 21:25:47 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: No thread work.
Message-Id: <vJTt5.8037$CW2.89798@news1.rdc1.ct.home.com>

"=B9=DA=C1=BE=BA=B9 \(Park, Jong-Pork\)" <okletsgo@hitel.net> wrote:

> I have ActiveState Perl 617 MSWin32-multi-thread version. But it didn't
> work thread.

Right. ActiveState perl doesn't have the support compiled into it that the
Thread module needs. You need to build your own version of perl for that.

					Dan


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

Date: 7 Sep 2000 18:54:59 GMT
From: nobody@contract.East.Sun.COM (Nobody)
Subject: Re: Perl 5.6.0 on BSDI 4.0... build problem.
Message-Id: <8p8oa3$h95$1@eastnews1.east.sun.com>

In article <Pine.GSO.4.21.0009061631520.14826-100000@king.halcyon.com>,
Elf Sternberg  <elf@halcyon.com> wrote:
>
>Actually, two problems.  The first is that the NDBM module is dumping core
>during the testing phase.  The DB module works fine, but BSDI 4.0 is a
>strange hybrid of BSDI 3.1 and FreeBSD, and the incogruities are sometimes
>annoying.
>
>Another is that pragma/warnings #257 fails, and I can't figure out why.
>
>Short question: has anyone else gotten perl 5.6.0 to build properly on
>BSDI 4.0 such that it passes all tests?
>

I got it to build first time through, though I later went back to
5.00503, since the modules I needed weren't yet compatible.  I'm
using 4.01 up to patch 24, BTW.  

Anita



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

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


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