[13377] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 787 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 14 01:07:31 1999

Date: Mon, 13 Sep 1999 22: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)

Perl-Users Digest           Mon, 13 Sep 1999     Volume: 9 Number: 787

Today's topics:
        About File::Copy ?? <roger_chiu@trend.com.tw>
    Re: back for more sorting abuse (Kragen Sitaker)
    Re: back for more sorting abuse <uri@sysarch.com>
    Re: back for more sorting abuse (Kragen Sitaker)
    Re: baffle about flock() please help! (Abigail)
    Re: baffle about flock() please help! (Kragen Sitaker)
    Re: Calls from HTML (Abigail)
    Re: Check Password from /etc/passwd on Linux (UNIX) (Abigail)
    Re: Comparing against today's date? (Abigail)
    Re: converting a number into a binary? (Abigail)
    Re: directory pb (Abigail)
    Re: Discussion: compiled perl program as shareware (Abigail)
        handling binary file? <zhengh@cspar.uah.edu>
    Re: handling binary file? (Kragen Sitaker)
        how to hide secured info? jloved@my-deja.com
    Re: how to hide secured info? (Kragen Sitaker)
    Re: How to perform nslookup functions in perl? (Kragen Sitaker)
    Re: How to send control codes from Expect module (Kragen Sitaker)
    Re: I need a date function... (Abigail)
    Re: I want to exit my script without sending anything b (Kragen Sitaker)
    Re: Idea for extracting name from city? (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 14 Sep 1999 13:03:11 +0800
From: "roger chiu" <roger_chiu@trend.com.tw>
Subject: About File::Copy ??
Message-Id: <vvVwzzm$#GA.257@news1>

when I copy file to other directory with File::Copy, the result are
different between Win98 and NT. In win98, use
"copy("c:\\a.txt","d:\\a.txt")" and cannot use "copy("c:\\a.txt","d:\\")".
In NT, use "copy("c:\\a.txt","d:\\")". Why are different between win98 and
NT? How do it copy files of a directory to other directory? Thanks a lot.

Roger Chiu.




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

Date: Tue, 14 Sep 1999 04:21:25 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: back for more sorting abuse
Message-Id: <93kD3.9502$N77.734601@typ11.nn.bcandid.com>

In article <x7r9k8msjs.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
>well, you want to eliminate that slow sort sub. time for some more
>reading and studying. check out this award winning paper <gloat!> on
>faster sorting:
>
>http://www.sysarch.com/perl/sort_paper.html

Very nice paper.

BTW, Shellsort (capitalized because it's named after somebody called
Shell) is O(N^(3/2)), or O(N sqrt N), not O(N lg N) as you say in the
paper, if I remember correctly.

You decide that "Perl is not the appropriate tool to use for huge sorts
(where huge is defined by your system's memory limits)", because Perl's
built-in sort operator requires the data to fit into VM.  But most
languages don't have a sort operator; by the same logic, they are not
the appropriate tool to use for any sorting.

It should be noted that the 'caching the sortkeys' approach -- without
the ||cache -- only works when the sortkeys are unique.

The packed-default sort is an excellent idea.  You can sort
variable-length binary data using null delimiters if you translate the
binary data in the keys in some manner, e.g.:

$key =~ s/\x01/\x01\x02/g;
$key =~ s/\x00/\x01\x01/g;

This ensures that the resulting keys compare the same,
lexicographically, as the original ones, but contain no nulls.  The
reverse transformation could in principle recover the original data,
but this is not necessary.

Thank you for a very interesting paper!

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 14 Sep 1999 00:49:40 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: back for more sorting abuse
Message-Id: <x73dwiksgr.fsf@home.sysarch.com>

>>>>> "KS" == Kragen Sitaker <kragen@dnaco.net> writes:

  KS> In article <x7r9k8msjs.fsf@home.sysarch.com>, Uri Guttman
  KS> <uri@sysarch.com> wrote:
  >> well, you want to eliminate that slow sort sub. time for some more
  >> reading and studying. check out this award winning paper <gloat!>
  >> on faster sorting:
  >> 
  >> http://www.sysarch.com/perl/sort_paper.html

  KS> Very nice paper.

thanx.

  KS> BTW, Shellsort (capitalized because it's named after somebody
  KS> called Shell) is O(N^(3/2)), or O(N sqrt N), not O(N lg N) as you
  KS> say in the paper, if I remember correctly.

i didn't know about the name. i have to research the O() value.

  KS> You decide that "Perl is not the appropriate tool to use for huge
  KS> sorts (where huge is defined by your system's memory limits)",
  KS> because Perl's built-in sort operator requires the data to fit
  KS> into VM.  But most languages don't have a sort operator; by the
  KS> same logic, they are not the appropriate tool to use for any
  KS> sorting.

that doesn't follow. c doesn't have a builtin sort but the unix sort
utility is written in C. we were just pointing out the limitations of
perl's builtin sort as it required its data in VM. there are sort
algorithms designed for when the data set won't fit into memory.  if you
are sorting that much data, perl is probably not a good choice no matter
what the method. an efficient external sort program is probably a better
choice. also, all our algorithm assumptions and benchmarks go out the
window when you start swapping data. in my benchmarks when i kept
scaling up the data set size, at some point it was easy to tell when it
ran out of memory as the times when way up as the disk was being
accessed.

also you could probably fit (many) more records into memory if you used
other languages like c. perl is notorious for its piggish use of ram. it
is designed to trade off memory space to get more speed.

  KS> It should be noted that the 'caching the sortkeys' approach --
  KS> without the ||cache -- only works when the sortkeys are unique.

explain what you mean some more.

  KS> The packed-default sort is an excellent idea.  You can sort
  KS> variable-length binary data using null delimiters if you translate
  KS> the binary data in the keys in some manner, e.g.:

  KS> $key =~ s/\x01/\x01\x02/g; $key =~ s/\x00/\x01\x01/g;

interesting.  i may add that option to the module (due out some time in
the near future for large values or near). this is like bit stuffing in
HDLC.

  KS> This ensures that the resulting keys compare the same,
  KS> lexicographically, as the original ones, but contain no nulls.
  KS> The reverse transformation could in principle recover the original
  KS> data, but this is not necessary.

we have ways to get back the original data regardless of the length of
the variable sort key. one trick is to append the record to the
extracted key and then append the length of the record as a packed
int. then you just grab the length with a simple substr and unpack and
do a substr from the end of the packed key with that length.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Tue, 14 Sep 1999 04:59:46 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: back for more sorting abuse
Message-Id: <6DkD3.9552$N77.740187@typ11.nn.bcandid.com>

In article <x73dwiksgr.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
>>>>>> "KS" == Kragen Sitaker <kragen@dnaco.net> writes:
>  KS> In article <x7r9k8msjs.fsf@home.sysarch.com>, Uri Guttman
>  KS> <uri@sysarch.com> wrote:
>  KS> You decide that "Perl is not the appropriate tool to use for huge
>  KS> sorts (where huge is defined by your system's memory limits)",
>  KS> because Perl's built-in sort operator requires the data to fit
>  KS> into VM.  But most languages don't have a sort operator; by the
>  KS> same logic, they are not the appropriate tool to use for any
>  KS> sorting.
>
>that doesn't follow. c doesn't have a builtin sort but the unix sort
>utility is written in C.

Yes, that was what I was thinking.  

> we were just pointing out the limitations of
>perl's builtin sort as it required its data in VM. there are sort
>algorithms designed for when the data set won't fit into memory.  if you
>are sorting that much data, perl is probably not a good choice no matter
>what the method.

That may well be.  But it's not because Perl's built-in sort operator
isn't up to the task.  (Not long ago, btw, someone suggested building a
Berkeley DB Btree-indexed file and inserting all the data into it, so
that keys() or each() would return the data in sorted order.)

>  KS> It should be noted that the 'caching the sortkeys' approach -- 
>  KS> without the ||cache -- only works when the sortkeys are unique.  
> 
>explain what you mean some more.

Uh, er, um, I meant I wasn't thinking clearly and posted something that
was obviously wrong.  Sorry!

>we have ways to get back the original data regardless of the length of
>the variable sort key. one trick is to append the record to the
>extracted key and then append the length of the record as a packed
>int. then you just grab the length with a simple substr and unpack and
>do a substr from the end of the packed key with that length.

Yeah.  Last time I did the packed-sort-key thing, it was because I was
passing stuff to Unix sort through a pipe; I can't remember whether I
didn't feel like reading the man page to figure out how to get it to
sort on fields, or because I was doing something complicated like
sorting Cartesian points by distance from the origin.  I seem to
remember that the code looked something like open OUTPUT, '|sort|perl
-pe "s/^[^\t]*\t/"' or die "Couldn't open OUTPUT: $!";

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 22:52:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: baffle about flock() please help!
Message-Id: <slrn7trhoh.f00.abigail@alexandra.delanet.com>

Kragen Sitaker (kragen@dnaco.net) wrote on MMCCIV September MCMXCIII in
<URL:news:tx8D3.7896$N77.623552@typ11.nn.bcandid.com>:
&& In article <37daabe6.29045007@news.inet.co.th>,
&& Ryan Ngi <ryanngi@hotmail.com> wrote:
&& >ooh ... successful cat test.xxx ......... i think
&& >it should access denied or something unsuccessful 'cuz it's lock....
&& 
&& In Unix, you don't need to lock a file to access it.  So cat doesn't.
&& So locking a file doesn't prevent anyone from accessing it; it only
&& prevents them from locking it.
&& 
&& I believe some recent (SVR4?) Unices have a 'mandatory locking' kludge:

SVR4 dates from 1990. It's not really what I call 'recent', unless you
want to call some versions of Perl 3 also 'recent'.... However, this
"kludge" was also present in SVR3, which is of 1986 vintage.

&& setgid without group execute means you can't open the file without
&& locking it first, or some such.

According to Stevens [1, pp 367], locking was orginally mandatory:

    Record locking was originally added to Version 7 in 1980 by John Bass.
    The system call entry in the kernel as a function named locking. This
    function provided mandatory record locking and propagated trough many
    vendor's versions of System III. Xenix systems picked up this function,
    and SVR4 still supports it in its Xenix compatibility library.

    SVR2 was the first release of System V to support the fcntl style of
    locking, in 1984.


[1] Stevens, W. Richard. "Advanced Programming in the UNIX Environment".
    Reading: Addison-Wesley, 1993. ISBN 0-201-56317-7.


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 04:30:39 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: baffle about flock() please help!
Message-Id: <PbkD3.9519$N77.736033@typ11.nn.bcandid.com>

In article <slrn7trhoh.f00.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>Kragen Sitaker (kragen@dnaco.net) wrote on MMCCIV September MCMXCIII in
><URL:news:tx8D3.7896$N77.623552@typ11.nn.bcandid.com>:
>&& I believe some recent (SVR4?) Unices have a 'mandatory locking' kludge:
>
>SVR4 dates from 1990. It's not really what I call 'recent', unless you
>want to call some versions of Perl 3 also 'recent'.... However, this
>"kludge" was also present in SVR3, which is of 1986 vintage.

Unix dates from 1970.  Perl dates from 1987.  The last Perl 3 was in
1991, three years after Perl 0 in late 1987, and eight years before
today.  Thus there has been Perl 3 for two-thirds of Perl's life, and
SVR4 for one-third of Unix's life.

By the same logic, I suppose, England "recently" had a civil war, and
the pharaohs were "recently" conquered by Rome.  So maybe it's not all
that recent.  :)

What I was really going on is that I had used Unix since 1992, and
(while I occasionally used IRIX in 1994) it wasn't until 1996 that I
regularly used a SVR4-based Unix.

>According to Stevens [1, pp 367], locking was orginally mandatory:

Very interesting. Thanks for the citation!

RIP WRS.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 22:58:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Calls from HTML
Message-Id: <slrn7tri4u.f00.abigail@alexandra.delanet.com>

Daniel Krajzewicz (krajzewicz@inx.de) wrote on MMCCIV September MCMXCIII
in <URL:news:37DCFC0B.C0C38D37@inx.de>:
== 
== Is it possible to make direct Perl-calls from HTML without having to
== press any
== buttons ??

Your question doesn't make any sense. You might as well as whether
it is possible to grow vegetables from a painting, without becoming
Wednesday first.

HTML isn't a programming language. An HTML document doesn't *do*, an
HTML document *is*. You can't call Perl from French either, and the
concept of pressing buttons doesn't go well with being a text in the
French language either.

Followups set, as your question has nothing to do with Perl.


Abigail
-- 
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 23:17:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Check Password from /etc/passwd on Linux (UNIX)
Message-Id: <slrn7trj7u.f00.abigail@alexandra.delanet.com>

Daniel Krajzewicz (krajzewicz@inx.de) wrote on MMCCIV September MCMXCIII
in <URL:news:37DCC17F.991774C5@inx.de>:
--
-- I just have a very small quesion :
-- if I know a users name and the password given by him, how can I
-- determine if the User belongs to my system.

This doesn't match the question in the subject. /etc/password is a
possible place to store passwords, but not the only one. There is
/etc/shadow as well, and let's not forget, the NIS database.

To get the entries out of /etc/passwd, see the getpw* functions.
Consult the manual and your systems manual for the details. But this
does not however, return the encrypted password from /etc/shadow. (If it
does on your system, what would be the point of having an /etc/shadow?)

You could of course login as the user, using the supplied password.

-- Linux, but it shall work for all systems.

That might be a bit of a challenge, as the manual suggests that there
are differences between systems.

-- By the way, I greatly invite to my site listed below, look esp. at
-- the chapter graphic/calendar-pictures and write an EMail (just click 
-- on "Daniel Krajzewicz"-Text...

And why should I want to do that? I thought that postings ending with
"please look at my site" where `in' in 1994, but `out' in 1995.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 23:21:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Comparing against today's date?
Message-Id: <slrn7trjf3.f00.abigail@alexandra.delanet.com>

Glenn Kauffman (glenn.kauffman@worldnet.att.net) wrote on MMCCIV
September MCMXCIII in <URL:news:7rj4fv$to$1@bgtnsc03.worldnet.att.net>:
?? This may help. Date modulues are large if that's all you're trying to do.
?? BTW: you should always use 4 digit years. (Y2K)

No! You should always use 10 digit years! (Y10K, Y100K, Y1M, Y10M, Y100M, Y1G)


Abigail
-- 
Will they never learn?


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 23:22:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: converting a number into a binary?
Message-Id: <slrn7trjhd.f00.abigail@alexandra.delanet.com>

Kragen Sitaker (kragen@dnaco.net) wrote on MMCCIV September MCMXCIII in
<URL:news:ip8D3.7867$N77.625941@typ11.nn.bcandid.com>:
;; 
;; What puzzled me was this: what else is int good for?


It's very handy if you need a flint, but all you have is a 'fl'.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 23:26:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: directory pb
Message-Id: <slrn7trjor.f00.abigail@alexandra.delanet.com>

Francois Breuiller (f-breuiller@ti.com) wrote on MMCCIV September
MCMXCIII in <URL:news:37DD00EA.CD6295D@ti.com>:
[] 
[] Could someone send to me an exemple of CGI script in to create a
[] directory $name_dir into path $path_dir ?

That's a strange question. First, one doesn't create directories into
paths, but one creates directories inside directories. Second, there
is nothing special about creating directories from a CGI program -
you do it the same way as from a non-CGI program.

Did you read the manual about mkdir?

[] Could someone explain me the use of the "system" command to copy file
[] between two directories ??

Well, you type 'system', then a space, then '"', the the command you
use to copy files between two directories, then another '"', then a ';'.

Is there a part of the manual about "system" that you do not understand?



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Sep 1999 23:32:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Discussion: compiled perl program as shareware
Message-Id: <slrn7trk4c.f00.abigail@alexandra.delanet.com>

Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCCIII September
MCMXCIII in <URL:news:7rggsd$2dm$1@gellyfish.btinternet.com>:
!! 
!! I certainly wouldnt be interested in no Perl program without the source
!! code.


Why not? You've never been interested in any program of which you didn't
get the source? Or is it just program written in Perl of which you want
the source? And of all the programs you have that include the source,
do you always use the source, or intent to use it? What about your
hardware? Are you interested in having hardware of which you do not have
the blueprints? If you are, what makes hardware different from software?
After all, todays hardware was yesterdays software.

While I think a source distribution is preferable over a non-source one,
I wouldn't go as far as saying I won't be interested in software that
doesn't come in source code.




Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 13 Sep 1999 22:28:59 -0500
From: "Hue Ray" <zhengh@cspar.uah.edu>
Subject: handling binary file?
Message-Id: <7rkful$n3v$1@info2.uah.edu>

I was trying to load an image file using perl, but it failed when it
encountered the character in hex [1A] which is the EOF in DOS/Windows OS. My
code is like this

#
# ....
# $File = "a.gif";
# ....
 print "Content-type: image/gif\n\n";
 binmode STDOUT;
 print `type $File`;
# ...
# end



Any idea? Thanks in advance.

HueRay




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

Date: Tue, 14 Sep 1999 04:31:21 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: handling binary file?
Message-Id: <tckD3.9523$N77.728586@typ11.nn.bcandid.com>

In article <7rkful$n3v$1@info2.uah.edu>, Hue Ray <zhengh@cspar.uah.edu> wrote:
>I was trying to load an image file using perl, but it failed when it
>encountered the character in hex [1A] which is the EOF in DOS/Windows OS. My
>code is like this

Don't use type.  Open the file yourself and binmode it.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 14 Sep 1999 04:03:34 GMT
From: jloved@my-deja.com
Subject: how to hide secured info?
Message-Id: <7rkheh$q48$1@nnrp1.deja.com>

I want to hide oracle login id and password in perl code. Is it
possible?

or .. is it possible to convert perl source code to execution file? (I
tried perl2exe for unix .. but, the file size is too big)

- Johnny


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 14 Sep 1999 04:33:28 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: how to hide secured info?
Message-Id: <sekD3.9528$N77.736211@typ11.nn.bcandid.com>

In article <7rkheh$q48$1@nnrp1.deja.com>,  <jloved@my-deja.com> wrote:
>I want to hide oracle login id and password in perl code. Is it
>possible?

No.

>or .. is it possible to convert perl source code to execution file? (I
>tried perl2exe for unix .. but, the file size is too big)

Even if you did convert it to an executable binary, no, you would not
be able to conceal the login id and password from someone in possession
of the binary.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 14 Sep 1999 03:29:24 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to perform nslookup functions in perl?
Message-Id: <oijD3.9439$N77.725468@typ11.nn.bcandid.com>

In article <37DD5ADE.95A60231@mts.mb.ca>,
Blair Kissel  <blair.kissel@mts.mb.ca> wrote:
>As I indicated in the above thread, I was unaware that the terminology for my
>task was a zone transfer, thus I skipped over that example.

Yeah, jargon can sometimes make it very difficult to locate the
information you need in documentation.  Glad the newsgroup could help :)

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 14 Sep 1999 03:27:32 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to send control codes from Expect module
Message-Id: <EgjD3.9434$N77.724923@typ11.nn.bcandid.com>

In article <7rbh6k$mvu$1@nnrp1.deja.com>, Bill  <wpflum@my-deja.com> wrote:
>My biggest problem now is with the screen dump again.  I don't
>think I'll need a term emulator just a way for me to redirect the
>screen to a variable, this would be an 'Except' question since 'Except'
>is the module interfacing with the telnet program.  What I'm looking
>for is almost like a multiline match but instead of matching anything I
>need to 'see' the text I'm matching against so I can copy it.
>Anyone have any ideas...while I'm waiting its back to the wall and
>the 'Expect' docs. ;)

Well, the thing is, without a terminal emulator, there is no screen to
dump.  There's just a stream of bytes that constitute instructions to a
terminal to move cursors around, set attributes, and (of course)
display characters.  It may be that you can figure out which parts of
the stream of bytes you need, just by looking at the stream of bytes,
but it may be arbitrarily difficult.

As an example: on a vt100 or compatible, this command
perl -e 'print "EL\e[DA\e[CS\e[DT\e[D\e[D\e[DC\n"'
displays "CATS".  First the A, then the S, then the T, then the C.  The
E and the L get overwritten.

If you're lucky, you'll be able to figure out which parts of that
stream of bytes you're being sent correspond to which parts of the
screen without too much of a hassle.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 23:48:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I need a date function...
Message-Id: <slrn7trl1c.f00.abigail@alexandra.delanet.com>

Jeff Battle (jjbattle@veribest.dot.com) wrote on MMCCIV September
MCMXCIII in <URL:news:fsbD3.8313$N77.650060@typ11.nn.bcandid.com>:
{} Visual Basic (I'm a newbie, forgive me if it's bad taste to mention VB in
{} this group) has a function called Weekday().  Give it a date and it returns
{} a number representing the day of the week. I can get the weekday of the
{} current day but I need the weekday of any entered date.
{} 
{} What's the easiest way to do this in Perl?


By using a module. Go to CPAN, look at the various Date:: and Time::
modules. Pick one you like.



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 14 Sep 1999 03:34:54 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: I want to exit my script without sending anything back to the users   browser
Message-Id: <ynjD3.9453$N77.726489@typ11.nn.bcandid.com>

In article <LDLC3.1273$rf1.7749@news1.online.no>,
Trond Michelsen <mike@crusaders.no> wrote:
>Well, onSubmit is at least a bit more friendly than onClick=this.form.submit
>(or something similar)

You don't understand.  Some of us think JavaScript is brain-dead.  Some
of us read BUGTRAQ and understand that not using JavaScript is a
defense against almost every web-browser security hole yet discovered.
Some of us like to be in control of our browsers, and don't like it
when some Web site tries to take that away from us with JavaScript.
Some of us don't like popup ad windows and image rollovers and the
other "cool" things people like to do with JavaScript.

For those of us who are like this (I'm tempted to say "those of us who
aren't total morons", but that would be slightly inaccurate -- there
are people who leave JavaScript on because they're uninformed, or
because they aren't the ones who use the browser), onSubmit and onClick
are equally unfriendly, because NEITHER ONE RUNS.

Yow.  I'm starting to sound as grumpy as Abigail or Tom, and with far
less right to do so.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 23:45:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Idea for extracting name from city?
Message-Id: <slrn7trkrf.f00.abigail@alexandra.delanet.com>

Eric Bohlman (ebohlman@netcom.com) wrote on MMCCIV September MCMXCIII in
<URL:news:7rhr82$49r@dfw-ixnews12.ix.netcom.com>:
\\ Kevin Reed (kevin@zippy.tnet.com) wrote:
\\ : Below are some sample records to show the problem that I am having:
\\ : 
\\ : Mrs. Joyce Aab Pittsford, NY
\\ : Mrs. Melissa Aab Pittsford, NY
\\ : Mr. Elmer Aamodt Grand Prairie, TX
\\ 
\\ There's no algorithmic way of separating the name and city in this 
\\ example.  There are some heuristics, but they require information outside 
\\ of the records themselves.  If you know that there's a city called Grand 
\\ Prairie, TX, but *not* one called Prairie, TX, or vice versa, you can 
\\ disambiguate it.  But if you have no information about Texas cities, or 
\\ if there's *both* a Grand Prairie and a Prairie, then this one is 
\\ impossible to disambiguate.

\begin{pedantic}
Well, if there is a Grand Prairie and a Prairie, but you know there isn't
an Elmer Aamodt in Grand Prairie, you can still disambiguate.
\end{pedantic}

\\ : Mr. C. Chester Abell Columbus, OH
\\ : Mr. Charles Abercrombe Amarillo, TX
\\ : Mr. Denis Abercrombie The Woodlands, TX
\\ 
\\ A reasonably safe heuristic is that words like 'the' don't occur in 
\\ people's names but do occur in place names.

Except of course in Dutch names, where "De" (Dutch for "The") is quite
common in people's names, and quite uncommon in place names....

\\ : The real data has every record in alphabetical order by last name.
\\ : So the following record would always have a last name that is
\\ : equal in value or greater.
\\ 
\\ This can form part of your heuristic; if a word in your current record is 
\\ lexically less than the validated last name from your previous record, it 
\\ can't represent the first word of the current record's last name.  

Well, yeah, but that only helps in determining where the last name
starts, and where the first name ends. It doesn't help you much to find
out where the last name ends, and the city begins.


Now, what has this to do with Perl? ;-)



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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