[7393] in Perl-Users-Digest
Perl-Users Digest, Issue: 1018 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 12 18:17:16 1997
Date: Fri, 12 Sep 97 15:00:35 -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 Fri, 12 Sep 1997 Volume: 8 Number: 1018
Today's topics:
Re: A simpler perl question. (Steve Monson)
An array of a list ??? <sgermain@nortel.ca>
Re: ARSPerl run problems <chrisl@bp.com>
Re: Basic question relating to ReadParse on NT (long in <greg@hassan.com>
Re: Binary AND and OR in Perl <fawcett@SPAMLESS.nynexst.com>
binary distribution of perl for NT4.0 (Jim McKinney)
Re: binary distribution of perl for NT4.0 <rbush@up.net>
Re: Bonehead addressing question <cbraiott@pobox.harvard.edu>
Re: Comparing dates?? (Faust Gertz)
Re: Comparing dates?? <rbush@up.net>
Re: flock in Win32? <hovnania@atc.boeing.com>
Re: How to email text file (Jeff Stampes)
Re: How to make 'beep' sound in perl? (Faust Gertz)
Re: How to make 'beep' sound in perl? (David Bonner)
Re: How to make 'beep' sound in perl? <chrisl@earthlink.net>
Re: Howto Parse data in spaced columns??? <yinso@u.washington.edu>
Re: Howto Parse data in spaced columns??? <rbush@up.net>
Re: is there a better way to do this subroutine? <rbush@up.net>
Re: PDF documentation for Perl: where? (Faust Gertz)
PERL DBM file help! <or96dc@cleaver.wbs.warwick.ac.uk>
perl NT and fork <bpollak@alben.com>
PerlIs & Internet module eric.sweet@schwab.com
PGP & CGI PERL SCRIPT <ghill@library.berkeley.edu>
Re: Sockets under Perl 5.003 and Solaris 2.5.1 (brian d foy)
some simple help <dandre@efficient.com>
STDERR, CGI, and external procs <dkp@lippy.ns.cs.boeing.com>
Strange behavior with undefined subroutine <chris@ixlabs.com>
tar on NT <Larry_P_Nguyen@qmail2.sp.trw.com>
Re: tar on NT <rbush@up.net>
Re: tar on NT (Nigel Reed)
What am I doing wrong? <KenVogt@rkymtnhi.com>
Win32 Registry QueryValue - need example <dvpgg@landmark.com>
Re: Writing format to string (Colin Kuskie)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Sep 1997 08:36:48 -0500
From: smonson@tri.sbc.com (Steve Monson)
Subject: Re: A simpler perl question.
Message-Id: <5vbghg$9ft@euphony.tri.sbc.com>
Aaron <aaron@soltec.net> wrote:
>I have been reading this with interest
>and learned a bit as well
>but my question
>along these same lines
>is
>how do you get it to spit out the file names recursively
>
>What I have (using the knowledge gained here) is a listing of the files in
>that directory but I also want a listing of allt he files below the
>directories, etc.
Well, aside from
system("ls -R $dir")
you might try something like this, which prints all the files in a
directory before descending to the next one below. You are of course
free to modify it to act in some other order, and include suitable
error checking, following symbolic links, etc.
sub lsR {
my($dir) = @_;
my(@dirs,$nextdir,$file);
local(*DIR);
return unless -d $dir;
# Grab a list of everything in this directory
opendir(DIR,$dir);
@dirs = sort(readdir DIR);
closedir DIR;
# list all the files in this directory
foreach $file (@dirs) {
print "$dir/$file\n" unless -d "$dir/$file";
}
# go to each subdirectory and do it all over again
foreach $nextdir (@dirs) {
next unless -d "$dir/$nextdir";
next if $nextdir =~ /^\.\.?$/;
&lsR("$dir/$nextdir");
}
}
--
What is a committee? A group of the unwilling, picked from the unfit,
to do the unnecessary.
-- Richard Harkness, The New York Times, 1960
------------------------------
Date: Fri, 12 Sep 1997 15:34:40 -0400
From: "Sylvain St.Germain" <sgermain@nortel.ca>
Subject: An array of a list ???
Message-Id: <34199950.5FB1@nortel.ca>
Hi,
I have a function that behave like this:
@Stuff = [qw/a b c d/];
Func(@Stuff) ## This is OK
but:
@Stuff = (qw/a b c d/);
Func(@Stuff) ## Bad...
The thing is that I am using push to fill @Stuff
and it seems that @Stuff become more like a list
than an array albeit I've defined it as an array.
Is there a way to have push resulting an array
not a list...???
FYI: This is in CGI.pm, I want to do
...->popup_menu(-values=>@Stuff, ...)
Many Regards,
Sylvain.
------------------------------
Date: Sat, 13 Sep 1997 06:55:18 +1000
From: Chris Leach <chrisl@bp.com>
Subject: Re: ARSPerl run problems
Message-Id: <3419AC36.5F1F@bp.com>
Jeff Williams wrote:
>
> Hello,
>
> I have used perl for simple scripts for quite some time but
> this
> is my first atempt at using a external module. I need access to
> Remedy ARS databases within some scripts and have compiled the ARSperl
> module but some errors when I try to use them.
>
> My System
> ---------
> CPU: Sparc 20
> OS: Solaris 2.4
> Compiler: GCC 2.7.2.1
> Perl: Perl 5.003 (compiled from source not installed from
> the
> Solaris package found at sunsite)
>
> ARSPerl
> -------
>
> All seemed to compile and install fine but when I run an example I get
> the following.
>
> ctiemc 11: List NTServers.pl
> Can't load
> '/opt2/gnu/lib/perl5/site_perl/sun4-solaris/auto/ARS/ARS.so'
> for module ARS: ld.so.1: /usr/local/bin/perl: fatal: relocation error:
> symbol not found: GetNTPasswordSeed: referenced in
> /opt2/gnu/lib/perl5/site_perl/sun4-solaris/auto/ARS/ARS.so at
> /opt2/gnu/lib/perl5/DynaLoader.pm line 140.
>
> at /opt2/gnu/lib/perl5/site_perl/ARS.pm line 70
> BEGIN failed--compilation aborted at .//ListNTServers.pl line 14.
> Can't locate auto/ARS/__ars_Termi.al in @INC at
> /opt2/gnu/lib/perl5/site_perl/ARS.pm line 209
> END failed--cleanup aborted at .//ListNTServers.pl line 14.
> root @ ctiemc 12:
>
> Help Please? Can someone enlighten me as to what I did wrong.
>
> Thanks In Advance, Jeff
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
I have also recently compiled the ARS module. I have version 2 API
libraries not sure the minor number but a least 18 months old. I
also have the same reloceation error.
Summary of my perl5 (5.0 patchlevel 4 subversion 3) configuration:
Platform:
osname=solaris, osvers=2.5.1, archname=sun4-solaris
uname='sunos horace 5.5.1 generic_103640-04 sun4c sparc
sunw,sun_4_75 '
hint=previous, useposix=true, d_sigaction=define
bincompat3=n useperlio=undef d_sfio=undef
Compiler:
cc='gcc', optimize='-O', gccversion=2.7.2
cppflags='-Dsrand=srand48 -Drand=lrand48 -I/apps/local/include'
ccflags ='-Dsrand=srand48 -Drand=lrand48 -I/apps/local/include'
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=31
Linker and Libraries:
ld='gcc', ldflags =''
libpth=/usr/lib /usr/ccs/lib /apps/local/lib
libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
libc=/usr/lib/libc.so, so=so
useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -R
/install/perl/live/lib/sun4-solaris/5.00403/CORE'
cccdlflags='-fpic', lddlflags='-G'
--
Chris Leach Mail: leachcj@bp.com or chrisl@oakton.com.au
Oakton Computing Phone: +61 3 92684771 Fax: +61 3 92684466
------------------------------
Date: Fri, 12 Sep 1997 14:49:51 -0400
From: Greg Hassan <greg@hassan.com>
Subject: Re: Basic question relating to ReadParse on NT (long inc. code)
Message-Id: <34198ECF.3C48@hassan.com>
I had this sort of problem with NT before.
I believe if you use a method=GET instead
of POST your form data will work correctly.
Maybe upgrading to newer packages will fix the POST
problem but I have not tested that yet. I personally
dont care if its a get or a post so I never bothered with
it.
-Greg
--
===============================================================
Greg Hassan, The Independent Solution (CGI,Java,SQL,Perl...)
http://www.hassan.com/, 1-701-235-3239
===============================================================
Online Editable Database: http://www.hassan.com/super_dbedit/
Super Chat: http://www.hassan.com/java/
User Hit Tracker: http://www.hassan.com/webhits.cgi/1
Sell Stuff on the Web: http://www.hassan.com/shopcart/
===============================================================
------------------------------
Date: 12 Sep 1997 15:37:06 -0400
From: Tom Fawcett <fawcett@SPAMLESS.nynexst.com>
Subject: Re: Binary AND and OR in Perl
Message-Id: <8j7mcmpbml.fsf@SPAMLESS.nynexst.com>
tansympp@pacific.net.sg (Tan Shao Yi) writes:
> Just a short question, may I know if anyone has managed to perform a
> successfuly binary AND or OR operation on two binary numbers in Perl? :)
> Something like: 10110100 AND 11111100 = 10110100
printf("%x\n", 0xB4 & 0xFC);
> or even: 10110100 OR 11111100 = 11111100
printf("%x\n", 0x94 | 0xFC);
> Have given it a try with the "&" operator and it gives me an incorrect
> output. :)
They work for me.
-Tom
------------------------------
Date: 12 Sep 1997 19:03:08 GMT
From: jmck@elmo.ece.cmu.edu (Jim McKinney)
Subject: binary distribution of perl for NT4.0
Message-Id: <5vc3lc$fls@fs7.ece.cmu.edu>
Hi,
I've been thru 3 or for FAQs and a bunch of web pages but I can't
seem to find a precompiled version of perl5 for WinNT 4.0. I'm
sure I missed the obvious so please accept my apologies...
Any pointers to a source will be greatly appreciated and immediatly
put to use.
thanx
-jmck
--
Jim McKinney jmck@ece.cmu.edu
System Administrator Manager, ECE Office: HH1304
Carnegie Mellon University (412) 268-5141
Keep your chin up and someone is bound to punch it eventually...
------------------------------
Date: Fri, 12 Sep 1997 17:15:50 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: binary distribution of perl for NT4.0
Message-Id: <3419B106.1877@up.net>
Jim McKinney wrote:
>
> Hi,
>
> I've been thru 3 or for FAQs and a bunch of web pages but I can't
> seem to find a precompiled version of perl5 for WinNT 4.0. I'm
> sure I missed the obvious so please accept my apologies...
>
> Any pointers to a source will be greatly appreciated and immediatly
> put to use.
>
> thanx
> -jmck
> --
> Jim McKinney jmck@ece.cmu.edu
> System Administrator Manager, ECE Office: HH1304
> Carnegie Mellon University (412) 268-5141
> Keep your chin up and someone is bound to punch it eventually...
http://www.perl.com/CPAN-local/ports/winNT/
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
------------------------------
Date: Fri, 12 Sep 1997 15:22:16 -0500
From: Chris Braiotta <cbraiott@pobox.harvard.edu>
Subject: Re: Bonehead addressing question
Message-Id: <3419A471.B55@pobox.harvard.edu>
Mike Stok wrote:
>
> In article <341954F2.7733@rkymtnhi.com>,
> Kenneth Vogt <KenVogt@rkymtnhi.com> wrote:
>
> >I have a bonehead question about relative addressing. My directories
> >are as follows:
> >
> >root -+-cgi
> > +-html
> > +-graphics
> >
> >If I run a cgi program that resides in /cgi, how can I call a file in
> >/html or /graphics from that cgi program without giving the absolute
> >address?
>
One could also use a "soft link" in UNIX (or alias on macs or shortcut
on win95). To create one in UNIX type "ln -s <pathToFile> <linkName>"
If you set your permissions appropriately, calling the soft link will be
the same as calling the file itself.
Chris Braiotta
chris_braiotta@harvard.edu
------------------------------
Date: Fri, 12 Sep 1997 19:29:06 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Comparing dates??
Message-Id: <341e95f4.3387444@news.wwa.com>
On 12 Sep 1997 18:34:06 GMT, burt@ici.net (Burt Lewis) wrote:
>I hope this is simple.
That depends on what you consider simple.
>I'm capturing birth dates via a form, something like:
>
>09101981 (mmddyyyy)
>
>I need to determine if the age of this person is greater than 18.
>Anyone have any routines or ideas on the best and easisest way to do this?
You don't want my ideas. They probably aren't any good. :-) The
collective wisdom which authored the FAQ suggests that you use either
the Date::Manip or the Date::DateCalc module. These modules can be
found at
ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-category/06_Data_Type_Utilities/Date/
or go to http://perl.com/CPAN to choose the CPAN nearest you.
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
------------------------------
Date: Fri, 12 Sep 1997 17:13:16 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: Comparing dates??
Message-Id: <3419B06C.1699@up.net>
Faust Gertz wrote:
>
> On 12 Sep 1997 18:34:06 GMT, burt@ici.net (Burt Lewis) wrote:
>
> >I hope this is simple.
>
> That depends on what you consider simple.
>
> >I'm capturing birth dates via a form, something like:
> >
> >09101981 (mmddyyyy)
> >
( i think people take the system administrator chainsaw analogy off the
deep end ...why use a chainsaw when scissors will do ...people and their
bloody modules!)
from the command line:
perl -e '$bd = "09101981";
require "ctime.pl";
$d=ctime(time);
($j,$j,$j,$j,$j,$t)=split / /,$d,6;
$y=$t-substr($bd,4);
print "$y\n";
'
16
I hope this helps.
> >I need to determine if the age of this person is greater than 18.
> >Anyone have any routines or ideas on the best and easisest way to do this?
>
> You don't want my ideas. They probably aren't any good. :-) The
> collective wisdom which authored the FAQ suggests that you use either
> the Date::Manip or the Date::DateCalc module. These modules can be
> found at
> ftp://ftp.digital.com/pub/plan/perl/CPAN/modules/by-category/06_Data_Type_Utilities/Date/
> or go to http://perl.com/CPAN to choose the CPAN nearest you.
>
> Streben nach Wahrheit
>
> Faust Gertz
> Philosopher at Large
--
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
------------------------------
Date: Fri, 12 Sep 1997 19:22:41 GMT
From: Paul Hovnanian <hovnania@atc.boeing.com>
Subject: Re: flock in Win32?
Message-Id: <34199681.66F6609@atc.boeing.com>
This might be complicated by the variety of file systems that Win95/NT
can run on. I believe there's at least 2, possibly 3 (FAT, FAT32,
NTFS(?)).
--
Paul Hovnanian hovnania@atc.boeing.com
------------------------------------------------------------------------
Misers are tough to live with, but they make great ancestors.
Opinions the sole property of the above, available for a nominal fee.
------------------------------
Date: 12 Sep 1997 18:53:26 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: How to email text file
Message-Id: <5vc336$q9e$1@neocad.com>
Aaron (aaron@soltec.net) wrote:
: I'm curious about this Mail::Send package
: does it have facilities for including files as attachments?
Not exactly...As long as you're talking text files, you can
easily merge them into the mail. If it's a binary, it's probably
more difficult, and not something i have experience using.
Jeff
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: Fri, 12 Sep 1997 19:12:29 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: How to make 'beep' sound in perl?
Message-Id: <341c93cc.2835997@news.wwa.com>
On 12 Sep 1997 11:26:19 -0700, Kun Liu <kxliu@us.oracle.com> wrote:
>How do I make 'beep' sound in perl? Much like if you do
>
> echo '\07' in sh or ksh.
>
>But I want this to be independent of the shell from which I invoke this script.
Have you tried
print "\a"; # Bell
?
Streben nach Wahrheit
Faust Gertz
Philosopher at Large
------------------------------
Date: 12 Sep 1997 18:06:07 GMT
From: davidb@kenan.com (David Bonner)
Subject: Re: How to make 'beep' sound in perl?
Message-Id: <5vc0af$gic@pony.kenan.com>
Kun Liu (kxliu@us.oracle.com) wrote:
: How do I make 'beep' sound in perl? Much like if you do
: echo '\07' in sh or ksh.
: But I want this to be independent of the shell from which I
: invoke this script
Try
print "\07";
--
#=====================================================================#
#"it's the word's suppression that gives it the | david bonner #
# power, the violence, the viciousness" -lenny bruce | dbonner@bu.edu #
#=====================================================================#
------------------------------
Date: Fri, 12 Sep 1997 12:51:26 -0700
From: "Christopher M. Lee" <chrisl@earthlink.net>
Subject: Re: How to make 'beep' sound in perl?
Message-Id: <34199D3E.460E03E1@earthlink.net>
Hello,
I got both to work on a solaris server
print "\a";
and
print "\07";
Now I have an additional question. How would you get multiple beeps. Doing this
does not work:
print "\a\a\a";
-chrisl
Faust Gertz wrote:
> On 12 Sep 1997 11:26:19 -0700, Kun Liu <kxliu@us.oracle.com> wrote:
>
> >How do I make 'beep' sound in perl? Much like if you do
> >
> > echo '\07' in sh or ksh.
> >
> >But I want this to be independent of the shell from which I invoke this script.
>
> Have you tried
>
> print "\a"; # Bell
>
> ?
>
> Streben nach Wahrheit
>
> Faust Gertz
> Philosopher at Large
--
Christopher M. Lee, Lead Web Services Admin.
EarthLink Network, Inc.
chrisl@earthlink.net
------------------------------
Date: Fri, 12 Sep 1997 11:59:32 -0700
From: Y Chen <yinso@u.washington.edu>
To: Gip <nospam.gibsonc@aztec.asu.edu>
Subject: Re: Howto Parse data in spaced columns???
Message-Id: <Pine.OSF.3.96.970912115212.6116B-100000@saul3.u.washington.edu>
well, you kinda wanna count the spaces in the file, to make life easier.
assume that it's gonna be about 10 spaces between each items (make sure
that you leave 30 spaces between eee & fff), then things will be easy to
take care of.
assign the file handle to array or string, and then count the delimiters
(whether 10 spaces or \n or \t, so long as there is a pattern to apply).
then you just do a split on them. it will give you two "" items in the
second column.
the following example use a single space for delimiter.
reading it the file into an array...
foreach (array) {
($item1, $item2, $item3, $item4) = split (' ', $_);
}
that should do it.
yin-so
On Fri, 12 Sep 1997, Gip wrote:
> How do I parse data out of the following computed text file, you can
> assume no tabs, just plain old spaces:
>
>
> column 1 column 2 column 3 column 4
>
> aaa bbb ccc
> ddd
> eee fff
>
> I want to be able to know that fff is in column 4, and that ccc is in
> column 3.
>
> Thanks for your time,
> CG
>
------------------------------
Date: Fri, 12 Sep 1997 15:26:41 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: Howto Parse data in spaced columns???
Message-Id: <34199771.593B@up.net>
Y Chen wrote:
>
> well, you kinda wanna count the spaces in the file, to make life easier.
> assume that it's gonna be about 10 spaces between each items (make sure
> that you leave 30 spaces between eee & fff), then things will be easy to
> take care of.
>
> assign the file handle to array or string, and then count the delimiters
> (whether 10 spaces or \n or \t, so long as there is a pattern to apply).
> then you just do a split on them. it will give you two "" items in the
> second column.
>
> the following example use a single space for delimiter.
>
> reading it the file into an array...
> foreach (array) {
> ($item1, $item2, $item3, $item4) = split (' ', $_);
> }
>
> that should do it.
>
> yin-so
>
sure if there is a single space delimiter, or if the number of spaces
stays regular;
i thought about this too but the example file dindt give this.
The problem is in the program that generates the data.
If he was going to change the problem i'd put a null (or somethingthat
wont appear as $item) in for blank entries then just do:
open (file,("cat somefile|));
while(<file>){
($_=$_)=s/ / /g;
(@item) = split (' ', $_);
$count=1;
foreache (@item){
if ($item ne "null") {
print "$item is in column $count\n";
}
count++;
}
}
close(file);
but it sure sounds like somone is going to have to fix the input file.
> On Fri, 12 Sep 1997, Gip wrote:
>
> > How do I parse data out of the following computed text file, you can
> > assume no tabs, just plain old spaces:
> >
> >
> > column 1 column 2 column 3 column 4
> >
> > aaa bbb ccc
> > ddd
> > eee fff
> >
> > I want to be able to know that fff is in column 4, and that ccc is in
> > column 3.
> >
> > Thanks for your time,
> > CG
> >
--
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
------------------------------
Date: Fri, 12 Sep 1997 15:04:55 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: is there a better way to do this subroutine?
Message-Id: <34199257.4D2F@up.net>
Since you dont understand perl i shall tell you what it does.
It matches passwd entries to poplog entries and strings them together.
Some other sub eats this array and spews an array of stats ;
further another sub eats that array and spews pretty graphics.
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
Terry Michael Fletcher - PCD ~ wrote:
>
> Raymond K. Bush (rbush@up.net) so eloquently and verbosely pontificated:
> > I'd like the following subroutine to be more efficient ... any ideas?
>
> yes, tell us what it is you want to do!
> there are a bunch of things that immediately look WRONG, and i have no
> idea what your algorithm is, or what you are passing to this sub. let me
> see if i can help:
>
> > sub SPL{
> > local(*p,*plog)=@_;
> ^^^^^^^^
oh really cant recognize two arrays being passed in ... this is right
out of the perl5 book example
$p is passwd names $ple is extracts from poplog (time user transfer)
> first things is to upgrade to perl5, because people wont normally support
> perl4 here. then you wouldnt need to use those ugly globs.
what 5.004_02 isnt new enough
>
> > #@nplog=@plog;
> > #print @p;
> > #print @plog;
>
sure was ... this runs but takes a long time prints pretty web pages
too. Takes an hour though.
> i assume your data was passing properly, since you debugged it with print
> statements here.
>
> > foreach $user(@p){
> > $report="";
> > ($u,@junk)=split(/\:/, $user);
> ^^^^^^
> dont waste an entire array! give split a maximum of 1. and lose the "\"
> since a colon is not special in a regular expression.
>
> ($u) = split (/:/, $user, 1);
>
oh so you do have a helpfull hint ... so you mean you do understand some
perl and the nature of ther question?
I did not know i could do that ... (appearing to no longer try and
flame)
> > #print "$u\n";
> > #@plog=@nplog;
> ^^^^^^^^^^^^
comments are comments ...from times when code was not the same ... was
trying to itterate over a smaller array each time since some items used
to get removed. ... i used to
> what was this attempting to debug? didnt you just assign the inverse
> above earlier? strange...
>
> > foreach $ple(@plog){
> > if ($ple =~ " $u "){
>
oh yes i want a space on both sides of $u and i want to search the
string for such a combo
... no doubts
> whoops! not sure if you are really trying to match the $u with a space
> character on each side, but i think you want:
> if ($ple eq $u)
> im sure that the above if statement never even matched?
you assume to much... in this case I mean what i say and say what i
mean.
>
> > # print ",$ple,\n";
> > #
> > #example line: Sep 3 15:44:08 dd43 popper[24571]: Stats: mick 0 0 0 0
> > #
since you didnt get it the above is a $ple (well a shortend version of
it anyway
ie "15:44:08 mick 0 0 0 0"
and i am searching for a keyword $u
ie mick
> > if ($report ne ""){
> > $report="$report|$ple";
> ^^^^^^^^^^^^^^^^^^^^^^
if my string is empty then append $ple
> $report .= "|$ple";
> > }else{
else do this cause i dont want leading pipes
> > $report="$ple";
> > }
> > }
> > #else{
> > # push(@nplog);
> > #}
> > }
>
> indent these lines from HERE:
> > if ($report eq ""){
> > $report="$u nmct";
> > }
> > #print ",$report,\n";
> > push (@report,$report);
> to HERE to make it less confusing.
yea well it was an afterthought but obviously you can interpolate in
your head or else you wouldnt say this ... at least it wasnt all left
justified ...(Jerimah would've done it that way)
>
> > }
> > return(@report);
> > }
>
maybe, but you probly put too much time in your dot sig file too
> well, not sure if i wasted my time or not, but maybe that helps.
>
> --
> #!/usr/local/bin/perl -- tfletche@pcocd2.intel.com
> map{$;.=chr$_}(112,114,105,110,116,32,117,110,112,97,99,107,32,34,117,
> 34);$_=$;.=q>,':2G5S="!A;F]T:&5R(%!E<FP@:&%C:V5R+`H`'>;y;\034;;d;eval;
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
------------------------------
Date: Fri, 12 Sep 1997 19:15:21 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: PDF documentation for Perl: where?
Message-Id: <341d947d.3012855@news.wwa.com>
On Fri, 12 Sep 1997 18:58:11 +0200, piller@netway.at_NOSPAM (Bernard
M. Piller) wrote:
>I am looking for the PDF Documentation for Perl 5.003.
>All the mirrors point to a 5.004BETA file that doesn't exist. Doese
>anybody know where I can find the 5.003 version?
http://www.perl.com/CPAN/authors/id/BMIDD/perlbook-5.004_01.tar.gz
seemed to work for me a few minutes ago.
HTH
Faust Gertz
Philosopher at Large
------------------------------
Date: Fri, 12 Sep 1997 21:07:34 +0100
From: dc <or96dc@cleaver.wbs.warwick.ac.uk>
Subject: PERL DBM file help!
Message-Id: <3419A106.E2A@cleaver.wbs.warwick.ac.uk>
i have a DBM file (users) with data in of the form:
$users{$fields{'Num'}}="$fields{'Subject'}::$fields{'Rel'}
::$fields{'Intell'}::$fields{'Interest'}::$fields{'Materials'}
::$fields{'Concepts'}::$fields{'Generate'}::$fields{'Opportunities'}";
where 'Num' is the key. Each of the fields Rel, Intell, Interest,
Materials, Concepts and Generate can take on the five different values:
low,below average, average, above average and high. How would I go
around counting how many low, below average etc.....for each of the
fields mentioned and save the number in six different variables. I wish
to count for all entries, regardless of which key.
Thanks
Dave
------------------------------
Date: Fri, 12 Sep 1997 17:31:10 -0400
From: Benny Pollak <bpollak@alben.com>
Subject: perl NT and fork
Message-Id: <3419B49E.B7FD3625@alben.com>
Is there an implementation of perl5 for NT that implements fork()?
Benny
------------------------------
Date: Fri, 12 Sep 1997 15:54:58 -0600
From: eric.sweet@schwab.com
Subject: PerlIs & Internet module
Message-Id: <874095873.29652@dejanews.com>
Can anyone tell me if Aldo's Internet module should work with PerlIs?
I've written a script to FTP log files from another machine and output a
web page with statistics, etc. It runs perfectly from the command line
with perl.exe, but fails to retrieve the files when run through PerlIs.
Any suggestions?
Thanks in advance,
Eric Sweet
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 12 Sep 1997 13:32:38 -0700
From: giulia hill <ghill@library.berkeley.edu>
Subject: PGP & CGI PERL SCRIPT
Message-Id: <3419A6E6.1AFF@library.berkeley.edu>
I am doing encryption through a CGI script which reads input from a
www form. Following is the code:
--------------------------------
push(@INC,'/usr/local/etc/httpd/cgi-bin');
require('cgi-lib.pl');
&ReadParse;
open (LOG,">$logFile");
print LOG "pgp = $pgp; in(TESTIN) = $in{'TESTIN'}; encry = $encrypt\n";
open (FILE, ">$tmpFile");
print FILE "$in{'TESTIN'}\n";
close FILE;
$command = "$pgp -fea $userId < $tmpFile > $encrypt";
print LOG $command;
open(PGP,"$pgp -fea $userId < $testFile > $encrypt 2> $stdERR|");
print LOG "Done with pgp\n";
`mail $mailUser < $encrypt`;
print LOG "Done with mail";
print<<END;
Content-type: text/html \n\n
<H2>End of the test</H2>
END
close PGP;
close LOG;
exit;
------------------------------------
When I submit the form, no encrypted file is created and the stderr
file $stdERR contains:
Pretty Good Privacy(tm) 2.6.2 - Public-key encryption for the masses.
(c) 1990-1994 Philip Zimmermann, Phil's Pretty Good Software. 11 Oct 94
Uses the RSAREF(tm) Toolkit, which is copyright RSA Data Security, Inc.
Distributed by the Massachusetts Institute of Technology.
Export of this software may be restricted by the U.S. government.
Current time: 1997/09/12 20:15 GMT
Preparing random session key...
We need to generate 192 random bits. This is done by measuring the
time intervals between your keystrokes. Please enter some random text
on your keyboard until you hear the beep:
cannot open tty, using stdin
Unable to get terminal characteristics: ioctl: Inappropriate ioctl for
device
-----------------------------------------------------------------------------
However, if I hard code the name of a file in the script and I execute
the script from the command line, instead of the server, everything
works correctly. The server runs under my account so it is not a
problem of permissions
Any suggestion is highly appreciated
Giulia
------------------------------
Date: Fri, 12 Sep 1997 15:08:20 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Sockets under Perl 5.003 and Solaris 2.5.1
Message-Id: <comdog-ya02408000R1209971508200001@news.panix.com>
In article <5vbuoi$am0@mozo.cc.purdue.edu>, wilker@math.purdue.edu wrote:
>I have a perl script that works under Sunos 4.1.3_U1 and
>not under Sparc or Intel 2.5.1.
>The values submitted to socket are the same in the two OS's,
>$AF_INET = 2;
>$SOCK_STREAM = 1;
>$structSockAddr = 'S n a4 x8';
Eek! don't hard code that stuff and expect it to
be portable! try using Socket or IO::Socket.
good luck :)
--
brian d foy <comdog@computerdog.com>
------------------------------
Date: 12 Sep 1997 21:02:08 GMT
From: "D'Andre Ladson" <dandre@efficient.com>
Subject: some simple help
Message-Id: <01bcbfbe$8a3a4fa0$a10ab7c7@dnt4>
I have a script that works fine form the command line but
fails when posted from the WWW. The error I received is that
the HOME: Undefined variable.
I think I need the equivalent of setenv HOME /user/home in
my perl script, but I can't figure out how to call it out
from perl.
I can print out the HOME env variable with print "$ENV{'HOME'}\n";
but I just can't figure out how to set the HOME within my perl
script. I know this simple but I'm having a major brain fart.
Any help is appreciated.
D'Andre
dandre@efficient.com
------------------------------
Date: Fri, 12 Sep 1997 19:27:12 GMT
From: Dennis Peterson <dkp@lippy.ns.cs.boeing.com>
Subject: STDERR, CGI, and external procs
Message-Id: <34199790.4053@lippy.ns.cs.boeing.com>
I would like to run traceroute from within a cgi script. I have used the
following methods: (using a form with post method and cgi-lib.pl)
print `traceroute $input{'server'}`;
print system('traceroute',$input{'server'});
print exec('traceroute',&input{'server'});
I have also played with $| for STDOUT and STDERR but nothing I have done
to date will return to my script the stderr output of traceroute. It
does return stdout fine. I would like to see the errors in my web page
as well as the normal data. How might this be done??
dp
------------------------------
Date: Fri, 12 Sep 1997 12:45:28 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Strange behavior with undefined subroutine
Message-Id: <34199BD8.2AAB@ixlabs.com>
Recently I wrote a routine which uses File::Copy's copy() funtcion.
With the line:
copy($filepath, $wd.$file.'.bak');
Works fine. So I cut and pasted the function into another script, but
forgot to also include the
use File::Copy;
statement.
I was running perl5.004_03 -w and use strict;
so what do you think happened?
Nothing!
No warnings, no errors, and, of course, the function did not copy.
I even did a
print copy($filepath, $wd.$file.'.bak');
And it produced no output!
So I realized my lack of the use File::Copy, and corrected this, and it
worked perfectly.
But the question remains - what was Perl doing with that statement?
Chris Schoenfeld
Director, Advanced Technology
IX Development Laboratories
Santa Rosa, Ca 95401
(707)-543-8030 Ext. 12
------------------------------
Date: Fri, 12 Sep 1997 11:30:58 -0700
From: Larry Nguyen <Larry_P_Nguyen@qmail2.sp.trw.com>
Subject: tar on NT
Message-Id: <34198A61.7856@qmail2.sp.trw.com>
is there a Win NT or DOS version of tar executable some where that I can
download? I'm trying to unpack and install the latest.tar.gz and I got
the gzip.tar file which I need a tar executable to un-tar it.
------------------------------
Date: Fri, 12 Sep 1997 15:33:12 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: tar on NT
Message-Id: <341998F8.7EC3@up.net>
Larry Nguyen wrote:
>
> is there a Win NT or DOS version of tar executable some where that I can
> download? I'm trying to unpack and install the latest.tar.gz and I got
> the gzip.tar file which I need a tar executable to un-tar it.
you probly want a nt/dos port, go here:
http://www.perl.com/CPAN-local/ports/winNT/
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
------------------------------
Date: 12 Sep 1997 17:37:28 GMT
From: nigelr@convex.hp.com (Nigel Reed)
Subject: Re: tar on NT
Message-Id: <5vbuko$444$1@news.rsn.hp.com>
Larry Nguyen (Larry_P_Nguyen@qmail2.sp.trw.com) wrote:
> is there a Win NT or DOS version of tar executable some where that I can
> download? I'm trying to unpack and install the latest.tar.gz and I got
> the gzip.tar file which I need a tar executable to un-tar it.
Look for tar.exe and gzip.exe. You might find it on
http://oak.oakland.edu
http://www.simtelnet.net
http://www.cdrom.com
http://www.windows95.com
Regards
Nigel
------------------------------
Date: Fri, 12 Sep 1997 15:51:32 -0600
From: Kenneth Vogt <KenVogt@rkymtnhi.com>
Subject: What am I doing wrong?
Message-Id: <3419B964.7545@rkymtnhi.com>
Hi folks:
I have a script that is working fine. It creates an HTML file on the
fly. Then I put the following code as the first print statement that
outputs the HTML code:
print qq!Set-Cookie: cart_id=6269836.8264;\n!;
print ..the rest of my code...
What now happens is that the page *displays* "Set-Cookie:
cart_id=6269836.8264;" instead of actually setting the cookie. What am
I doing wrong?
Thanks.
--
Kenneth Vogt
KenVogt@rkymtnhi.com
http://ModernShopping.com
Buy Tupperware(r) products right on the WWW!
------------------------------
Date: Fri, 12 Sep 1997 16:06:24 -0400
From: Pat Garverick <dvpgg@landmark.com>
Subject: Win32 Registry QueryValue - need example
Message-Id: <3419A0C0.7B95@landmark.com>
I'm trying to use Win32::Registry to read the Windows95 registry.
I successfully use Open and GetKeys.
However, I am unable to use QueryValue successfully.
Can anyone give me an example using this?
My goal is to get the value for the name I specify under
a low-level key.
For example, Using Open, I work my way down
HKEY_LOCAL_MACHINE, SOFTWARE, ActiveWare, Perl5.
Using the regular Registry Editor, I see there is, for example,
the name BIN which has the value "D:\perl\bin".
I want my perl script to let me query to get this same value
when I specify the name of "BIN".
fyi, perl -v indicates I'm on 5.003_07
Thanks
Pat
------------------------------
Date: 12 Sep 1997 13:48:37 -0700
From: colink@latticesemi.com (Colin Kuskie)
Subject: Re: Writing format to string
Message-Id: <5vc9r5$flk@sarek.latticesemi.com>
In article <4o6KNs_00WB_0H=mk0@andrew.cmu.edu>,
Ben Raia <br2a+@andrew.cmu.edu> wrote:
>Is there any way to either
>
>1) directly write the format to a string, or
>
>2) somehow get a filehandle that points to a string rather than a stream
>and just write to that filehandle in the normal way?
Both of these are described in the perlform manpage, and in sections
of perlfunc. I think the simplest way is to use the formline() function
to generate the output and assign it to a string, but then you have
to do it line by line.
And the alternative is forking a child process via open()...
Hope this helps,
Colin Kuskie
------------------------------
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 1018
**************************************