[7843] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1468 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 13 21:07:20 1997

Date: Sat, 13 Dec 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           Sat, 13 Dec 1997     Volume: 8 Number: 1468

Today's topics:
     A sort list problem ... <kilrogg2@mindless.com>
     Re: A sort list problem ... (Tushar Samant)
     Are locals automatically initialized ? <kilrogg2@mindless.com>
     Best port to Win 95? (dave)
     Re: delete file in perl <rootbeer@teleport.com>
     Re: delete file in perl (Tushar Samant)
     Re: File test operators with symbolic links <rootbeer@teleport.com>
     Re: getting list of directories, returned as an array (Joshua J. Kugler)
     Re: HELP - Bulkmail - Does anyone know how to do it? <mhanson@arrowweb.com>
     HELP! on converting dbase to db zrmathai@total.net
     Re: mkdir command <rootbeer@teleport.com>
     Re: newbie: compact an array <rootbeer@teleport.com>
     Re: Only one execution in -ne (Charles DeRykus)
     Re: perl http client via sockets <merlyn@stonehenge.com>
     Re: Perl on Netware? (Mike Stucka)
     Re: PerlMagick, how to concate 2 or more images? (Tushar Samant)
     Re: pgp encrypion via perl script (brian d foy)
     PIng a Port <russ@eastland.net>
     Re: PIng a Port <rootbeer@teleport.com>
     problem with this script? <dianne@jot.nb.ca>
     Re: problem with this script? <dianne@jot.nb.ca>
     Re: problem with this script? (Tushar Samant)
     Re: setting environment variable within perl script <rootbeer@teleport.com>
     Re: setting environment variable within perl script (brian d foy)
     Re: untainting data <jaydee@worsdall.demon.co.uk>
     Re: Which language pays most 17457 -- C++ vs. Java? <roedy@BIX.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 11 Dec 1997 17:30:36 -0500
From: "Kilrogg2_GS" <kilrogg2@mindless.com>
Subject: A sort list problem ...
Message-Id: <66ppbu$dft@news2.snet.net>

Hi !

Here is my problem, i want to reorder a list of word in the
alphabetical order.
I tried the script below but it doesn't work at all !

@list = ('HeLlo','how','arE','yOU','Today');
@list = sort @list;

Instead it gives the result : ('HeLlo','Today','arE','how','yOU')

Does anybody have an idea of what to do here ?

Thanks in advance,

Kil




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

Date: 13 Dec 1997 19:43:42 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: A sort list problem ...
Message-Id: <66vdke$3fl@tekka.wwa.com>

kilrogg2@mindless.com writes:
>Hi !
>
>Here is my problem, i want to reorder a list of word in the
>alphabetical order.
>I tried the script below but it doesn't work at all !
>
>@list = ('HeLlo','how','arE','yOU','Today');
>@list = sort @list;
>
>Instead it gives the result : ('HeLlo','Today','arE','how','yOU')
>
>Does anybody have an idea of what to do here ?


If the list is small enough:

	sort {uc($a) cmp uc($b)} @list



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

Date: Fri, 12 Dec 1997 22:37:54 -0500
From: "Kilrogg2_GS" <kilrogg2@mindless.com>
Subject: Are locals automatically initialized ?
Message-Id: <66suup$prh@news1.snet.net>

Hi !

I wonder if parmeters declared "local"
in a function are initialized to a default
value by the compiler ?

sub foo { local($var); }


Thanks in advance,

Kil




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

Date: Sat, 13 Dec 1997 21:21:31 GMT
From: y@rrrr.pah (dave)
Subject: Best port to Win 95?
Message-Id: <3492fc11.7080162@news.one.net>

What is best port of Perl to Win 95?

Why?

How much disk space and memory does it require?


Thanks,
Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://w3.one.net/~dlripber
ten.eno@rebpirld


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

Date: Sat, 13 Dec 1997 14:31:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kelly Horstmann <kelly_horst@hotmail.com>
Subject: Re: delete file in perl
Message-Id: <Pine.GSO.3.96.971213143005.23745I-100000@user2.teleport.com>

On Sat, 13 Dec 1997, Kelly Horstmann wrote:

[ Details of problem snipped. ]

