[8109] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1728 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 25 23:07:52 1998

Date: Sun, 25 Jan 98 20:00:32 -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           Sun, 25 Jan 1998     Volume: 8 Number: 1728

Today's topics:
    Re: @ == @, comparing arrays <vladimir@cs.ualberta.ca>
    Re: Access to parsed Perl program (Chip Salzenberg)
    Re: Bad (Swear) Word Checking (Chip Salzenberg)
    Re: Bad (Swear) Word Checking (Abigail)
    Re: Bad (Swear) Word Checking (Abigail)
        BASE64 Decode <smiths@erols.com>
    Re: Bug in splice? (Chip Salzenberg)
    Re: CGI.pm and server errors (Chip Salzenberg)
        cyclic refs (Re: References to parent objects) <vladimir@cs.ualberta.ca>
    Re: Decrypting modules for Perl <efinch@vais.net>
    Re: help: open an existing page and replace parts of it (Chip Salzenberg)
    Re: how to do formfeed/pagebreak (Chip Salzenberg)
        html user needing perl? <bbank@viser.net>
    Re: I/O to a tty (Chip Salzenberg)
        IIS/NT 4.0 and PERL5, got it to work! <zeropage@computek.net>
    Re: Interfacing a database through a perl script??? <coolj@zip.com.au>
    Re: Is Perl cron-able? (Sean Malloy)
        MsqlPerl says Server not running <pat@nef.wh.uni-dortmund.de>
        Perl module documentation format? (Andrew Brown)
    Re: Perl module documentation format? (Michael Fuhr)
    Re: Perl Source Obfuscator (Abigail)
    Re: Perl Source Obfuscator (binkley)
    Re: Problems with DBFile (Jonathan Nicholson)
    Re: References to parent objects <vladimir@cs.ualberta.ca>
    Re: Survival Of perl (Abigail)
    Re: Temporary or Internal Files or Dummy Filehandles (Ton Hospel)
    Re: Using Cgi Script to Redirect User By Domain Name? H (Chip Salzenberg)
    Re: Variable scope question/problem (Chip Salzenberg)
    Re: White Hats and Black <*@qz.to>
    Re: White Hats and Black <flavell@mail.cern.ch>
    Re: White Hats and Black <tchrist@mox.perl.com>
    Re: White Hats and Black <tchrist@mox.perl.com>
    Re: Why does split return undef? - My own followup (Felix Morley Finch)
        Why does split return undef? (Felix Morley Finch)
        Why enable CreateProcessWithNewConsole? <zeropage@computek.net>
        WIN32 LWP Problem <Webmaster@csa.clpgh.org>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 25 Jan 1998 20:02:32 -0700
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
Subject: Re: @ == @, comparing arrays
Message-Id: <om7m7oym2f.fsf@tees.cs.ualberta.ca>

One can't answer this correctly before one knows what kind of equality
is had in mind. Eg if you use stringization or (string) eq, these are
not equal: ("5") and ("5.0"). They are equal if you use (numeric) ==.


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

Date: Mon, 26 Jan 1998 01:22:47 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Access to parsed Perl program
Message-Id: <6agokt$ags$1@cyprus.atlantic.net>

According to reid@tigger.cs.colorado.edu (C. Reid Turner):
>Is there any way to get access to something
>like an abstract syntax tree representation 
>of a Perl program from perl?  

I think the nearest thing is the -Dx flag.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Mon, 26 Jan 1998 01:24:31 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Bad (Swear) Word Checking
Message-Id: <6agoo6$ahf$1@cyprus.atlantic.net>

According to dave.power@adpdesign.com (Dave Power):
>On Sun, 25 Jan 1998 15:03:15 -0500, Chipmunk <rjk@coos.dartmouth.edu>
>wrote:
>>Dave Power wrote:
>>> Does anyone know if a 'Bad Word' (dubious or definite swear words)...
>>
>>This one's more of a phrase than a word:
>>"People who post questions to clpm which have nothing to do with Perl."
>
>The thing is I'm trying to validate a form, the contents of which will
>be transmitted to ithers.

That's a CGI issue if anything.
Get thee to comp.infosystems.www.authoring.cgi.

>I need to know if the content may be offensive. This is a Perl app
>Chippy!

You're using a keyboard to write this CGI script, right?
Get over to comp.sys.ibm.pc.hardware.keyboards.

-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: 26 Jan 1998 01:27:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Bad (Swear) Word Checking
Message-Id: <6agopa$cg9$3@client3.news.psi.net>

