[9671] in Perl-Users-Digest
Perl-Users Digest, Issue: 3265 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 27 14:07:13 1998
Date: Mon, 27 Jul 98 11:00:45 -0700
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, 27 Jul 1998 Volume: 8 Number: 3265
Today's topics:
5.005 released (with maintenance update 01) (Gurusamy Sarathy)
Re: blat blues (Bob Trieger)
DBM access by multiple scripts beaumack@my-dejanews.com
Re: EOF, EOT and END_OF_TEXT error messages (Bob Trieger)
Re: Expanding Pathnames <jdporter@min.net>
File Sizes (Ford)
Re: File Sizes (Bob Trieger)
FTP without Net::FTP module pjgeer@my-dejanews.com
Hash reference? <pearse@mail.shebang.net>
How can I anonymous array ref from split? <jwdavison@lucent.com>
Re: If statement does not compare correctly <jdporter@min.net>
Nead a Redir Script, Please ( Ghost )
Re: NT Sysadmin scripts <stepherd@gusun.georgetown.edu>
Re: perl 5.004_04 - cygwin32: make problems <rurban@sbox.tu-graz.ac.at>
Re: perl as pseudocode <lavoie@zeus.genie.uottawa.ca>
Re: PLEASE HELP: Simple ascii to binary script (John Stanley)
Re: POST from perl? <Tony.Curtis+usenet@vcpc.univie.ac.at>
Problem with file sizes (Ford)
Re: Reacting to 1 of 10 or so possible values.... Need (Andre L.)
Re: Reacting to 1 of 10 or so possible values.... Need <merlyn@stonehenge.com>
Re: Recent Secret Government Experiments Killing People (-)
Re: Recent Secret Government Experiments Killing People <crap.b_carnell.crap@orangenet.co.uk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Jul 1998 00:45:42 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: 5.005 released (with maintenance update 01)
Message-Id: <6pgijm$fs8@srvr1.engin.umich.edu>
The Perl Porters proudly present a shiny new release of Perl, version 5.005.
This is a major release that incorporates all maintenance and development
changes since the last major release, 5.004.
This major release is not to be confused with maintenance releases of 5.004.
A new maintenance release of 5.004 (5.004_05) is in fact in final beta test
stages now and should be released within a few weeks.
WARNING: Version 5.005 is NOT BINARY COMPATIBILE with previous releases.
You will need to recompile all extensions that require a C compiler to build
(i.e. those that contain XSUBs). A brief summary of the more significant
changes is included at the end.
There has been one maintenance update since the time 5.005 was released,
to fix a few platform-specific problems. You can find the 5.005_01
release from any of the Comprehensive Perl Archive Network (CPAN) sites
worldwide. To select from a list of sites, go to:
http://www.perl.com/CPAN
Note the absence of a trailing `/'. The actual file can be found at:
http://www.perl.com/CPAN/authors/id/GSAR/perl5.005_01.tar.gz
Perl builds and runs on a bewildering number of platforms. Virtually all
known and current Unix derivatives are supported, as are VMS, DOS, OS/2,
Windows, QNX, BeOS, and the Amiga. There are also the beginnings
of support for MPE/iX. If you find that your platform is unsupported,
do let us know.
Be sure to read the "INSTALL" document for Unix-like platforms, and the
port-specific "README.xxx" files for others. For brief notes on what has
changed, see "pod/perldelta.pod". More specific logs can be found in the
"Changes" file.
If everything went well, and all the tests passed, "make ok" will mail us
a report of your build configuration. If not, run "make nok" and describe
your problems in detail. Those two make targets run the "perlbug" utility,
located at "utils/perlbug". If "perlbug" cannot determine how to send mail
from your system, you may have to let it save the report to a file, and
mail it to us at <perlbug@perl.com>.
Being the lazy bunch we are, we have gone and written "perlbug" in
Perl, so if you are unable to build Perl at all, we apologize. Please
include the _output_ of the "./myconfig" shell script with a detailed
summary of what went wrong, and send it to <perlbug@perl.com>. If Perl
built fine, but you have been unable to install it, "perlbug" can also be
run as "./perl -Ilib utils/perlbug". The "-h" option will show a short
usage summary.
If after having successfully installed Perl, you find any bugs or
incompatibilities that aren't already mentioned in the documentation,
please use "perlbug" to report the problem.
Once again, be sure to read the "README.xxx", "INSTALL", and
"pod/perldelta.pod" files for important information about this release.
And, in the words of Larry Wall: "Have the appropriate amount of fun."
--The Perl Porters
----------------------------------------------------------------------------
BRIEF SUMMARY OF CHANGES
----------------------------------------------------------------------------
For a more detailed list, see "pod/perldelta.pod" in the source
distribution. Note that this release is NOT BINARY COMPATIBLE with
earlier releases. You'll need to recompile all XS extensions.
+ Several exciting new features. Most of these are experimental. See below.
+ Sources are now ANSI C. A conforming compiler is required to build Perl
and extensions.
+ Perl's global variables now have a "PL_" prefix to minimize collisions with
libraries and applications that may embed Perl.
+ Much revamped regular expression engine.
+ Improved support for multiple interpreters.
+ Vastly improved support for the Win32 platform.
+ Support for more platforms. (BeOS, DOS, MPE/ix.)
+ Several memory leaks have been fixed.
+ More efficient, internal implementation of sort().
+ Tied arrays and handles are now fully supported.
+ Improved malloc().
+ Internals are now more reliable against unforeseen stack reallocs.
+ "EXPR foreach EXPR" syntax is supported.
+ Several more optimizations implemented.
+ Many security fixes.
+ More generous treatment of literal carriage returns in Perl source.
+ Better locale support.
+ Several modules and pragmata have been added. (B, Data::Dumper, Errno,
File::Spec, ExtUtils::Packlist, Fatal, IPC::SysV, attrs, fields, re.)
+ Newer versions of most existing modules.
+ Many additional diagnostics, some withdrawn.
The following features are almost all new, and are considered experimental.
Their implementation and interface are subject to change in future versions.
+ OS-level perl threads.
+ A suite of compiler modules with various backends, for producing C or
bytecode from Perl, and for various useful diagnostics.
+ C++ Perl Object abstraction supported on Win32.
+ Precompiled regular expressions.
+ Pseudo-hashes (manipulate arrays using hash syntax).
+ Enhanced 64-bit support.
+ Reliable signals, when threading is enabled.
+ Extended support for exception handling.
+ EGCS/GCC compilers are now supported on Win32.
----------------------------------------------------------------------------
TESTED PLATFORMS
----------------------------------------------------------------------------
This release is known to build and pass all tests (with some noted
exceptions) on the following platforms:
ARCHNAME OSVER CC REMARKS
------------------------------------------------------------------------
alpha-dec_osf 4.0 cc
alpha-dec_osf-threa 4.0 cc
aix 4.1.4.0 cc
aix 4.1.5.0 cc
dos-djgpp DOS gcc 2.8.1 posix.t#4 fails
IP22-irix 5 cc
IP22-irix 6.2 cc -n32
IP22-irix 6.2 cc -n32 -mips3
IP27-irix 6.4 cc -n32
IP28-irix 6.2 cc -n32
IP32-irix 6.3 gcc 2.8.1
i386-bsdos 3.1 shlicc2 2.7.2.1
i386-bsdos-thread 3.1 shlicc2 2.7.2.1
i386-freebsd 2.2.6 gcc 2.7.2.1
i386-svr4,unixware 7.0.0 cc
i386-svr4,unixware 2.1.2 cc
i386-svr4,unixware 2.1 cc
i586-linux 2.0.33 gcc 2.7.2
i686-linux 2.0.34 gcc 2.7.2.1 shared libperl
i686-linux 2.0.32 gcc 2.8.1
i686-linux 2.0.34 gcc 2.7.2.3
i686-linux-thread 2.0.32 gcc 2.8.1
i686-linux-thread 2.0.34 gcc 2.7.2.3
i686-linux-thread 2.1.110 egcs 1.0.2
i86pc-solaris 2.7 cc
i86pc-solaris 2.6 gcc 2.7.2.3.f.1
i86pc-solaris-threa 2.6 gcc 2.7.2.3.f.1
MSWin32-x86 NT4.0 Visual C 5.0 posix.t#2 fails sometimes
MSWin32-x86-thread NT4.0 Visual C 5.0 posix.t#2 fails sometimes
MSWin32-x86-object NT4.0 Visual C 5.0 posix.t#2 fails sometimes
MSWin32-x86 NT4.0 Borland C 5.02
MSWin32-x86-thread NT4.0 Borland C 5.02
MSWin32-x86-object NT4.0 Borland C 5.02
MSWin32-x86 NT4.0 egcs 1.0.2 posix.t#2 fails sometimes
MSWin32-x86-thread NT4.0 egcs 1.0.2 posix.t#2 fails sometimes
ppc-linux 2.1.24 egcs 1.0.3
ppc-linux-thread 2.1.24 egcs 1.0.3
powerpc-machten 4.1 gcc 2.7.2.2
PA-RISC1.1 10.20 cc
PA-RISC2.0 11.00 cc
sparc-linux-thread 2.0.33 egcs 1.0.2 shared libperl
sun4-solaris 2.6 cc
sun4-solaris 2.6 gcc 2.7.2.3
sun4-solaris-thread 2.6 gcc 2.8.0
sun4-solaris-thread 2.6 cc
sun4-solaris-thread 2.6 gcc 2.7.2.3
sun4-solaris 2.5.1 cc
sun4-solaris 2.5.1 gcc 2.8.1
sun4-solaris-thread 2.5.1 cc
sun4-solaris-thread 2.5.1 gcc 2.7.2.2
sun4-solaris-thread 2.5.1 gcc 2.8.1
sun4-solaris 2.4 cc
sun4-solaris 2.4 gcc 2.7.2
sun4-solaris 2.3 cc
sun4-sunos 4.1.4 egcs 1.0.3
sun4-sunos 4.1.3u1 gcc 2.8.0
sun4-sunos 4.1.1 gcc 2.7.2
VMS_AXP V7.1 CC/DECC
VMS_AXP-thread V7.1 CC/DECC
VMS_AXP V6.2 CC/DECC
x86-qnx 424 cc
------------------------------
Date: Mon, 27 Jul 1998 16:28:07 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: blat blues
Message-Id: <6pi9vm$i13$1@strato.ultra.net>
[ posted and mailed ]
"Neal Miyake" <sponge@iav.com> wrote:
-> Hi,
->
-> Been porting over some unix perl scripts to NT4 Servers running Exchange
-> 5.5, IIS4 and Perl for Win32. Am trying to send mail via command line, and
-> was told to try blat.
If you are looking for an alternative way to send e-mail via perl, try the
Net::SMTP module. It is well documented and quite simple to use.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Mon, 27 Jul 1998 17:17:50 GMT
From: beaumack@my-dejanews.com
Subject: DBM access by multiple scripts
Message-Id: <6picnu$v1s$1@nnrp1.dejanews.com>
I am writing a series of scripts that rely on DBM files to store data. There
may be times when two users, using two seperate scripts, will be accessing the
same DBM simultaneously. It is important that the data in the DBM files does
not become corrupted, but with the chance taht two people many be modifying a
DBM file at the same time, I became worried about this.
Is it OK to have a DBM file in use by several people simultaneously? If not,
how do you lock out others from using the DBM file at the same time? Is
there a better way to simply store data that needs to be accessed fairly
quickly (faster than reading in a text file into arrays, then rewriting the
text file after modificaitons have been made) ?
Thanks for your help,
Beau Mack
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 27 Jul 1998 16:39:50 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: EOF, EOT and END_OF_TEXT error messages
Message-Id: <6piall$i13$2@strato.ultra.net>
[ posted and mailed ]
jbonzo@home.com wrote:
-> I'm trying to implement a new postcard script I downloaded from the web.
-> Everything is working fine except I get the following messages. Can anyone
-> help?
Yes, the guy/gal that wrote the script can probably help.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Mon, 27 Jul 1998 16:08:28 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Expanding Pathnames
Message-Id: <35BCA773.AA5@min.net>
In <6pi7bk$st8$2@client3.news.psi.net> abigail@fnx.com (Haijo Schipper)
wrote:
>
> Patrick W. O'Neill (oneill@capsl.udel.edu) wrote on MDCCXCI September
> MCMXCIII in <URL: news:35BC9529.C6FBDF13@capsl.udel.edu>:
> ++ a location of a file and return the full pathname?
>
> Is there any reason "glob" doesn't do what you want?
Yes, there's a very good reason:
It's not what glob is meant to do.
--
John Porter
------------------------------
Date: Mon, 27 Jul 1998 15:37:18 GMT
From: fordprefect@bigfoot.spamthis.com (Ford)
Subject: File Sizes
Message-Id: <35bc9d83.595697207@news.charm.net>
Hey gang,
Hopefully this is a quick one. I've been trying to get the
size of several files for some logging purposes. I've been using
something along the lines of:
$size = -s $filename;
This works when the files are in the same directory but when I try to
give it a path to the file it comes up blank. I know that it's dying
because of me trying to include the path. Any ideas?
Ford
Please excuse the munged address. I'm trying for a spam free diet.
If you wish to email me please remove "spamthis" from the address
above. Thanks.
------------------------------
Date: Mon, 27 Jul 1998 16:51:30 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: File Sizes
Message-Id: <6pibbf$i13$3@strato.ultra.net>
fordprefect@bigfoot.spamthis.com wrote:
-> Hey gang,
->
-> Hopefully this is a quick one. I've been trying to get the
-> size of several files for some logging purposes. I've been using
-> something along the lines of:
->
-> $size = -s $filename;
->
-> This works when the files are in the same directory but when I try to
-> give it a path to the file it comes up blank. I know that it's dying
-> because of me trying to include the path. Any ideas?
Works fine for me either way. Perhaps posting a short snippet of the code
that is not working will help.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972
Ext: 1949 and let the jerk that answers know
that his toll free number was sent as spam. "
------------------------------
Date: Mon, 27 Jul 1998 16:57:24 GMT
From: pjgeer@my-dejanews.com
Subject: FTP without Net::FTP module
Message-Id: <6pibhl$tb7$1@nnrp1.dejanews.com>
I have to write a script to execute ftp commands on a remote site. For
annoying boorocratic reasons I cant use the handy Net::FTP module. Anyone
have such a script lying around? If you do, please post or email
pjgeer@hotmail.com. Thanks, Phil
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 27 Jul 1998 17:33:28 +0000
From: Robert Eric Pearse <pearse@mail.shebang.net>
Subject: Hash reference?
Message-Id: <35BCB9E8.23626EA2@mail.shebang.net>
Anybody know of a simple, easy-to-follow,
just-what-you-need-to-get-started web reference on hashes. I'm making
SQL calls to a database and I'm having a hard time walking through the
data that's returned.
Thanks,
Robert
--
__________________________________
Robert Eric Pearse
pearse@mail.shebang.net
------------------------------
Date: 27 Jul 1998 10:54:35 -0500
From: Joe Davison <jwdavison@lucent.com>
Subject: How can I anonymous array ref from split?
Message-Id: <xgor9z78f2c.fsf@nwswd131.ih.lucent.com>
What I want, almost:
my($pstring, %daPerms);
while(<>) {
chomp();
$pstring=$_; # For instance, $pstring="13254";
@aPerm = split "", $pstring;
$daPerms{$pstring} = \@aPerm;
}
I want to build a hashtable with values that are references to arrays of
small integers (permutations), and keys that are the external
representations.
What I wrote doesn't work, because all the values are references to the
single array @aPerm, which gets overwritten each new line.
I tried, among other things:
$daPerms{$pstring} = split("", $pstring);
But, because that's a scalar context, I get the number of characters,
not the array.
$daPerms{$pstring} = \split("", $pstring);
Still a scalar context, so I get a reference to the size.
So, I tried to see if I could create a list context (Although
the book says it can't be done):
$daPerms{$pstring} = \@{split("", $pstring)};
But I get the error message:
"Use of implicit split to @_ is deprecated at ./test.pl line 10."
I don't really understand that error message, but it's clearly not
what I'm looking for.
So, How do I get an anonymous array reference to the array created by
split?
Thanks for a clue...
--
Joe Davison jwdavison@lucent.com
Sure it doesn't work as well as it used to,
but think of all the money we're saving.
------------------------------
Date: Mon, 27 Jul 1998 15:56:09 GMT
From: John Porter <jdporter@min.net>
Subject: Re: If statement does not compare correctly
Message-Id: <35BCA491.33F9@min.net>
Leon, Schmetz wrote:
>
> if ( ( -1609432919 | -2147483648 ) == -1609432919 ) {
> print "\n Matched value";
> }
> else {
> print "\n If statement does not find this equal";
> }
It's because perl assumes that the result of a bitwise
OR is unsigned, so in this case
( -1609432919 | -2147483648 ) produces 2685534377,
which is identical to -1609432919 in its binary
representation. So the upshot is, you better compare
the result of your bitwise ops to unsigned numbers
You can force it on the right-hand side by doing this:
if ( ( -1609432919 | -2147483648 ) == ( -1609432919 | 0 ) ) {
ORing with zero doesn't change the bits, but gives you
an unsigned number you can compare with.
--
John Porter
------------------------------
Date: Mon, 27 Jul 1998 17:16:17 GMT
From: Just@CrazySexyCool.Com ( Ghost )
Subject: Nead a Redir Script, Please
Message-Id: <35bdb5a4.13570833@194.65.22.19>
Hi
I don4t know to program in Perl, so if someone could help me I will
apreciate.
I nead a perl script ( cgi ) to organize my web page.
I would like something that works li this :
I've got a txt file were I can put this information :
struture.txt
-------------------------------------------------
home=http://myserver.com/
links=http://myserver.com/links/
files=http://myserver.com/files/
-------------------------------------------------
and then a script that will work with this tag:
<a href="http://myserver/cgi-bin/redir.cgi?id=home">Home Page</a>
<a href="http://myserver/cgi-bin/redir.cgi?id=links">Links Page</a>
<a href="http://myserver/cgi-bin/redir.cgi=id=files">Files Page</a>
the script will read the txt file and redirect the browser to the
respective page.
If someone put http://myserver/cgi-bin/redir.cgi in the browser, this
will redirect automaticaly to the Home Page ( http://myserver ).
I nead this script to organize the files and for easy link others
pages.
This script is for hide the forlder were I4m going to put some files
too, so I don4t want the real address to apear in the browser when
someone links to the files folder.
I would like, if possible, when someone links to a file, they only see
something like this :
http://myserver/cgi-bin/redir.cgi?id=filename
Can anyone help me ??
Thanks in advance
Ghost
------------------------------
Date: Mon, 27 Jul 1998 13:28:44 -0400
From: Dave Stephens <stepherd@gusun.georgetown.edu>
Subject: Re: NT Sysadmin scripts
Message-Id: <35BCB8CC.95B667ED@gusun.georgetown.edu>
Well, I'm just starting at the whole NT admin Perl automation thing, but
here's
a handy little script I wrote for creating users via a CGI webform.
It's actually much faster than using the UMD (far less mouse clicks)
and it would be easy to modify it to reference a text file that held
constants so you didn't have to enter in the same data (i.e. group,
etc.) over and over. Anyway, here's the source. Feel free to modify it and
use it.
Note that I was unable to make this work w/ IIS and ActiveState perl.
I've been using it on Enterprise w/ Perl v5 build 110 w/ no problem.
Also, the part of the script that sends an e-mail to the newly created
user assumes that you have Jgaa's wsendmail on the server. Go to
http://www.jgaa.com/cgi-bin.htm if you don't have it.
I won't include the html source for the form since you can probably figure
that out yourself, but if you need it drop me a line at
stepherd@gusun.georgetown.edu.
Hope this helps a bit.
--Dave Stephens
#generate header
print "Content-type: text/html\n\n";
# Get Form Information
&parse_form;
&get_date;
chdir ("e:/docs/ntadmin/");
$from = "UAA_Tech_Services";
$server = $in{'server'};
$username = $in{'username'};
$name = $in{'name'};
#assign appropriate drive letter
{
$driveletter = "f:";
}
if ($server eq "vishnu")
{
$driveletter = "g:";
}
#make home directory
mkdir ("$driveletter/users\$/$username", 0777);
#make profiles directory
mkdir ("$driveletter/profiles\$/$username", 0777);
#create user
use Win32::NetAdmin;
# set info for the user.
$userName = $in{'username'};
$password = $username;
$passwordAge = 180;
$privilege = USER_PRIV_USER;
$homeDir = "$driveletter/users\$/$username";
$comment = $in{'comment'};
$flags = UF_SCRIPT;
$scriptpath = 'C:\\';
Win32::NetAdmin::UserCreate('', $userName,
$password,
$passwordAge,
$privilege,
$homeDir,
$comment,
$flags,
$scriptpath) || print "Uh, oh. That username
may already exist. ";
#add the user to the appropriate group
$users = $username;
$groupName = $in{'group'};
use Win32::NetAdmin;
Win32::NetAdmin::LocalGroupAddUsers('',
$groupName,
$users,
) || print "Uh, oh. Can't assign group. Check
to make sure group exists. ";
$email = $in{'email'};
#if no @ sign is present append rest of address
if ($email =~ /\@/)
{ }
else
{
@joiner[0] = $email;
@joiner[1] = "\@uaa.alaska.edu";
$email = join("", @joiner);
}
#if no e-mail address is entered then skip sending the message
if ($email ne "")
{
open(NEWFILE,">email.txt");
#print out e-mail message to send
print NEWFILE "New Account Created";
print NEWFILE "\n\n";
print NEWFILE "To: $name\n";
print NEWFILE "From: $from\n";
print NEWFILE "Subject: New Account\n";
print NEWFILE "Date: ";
print NEWFILE ($date);
print NEWFILE "\n\n";
print NEWFILE "------------------------------------------------------------";
print NEWFILE "\n";
print NEWFILE "Dear $name,\n\n";
print NEWFILE "The account you requested has been created. Please note
carefully\n";
print NEWFILE "the following information:\n";
print NEWFILE " Username: $username\n";
print NEWFILE " Password: $username\n\n";
print NEWFILE "Your password is initially set you your username. You will be
prompted\n";
print NEWFILE "to change it the first time you log on to the system.
Passwords expire\n";
print NEWFILE "and must be changed every 180 days.\n\n";
print NEWFILE "Thanks for your request.\n\n";
print NEWFILE "UAA Tech Services";
#close the file
close (NEWFILE);
#send mail through the mail program
open(MAIL,"|wsendmail.exe -CGI -f($from) -s(Account) $email email.txt");
close (MAIL);
}
#print something on the screen so you don't get the document contains to data
error
print "<HTML>
<HEAD><TITLE>User Created</TITLE>
</HEAD>
<BODY BACKGROUND=\"creampaper.jpg\" BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"
LINK=\"#0000FF\"
VLINK=\"#0000FF\" ALINK=\"#FFFF00\">
<center>
<font size = \"+2\">
User Created</font>
<br><br>
Click <a href = \"index.html\"> HERE </a> to add another
</body></html>";
#un-webify the form data
sub parse_form {
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
else {
unless ($name eq 'body') {
$value =~ s/<([^>]|\n)*>//g;
}
}
$in{$name} = $value;
}
}
#Get Date & Format
sub get_date {
@days =
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
if ($hour < 10) { $hour = "0$hour"; }
if ($min < 10) { $min = "0$min"; }
if ($sec < 10) { $sec = "0$sec"; }
$date = "$days[$wday], $months[$mon] $mday, 19$year at $hour\:$min\:$sec";
}
keydet89@yahoo.com wrote:
> Does anyone know were I can find Perl on Win32 sysadmin
> scripts for maintaining a NT/win95 network?
>
> I have checked ActiveState, but I haven't been able to access
> their forums.
>
> I am particularly interested in controlling services, accessing
> the registry and the EventLog; using NetAdmin, AdminMisc, and NetResource.
>
> Basically, I am looking for examples that I can modify for my own
> sysadmin uses...
>
> Thanks
>
> Carv
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 27 Jul 1998 16:55:38 GMT
From: Reini Urban <rurban@sbox.tu-graz.ac.at>
Subject: Re: perl 5.004_04 - cygwin32: make problems
Message-Id: <35bcafa4.27397595@judy>
Reini Urban <rurban@sbox.tu-graz.ac.at> wrote:
>make with cygnus b19 fails with perl 5.004_04
forget it,
the new perl 5.005 has the compiler included and
compiles with msvc successfully.
even crypt and threads is there now for msvc.
btw:
the latest libdes 4.01 is different to the description in perl5.005
I needed almost all libdes sources in the lib, not only fcrypt.c
makecrypt.bat in win32:
cl.exe -c -nologo -O2 -Gf -G6 -W3 -I..\lib\CORE -I.\include -I. -I..
-DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERLDLL -DPERL_CORE
-DNDEBUG -DMSDOS -DPERL5 fcrypt.c set_key.c des_enc.c ecb_enc.c
lib /OUT:des_fcrypt.lib fcrypt.obj set_key.obj des_enc.obj ecb_enc.obj
Note: I set -DMSDOS and -DPERL5 explicitly.
---
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
-- Bjarne Stroustrup on C++
------------------------------
Date: 27 Jul 1998 11:43:25 -0400
From: Lavoie Philippe <lavoie@zeus.genie.uottawa.ca>
Subject: Re: perl as pseudocode
Message-Id: <y64sw3710i.fsf@yoho.genie.uottawa.ca>
"Adam Atkinson" <ghira@mistral.co.uk> writes:
> I occasionally have to give shortish talks to colleagues in which
> I explain how to do something (e.g. Huffman coding or Monte carlo
> simulation) and as well as explaining the algorithm I will show a program
> in perl which actually DOES the thing in question.
>
> Since my audience will not, generally, know perl, these programs
> need to be working perl programs which look like pseudocode
> rather than elegant/idiomatic perl. Of course, TMTOWTDI, so
> perhaps I can do whatever I like. Also, I'm relatively new to Perl so I
> probably wouldn't usually think of the elegant techniques anyway.
>
To answer your question, since I'm new to perl too and don't really
care about $j != undef.
I'd do the following,
create a pseudo->real perl script (and perl->pseudo script to).
That script will convert some of your pseudo construct to normal perl
constructs. Of course don't show that script to others because they'll
be completely bewildered by what's going on. So for example you could
at first create a list of the variables in your code.
my $i ;
my $entropy ;
my $symbol ;
...
The perl->pseudo script will create a database of the symbols you are
using and will change all references to $var to var. I find it's more
readable for neophyte without the $.
So the followiong code would become
> open(SYMBOLS,$ARGV[0]) || die "Can't find symbol table";
>
> $i=0;
> $entropy=0;
> while (<SYMBOLS>) {
> ($symbol[$i],$prob{$i}) = split(/ /, $_);
> chomp $prob{$i};
# that line change because words are easier to read than the || sign
die "Can't find symbol table" unless open(SYMBOLS,ARGV[0]) ;
i = 0 ;
entropy = 0 ;
while(<SYMBOLS>) {
(symbol[i],prob[i]) = split(' ',$_) ;
}
chomp prob[i] ;
Now from the above some things are still perl-specific. the use of
<SYMBOLS>, the use of $_, the use of (var,var) = (...) and finally
chomp.
So, have the perl->pseudo expand these to something more legible.
<SYMBOLS> : a line in SYMBOLS
split(' ',$_) : seperate $_ at ' '
$_ : current line
chomp : remove trailing new lines characters from
Also, you don't need the ; in pseudo-code.
So the code now becomes
die "Can't find symbol table" unless open(SYMBOLS,ARGV[0]) ;
i = 0
entropy = 0
while(a line in SYMBOLS>) {
(symbol[i] , prob[i]) = seperate the current line at ' '
}
remove the trailing new lines characters from prob[i]
The line inside the while loop is still a bit unreadable to non-perl
programmers. You can probably change it from
(symbol[i] , prob[i]) = seperate the current line at ' '
to
seperate the current line at ' ' then put the result in symbol[i] and prob[i]
The pseudo->perl script could convert back that line with something like
s/^(.*)then put the result in ([\w|[|]|_]?) and ([\w|[|]|_]?)/($2,$3) = $1/gs ;
So the final version is
die "Can't find symbol table" unless open(SYMBOLS,ARGV[0])
i = 0
entropy = 0
while(a line in SYMBOLS>) {
seperate the current line at ' ' then put the result in symbol[i] and prob[i]
}
remove the trailing new lines characters from prob[i]
I hope this is what you were looking for. Have fun with the converting
script and put in on CPAN when it's done ;)
Phil
------------------------------
Date: 27 Jul 1998 17:54:59 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: PLEASE HELP: Simple ascii to binary script
Message-Id: <6pietj$773$1@news.NERO.NET>
In article <6pi575$e2p$1@msunews.cl.msu.edu>,
Dan Nguyen <nguyend7@egr.msu.edu> wrote:
>Dan Nguyen <nguyend7@egr.msu.edu> wrote:
>: I'll be nice and show you the code that will do what I think you sort
>: of want.
>
>Okay. I was rethinking some of the code, and the new way below is
>just slightly better.
I haven't benchmarked it, but I bet my version is faster.
#!/usr/local/bin/perl -w
# a simple script to read ASCII, write binary.
# for every line you take in in ASCII
while(<>) {
# print it right back out, since ASCII is binary.
print;
}
------------------------------
Date: 27 Jul 1998 18:15:48 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: POST from perl?
Message-Id: <7xr9z76zij.fsf@fidelio.vcpc.univie.ac.at>
Re: POST from perl?, Orlando <Frook@mail.dma.be> said:
Orlando> hi, Does anybody know how I can post data from my
Orlando> perl script to a script on an other page?
perldoc LWP
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | personal email:
Stupid! Stupid!" ~ Eros, Plan9 fOS. | tony_curtis32@hotmail.com
------------------------------
Date: Mon, 27 Jul 1998 16:01:55 GMT
From: fordprefect@bigfoot.spamthis.com (Ford)
Subject: Problem with file sizes
Message-Id: <35bda463.597457188@news.charm.net>
Hey gang,
Hopefully this is a quick one. I've been trying to get the
size of several files for some logging purposes. I've been using
something along the lines of:
$size = -s $filename;
This works when the files are in the same directory but when I try to
give it a path to the file it comes up blank. I know that it's dying
because of me trying to include the path. Any ideas?
Ford
Please excuse the munged address. I'm trying for a spam free diet.
If you wish to email me please remove "spamthis" from the address
above. Thanks.
------------------------------
Date: Mon, 27 Jul 1998 12:31:13 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Reacting to 1 of 10 or so possible values.... Need some streamlining help.
Message-Id: <alecler-2707981231130001@dialup-675.hip.cam.org>
Oops! Made a boo-boo. Forgot the semi-colon after each case handler:
CASE:
foreach ($reqType) {
/^typeOne$/ && do {
#...set up environment...
#...execute routine(s)...
last CASE;
};
/^typeTwo$/ && do {
#...set up environment...
#...execute routine(s)...
last CASE;
};
# otherwise:
#... handle any other values here ...
}
Better.
A.L.
========================
In article <alecler-2607981743410001@dialup-804.hip.cam.org>,
alecler@cam.org (Andre L.) wrote:
> You can emulate a Pascal-like case statement:
>
> CASE:
> foreach ($reqType) {
>
> /^typeOne$/ && do {
> ...set up environment...
> ...execute routine(s)...
> last CASE;
> }
>
> /^typeTwo$/ && do {
> ...set up environment...
> ...execute routine(s)...
> last CASE;
> }
>
> # otherwise:
> ... handle any other values here ...
> }
>
> A.L.
------------------------------
Date: Mon, 27 Jul 1998 17:04:34 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Reacting to 1 of 10 or so possible values.... Need some streamlining help.
Message-Id: <8c7m0zi5t2.fsf@gadget.cscaper.com>
>>>>> "John" == John Porter <jdporter@min.net> writes:
John> Maybe this is a little neater:
John> for ( $reqType ) {
John> /^typeOne$/ and &handle_typeOne or
John> /^typeTwo$/ and &handle_typeTwo or
John> &do_default_thing
John> }
And broken if &handle_typeOne returns false.
Don't do this. Broken.
print "Just another Perl hacker,"
--
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@teleport.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: Mon, 27 Jul 1998 16:01:27 GMT
From: root.noharvest.\@not_even\here.com (-)
Subject: Re: Recent Secret Government Experiments Killing People!!!
Message-Id: <35bca10b.119513682@news2.cais.com>
Dave <davidmcg@cqm.co.uk> Said this:
>Hmmm..
>
>That's not all..
>
>How many ppl in the group are willing to believe the fact that the AIDS
>virus was NOT ACCIDENTAL. After reading a txt file recently of a
>supposed interview that took place in America, it was revealed that the
>AIDS virus could either be the result of chemical warfare research gone
>wrong or a attempt at population control by the US Government.
Oh geez.
>
>Personally, I'm more willing to believe the latter. Both government's
>are all back-stabbing bastards and nobody will ever change my opinion on
>that.
>
>Makes you think though, does'nt it. How many more secrets has the
>government kept from us over the years. Why are they so afraid of ppl
>like ourselves, are they afraid we might uncover something we should'nt.
Afraid? Get real. No government is afraid of it's people. Think
about it. "Democracy"? What, like your vote is going to affect the
balance of power? Please. Popular elections and the entire concept
of a democracy is just there to placate us while the government keeps
doing what it does best, which is GOVERN. Big whoopdeedoo.
>
>I think we all might have the idea that all this shit about secret bases
>in Nevada could be rumoured by the government themselves to cover up
>something a bit more sinister.
Please. I live outside D.C., and I hang around with people employed
at NSA, Fema, the Pentagon, and every where else - the government is
definitely not trying to hide anything. If anything, it's trying to
push more and more in your face so you will be so fucking scared: of
crime, of disease, of this, of that, so that you will gladly sit back
and let them make more laws. But to be totally honest, a government is
not an entity in the sense that it can plan in that capacity. A
government is a collection of many disparate agencies, offices, and
"leaderships". To think that a cohesive (and devious) plan would come
from all that is ridiculous. In fact, it might just be the lack of
organization among all the various parts of the government that
creates the appearance of some sinister plot.
The basic idea of a conspiracy stems from a person's need to feel
important. If there's a conspiracy, it helps legitimize their view of
the world revolving around them. Trust me, you mean nothing to the
government, I mean nothing to the government, neither of us means
anything, even to the next guy. Everyone's insignificant, nobody is
the center of the universe. Most of the general public, having never
actually emerged from the dark ages like those of us in the top 2% of
the intellectual class, don't want to accept the fact that they are
inconsequential, insignificant, and most definitely not the primary
focus of at least one government agency. I suppose it makes them feel
"valid" or something.
>
>I am now going to shutup before this posting begins to sound like some
>bad episode of the X-Files...
>
Wouldn't life be great if it happened the way some drug-affected,
low-salaried script writer envisioned it?
------------------------------
Date: 27 Jul 98 17:48:49 GMT
From: "+HCrD f WnRF;" <crap.b_carnell.crap@orangenet.co.uk>
Subject: Re: Recent Secret Government Experiments Killing People!!!
Message-Id: <01bdb984$880cbe00$a3a0dac1@barry>
?????????????More download time!
Me speake englishe!
J. Parera <parera@teleline.es> wrote in article
<6pi7k7$4i6$1@talia.mad.ibernet.es>...
> ?Este grupo no es de habla espaqola?
>
>
>
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3265
**************************************