> Just let me know, if you can code up this problem. 

Yes, I could write a program to do that. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!




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

Date: 13 Dec 1997 19:31:34 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: delete file in perl
Message-Id: <66vctm$2tg@tekka.wwa.com>

kelly_horst@hotmail.com writes:
>I want to write a perl program to delete a specified kind of file, (for
>example *.o file)in the current directory (say, /usr/bin/perl) and also
>delete all the *.o files in all other subdirectories (eg.
>/usr/bin/perl/dir1, /usr/bin/perl/dir2, /usr/perl/dir3  etc).

This program has been written. Install "pfind" and invoke it like this:

	pfind . '/\.o$/' 'unlink $_'

Get it from:

	<http://www.perl.org/CPAN/authors/Ilya_Zakharevich/scripts/pfind.gz>



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

Date: Sat, 13 Dec 1997 14:12:38 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Damani Walton <walton@world.std.com>
Subject: Re: File test operators with symbolic links
Message-Id: <Pine.GSO.3.96.971213140728.23745E-100000@user2.teleport.com>

On Sat, 13 Dec 1997, Damani Walton wrote:

> How can one test the attributes of a symbolic link? 

Use lstat, instead of stat. Then the pseudo-filehandle _ (underscore) 
will hold the results for the link, rather than its target. (Of course,
you can use the result of the lstat directly, but the file test operators
are often more convenient.)

    die "Can't lstat '$some_symlink': $!" 
	unless lstat $some_symlink;
    print "readable..." if -r _;

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 13 Dec 1997 20:13:23 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: getting list of directories, returned as an array
Message-Id: <3492eb72.2506337@news.inreach.com>

On 11 Dec 1997 08:28:37 -0700, Randal Schwartz <merlyn@stonehenge.com>
wrote:

[Posted and e-mailed]

()You're trying too hard.
()
()    use File::Find;
()
()    find ( {
()	push @dirlist, $File::Find::name if -d;
()    }, '/win' );
()

You're right, I was trying too hard. :)  Now I got another sticker,
which is not a big deal, because I don't mind the workaround.

This works:

find(\&get_dir_list, '.');

sub get_dir_list {push(@dirlist, $File::Find::name) if -d;}

And well.  I like it, and probably will use it.

This doesn't work:

find({push(@dirlist, $File::Find::name) if -d;}, '.');

It gives me: 

syntax error at \utah\test.bat line 7, near ") if"
Execution of \utah\test.bat aborted due to compilation errors.

Yes, I am running on a DOS system. :)  My details are below.

Thanks for your help. You advice helped much!

Details:

486DX2/66, 12MB, 540MD HD, MS-DumbOpertaingSystem v 6.22, Win 3.1
(I am going Linux as soon as I can. :)

Perl -V:
 
Summary of my perl5 (5.0 patchlevel 4 subversion 2) configuration:
  Platform:
    osname=dos, osvers=djgpp, archname=djgpp
    uname=''
    hint=recommended, useposix=undef, d_sigaction=define
    bincompat3=n useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O2 -fomit-frame-pointer -malign-loops=2
-malign-jumps=2 -malign-functions=2', gccversion=2.7.2
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=undef, usevfork=false
    voidflags=15, castflags=0, d_casti32=undef, d_castneg=define
    intsize=4, alignbytes=4, usemymalloc=n, randbits=31
  Linker and Libraries:
    ld='ld', ldflags ='-s'
    libpth=c:/perl/lib
    libs=-lm -lc
    libc=c:/perl/lib/libc.a, so=none
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags=''
    cccdlflags='', lddlflags=''


Characteristics of this binary (from libperl):
  Locally applied patches:
  	DOS_DJGPP_2 - patch for the dos/djgpp port
  Built under dos
  Compiled at Oct  5 1997 18:37:11
  %ENV:
    PERLLIB_PREFIX="f:/perllib c:/perl"
  @INC:
    c:/perl/lib/perl5
    c:/perl/lib/perl5/site
    c:/perl/lib/perl5/site
    .



As my ISP's news server isn't always reliable, please reply via e-mail as well.

Joshua J. Kugler
Computer Consultant--Web Developer
Real e-mail address spelled out to prevent spam. jkugler at inreach dot com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!



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