Dave Power (dave.power@adpdesign.com) wrote on 1608 September 1993 in
<URL: news:34cb8329.25390362@news.virgin.net>:
++ 
++ Does anyone know if a 'Bad Word' (dubious or definite swear words)
++ file exists which may be available. I think I know most of the English
++ ones (but then I'm not that sure that I do). I'm really looking for a
++ definitive list covering at least the western world languages.

There are no "Bad Words" in perl.

++ An Alta Vista search turned up nothing relevant.

And hence you turned to clpm??

Try alt.bad.words.


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


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

Date: 26 Jan 1998 01:29:12 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Bad (Swear) Word Checking
Message-Id: <6agot8$cg9$4@client3.news.psi.net>

Dave Power (dave.power@adpdesign.com) wrote on 1608 September 1993 in
<URL: news:34cbc1fb.2073286@news.virgin.net>:
++ 
++ The thing is I'm trying to validate a form, the contents of which will
++ be transmitted to ithers.

It still has nothing to do with perl.

++ I need to know if the content may be offensive. This is a Perl app

And? You are programming that while sitting in a chair, right?
Does that mean rec.furniture would be an appropriate newsgroup?


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Sun, 25 Jan 1998 22:19:35 -0500
From: "The Smiths" <smiths@erols.com>
Subject: BASE64 Decode
Message-Id: <6agv81$4eh$1@winter.news.erols.com>

Hi,

Before I write one, I was wondering if a BASE64 decode routine might already
be available in PERL?

Thanks,
Tim.




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

Date: Mon, 26 Jan 1998 01:26:44 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Bug in splice?
Message-Id: <6agosb$ai0$1@cyprus.atlantic.net>

According to malch@malch.com (Malcolm Hoar):
>The following code:
>  @times = ();
>  $var = splice (@times, -9, 1);
>sets $var to null under Perl4 and Perl5.00401. However, Perl5.00404
>generates the following run time error (running from shell):
>  Modification of non-creatable array value attempted, subscript -9

It's a bug fix -- too-large negative indices are now errors.

>When run as a cgi script, it just bombs. However, there's nothing
>in the httpd error log.

This is an issue to take up with the authors of your server.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Mon, 26 Jan 1998 00:55:11 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: CGI.pm and server errors
Message-Id: <6agn15$abb$1@cyprus.atlantic.net>

According to Sanjay Vohra <sanjay@cis.ohio-state.edu>:
>i wonder what i am missing,

You're missing enough sample code for anyone to help.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: 25 Jan 1998 19:42:04 -0700
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
To: dan@gulch.demon.co.uk (Dan Sumption)
Subject: cyclic refs (Re: References to parent objects)
Message-Id: <ombtx0yn0k.fsf@tees.cs.ualberta.ca>

In article <34c8da22.2589673@news.demon.co.uk> dan@gulch.demon.co.uk (Dan Sumption) writes:

> as there are no longer any references to the container other than
> the container itself, it can now be safely (and automatically)
> destroyed.

But it won't because its members are referring to it, and perl's
garbage collector does not handle cyclic garbage. It's a based on
simple reference counting, so it has no way of knowing that the only
refs to container are form members that also ought to be destroyed.

So you need to detect when the container goes out of scope, and tell
all its members to stop referring to it. Or simply break the
connection to the members, which will make them garbage and will
eventually destroy the back refs too.


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

Date: Sun, 25 Jan 1998 21:50:25 -0500
From: Ed Finch <efinch@vais.net>
Subject: Re: Decrypting modules for Perl
Message-Id: <34CBF9F1.AE71091B@vais.net>



brian d foy wrote:

> In article <6aequf$800$1@volt.electriciti.com>, "David" <davidu@eciti.com> posted:
>
> >I have written a perl script that takes input, incrypts it via 'crypt,' and
> >then stores it in a file.  I need to be able to decrypt this file when it is
> >needed, the 'crypt' function does not allow me to do this.  I am in search
> >of existing code(preferably in OOP, but normal perl is fine) that will be
> >able to sufficiently encrypt code, and the be able to decrypt with the
> >correct salt.  DES encryption strength is sufficient.  as is RSA, MD5, or
> >any other 'standard.'  If the code uses a custom algorithem, I must have the
> >right to change the algorithem.
>
> CPAN [1] is your friend.
>

"man crypt" would also have indicated that reversing the encryption is not possible,
except by brute force.

Ed



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

Date: Mon, 26 Jan 1998 01:28:16 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: help: open an existing page and replace parts of it
Message-Id: <6agov6$aik$1@cyprus.atlantic.net>

According to "Ilia Lobsanov" <ilia@detoronics.net>:
>Hello, I'm a beginner in Perl, and was wondering if there is an easy way to
>open an existing html page, replace specific parts of it, and return the new
>page to client.

You need:
  1. To learn about the s/// operator;
  2. To go immediately to comp.infosystems.www.authoring.cgi.

-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Mon, 26 Jan 1998 01:06:37 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: how to do formfeed/pagebreak
Message-Id: <6agnmj$ae3$1@cyprus.atlantic.net>
Keywords: from just another new york perl hacker

According to comdog@computerdog.com (brian d foy):
>doesn't Perl do the translation of \f to whatever the local
>representation of a form feed is?

Perl at present works only with ASCII, and ASCII only has exactly one
character that can be the form feed (decimal 12).  Any environment that
uses ASCII that doesn't think that 12 is the form feed is broken.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Sun, 25 Jan 1998 17:42:34 -0800
From: Steve Brooks <bbank@viser.net>
Subject: html user needing perl?
Message-Id: <34CBEA09.F9791AD9@viser.net>

To Group,
I've been administration under html code and I'd like to know if I need
a domain?  I'm reading a book called programing in perl and I'm starting
to comprehend a small %.  Where would I nest my files? #user/perl/my
files.  On my domain, on my service provider?  Please help me to
understand perl better.  I need perl for database management.

--

Brooks Works Ink.
Steve Brooks
bbank@viser.net




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

Date: Mon, 26 Jan 1998 01:08:19 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: I/O to a tty
Message-Id: <6agnpp$aen$1@cyprus.atlantic.net>

According to "Tino W. Dai" <oberoc@hex.net>:
>(startup scripts). My question how to get it to write and this read from
>a specify tty, lets say the last one that was accessed according to the
>who command. Thanks in advance.

(1) This isn't a Perl problem.
(2) This is probably impossible anyway, because your program
    will compete for input with whatever program the user is
    running.

>PS: Please respond by email, I don't read this group too often. Thanks
>oberoc@hex.net

Oh well, I guess you won't see this.

-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Sun, 25 Jan 1998 18:55:55 -0600
From: Bryan Ingram <zeropage@computek.net>
Subject: IIS/NT 4.0 and PERL5, got it to work!
Message-Id: <34CBDF1B.E7598ADF@computek.net>

Hello everyone,

Despite the fact that not a single person responded with any words of
wisdom to my earlier query as to possible reasons why my perl
implementation was not working, I did manage to get the situation
resolved!

Basically, though I found this no where in the documentation for Perl
Win32, when you are setting up the Registry
HKEY_LOCAL_MACHINE......scriptmap ... you must include a "%s %s" to the
end of your command line.  For instance.

 .pl: c:\perl\bin\perl.exe %s %s

If this is indeed in the documentation, it was not readily apparent.

Hope this might help someone ..

Bryan Ingram




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

Date: Mon, 26 Jan 1998 11:42:28 +1100
From: Jason Bainbridge <coolj@zip.com.au>
Subject: Re: Interfacing a database through a perl script???
Message-Id: <34CBDBF4.1F65D3FB@zip.com.au>



Tom Phoenix wrote:

> Perl comes with several modules which can implement databases, and there
> are others available on CPAN. Check out the AnyDBM_File module to get
> started. Hope this helps!
>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/

  Thankyou, I will check this out.

Jason Bainbridge



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

Date: Mon, 26 Jan 1998 02:46:51 GMT
From: malloy@concentric.net (Sean Malloy)
Subject: Re: Is Perl cron-able?
Message-Id: <34ccf886.600717747@news.concentric.net>

chip@mail.atlantic.net (Chip Salzenberg) wrote:
>According to "jgaff" <jgaff@_no_spam_technologist.com>:
>>Does Perl have special problems or considerations when running as a cron
>>job?
>
>Nope.  Perhaps your Perl program is depending on some aspect of the
>environment that isn't available from cron.  Or perhaps you're running
>"perl scriptname" from cron, and perl isn't in cron's minimal PATH.

That's the most likely problem; I have a set of cron jobs that run
Perl programs to generate new access reports for the website I
administer; they run daily and weekly, and have been running for
months without a hitch. But if you don't have any special environment
factors, making the Perl program file executable and making sure that
the first line of the program is

    #!/your/path/to/perl

(wherever you keep the Perl interpreter, such as /usr/local/bin/perl),
and you shouldn't have a problem.

-- 
Sean R. Malloy               | American Non Sequitur
    Naval Medical Center     |       Society
    San Diego, CA 92134-5000 |
malloy@cris.com              | "We may not make sense,
srmalloy@snd10.med.navy.mil  |  but we do like pizza"
FORMAL NOTICE: unsolicited commercial email will be read
at a charge of $500 per item. Receipt of such email shall
be considered to constitute acceptance of contract, and 
will be billed immediately.


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

Date: Mon, 26 Jan 1998 02:12:11 +0100
From: Patrick Clauberg <pat@nef.wh.uni-dortmund.de>
Subject: MsqlPerl says Server not running
Message-Id: <34CBE2EB.12F3@nef.wh.uni-dortmund.de>

Hi,

I just installed the MsqlPerl-1.11 on a server, where the msql-1.16 is
running

README tells me to run a 
make test 
to check out if everything is fine.

from the test thing I get the error message, that my server is not
running, but in fact it is, since I can get access to the databases
with  the msql program

So, I did not care about the error and made a
make install
which seemed to work out fine, but my perl scripts can't get a
connection as well.

the database is running on the default port
and I have no clue how to get the perl stuff going

Help!

Thanx

Patrick


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

Date: 26 Jan 1998 02:03:37 GMT
From: atbrown@halcyon.com (Andrew Brown)
Subject: Perl module documentation format?
Message-Id: <6agqtp$137$1@brokaw.wa.com>

Most Perl modules include documentation at the beginning of the file,
such as:

   =head1 DESCRIPTION
   Blah blah blah, lots of other =head1's deleted.
   =cut

Could someone point me toward a description of the syntax for this 
documentation format?  I notice tags like C<>, E<>, and F<>... I'd like
a full description of this format, if possible.

Thanks,
Andrew

// ----------------------------------------------------------------------
// andrew todd brown           "obfuscated e-mail addresses hurt usenet!"
// mailto:andrewbrown@acm.org
// ----------------------------------------------------------------------



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

Date: 25 Jan 1998 20:02:25 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Perl module documentation format?
Message-Id: <6aguc1$j0g@flatland.dimensional.com>

atbrown@halcyon.com (Andrew Brown) writes:

> Most Perl modules include documentation at the beginning of the file,
> such as:
>
>    =head1 DESCRIPTION
>    Blah blah blah, lots of other =head1's deleted.
>    =cut
>
> Could someone point me toward a description of the syntax for this 
> documentation format?  I notice tags like C<>, E<>, and F<>... I'd like
> a full description of this format, if possible.

That's Perl's "plain old documentation" (POD) format.  See the
perlpod manual page on your system or at:

    http://www.perl.com/CPAN/doc/manual/html/pod/perlpod.html

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: 26 Jan 1998 01:31:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Source Obfuscator
Message-Id: <6agp23$cg9$5@client3.news.psi.net>

Nick (nmarino@home.com) wrote on 1608 September 1993 in
<URL: news:6afrev$ies$1@ha2.rdc1.pa.home.com>:
++ There are utilities available which make C source code unreadable, yet
++ compilable. The purpose is to distribute source code for recompilation, but
++ without revealing trade secrets etc.
++ 
++ These type of source code filters are called sometimes called Shrouds or
++ Obfuscators.
++ 
++ Does anything like that exist for Perl?


It's called 'rm'.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Sun, 25 Jan 1998 22:35:51 -0500
From: "B. K. Oxley (binkley)" <binkley@bigfoot.com>
Subject: Re: Perl Source Obfuscator
Message-Id: <6ah0an$1vi$1@ndnws01.ne.highway1.com>

Take a look at the Filter modules

--binkley

brian d foy wrote in message ...
>>There are utilities available which make C source code unreadable, yet
>>compilable. The purpose is to distribute source code for recompilation,
but
>>without revealing trade secrets etc.





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

Date: 25 Jan 1998 20:35:05 -0000
From: jono@nospam.nowhere.noorg (Jonathan Nicholson)
Subject: Re: Problems with DBFile
Message-Id: <6ag7lp$uo6$1@acme.demon.co.uk>

I did try to reply to this via email, but it bounced....

Since I wrote this I've made a few changes to the code, that seem to have
fixed the symptoms, but I don't understand quite why, I've changed the way
the data is packed from strings, from using null padding to using space
padding. 

----

Here's the extra information:-

At the moment I've taken steps to ensure that there is only one access to
the database at a time (by not running multiple instances of the program)
the locking proceedures I've been using are as follows (these do not work
currently due to an unrelated Digital Problem)

