[6306] in Perl-Users-Digest
Perl-Users Digest, Issue: 928 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 11 17:28:46 1997
Date: Tue, 11 Feb 97 14:00:22 -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 Tue, 11 Feb 1997 Volume: 7 Number: 928
Today's topics:
Re: 'do' and command-line parameters (Joel Earl)
Re: *** NEW WAY TO PROMOTE YOUR WEB YOURSELF *** (Chris Nandor)
Re: 5.003 Sys::Syslog Not Working (Lance A. Brown)
Re: [Q:] whitespace <andy@wonderworks.co.uk>
Can I manipulate with modem from Perl? <itcg@com.latnet.lv>
Code refs not first class? (Jason Brazile)
Copying files in Pel (Niksun)
Re: Copying files in Pel (Nathan V. Patwardhan)
FORK :( <laurent@mars.fer.uni-lj.si>
Re: FORK :( (Nathan V. Patwardhan)
Re: FORK :( (Nathan V. Patwardhan)
Re: FTP Client <santiago@gambito.com>
getprpwent Perl library? (Ishee J A)
Help Variable Interpretation .. <cperi@pcocd2.intel.com>
Re: How to check an environmental variable (Brian L. Matthews)
Re: How to run shell program in perl with --date 'one (Brooks Davis)
Re: How to run shell program in perl with --date 'one (Dave Thomas)
Re: How to run shell program in perl with --date 'one (Greg Haygood)
Re: opendir/readdir/closedir (The next Pele)
Re: Perl For NT Question.... <bmehling@uci.edu>
Re: Perl on Microsoft IIS, NT Server 4.0 <bmehling@uci.edu>
Re: Perl vs Korn Shell (Jerry Whelan)
Problem with -dw & use strict <toml@synnet.com>
Reading Sockets = Bug in Perl's tainting? (Clinton Pierce)
Receive/Send e-mail from Win 95 <itcg@com.latnet.lv>
Re: regexp help <andy@wonderworks.co.uk>
Regexp question... (Jason Costomiris)
SELECT&FORK for NT <laurent@mars.fer.uni-lj.si>
Treating a function return like a file handle? <ragoff@sandia.gov>
use perl module, @INC, and -I <srf@ssih.com>
Re: Using $ENV{'QUERY_STRING'} (Kevin Woodward)
Re: Win32/NT problems with ARGVand .pl association <bmehling@uci.edu>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Feb 1997 18:17:04 GMT
From: earl@shadowfax.rchland.ibm.com (Joel Earl)
Subject: Re: 'do' and command-line parameters
Message-Id: <EARL.97Feb11121704@shadowfax.rchland.ibm.com>
In article <8myaTsa00YUs0n3W00@andrew.cmu.edu> Gautam Srikanth <morpheus+@andrew.cmu.edu> writes:
> I'm trying to execute a perl script from within another, referencing
> it by filename. Normally, saying:
>
> do 'foo.pl';
>
> would work. However, if I try to pass the script command-line
> parameters, like:
>
> do 'foo.pl bar';
>
> nothing happens. Is there any way to pass parameters to another perl
> script without having to resort to system()?
>
Sure, just set up the command line parameters in @ARGV, like the shell would do:
@ARGV = ('bar','-v','whatever');
do 'foo.pl';
--
Joel Earl, earl@vnet.ibm.com
Logic Analysis and Optimization
IBM Rochester, Minnesota
(507) 253-2304
------------------------------
Date: Tue, 11 Feb 1997 13:27:00 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: *** NEW WAY TO PROMOTE YOUR WEB YOURSELF ***
Message-Id: <pudge-ya02408000R1102971327000001@news.idt.net>
Loser, don't waste our bandwidth with this trash. If you are so good at
giving people visibility, how come you have to resort to spamming
newsgroups to get YOURSELF noticed?
#================================================================
Of all the tall tales, I think my favorite is the one about Eli
Whitney and the interchangeable parts.
--Jack Handey
Chris Nandor pudge@pobox.com
PGP Key 1024/B76E72AD http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6
------------------------------
Date: 11 Feb 1997 13:51:40 -0500
From: brown9@niehs.nih.gov (Lance A. Brown)
Subject: Re: 5.003 Sys::Syslog Not Working
Message-Id: <553ev3kwg3.fsf@splat.niehs.nih.gov>
Michael Brennen <mbrennen@fni.com> writes:
> I've seen that the 5.003 Sys::Syslog package is not working on both an
> linux/intel and linux/alpha; I've also seen one other reference to
> this. I could find no reference to this in the posted perl bugs at
> <http://www.perl.com/perl/>. Are there any known fixes or workarounds?
> TIA,
The syslogd shipped with linux is not configured to accept syslog via
sockets by default whichi s what Sys::Syslog wants to do. You need to
add -r to the syslogd command line in the init script to tell syslogd
to open the socket.
--[Lance]
------------------------------
Date: Tue, 11 Feb 1997 20:47:40 +0000
From: Andy Armstrong <andy@wonderworks.co.uk>
Subject: Re: [Q:] whitespace
Message-Id: <4aZEMBAsrNAzEwC9@wndrwrks.demon.co.uk>
In article <32FCF66E.41C6@cs.bham.ac.uk>, Nigel Byrnes
<njb@cs.bham.ac.uk> writes
>hi
>
>I was wondering if anyone here could tell me how to strip out the
>whitespace out of a string like the one below:
>
>$string1 = " floor : {1,2,3,4,5};" or
>$string2 = "reset : 0;"
>
>A property worth noting is that the whitespace occurs before the colon.
>
>Thanks very much
You only want to remove it before the colon? If so you can do
$string1 =~ s/\s+:/:/g;
If you want to remove all spaces just do
$string2 =~ s/\s+//g;
--
http://www.wonderworks.co.uk --> Motion Picture Image Capture System
Andy Armstrong, WonderWorks
------------------------------
Date: Tue, 11 Feb 1997 15:24:44 +0200
From: Girts Kaarklinsh <itcg@com.latnet.lv>
Subject: Can I manipulate with modem from Perl?
Message-Id: <3300731C.DB@com.latnet.lv>
I am just wondering if one can manipulate with modem using perl?
If yes, any examples around?
--
* Girts Kaarklinsh (itcg@com.latnet.lv)
* Telegroup Baltics Ltd.
* Riga, Latvia
* http://www.telegroup.lv
------------------------------
Date: 11 Feb 1997 20:26:25 GMT
From: jason@ampersand.com (Jason Brazile)
Subject: Code refs not first class?
Message-Id: <5dqklh$1mq$1@ftp.ampersand.com>
Keywords: first class, references
Fellow Perl folks,
Hmmm. It seems as if either code references are not really first class
or there is some inconsistent syntax on how to get at it that I am
failing to grasp. I am still relatively new to the language.
Can you tell me how to access an immediate code ref as in the following
code?
Thanks.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#!/usr/bin/perl
use strict;
sub main
{
&{[sub{print "foo\n"}]->[0]}; # immediate array ref
&{{'0' => sub{print "foo\n"}}->{'0'}}; # immediate hash ref
# &{sub {print "foo\n"}}; # syntax error
# &{eval{sub {print "foo\n"}}}; # this doesn't help
do {sub {print "foo\n"}}; # ???
goto sub {print "foo\n"}; # an unlikely winner but only
# inside subroutines
}
&main;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
---
Jason Brazile
Ampersand, Inc
Billerica, MA
------------------------------
Date: Tue, 11 Feb 1997 20:36:08 GMT
From: niksun@lconn.net (Niksun)
Subject: Copying files in Pel
Message-Id: <3300d786.2161211@news.inetw.net>
Is there a way to copy a file in Perl - other than reading a file and
then writing to another like this?:
---
open(FILE,"path/file");
@lines = <FILE>;
close(FILE);
open(FILE,">path/newfile");
foreach $line (@lines) {
print FILE "$line";
}
close(FILE);
---
Ideas anyone?
Niksun
------------------------------
Date: 11 Feb 1997 21:29:14 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Copying files in Pel
Message-Id: <5dqoba$bgi@fridge-nf0.shore.net>
Niksun (niksun@lconn.net) wrote:
: Is there a way to copy a file in Perl - other than reading a file and
: then writing to another like this?:
Of course. :-)
Please pick up some documentation from http://www.perl.com/perl or
Check out the File::Copy module for Perl 5.
--
Nathan V. Patwardhan
nvp@shore.net
"send me mail"
--Jamie Zawinski
------------------------------
Date: Tue, 11 Feb 1997 19:36:46 +0100
From: laurent <laurent@mars.fer.uni-lj.si>
Subject: FORK :(
Message-Id: <3300BC3E.5CAA@mars.fer.uni-lj.si>
Is there any Perl port for Win95 that supports fork and socket
functions?
------------------------------
Date: 11 Feb 1997 19:07:52 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: FORK :(
Message-Id: <5dqg28$2bf@fridge-nf0.shore.net>
laurent (laurent@mars.fer.uni-lj.si) wrote:
: Is there any Perl port for Win95 that supports fork and socket
: functions?
http://www.activeware.com. Get the new version of Perl 5.003_07, which
has decent socket support sockets. I have *no idea* if fork() is currently
supported. I abandoned my version of NT Perl PL110, and am happy with
the new port. Things seem to be coming along.
--
Nathan V. Patwardhan
nvp@shore.net
"send me mail"
--Jamie Zawinski
------------------------------
Date: 11 Feb 1997 19:09:35 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: FORK :(
Message-Id: <5dqg5f$2bf@fridge-nf0.shore.net>
Nathan V. Patwardhan (nvp@shore.net) wrote:
: http://www.activeware.com. Get the new version of Perl 5.003_07, which
: has decent socket support sockets. I have *no idea* if fork() is currently
^^^^^^^^^^^^^^^^^^^^^^
Oooops. Redundancy is so redundant. I meant to say, "which has decent
socket support."
--
Nathan V. Patwardhan
nvp@shore.net
"send me mail"
--Jamie Zawinski
------------------------------
Date: 11 Feb 1997 18:24:31 GMT
From: "Santiago Alvarez Rojo" <santiago@gambito.com>
Subject: Re: FTP Client
Message-Id: <01bc184a$01ceae20$d626b3c2@jimmy.iponet.es>
When transferring text files use the ascii mode and you won't get any
annoying CTRL-M. Usually you have an check-box where you can choose between
ASCII or BINARY.
--
Santiago Alvarez Rojo
santiago@gambito.com
http://www.gambito.com/santiago
-----------------
Tom Christiansen <tchrist@mox.perl.com> wrote in article
<5ddsfg$995$1@csnews.cs.colorado.edu>...
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> max@amagicstore.com writes:
> :Does anybody know any FTP client or other program that transform MS-DOS
> :based text files into UNIX text files (basically without the ^M at the
> :end of each line)??
>
> I've always found the Redhat CDs remarkably effective at this.a
>
> --tom
> --
> Tom Christiansen Perl Consultant, Gamer, Hiker
tchrist@mox.perl.com
>
> "It is easier to port a shell than a shell script."
> --Larry Wall
>
------------------------------
Date: 11 Feb 1997 15:28:26 -0500
From: eq6@ornl.gov (Ishee J A)
Subject: getprpwent Perl library?
Message-Id: <5dqkpa$4qp@stc06.ctd.ornl.gov>
I have been using the getpwent function in various system admin. scripts
with generally good results, but on Digital Unix with enhanced security
enabled, getpwent is unable to extract users' passwords from the password
database file. I notice that DEC includes a C function, getprpwent, to
obtain the password information. Does anyone know of a perl module which
duplicates this function? I haven't had any luck on CPAN or in the various
docs and FAQS. Thanks,
James Ishee
eq6@ornl.gov
Lockheed Martin Energy Systems
------------------------------
Date: Tue, 11 Feb 1997 11:24:22 -0800
From: Charles Peri - EUCD ~ <cperi@pcocd2.intel.com>
Subject: Help Variable Interpretation ..
Message-Id: <3300C766.41C6@pcocd2.intel.com>
I have a problem in a variable interpretation.
I have a file which has the similar contents:
name $NAME
In my perl program,
$NAME is initialized to "My Name"
now when I Parse the datafile and split the lines
to $keyword and $value
$keyword = "name"
$value = "$NAME"
But I want $value to be "My Name" and I don't know
why it is not set that way.
Any Help will be appreciated,
Thanks,
Charles Peri
------------------------------
Date: 11 Feb 1997 19:59:00 GMT
From: blm@coho.halcyon.com (Brian L. Matthews)
Subject: Re: How to check an environmental variable
Message-Id: <5dqj24$gil$1@brokaw.wa.com>
In article <33002A40.5DE4@easics.be>, Bart Willems <bart@easics.be> wrote:
|akench@cvimail.cv.com wrote:
|> Is there a way to check if a environmental variable exists or no.
|if (defined($ENV{'variable'}))
| ^^^^^^^
That will probably be fine for environment variables, but in
general, you want to use exists when all you care about is
existence of an entry with a given key. Read about exists in
perlfunc for more info.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 11 Feb 1997 19:13:53 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: How to run shell program in perl with --date 'one month ago' +%b options
Message-Id: <5dqgdh$k2$1@cinenews.claremont.edu>
Brian Freeze (freezeb@deltastar.nb.ca) wrote:
: Greetings
:
: I am trying to write a small perl script and have run into this problem. I am
: trying to call "/bin/date --date 'one month ago' +%b" into a perl script. I
: assign this to a variable as follows:
:
: $date_exe="/bin/date";
: $date='$date_exe --date '1 month ago' +"%b"';
Since it appears that you only want the month you could use:
$lastmonth =
(Jan,Feb,Mar,Apr,May,Jun,Juil,Aug,Sep,Oct,Nov,Dec)[(localtime)[4]-1];
If you really want to do things with the date command you could use the
following code:
$date_exe = "/usr/local/pkg/sh-utils-1.15/bin/date";
$last_month = `$date_exe --date \'1 month ago\' +\"%b\"`;
chop $last_month;
print "$last_month\n";
The $date_exe I set is a pointer to the latest copy of GNU date on my
system. Unless you are running some sort of free unix or an NT port
/bin/date probably won't except the --date switch. Pay careful attention
to the backticks (`) in the command.
Hope this helps,
Brooks
--
Brooks Davis +------------------------------------------------+
brdavis@hmc.edu | "_Slackware_ [Linux] is the MacOS of UNIXes." |
Harvey Mudd College | -- Richard Garnish |
340 E. Foothill Blvd. | on alt.sysadmin.recovery |
Claremont, CA 91711 +------------------------------------------------+
------------------------------
Date: 11 Feb 1997 19:29:25 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: How to run shell program in perl with --date 'one month ago' +%b options
Message-Id: <slrn5g1hvb.7eu.dave@fast.thomases.com>
On 11 Feb 1997 15:33:18 GMT, Brian Freeze <freezeb@deltastar.nb.ca> wrote:
> Greetings
>
> I am trying to write a small perl script and have run into this problem. I am
> trying to call "/bin/date --date 'one month ago' +%b" into a perl script. I
> assign this to a variable as follows:
>
> $date_exe="/bin/date";
> $date='$date_exe --date '1 month ago' +"%b"';
There are a couple of problems. You use single quotes to delimt the string,
so:
$date='$date_exe --date '1 month ago' +"%b"';
^ ^
start---' -- end
Uh - whats this - a '1'. That's a number, and I was expecting some kind of
operator. Guess I'd better complain....
Secondly, it wouldn't work too well anyway, as $date_exe won't be expended
inside a single quoted string.
An easier way of handling command arguments is to use a list:
$date_exe = "/bin/date";
@date_cmd = ($date_exe, '--date', '1 month ago', '+"%b"');
...
exec @date_cmd
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Tue, 11 Feb 1997 19:52:45 GMT
From: greg@iweb.net (Greg Haygood)
Subject: Re: How to run shell program in perl with --date 'one month ago' +%b options
Message-Id: <3303cc18.527945165@nntp.atlanta.com>
On 11 Feb 1997 15:33:18 GMT, freezeb@deltastar.nb.ca (Brian Freeze)
wrote:
>Greetings
>
>I am trying to write a small perl script and have run into this problem. I am
>trying to call "/bin/date --date 'one month ago' +%b" into a perl script. I
>assign this to a variable as follows:
>
>$date_exe="/bin/date";
>$date='$date_exe --date '1 month ago' +"%b"';
>
>I then use "exec" and "print" to make the calls to the variables. I keep
>getting syntax errors from the $date= variable and can't figure out what
>needs to be escaped in order to allow all the options for the unix date
>command.
>
>
well, another alternative to making the system call (making the code
[more] portable) is to use Sullivan Beck's cool Date::Manip module.
i just found it, and it solved a number of problems i was having with
some date manipulations, including trying to figure out "what days
comprised last week", etc. the module lets you do something simple
like:
use Date::Manip;
my $date = ParseDate("one month ago");
which will give you a string containing the full date/time for
one month ago, and of the base format used by the modules
subroutines. ( for a specific time last month, you could say "one
month ago at 12:45" ).
so you now can say:
my $realdate = UnixDate($date, qw(%b));
will give you the string you're looking for.
check the module docs for all the formatting & manips available.
the module is on CPAN.
hope it helps,
greg
------------------------------
Date: 11 Feb 1997 18:39:43 GMT
From: gt1535b@acmex.gatech.edu (The next Pele)
Subject: Re: opendir/readdir/closedir
Message-Id: <5dqedf$an3@catapult.gatech.edu>
Nathan V. Patwardhan (nvp@shore.net) wrote:
: The next Pele (gt1535b@acmex.gatech.edu) wrote:
: : opendir(DIR, "$rlsdir");
: : @Rlse = readdir(DIR);
: Why aren't you returning errors? I suspect your program can't
: open the directory $rlsdir, and will output an error message
: if you use die() or the subroutine below. :-)
thanks. turns out I had misspelled the variable name :)
: sub output_error {
: my($error_msg) = @_; ### pass in error message
: print("ERROR: $error_msg\n");
: exit;
: }
: opendir(DIR, "$rlsdir") || output_error("$!");
: @Rlse = readdir(DIR);
: closedir(DIR);
: --
: Nathan V. Patwardhan
: nvp@shore.net
: "send me mail"
: --Jamie Zawinski
--
<>< Daryl Bowen <><
Georgia Institute of Technology
Internet: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op
------------------------------
Date: Tue, 11 Feb 1997 10:41:43 -0800
From: Ben Mehling <bmehling@uci.edu>
To: Michelle Feigen <shelle@interaccess.com>
Subject: Re: Perl For NT Question....
Message-Id: <3300BD67.776A@uci.edu>
Michelle Feigen wrote:
>
> Does anyone have information pages on the generalities of working with Perl
> for NT. Not installing...It's AFTER that that I need a little help.
We have just started getting PERL to work in NT as well - Here are the
useful links I have found and amassed just for an easy jump-off point:
http://pulse.gsm.uci.edu/~bmehling/perl
> Sorry...Actually got a customer not using UNIX.
Don't you hate that. Hope this helps out...
Ben
------------------------------
Date: Tue, 11 Feb 1997 10:37:03 -0800
From: Ben Mehling <bmehling@uci.edu>
Subject: Re: Perl on Microsoft IIS, NT Server 4.0
Message-Id: <3300BC4F.1247@uci.edu>
Adam Richards wrote:
> one is using the DLL which is supposed to be faster,
> the other is to use the perl.exe directly.
> I have tried both, and see no performance difference.
To invoke the .dll without having the "Save as..." dialog appear you
need to help perl out. Make sure to print the appropriate headers:
"HTTP/1.0 200 OK\nContent-type: text/html\n\n";
> I prefer to use the perl.exe %s association that was
> recommended to you because it is more reliable and
> give access to the server environmental variables.
We actually use both here... Sometimes we find it easier to use one or
the other (although we have found no performance diffs). Just associate
two different ways:
.pl = perl.exe %s
.pld = perlis.dll
Ben
http://pulse.gsm.uci.edu/~bmehling/perl
------------------------------
Date: 11 Feb 1997 13:31:26 -0600
From: jerryw@convex.com (Jerry Whelan)
Subject: Re: Perl vs Korn Shell
Message-Id: <5dqhee$151@imagine.convex.com>
In article <slrn5fl2vq.3mt.kinge@king.oklahoma.net>,
Ed King <kinge@oklahoma.net> wrote:
-} I'm at the point where I want to write some simple programs for my
-} private use. I bought the Bolsky book entitled "The New Korn Shell" and
-} the author maintains the Korn shell is the greatest thing since sliced
-} bread. I want to know if Korn shell scripting or Perl is more
-} versatile. If I just want to invest time learning one which one should
-} it be and why.
My standard response to anyone asking about using ksh is, "don't!"
I have seen the innards of ksh and it is a huge and ugly beast,
the source is a maze of twisty little passages, all alike. If you
ever encounter a bug in your implementation of ksh, good luck on
getting it fixed, ksh's source is so labyrinthine and misleading,
that anything other than the most trivial change is likely to have
subtle and unexpected side-effects that may not surface for weeks
or months of regular usage.
Perl's source, on the other hand, is far cleaner and much better
documented than ksh's. Plus, you and everyone else on the planet,
have access to it. So if there is a bug you can try to fix it yourself,
and if that fails, there are plenty of perl internals gurus running
around on the net that take a keen interest in keeping perl as bug-free
as possible.
--
------------------------------------------------------------------------------
Jerry Whelan -- Information Superman jerryw@convex.com
------------------------------
Date: Tue, 11 Feb 1997 12:42:34 -0500
From: Tom Lynch <toml@synnet.com>
Subject: Problem with -dw & use strict
Message-Id: <3300AF8A.5BE9@synnet.com>
Greetings:
One of the system admins here has a script which runs
just fine with the "-w" & "use strict;" but when I
add the "-d" for debugging I get:
Stack dump during die enabled outside of evals.
Loading DB routines from perl5db.pl patch level 0.95
Emacs support available.
Enter h or `h h' for help.
Can't use string ("DB::dbwarn") as a subroutine ref while "strict refs"
in use.
Callback called exit.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/Getopt/Long.pm
line 53.
I was the one who build perl5 here at the site so I
have been looking into this one, but not to sure what
to do. Should I rebuild perl. If so what switch do
I set or not set? Here is the "-V" on perl:
Summary of my perl5 (5.0 patchlevel 3 subversion 2) configuration:
Platform:
osname=hpux, osvers=9, archname=PA-RISC1.1
uname='hp-ux bush a.09.05 a 9000735 2002907143 two-user license '
hint=recommended, useposix=true, d_sigaction=define
perlstdio=define sfio=
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include -DDEBUGGING'
ccflags ='-D_HPUX_SOURCE -Aa -I/usr/local/include -DDEBUGGING'
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 /lib/pa1.1 /lib /usr/lib
libs=-lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
libc=/lib/libc.sl, so=sl
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=, ccdlflags='-Wl,-E
-Wl,-B,deferred '
cccdlflags='+z', lddlflags='-b -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING
Built under hpux
Compiled at Oct 24 1996 10:12:09
@INC:
/usr/local/lib/perl5/PA-RISC1.1/5.00302
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/PA-RISC1.1
/usr/local/lib/perl5/site_perl
.
If it would help I can send along the perl script but it's quite
big.
Thanks for any and all help!
Tom
------------------------------
Date: 11 Feb 1997 18:21:33 GMT
From: cpierce1@cp501.fsic.ford.com (Clinton Pierce)
Subject: Reading Sockets = Bug in Perl's tainting?
Message-Id: <5dqdbd$fen5@eccws1.dearborn.ford.com>
I think that the Perl 'tainting' logic needs some work, and
wanted to know what everyone else thinks. What concerns me is that
data read over a socket is considered "clean". For example, take the
following Perl pseudo-code:
...=getprotobyname('tcp');
...=getservbyport($port, 'tcp');
pack($sockaddr,...);
socket(S,...) || die;
bind(S,...) || die;
listen(S,...) || die;
accept(NS,S) || die;
while(<NS>) {
system("$_"); # Evil things here with $_
}
Anything read on the socket filehandle NS is considered clean. Is
that supposed to be? If I run the above code as a set-uid script
and listen on a particulat port, I can make the Perl script do
whatever I want... Is this a bug or a feature? In order to setup
the socket in the first place no "tainted" sources need to be read
(no filesystem names, no streams, etc...) and I think that's why perl
may not recognize NS as being a bit...insecure.
[Yes, I know that "good programming techniques" will recognize $_ as
a tainted piece of data, and not even consider doing the above...but
Perl advertizes to help with this.]
What'cha think?
--
-----------------------------------------------------------------o------
Clinton A. Pierce | "If you rush a Miracle Man | \ / \ /
cpierce1@ford.com | you get rotten miracles." | \ G /
DCI, Inc. on loan to Ford|--Miracle Max, The Princess Bride| / \ / \
-------------------------------------------------------------Freemason--
Geek Code: GCM/GCSd-(++)s+:+a-C++UA++++$UIS+++$UL+++P++++L++E---W++N++w
---Ot++(+++)5+X+R-tv-b+++DI++++G++e+>++h----r+++y+++(--)>y*
http://www.dcicorp.com/~clintp
------------------------------
Date: Tue, 11 Feb 1997 15:35:00 +0200
From: Girts Kaarklinsh <itcg@com.latnet.lv>
Subject: Receive/Send e-mail from Win 95
Message-Id: <33007584.5B26@com.latnet.lv>
I want to write a script which would forward e-mail to alpha-numeric
pager or send a notification when certain URL is accessed. We have an
URL where one can enter the # of pager and enter the text. I have a
permanent connection to our ISP. The thing is that I am runing Win 95,
so I have no ideas how to catch incoming mail.
Also any ideas how to send an e-mail nicely from HTML form.
--
* Girts Kaarklinsh (itcg@com.latnet.lv)
* Telegroup Baltics Ltd.
* Riga, Latvia
* http://www.telegroup.lv
------------------------------
Date: Tue, 11 Feb 1997 19:19:42 +0000
From: Andy Armstrong <andy@wonderworks.co.uk>
Subject: Re: regexp help
Message-Id: <K7xYEDAOZMAzEwXO@wndrwrks.demon.co.uk>
In article <w10sp33i759.fsf@wombat.staff.ichange.com>, nelson <nmljn@wom
bat.staff.ichange.com> writes
>s/[\s,\;]/,/g;
>s/,{2,}/,/g;
That's just
s/[\s,\;]+/,/g;
>I'm sure there are better ways to do it--someone will probably jump in
>offering a one-pass solution, but will probably forget that you said
>"any combination of those". :-)
:-)
--
http://www.wonderworks.co.uk --> Motion Picture Image Capture System
Andy Armstrong, WonderWorks
------------------------------
Date: 11 Feb 1997 19:44:09 GMT
From: jcostom@shaft.sjis.com (Jason Costomiris)
Subject: Regexp question...
Message-Id: <slrn5g1j0f.lls.jcostom@dogbert.sjis.com>
I've been given the wonderful (yeah, sure) task of coming up with a
program that will do some accounting type stuff. Some of the files
are in a priveleged area of the system, so I will use a C wrapper to run the
script setuid to root. Of course, since it will be ordinary support
lusers running it, I want to trap any naughty chars... For ex:
If I did soemthing like:
prog customer.com&&'cp /bin/sh ~/.foo'
prog cust2.com&&'chmod 4755 ~/.foo'
I'd have a bit of trouble...
Suppose I store $ARGV[0] in a var called $domain. I'd need to do something
like:
$domain =~ s/<some regexp here>//;
I'd like to be able to keep the first part (the customer domain), and
potentially account for doing it with a hostname as well (host.domain.com)..
Thoughts?
--
Jason Costomiris | Finger for PGP 2.6.2 Public Key
jcostom@sjis.com | "There is a fine line between idiocy
My employers like me, but not | and genius. We aim to erase that line"
enough to let me speak for them. | --Unknown
http://www.jasons.org/~jcostom
------------------------------
Date: Tue, 11 Feb 1997 20:27:01 +0100
From: laurent <laurent@mars.fer.uni-lj.si>
Subject: SELECT&FORK for NT
Message-Id: <3300C805.2613@mars.fer.uni-lj.si>
fork doesn't work in ActiveWare NT Perl port, ok... But wnat about
select? On (build 110) system it terminates the executable... i.e.
Runtime error... Damn! So there is no way to implement a concurrent
(even one process) client or server in Perl NT? Of course I could have
execed multiple processes, but that is cumbersome :)))
------------------------------
Date: Tue, 11 Feb 1997 14:02:04 -0700
From: "Robert A. Goff" <ragoff@sandia.gov>
Subject: Treating a function return like a file handle?
Message-Id: <3300DE4B.1CFB@sandia.gov>
Is there any way to treat the return of a function the same way as I
would a file handle, specifically reading it a line at a time?
I'm working on a script that pulls configuration out of a large file.
That file may be local or remote, and if it's remote I'm using ftp
(ftplib.pl) to get it. Since it's so large (~50k) I'd rather not read
the whole thing from ftp into a string if I can help it. I'm thinking
I'd like to read the input line by line from the return of ftp'gets()
and close the connection when I have what I need.
I could spool it to a /tmp file. Is there a better way?
--
=================================================
Robert Goff email: ragoff@sandia.gov
Sandia National Labs Phone: (505)284-3639
------------------------------
Date: Tue, 11 Feb 1997 15:10:32 -0500
From: Steve Friedland <srf@ssih.com>
Subject: use perl module, @INC, and -I
Message-Id: <3300D238.3256@ssih.com>
I am having trouble getting perl to find my perl module.
I have created a simple perl module (SRF.pm) located in the directory
/users/srf/modules. In order for my program located in /users/srf/perl
to run, the perl module must either be in /users/srf/perl, or I must use
the command line option (-I/users/srf/open).
If I remove the "-I/users/srf/open" line from junk.pl below, the
"unshift(@INC,'/users/srf/open');" should prepend my module directory to
the @INC array, and find my module. It doesn't work that way though. If
I comment out the "use SRF;" line so the program will run, printing @INC
shows that "/users/srf/modules" is the first entry! Why can't it find my
module? I am running perl5.003 on OSF1v3.2.
/users/srf/perl/junk.pl:
#!/usr/bin/perl -I/users/srf/modules
unshift(@INC,'/users/srf/modules');
print join("\n", @INC);
use SRF;
test_srf;
################################
/users/srf/modules/SRF.pm:
#!/usr/bin/perl
package SRF;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(test_srf);
#@EXPORT_OK = qw(test_srf);
sub test_srf{
print ("\nThis is a test of the SRF module.\n");
}
--
Steve
srf@ssih.com
--
------------------------------
Date: Tue, 11 Feb 1997 21:33:13 GMT
From: kevin@redsun.com (Kevin Woodward)
Subject: Re: Using $ENV{'QUERY_STRING'}
Message-Id: <3300e478.25559047@news.virgin.net>
On Sun, 9 Feb 1997 17:27:47 -0600, tadmc@flash.net (Tad McClellan)
wrote:
>Kevin Woodward (kevin@redsun.com) wrote:
<snip>
>
>
>Now, I don't know what your _real_ question is. So I'll have to make
>some guesses:
>
>1) to set a _perl_ variable from an _environment_ variable:
>
>$quy = $ENV{'QUERY_STRING'}; # this assumes that QUERY_STRING has
> # been set to something by someone
>
>
>2) to set an _environment_ variable form a _perl_ variable:
>
>$ENV{'QUERY_STRING'} = $quy;
>
>
>3) to parse the URL encoded input to a CGI script:
>
> a) ask about CGI in the CGI newsgroup: comp.infosystems.www.authoring.cgi
>
> b) use the CGI.pm perl module
>
>
>
>Hope this helps!
Thanks for your help. I found a solution which came to me while
writing a c++ program. QUERY_STRING was a file name for the script so
use and I didn't have the access rights setup correctly. <grin> opps.
I've subscribed to your suggested ng.
Thanks,
Kevin.
------------------------------
Date: Tue, 11 Feb 1997 10:22:24 -0800
From: Ben Mehling <bmehling@uci.edu>
To: Trond Ruud <troruud@online.no>
Subject: Re: Win32/NT problems with ARGVand .pl association
Message-Id: <3300B8E0.5546@uci.edu>
Trond Ruud wrote:
> run the script by explicitly starting Perl, i.e
> as: $perl script.pl, which destroys most of the fun!
You defintely need to make file association between .pl and perl.exe -
that way
can point and click... Check here:
4.10. How do I associate Perl scripts with perl?
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ_4.html#4_10
> second, Perl doesn't detect my command line arguments. i.e.:argv is always
> empty. I suspect that this problem's connected to my way of explicitly
> running perl, (as described above.)
If you plan on doing any cgi stuff you might consider using the
perlis.dll file
and make a "script map" association with the webservs registry.
I have assembled a web page with a section dedicated to good perl/Win32
sites
available on the web...
http://pulse.gsm.uci.edu/~bmehling/perl
Hope that helps.
Ben
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 928
*************************************