Date: Sat, 13 Dec 1997 12:00:30 -0800
From: Mike <mhanson@arrowweb.com>
Subject: Re: HELP - Bulkmail - Does anyone know how to do it?
Message-Id: <3492E95E.1BA@arrowweb.com>

Tushar Samant wrote:
> 
> hector@csgm.com writes:
> >Here's the theoretical scenario:
> >
> >I've been given a text based database of over 12,000 e-mails
> >
> >I write a simple program that referrances each e-mail one by one and sends an
> >e-mail through sendmail to each and every individual.
> 
> 1. Put a "sleep 1" between calls to sendmail. That way the OS doesn't
> have to cater to a sudden demand for 12000 processes, and the resulting
> savings in overhead speed up the process considerably.
> 
> 2. As for "no data", that's as you know because the browser is not
> getting anything. For me (I manage a database of over 100,000 email
> addresses), I have found a simple approach very effective: Read up on
> "Server Push" and make a movie of about 100-500 frames of big jpegs.
> Using server push, send a frame down to the browser every 3 or 4
> addresses. That way it doesn't time out and the added bonus is the
> user sees some progress being made.
> 
> 3. You could also do this with a sound file -- the effect is it
> feels like you "on hold" and that's very effective.
> 
> 4. A third way is to send the user an email for every succesful
> sendmail connection you made. This can be done with a few more
> statements in the loop. That way he might get a "no data error"
> in he browser but he knows that the job is chugging along, which
> is mostly what matters.
> 
> Good luck!


How do you put in so it plays a song and then does the perl stuff in the
back round so it doesn't timeout?


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

Date: Sat, 13 Dec 1997 13:04:51 -0500
From: zrmathai@total.net
Subject: HELP! on converting dbase to db
Message-Id: <3492CE43.FFE1DD66@usa.net>

I'm new to perl and perl with databases in general, so I hope someone
can provide a solution to this problem!

I have a Delphi program which updates and maintains a dbase database of
usernames and passwords or usernames and e-mail addresses. This database
is updated daily on my Windows95 PC.

Ideally, I'd like have my Delphi program convert the database locally
and then upload it so that my perl scripts on a UNIX server can access
using dbmopen.

I have Perl for Win32 and that creates a different database format (two
files FILE.PAG and FILE.DIR) with dbmopen than the same perl script on
UNIX (FILE.DB), so unfortunately I can't write a Perl for Win32 script
to locally convert the files.

To reiterate: I'd like to locally convert a dbase file then upload it
and have that file read by a UNIX perl script.

Can anyone help?

Please send any suggestions to my e-mail as I will only have e-mail
access for the next little while. Thanks in advance!



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

Date: Sat, 13 Dec 1997 14:28:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Abigail <abigail@fnx.com>
Subject: Re: mkdir command
Message-Id: <Pine.GSO.3.96.971213142807.23745H-100000@user2.teleport.com>

On 13 Dec 1997, Abigail wrote:

> I don't think it is unreasonable to expect that C<umask 022; mkdir
> "newdir", 777;> creates a directory with permissions rwxr-xr-x. 

What should this do? :-)

    $foo = 777;
    umask 022;
    mkdir "newdir", $foo;

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 13 Dec 1997 14:37:06 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: NerveGas <NerveGas@nospam.com>
Subject: Re: newbie: compact an array
Message-Id: <Pine.GSO.3.96.971213143416.23745J-100000@user2.teleport.com>

On Sat, 13 Dec 1997, NerveGas wrote:

> > : >  Suppose @a is an array of integers. I want to compact @a, so
> > : >  that elements that are 0 get deleted. How can I do this without >
> > : >  declaring another array @b such as:
> 
>      I couldn't tell you how to do it (I don't think it's possible),

Yes, it's possible. :-)  (You could modify @a in-place with splice, as
some posters have done.) 

> but if you are looking to save memory, you may want to try creating the
> second array, and simply undef() each element in the first as it is
> checked. 

That wouldn't save any memory.