On opening the DB I clone the file handle as follows:-


$outputdb = tie(%datatie, "DB_File", $MASTER_DB, O_RDWR|O_CREAT, 
			0640,  $DB_HASH) 
		|| die "Failed to open file $MASTER_DB for write : $!\n";
$fd = $outputdb->fd;
open(FH, "+<&=$fd") || die "FAILED: fdopen $!\n";

Then whenever I use the database I call a subroutine:-

	&dolock(&F_RDLCK);
	%thisproj = &dounpack($datatie{$instance});
	&dolock(&F_UNLCK);

where dolock is defined:-


sub dolock {
	local ($mode) = @_;
	local ($flock);
	$flock = pack('iilli', $mode, 0, 0, 0, $$);
	fcntl(FH, &F_SETLKW, $flock);
}

Not pretty, but it works.

The code that exhibits the problems with creating keys follows. It's
not very well commented! The dopack routine that is commented out is
included from the Sinbad::Sinbad module.


#!/usr/local/bin/perl
$|=1;
use lib '/nfs/sinbad/lib';
use Sinbad::Sinbad;
use Fcntl;
use DB_File;

$DBGEN = "/nfs/sinbad/database/nearline.db";

print "Database to create/update : [$DBGEN] ";
$DBGEN2 = <STDIN>;
chop $DBGEN2;
$DBGEN = $DBGEN2 if $DBGEN2;