>   foreach $i (@a) {if ($i) {@b[$j] = $i;undef($a[$j];$j++;};};

Modern perl versions will warn you about using things like @b[$j], or
using undefined $j as an array index. But thanks for trying! :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 13 Dec 1997 23:17:22 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Only one execution in -ne
Message-Id: <EL5I0z.5wG@bcstec.ca.boeing.com>

In article <34925761.E088C142@inf.ethz.ch>,
Per Kistler  <kistler@inf.ethz.ch> wrote:
 > Hi All
 > 
 > How can one make that a command like reading a file will be
 > executed only once within a perl -ne '....' statement?
 > While processing files I have to read another file, which
 > could stay in an array, instead of beeing read a new for
 > every line of the of the files to process.
 > Like in such a line:
 > perl -ne 'read one time "filename"; statements for each line; print;'
 > files
 > 

close the ARGV filehandle, e.g.,

perl -ne 'read one time "filename"; ... ; close ARGV' files


HTH,
--
Charles DeRykus


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

Date: 13 Dec 1997 11:54:34 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: <mikane@shell3.ba.best.com>
Subject: Re: perl http client via sockets
Message-Id: <8czpm52hw5.fsf@gadget.cscaper.com>

>>>>> "Unknown_Poster" ==   <mikane@shell3.ba.best.com> writes:

Unknown_Poster> I want to write a perl script that will get an HTML
Unknown_Poster> page off a server on the Internet using http.

Unknown_Poster> I assume the way to go about it is to go the socket
Unknown_Poster> route. My perl 5 book is a bit skimpy on this subject.

Unknown_Poster> Can anyone suggest a reference?

Just type the following to your shell:

	perl -MCPAN -e 'CPAN::Shell->expand("Module","LWP")->install' &&
	perldoc lwpcook

All will become clear.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 261 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 13 Dec 1997 23:31:15 GMT
From: mstuckaSPAMBAN@abel.math.luc.edu (Mike Stucka)
Subject: Re: Perl on Netware?
Message-Id: <66v5s3$ikk$1@artemis.it.luc.edu>

Matt W. Bowers (mbowers@CimageD.com) wrote:
: Can anyone refer me to a good source of information for the current Perl
: port to Netware? A client of mine picked that server (despite several
: impassioned pleas to the contrary). Now I need to figure out how to install
: & configure the Perl interpreter.

Here's the binary (Perl 4, unfortunately):
http://www.perl.org/CPAN/ports/netware/
http://www.oasis.leo.org/perl/ports/netware/perl4/00-index.html

I could't find any help references, sorry.


Mike Stucka / mstucka at math.luc.edu
This person runs on ethanol, an environmentally friendly alternative fuel. 



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

Date: 13 Dec 1997 15:55:14 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: PerlMagick, how to concate 2 or more images?
Message-Id: <66v082$ldi@tekka.wwa.com>

tmaster@tea.com writes:
>Here is a sample code:

I am sorry I can't tell you specifically what's wrong. But your
whole Montage call looks suspicious to me. I think you should be
invoking it on $p not $q.

Also keep in mind that there ARE a few weird anomalies in PerlMagick,
some arguments are not what the documentation says.

BTW I think the warning message has a perfectly good explanation of
why it's warning when a variable appears only once -- because it's
a possible typo.

>use Image::Magick;
>
>my $p = new Image::Magick;
>my $q = new Image::Magick;
>
>$img = "/users/skang/pics/asian.jpg";
>$icon = "/users/skang/pics/il-icon.gif";
>
>
>$p->Read($img);
>$p->Read($icon);
>$p->[0]->Scale(width=>'400',height=>'50');
>$p->[1]->Scale(width=>'50',height=>'50');
>
># this is the part that i can't seem to make it to work.  
>$q->Montage(geometry=>'450x50', -mode=>'Concatenate', tile=>'2x1',
>filename=>$p);
>
>$q->Write('yes.jpg');
>
>undef $q,$p;



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

Date: Sat, 13 Dec 1997 14:40:33 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: pgp encrypion via perl script
Message-Id: <66unui$rl6@bgtnsc02.worldnet.att.net>

In article <mbudash-1312970304160001@d67.pm2.sonic.net>, mbudash@sonic.net
(Michael Budash) wrote:

> In article <34917ff8.17495498@news.scescape.net>, rgay@palmetto.net wrote:
> 
> >> Any ideas on  this one...
> 
> If I'm gathering your problem correctly, I just went thru the same thing
> on an Irix server, and the answer was incredibly simple:

> chdir "path_to_dir_containing_pgpe";
> $encrypted_data = `(echo "$unencrypted_data") | pgpe -at -r
> $recipient_email_address`;

> Pretty simple, eh?

THIS IS NOT THE RIGHT WAY TO DO IT (yes i'm yelling).

you cannot store the plaintext on disk.
you cannot store the plaintext on disk.
you cannot store the plaintext on disk.
you cannot store the plaintext on disk.
you cannot store the plaintext on disk.
you cannot store the plaintext on disk.
you cannot store the plaintext on disk.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Sat, 13 Dec 1997 14:00:37 -0600
From: "Russ Verner" <russ@eastland.net>
Subject: PIng a Port
Message-Id: <66upej$hiq$1@news1.iamerica.net>

Hello,
    does anyone know how to ping a specific port.  If I wanted to ping port
80 I use the ping command with the host name .   How do you ping a program
you have running on like port 3335?  I'm using a Linux machine version
2.0.32.
Russ
russ@eastland.net





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

Date: Sat, 13 Dec 1997 14:49:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Russ Verner <russ@eastland.net>
Subject: Re: PIng a Port
Message-Id: <Pine.GSO.3.96.971213144816.23745L-100000@user2.teleport.com>

On Sat, 13 Dec 1997, Russ Verner wrote:

>     does anyone know how to ping a specific port. 

You can ping a host, not a port. But if you wish, you could try opening a
socket to a particular port on a particular host, and see whether that
succeeds. Is that what you want? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 13 Dec 1997 19:48:17 GMT
From: "dianne" <dianne@jot.nb.ca>
Subject: problem with this script?
Message-Id: <01bd07ff$d8a6b1e0$cd67a4c6@dianne.jot.nb.ca>

A friend asked me to take a look at his script.  Any ideas why the new-line
character is getting sent twice in this script? 

void ContentType(char *type);
void OutFile(char *path);

void ContentType(char *type)
{
	fprintf(stdout,"Content-type: %s\n\n", type);
}
void OutFile(char *path)
{
	FILE *fp;
	if((fp=fopen(path,"rb"))==NULL)
		return;
	while(1)
	{
		int ch=getc(fp);

		if(!feof(fp))
			fputc(ch,stdout);
		else
      	break;
	}
	fclose(fp);
}



TIA

dianne


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

Date: 13 Dec 1997 22:35:01 GMT
From: "dianne" <dianne@jot.nb.ca>
Subject: Re: problem with this script?
Message-Id: <01bd0817$243a1c20$cd67a4c6@dianne.jot.nb.ca>

Oops, pasted the wrong script(program), sorry.

dianne <dianne@jot.nb.ca> wrote in article
<01bd07ff$d8a6b1e0$cd67a4c6@dianne.jot.nb.ca>...
> A friend asked me to take a look at his script.  Any ideas why the
new-line
> character is getting sent twice in this script? 
> 



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

Date: 13 Dec 1997 19:34:51 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: problem with this script?
Message-Id: <66vd3r$32g@tekka.wwa.com>

dianne@jot.nb.ca writes:
>Oops, pasted the wrong script(program), sorry.

Too late, I ran the perl interpreter on it and it's already sequenced
the human genome.



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

Date: Sat, 13 Dec 1997 14:24:15 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: setting environment variable within perl script
Message-Id: <Pine.GSO.3.96.971213142337.23745G-100000@user2.teleport.com>

On Sat, 13 Dec 1997, brian d foy wrote:

> In article <Pine.GSO.3.96.971212184841.14102U-100000@user2.teleport.com>,
> Tom Phoenix <rootbeer@teleport.com> wrote:

> > Why aren't you using a module? 

> in all fairness, the PGP module on CPAN is an alpha module.  it gave me
> so many problems that i wrote my own :)

So you, at least, _are_ using a module. :-)  When will you be uploading it
to CPAN? :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 13 Dec 1997 20:45:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: setting environment variable within perl script
Message-Id: <66vda9$40t@bgtnsc02.worldnet.att.net>

In article <Pine.GSO.3.96.971213142337.23745G-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:

> On Sat, 13 Dec 1997, brian d foy wrote:

> > in all fairness, the PGP module on CPAN is an alpha module.  it gave me
> > so many problems that i wrote my own :)
> 
> So you, at least, _are_ using a module. :-)  When will you be uploading it
> to CPAN? :-)

next time i get i get a free week i'll be able to put the finishing
touches on it.  then i have to work out the details with CPAN and the
original author.  then i have to get permission from the Suits to let
me release it (it was done as a work for hire, so i don't own it).

then i have to convince myself that it doesn't suck.  that's the hard
part ;)

-- 
brian d foy                                 <http://computerdog.com>
i will release no software before its time


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

Date: Sat, 13 Dec 1997 17:25:25 +0000
From: Mark Worsdall <jaydee@worsdall.demon.co.uk>
Subject: Re: untainting data
Message-Id: <iqSFaIAFUsk0EwOj@worsdall.demon.co.uk>

In article <Pine.GSO.3.96.971211210549.10598E-
100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> writes
>On Thu, 11 Dec 1997, Mark Worsdall wrote:
>
>> Hi, I am trying to untaint an IP variable passed to me. Now in all
>> SINGLE IP numbers the untainting works fine, however on occasion I am
>> passed data such as this:-
>> 194.154.10.177, 194.238.50.8
>> 
>> 2 IP numbers with a space, 
>
>And a comma, it seems.
>
>> so I drop the space and then try to untaint the data (DOH!) no good, cos
>> yes I should really untaint the data before doing anything with it
>
>Do you know that it will be exactly two such numbers, or possibly more?
>Will there always be a comma and a space, or something else?
>
>> $surfer = $ENV{'HTTP_X_FORWARDED_FOR'} || 'Nothing';
>> $surfer =~ s/ //g;      # drop spaces
>> if ($surfer =~ /^([-\@\w.]+)$/) {
>>         $surfer = $1;   # $surfer now untainted
>> } else {
>>         die "Tainted data in $surfer: $!";
>> }
>
The data maybe of these forms:-
unknown
143.136.213.62
193.136.213.62, 193.136.212.21
193.136.213.62, 193.136.212.21, 10.120.67.45