if (-f $DBGEN) {
	for(;;) {
		print "Database exists [O]verwrite or [A]ppend? ";
		$answer = <STDIN>;
		if($answer =~ /^o/i) {
			unlink $DBGEN;
			last;
		}
		elsif($answer =~ /^a/i) {
			last;
		}
	}
}
#else {
#	open(T, ">$DBGEN");
#	close T;
#}

$outputdb = tie(%master, "DB_File", $DBGEN, O_RDWR|O_CREAT, 0640, $DB_HASH) || die "Failed to open file $MASTER_DB for write : $!\n";

while($file = shift) {
	undef $data;
	open(FILE, $file) || warn "Cannot open $file : $!\n" | next;
	print "Running $file\n";
	$KEY = <FILE>;
	if($KEY !~ /^KEY:(.+)/) {
		print "No key in $file! Skipped\n";
		next;
	}	
	$key = $1;
	next if $master{$key};
	print "Updating $key\n";
	while(<FILE>) {
		chop;
		foreach $magic ('name', 'tcode', 'timest', 'location', 'uid', 'gid', 'projid', 'stakid',
				 	  'size_h', 'size', 'offline', 'resa', 'online', 'resb', 
				 	  'hist1', 'hist2', 'hist3', 'hist4', 'hist5') {
			if(/$magic\s+(.+)/) {
				$data{$magic} = $1;
				last;
			}
		}
	}
	close FILE;
	print "Packing...\n";
	my $Tvar = &dopack(%data);
	print "Returned\n";
	$master{$key} = $Tvar;
	print "Done\n";
}	
$outputdb->sync();			
untie %master;
undef $outputdb;
	
#sub dopack {
#	local (%datalist) = @_;															# Get the current data list. 
#	undef @data;																	# reset the data array
#	print "Running\n";
#	foreach $key ('name', 'tcode', 'timest', 'location', 'uid', 'gid', 'projid', 'stakid',
#			 	  'size_h', 'size', 'offline', 'resa', 'online', 'resb', 'hist1', 'hist2', 'hist3', 'hist4', 'hist5') {
#		print "pushing $key\n";
#		push @data, $datalist{$key};												# strip out the keys from the associative array
#	}
#	my $tmpvar = pack 'a32 I a14 a256 I I I I L L a14 I a14 I A32 A32 A32 A32 A32', @data; 
#	print "Packed...\n";
#	return $tmpvar;
#}


The version information is as follows:-

Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
  Platform:
    osname=dec_osf, osvers=4.0, archname=alpha-dec_osf
    uname='osf1 byron v4.0 564 alpha '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio= d_sfio=
  Compiler:
    cc='cc', optimize='-O4', gccversion=
    cppflags='-std -D_INTRINSICS -D__LANGUAGE_C__'
    ccflags ='-std -D_INTRINSICS -D__LANGUAGE_C__'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/shlib /shlib /lib /usr/lib /usr/ccs/lib
    libs=-ldbm -ldb -lm
    libc=/usr/shlib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
    cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O4 -msym -s
-L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under dec_osf
  Compiled at Jul 18 1997 16:19:20
  @INC:
    /usr/local/lib/perl5/alpha-dec_osf/5.00401
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/alpha-dec_osf
    /usr/local/lib/perl5/site_perl
    .

DB_File is version 1.14