I am simply trying to extract an IP number to do a:-
# Translate variable $surfername from IP address into domain name
if ($surfername =~ /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/) {
        ($dns) = gethostbyaddr(pack("C4",$1,$2,$3,$4),2);
        $surfername = $dns if ($dns);
        $surfername = lc($surfername);
}

ofcourse I need to seperate the IP numbers and except the first one that
dns resloves successfully, if after all dns fails then I do a traceroute
on the first number, when I should do a traceroute on all IP numbers
except local ones (10.x.y.z) etc.

Mark.

-- 
Mark Worsdall - Oh no, I've run out of underpants :(
Home:- jaydeeATworsdall.demon.co.uk  WEB site:- http://www.worsdall.demon.co.uk
Shadow:- webmasterATshadow.org.uk    WEB site:- http://www.shadow.org.uk


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

Date: 13 Dec 1997 19:29:46 GMT
From: Roedy Green <roedy@BIX.com>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <66unna$f4m@lotho.delphi.com>

Why would the programmers be paid substantially more for using a particular
computer language?

1. is it so frustratingly boring that almost no one wants to use it?

2. it is so frustratingly difficult almost no one can use it?

3. the language is well tuned for solving the problems of wealthy companies.

4. because you can't learn the language from off-the-shelf books and with a
home computer or at a college.  You need to learn from $1000 a day courses.

5. Nobody's ever heard of the language.

6. There's a shortage of people who know the language relative to the
demand for it.



For the JAVA GLOSSARY and the CMP Utilities: http://oberon.ark.com/~roedy
--
Roedy Green               Roedy rhymes with Cody   roedy@bix.com ICQ:5144242
Canadian Mind Products    contract programming     (250) 285-2954
POB 707 Quathiaski Cove   Quadra Island BC         Canada V0P 1N0 
-30-


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

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

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed 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 1468
**************************************

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