As the the version of the Berkley DB I can only guess, it was installed
with the operating system and no documentation is with it... The
include file (db.h) has a verion 8.7 at the top, which is the only version
number I can find... I don't know whether that is a Digital revision or
not

Many thanks for taking the time to reply,


Jonathan

| Jonathan Nicholson (jono at acme dot demon dot co dot uk)  0973 199 983   |
| The great thing about television is that if anything happens, anywhere    |
| in the world, night or day, you can always change the channel             |


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

Date: 25 Jan 1998 19:43:48 -0700
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
Subject: Re: References to parent objects
Message-Id: <om90s4ymxn.fsf@tees.cs.ualberta.ca>

In article <34C89C7A.464F@min.net> John Porter <jdporter@min.net> writes:

> you will have circular references, which means objects might
> live longer than you expect.
Like, forever.


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

Date: 26 Jan 1998 03:05:46 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Survival Of perl
Message-Id: <6aguia$d7l$1@client3.news.psi.net>

Randal Schwartz (merlyn@stonehenge.com) wrote on 1608 September 1993 in
<URL: news:8ck9bo5mnn.fsf@gadget.cscaper.com>:
++ >>>>> "Abigail" == Abigail  <abigail@fnx.com> writes:
++ 
++ Abigail> Perl was announced in the last weeks of 1987, a mere 2 years
++ Abigail> before the WWW was born.
++ 
++ 
++ Abigail>   With a background of system design in real-time
++ Abigail>   communications and text processing software development, in
++ Abigail>   1989 he [Tim Berners-Lee] invented the World Wide Web, an
++ Abigail>   internet-based hypermedia initiative for global information
++ Abigail>   sharing. while working at CERN, the European Particle
++ Abigail>   Physics Laboratory.
++ 
++ Abigail>   [http://www.w3.org/People/Berners-Lee/]
++ 
++ 
++ Abigail> Next time, please say "Perl has been around just 2 years
++ Abigail> longer than the web".
++ 
++ Quick.  Tell me what *browser* you used in 1989.  Or what day it
++ was the first time you typed "http.. something".

I used browsers 2 years before I used perl. If we go by *my* experience,
then the web is older than perl.

++ I bet it wasn't 1989.  The web *did not exist* for anyone outside of
++ CERN or NCSA until Mosaic was released publicly, which to my
++ recollection was sometime in mid 1993. In contrast, Perl *was*

Januari 1993.

++ released on comp.sources.unix in 1987.  Some six years before Mosaic.

Rubbish. The sources for "WWW software" were released in alt.hypertext
in the first half of 1991. [1]  And AFAIK, Cerns linemode browser
was available by telnetting to a certain port at Cern. Mosaic wasn't
the first browser. It wasn't even the first browser with graphics.
ViolaWWW and Midas (with the ICON element) did graphics before Mosaic did.

So, if you want to take the "release of the sources" (not that there
are "the sources" for the Web, as it is more of a protocol and an
idea than a piece of software) as the beginning date, the difference
is about 3.5 years. Not 6.


[1] ``Interview Tim Berners-Lee. On Simplicity, Standards, and
     "Intercreativity"''. In "World Wide Web Journal", O'Reilly.
     Vol 1, Issue 3, pp 3 - 10.



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: 26 Jan 1998 02:06:09 GMT
From: thospel@mail.dma.be (Ton Hospel)
Subject: Re: Temporary or Internal Files or Dummy Filehandles
Message-Id: <6agr2h$cuq$1@post.lunix.org>

In article <rc0230-1501981841060001@mac-stash.sps.mot.com>,
	rc0230@email.mot.com (David Stashower) writes:
> I need to create either a temporary or, better yet, an "internal" file in
> perl. What I mean is, I want to associate a filehandle directly with an
> array (list), without having to actually create a file, such that other
> operations can read from the filehandle as if it were a file. 
> 
> I have a variety of routines that read sequentially from an open
> filehandle, and I have a separate routine to find / verify / open the
> file. For other reasons, I need this "file open" routine to sometimes read
> through & process the file first, thus the data is loaded into an array.
> How can I pass this array to the other routines, so that it appears to be
> a filehandle ?  
> 
> I do not want to re-write all the code to use an array instead of a
> filehandle. Besides, in many cases I do not want to have to load the files
> into memory (too big, and requires more than one read-pass). Basically I
> need some sort of fake or "dummy" filehandle creator, that treats an array
> like its a file.
> 
> Worst case: I could write to a temporary file and re-open it; but even
> then I need some way of denoting this as a file that should be "deleted
> upon closure". I.e. I'd need something similar to good old FORTRAN's
> "SCRATCH" file (sorry, I said the F-word). But this would be really
> inefficient, and should be avoided.
> 
> Any Ideas ?
> 
> Thanks,
> David

One way to do it would be to fake things a bit with tie-ing filehandles.
Example code to get you started:

(the only reason I put it under IO::Memory is in case you want to
 play with the IO::Handle methods to make things more consistent.
 (it would definitely be cleaner to have a seperate class for the tied 
 data structure, but like this it LOOKS like one package) You could
 ignore that stuff. The real meat is the tie method, see perldoc perltie)
-------------------A file IO/Memory.pm--------------------------------
package IO::Memory;

$VERSION	= 0.00;

use Exporter();
use IO::Handle;
use Carp;

@ISA = qw(IO::Handle Exporter);

# Quick and dirty code. The tied data should get it's own package
sub TIEHANDLE {
    my ($class, @data) = @_;

    bless { "line" => 0,
            "data" => \@data}, $class;
}

sub READLINE {
    my $d = shift;
    my $line  = $d->{"line"};
    my $lines = $d->{"data"};

    if (wantarray) {
        return @{$lines}[$line..$#{$lines}];
    } else {
        return undef unless defined($lines = $lines->[$line++]);
        $d->{"line"} = $line;
        return $lines;
    }
}

sub new {
    @_ >= 1 or croak 'usage: new IO::Memory [Array]';
    my $class = shift;
    my $fh = $class->SUPER::new();
    tie(*$fh, 'IO::Memory', @_);
    return $fh;
}

1;
----------------------------------------------------------------------

An example of use:
----------------------------------------------------------------------
#! /usr/bin/perl -wT-
use IO::Memory;

$fh = new IO::Memory("line 1\n", "line 2\n");
while (<$fh>) {
    print "Line is: $_";
}
----------------------------------------------------------------------

The output of which is indeed:
Line is: line 1
Line is: line 2


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

Date: Mon, 26 Jan 1998 01:29:45 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Using Cgi Script to Redirect User By Domain Name? Help!
Message-Id: <6agp1v$ajg$1@cyprus.atlantic.net>

According to harris@pysnet.net (Mark):
>I wonder where can I find a cgi script that can ....

See comp.infosystems.www.authoring.cgi.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Mon, 26 Jan 1998 00:59:03 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Variable scope question/problem
Message-Id: <6agn8d$acl$1@cyprus.atlantic.net>

According to Theo Van Dinter <felicity@dilbert.kluge.net>:
>---------------------
>use strict;
>my($temp);
>sub subr { $temp = 1 }
>---------------------
>
>This works without error on Perl 5.004_03 (and 04).  Is the 'my($temp)' just
>declaring the variable globally which is why I don't have to declare anything
>in the subr routine?

Mostly, if by "global" you mean "visible to all subsequent code in
this file".  See the "perlsub" man page.

>I assumed (incorrectly?) that commands not within a
>subroutine were considered to be in a 'main' function, with it's own scope.

Yes: No.  :-)   Your assumption was incorrect.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: 26 Jan 1998 01:10:45 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: White Hats and Black
Message-Id: <qz$9801251956@qz.little-neck.ny.us>

Posted and mailed.

Tom Christiansen  <tchrist@mox.perl.com> wrote:
> 			White Hats and Black

How many times are you going to post this? I've seen three so far.

 ...

> Now in one bold stroke, Netscape is a contender again, one who has changed
> the stakes and upped the ante in a way that Microsoft dare not follow.

I'd recommend waiting and seeing. The new distribution license for the
browser is pretty blunt about it being free only as long as MSIE is free.
While the press release talks about the "tradition" of the GPL, it does
not state the terms of the license the source will be issued under. So,
while this is a very interesting and dramatic move, I find your presentation
of it all to be grandiloquent and presumptious.

Elijah
------
has seen much speculation and rumoring on the licensing terms



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

Date: Mon, 26 Jan 1998 02:24:37 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: White Hats and Black
Message-Id: <Pine.A41.3.95a.980126021649.104656A-100000@sp057>

On 26 Jan 1998, Eli the Bearded wrote:

> Tom Christiansen  <tchrist@mox.perl.com> wrote:
> > 			White Hats and Black
> 
> How many times are you going to post this? I've seen three so far.

I was also unsettled to see a respected usenaut doing that.

> While the press release talks about the "tradition" of the GPL, it does
> not state the terms of the license the source will be issued under.

That is one aspect of the matter, yes.

I was also somehow reminded of an old British joke from the Cold War
era:

"Let's give all _our_ secrets to the Soviets and let _them_ be five
years behind for a change". 

Well, it's a poor analogy, but maybe there's a hidden message...



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

Date: 26 Jan 1998 02:46:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: White Hats and Black
Message-Id: <6agtel$phs$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, "Alan J. Flavell" <flavell@mail.cern.ch> writes:
:> How many times are you going to post this? I've seen three so far.

I cancelled a mistaken post and reposted.  I should have
used supersede, I guess.  And I didn't care to use a crosspost
to a moderated group I've had trouble getting messages through to.

But I cannot see how anyone could say the freeing of
course as a bad thing.  You're not saying it is, are you?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    X-Windows: Live the nightmare.
	--Jamie Zawinski


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

Date: 26 Jan 1998 03:00:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: White Hats and Black
Message-Id: <6agu93$phs$2@csnews.cs.colorado.edu>

In comp.lang.perl.misc, Eli the Bearded <*@qz.to> writes:
:this is a very interesting and dramatic move, I find your presentation
:of it all to be grandiloquent and presumptious.

I can't believe you're knocking the freeing of software.  Or was it that
you just didn't like my writing style?  Please write something better then.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
"L'extension des privileges des femmes est le principe general de tous
 progres sociaux."
    --Charles Fourier, 1808


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

Date: 26 Jan 1998 03:02:40 GMT
From: felix@crowfix.com (Felix Morley Finch)
Subject: Re: Why does split return undef? - My own followup
Message-Id: <slrn6cnv7h.678.felix@crowfix.com>

Alright, in trying to make a workaround, I discovered it's not split
itself, it's return () that is undef, ie

sub xyz { return (); }

returns undef, not an empty array.  Is this because I am hopelessly
wedded to thinking of them as arrays, when they are really lists, and
it's the same as

sub xyz { return; }

??? Sure doesn't seem *right*.  But maybe I just need to get out of my
fossilized old fashioned obsolete thinking, is that it?   =8-O

-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
            PGP = 91 B3 94 7C E9 E8 76 2D   E1 63 51 AA A0 48 89 2F
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


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

Date: 26 Jan 1998 02:51:08 GMT
From: felix@crowfix.com (Felix Morley Finch)
Subject: Why does split return undef?
Message-Id: <slrn6cnue7.678.felix@crowfix.com>

If I'm blind, shoot me.  If I didn't read the funny manual, shoot me.
But please tell me where I screwed up first :-)

If I split an empty string to an array, it returns an empty array if
inline, but undef if returned from a subroutine.

--- inline (prints "Defined, 0 elements"):

#!/usr/bin/perl -w

@ary = split(/_/, "");
if (defined (@ary)) {
    print "Defined, " . scalar(@ary) . " elements\n";
} else {
    print "Not defined\n";
}

--- subroutine (prints "Undefined"):

#!/usr/bin/perl -w

@ary = &spitme("");
if (defined (@ary)) {
    print "Defined, " . scalar(@ary) . " elements\n";
} else {
    print "Not defined\n";
}

sub spitme {
    my($text) = @_;
    return split(/_/, $text);
}


I feel incredibly ignorant here.  Part of me screams BUG but the rest
screams Larry Wall.  That oughta be enough :-) but I am still baffled.


-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
            PGP = 91 B3 94 7C E9 E8 76 2D   E1 63 51 AA A0 48 89 2F
I've found a solution to Fermat's Last Theorem but I see I've run out of room o


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

Date: Sun, 25 Jan 1998 18:58:13 -0600
From: Bryan Ingram <zeropage@computek.net>
Subject: Why enable CreateProcessWithNewConsole?
Message-Id: <34CBDFA5.1B1D1AEF@computek.net>

Recently while attempting to install ActiveStates latest version of
Perl, I noticed it enabled the registry entry
"CreateProcessWithNewConsole" ..

Under IIS Documention it clearly states that this should only be done
with caution, and that it could have severe repurcussions in terms of
speed ..

So .. is there any good reason why this is being turned on?  I went back
and manually disabled this setting on my system, and everything is still
working fine.

Wondering,
Bryan Ingram
zeropage@computek.net




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

Date: Sun, 25 Jan 1998 21:50:03 -0500
From: John Kotwicki <Webmaster@csa.clpgh.org>
Subject: WIN32 LWP Problem
Message-Id: <6agtku$abu@bgtnsc02.worldnet.att.net>

I have the LWP Module installed on a Win95 machine and whenever I try to 
use it I receive the following compilation error:

	Can't locate /auto/LWP/UserAgent/env_proxy.al in @INC ....

Where do I find this file?  How do I fix this problem?

John Kotwicki


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

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

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