[8374] in Perl-Users-Digest
Perl-Users Digest, Issue: 1991 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 28 05:07:17 1998
Date: Sat, 28 Feb 98 02:00:30 -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 Sat, 28 Feb 1998 Volume: 8 Number: 1991
Today's topics:
Re: "require" probs... <corky@ma.ultranet.com>
Re: Creating files on the server <tchrist@mox.perl.com>
Getting system() to recognize localized STDOUT (Andrew Brown)
Re: How do I search a file for a SPECIFIC string? <niting@raleigh.ibm.com>
Re: How do I search a file for a SPECIFIC string? <uri@sysarch.com>
large file support <NOSPAM-mmondy@sugarland.unocal.com>
mSQL troubles <gconklin@iphysique.com>
Re: Musings on English.pm <joseph@5sigma.com>
Re: Musings on English.pm <uri@sysarch.com>
Re: PASSWORD update utility for SunOS4.1.4/OpenVMS 6.2 <webmaster@fccjmail.fccj.cc.fl.us>
Patches for CPerl and Emacs 20.2 (Ilya Zakharevich)
Re: Perl4 to Perl5 conversion issues (Maxine G.)
Prob: perl5 lib version, how to clean up? <frohme@memphis.edu>
Search script logic <niting@raleigh.ibm.com>
Re: Stupid Perl file handler limitation! schwern@starmedia.net
Re: Talking to a CGI script with Perl Via Post <ebohlman@netcom.com>
Re: testing for variable type <joneil@cks.ssd.k12.wa.us>
Re: testing for variable type <tchrist@mox.perl.com>
Re: The Ineffable Tom C. <joseph@5sigma.com>
Re: top like module out there? (John Erjavec V)
Re: webserver configuration/cgi.pm/nt <webmaster@fccjmail.fccj.cc.fl.us>
Re: What does this one-liner do? <tchrist@mox.perl.com>
Re: Why doesn't this program print out matches? (Jonathan Feinberg)
Re: Why doesn't this program print out matches? <jdporter@min.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 27 Feb 1998 20:32:15 -0500
From: Bob Trieger <corky@ma.ultranet.com>
To: Randall Stephenson <tjbtech@rtweb.net>
Subject: Re: "require" probs...
Message-Id: <34F7691F.4953@ma.ultranet.com>
Randall Stephenson wrote:
>
> I am using another script as a library for some subs. Obviously, this
> requires (no pun intended) the "require" function. Isn't the permission
> for a required script 744? Nevertheless, I have tried every permission,
> but to no avail. I get this strange message:
>
> [name of required script] does not return true in [name of script] line
> [#]
Try putting
1;
as the last line in the script you are using as a library to make it
return true.
HTH
Bob Trieger
corky@ultranet.com
------------------------------
Date: 28 Feb 1998 02:25:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Creating files on the server
Message-Id: <6d7sjl$2g9$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bill@astro.fccj.cc.fl.us writes:
:run your CGI suid to root
I'd rather just wipe the disk myself, thank you.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
echo "Your stdio isn't very std."
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 28 Feb 1998 02:07:56 GMT
From: atbrown@halcyon.com (Andrew Brown)
Subject: Getting system() to recognize localized STDOUT
Message-Id: <6d7rhs$gg4$1@brokaw.wa.com>
I have a script in which I wish to *temporarily* redirect STDOUT to a
file. However, I have found that system() does not honor a localized
*STDOUT on my system (Perl 5.003 build 3?? on WinNT 4.0 SP3). Please see
the script at the end of this message.
I can easily get around this, but my question is: why does system() not
pick up the localized STDOUT? I looked at the FAQ, perlsub (for info on
system), and perlfunc (for info on local), and found no answers....
Thanks,
Andrew Brown
__BEGIN__
select STDOUT;
$| = 1;
&mysub;
sub mysub { # 1
local *STDOUT; # 2
open (STDOUT, ">logfile"); # 3
print "--- Text ---\n"; # 4 : Gets sent to 'logfile'....
system("blah.bat"); # 5 : If line 2 is not commented out,
# the 'blah.bat's output is printed
# to the screen, not 'logfile' )-:
&mysub2; # 6 : Gets sent to 'logfile'....
} # 7
sub mysub2 {
print "--- Text ---\n"; # 8 : Gets sent to 'logfile'....
}
__END__
------------------------------
Date: Fri, 27 Feb 1998 14:21:34 -0800
From: "Nitin Gupta" <niting@raleigh.ibm.com>
Subject: Re: How do I search a file for a SPECIFIC string?
Message-Id: <6d7e47$i4s$1@sjnews.sanjose.ibm.com>
Once you have the word you want, add a space before and after it (in the
variable) and then search, this will result in 'camel' always and never hit
'camels' even though the keyword in contained in this string.
-Nitin
Greg Bacon wrote in message <6d7c8t$e20$1@info.uah.edu>...
>[Posted and mailed]
>
>In article <6d6u39$plf$1@nnrp1.dejanews.com>,
> miller@bigsky.net writes:
>: I would like to search a file for a specific string. Say the word camel,
but
>: not camels, or big but not bigsky. I can get the file into and array and
>: split the array up into fields, but I just can't seem to make it only
detect
>: what I'm searching for and not other variations. Any HELP out there?
>
>Read the fine perlre manpage and search for `word boundary'.
>
>Hope this helps,
>Greg
>--
>open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
>f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
>d2ac158c84c4ece4d22d1000118a8d5491000000
>EOF
------------------------------
Date: 27 Feb 1998 23:40:08 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: How do I search a file for a SPECIFIC string?
Message-Id: <x74t1k1gwn.fsf@sysarch.com>
"Nitin Gupta" <niting@raleigh.ibm.com> writes:
> Once you have the word you want, add a space before and after it (in the
> variable) and then search, this will result in 'camel' always and never hit
> 'camels' even though the keyword in contained in this string.
WRONGO my little friend. what if the word starts or end the line? the
comment below from greg is correct.
>
> -Nitin
>
> Greg Bacon wrote in message <6d7c8t$e20$1@info.uah.edu>...
> >
> >Read the fine perlre manpage and search for `word boundary'.
^^^^
misspelled :-)
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: Fri, 27 Feb 1998 19:25:44 -0600
From: Michael Mondy <NOSPAM-mmondy@sugarland.unocal.com>
Subject: large file support
Message-Id: <34F76798.CF077F1A@sugarland.unocal.com>
The size returned by lstat is incorrect for files over 2 GB for
perl 5.004_04 and earlier versions. I see this under Solaris 2.6
and IRIX 6.2. Note that under Solaris 2.6, large file support must
be enabled via compilation options as described in lfcompile(5) and
under IRIX 6, you need to use something other than 'cc -32'.
The problem seems to be that systems which support large files use
a 64bit off_t. However, in pp_sys.c, the size from the stat buf is
cast to an I32.
Using a double instead of an I32 seems to solve the problem. An I64
would work, but the perl internals use no such thing.
I've hacked it locally as shown in the diff below. There should really
be a #define which is set by Configure, but I just edited pp_sys.c to
use contain a (partial) compile time test and a run time test to use
a double if warranted. I've tested this briefly under Solaris 2.6;
I imagine this works under IRIX 6.2, but haven't yet tested it.
*** pp_sys.c.original Wed Oct 8 09:10:30 1997
--- pp_sys.c Fri Feb 27 19:16:51 1998
***************
*** 165,170 ****
--- 165,175 ----
#define ZBTLEN 10
static char zero_but_true[ZBTLEN + 1] = "0 but true";
+ #if defined(_LARGEFILE_SOURCE) || defined(__sgi__) || defined(sgi)
+ #error "HACK ALERT; you probably should not use this"
+ #define LARGE_FILES
+ #endif
+
/* Pushy I/O. */
PP(pp_backtick)
***************
*** 2115,2121 ****
#else
PUSHs(sv_2mortal(newSVpv("", 0)));
#endif
! PUSHs(sv_2mortal(newSViv((I32)statcache.st_size)));
#ifdef BIG_TIME
PUSHs(sv_2mortal(newSVnv((U32)statcache.st_atime)));
PUSHs(sv_2mortal(newSVnv((U32)statcache.st_mtime)));
--- 2120,2131 ----
#else
PUSHs(sv_2mortal(newSVpv("", 0)));
#endif
! #ifdef LARGE_FILES
! if (sizeof(off_t) > sizeof(int))
! PUSHs(sv_2mortal(newSVnv((double)statcache.st_size)));
! else
! #endif
! PUSHs(sv_2mortal(newSViv((I32)statcache.st_size)));
#ifdef BIG_TIME
PUSHs(sv_2mortal(newSVnv((U32)statcache.st_atime)));
PUSHs(sv_2mortal(newSVnv((U32)statcache.st_mtime)));
--
Mike Mondy mmondy@sugarland.unocal.com Remove NOSPAM to e-mail
------------------------------
Date: Fri, 27 Feb 1998 19:08:57 -0800
From: "Grant Conklin" <gconklin@iphysique.com>
Subject: mSQL troubles
Message-Id: <6d7utg$154$1@ha2.rdc1.sfba.home.com>
Newbie here... please bare with me.
Having no telnet access to the server host, I'm painfully trying to setup
our database on an mSQL db with perl. I've read, searched, asked and begged
for help and every answer is more vague than the next.... It seems that
there are more ways than one to accomplish this simple task and it's
difficult to get ERROR feedback, so where am I going wrong?
(I comment out code once used as one of thousands of test)
After running each script (and thinking all is working since no errors
show), the table fields seem to be blank.
Please Help!
(thanks in advance...)
------ Build database -----
#!/usr/bin/perl5 -w
use strict;
use Msql;
print "Content-type: text/html\n\n";
# Define variables
$host = "iphysique.com"; # database host server name
$database = "iphysique.com"; # database name
$table = "TEST"; # table referring to
# Connect to the database host
$dbh = Msql->Connect($host);
if (!$dbh)
{
print "Error connecting to database; $Msql::errstr\n";
}
# Identify database to be used
$dbh->SelectDB($database);
if (!$dbh)
{
print "Error identifying database; $Msql::errstr\n";
}
# Issue the command
$sth = $dbh->Query("CREATE TABLE $table \(name char\(30\),email
char\(40\)\)");
print "Command Complete";
undef $sth;
undef $dbh;
-------- Input data --------
#!/usr/bin/perl5 -w
use strict;
use Msql;
print "Content-type: text/html\n\n";
# Define variables
$host = "iphysique.com"; # database host server name
$database = "iphysique.com"; # database name
$table = "TEST"; # table referring to
# Input from html
$name = "Anna Lissa";
$email = "gconklin\@candescent.com";
# List databases
# relshow $database;
# Connect to database host
$dbh = Msql->connect($host); # connect to the database host
if (!$dbh)
{
print "Error connecting to database; $Msql::errstr\n";
}
# identify database to be used
$dbh->SelectDB($database);
# Issue the command
$sth = $dbh->Query("INSERT INTO $table \(name,email\) VALUES
\($name,$email\)");
print "Command Complete";
undef $sth;
undef $dbh;
---------- Select data -----------
#!/usr/bin/perl5 -w
use strict;
use Msql;
print "Content-type: text/html\n\n";
# Define variables
$host = "iphysique.com"; # database host server name
$database = "iphysique.com"; # database name
$table = "TEST"; # table referring to
# Connect to database host
$dbh = Msql->Connect($host) || print "Error connecting to database;
$Msql::errstr\n";
# Select database
$dbh->SelectDB($database);
# Issue the command
$sth = $dbh->Query("SELECT * FROM $table");
# $sth = $dbh->Prepare($sql_stmt);
print "Command Complete<P>";
# Print results
# $sth->DataSeek(0);
@row = $sth->FetchRow;
print "Results of row:<BR>$row<P>";
# List results
foreach $thisrow (@row)
{
# $first_name = $record[0];
$name = $thisrow[0];
$email = $thisrow[1];
print "Results:<BR>$name $email <BR>";
}
undef $sth;
undef $dbh;
------------------------------
Date: Fri, 27 Feb 1998 19:21:47 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Musings on English.pm
Message-Id: <34F77475.1B255019@5sigma.com>
My point is/was that it is *broken* if it works.
-joseph
Stefaan A. Eeckels wrote:
> So it does work (perl5.004_3).
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 27 Feb 1998 23:47:47 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Musings on English.pm
Message-Id: <x73eh41gjw.fsf@sysarch.com>
i just checked English.pm and i can't find any use of $`, $& or $'. i
always wondered why it was even there in the first place.
maybe the typeglobs to *&, $` and $' cause the behavior that we loathe so
much?
if so why not create two versions, on with all the rest of the names and
one with just the MATCH ones.
or better, the MATCH ones could be autoimported when referenced so only
those who use them will get the slow down. the rest of us will win by
default!
just trying to help,
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: Sat, 28 Feb 1998 03:16:53 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: PASSWORD update utility for SunOS4.1.4/OpenVMS 6.2
Message-Id: <34F78078.EF99EA8A@fccjmail.fccj.cc.fl.us>
Yes, it is possible.
Bill
Jim Earnest wrote:
> Is it possible to construct a PERL app that will allow password updates
> across SunOS and OpenVMS platforms.
------------------------------
Date: 28 Feb 1998 06:02:29 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Patches for CPerl and Emacs 20.2
Message-Id: <6d899l$sm9$1@mathserv.mps.ohio-state.edu>
Two patches for RMS Emacs 20.2 are provided on
ftp://ftp.math.ohio-state.edu/pub/users/ilya/cperl-mode/
With these two patches all the known problems with support for
syntax-table text-property are solved (and in 99.99% of cases CPerl
guesses Perl syntax correct).
Note that the current version (2.5, soon to be 2.6) of CPerl does not
allow re-syntaxification on the fly. I still run into unexplicable
problems trying to do it.
I want to know about any problem you have with these patches installed.
Enjoy,
Ilya
------------------------------
Date: Sat, 28 Feb 98 06:13:02 GMT
From: *nospam*mg*nospam*@*nospam*pcg*nospam.net (Maxine G.)
Subject: Re: Perl4 to Perl5 conversion issues
Message-Id: <6d89tn$2ja@examiner.concentric.net>
Oh. Sorry. I just get so tired of the spam. I look forward to reading your
response here on the newsgroup.
In article <34F76C5E.3B31@nicom.com>, palincss@nicom.com wrote:
>You know, I seriously considered replying by mail, but you've
>just made it too damned hard to figure out what your address
>actually is.
>
>Maxine G. wrote:
>>
>> I will soon be migrating an application from a perl4 system to a perl5
> system.
>> Is there a summary of conversion issues somewhere that I could look at? The
>> only thing I've heard about is having to put a "\" before a "@".
>>
>> Please reply by e-mail.
>>
>> Tia!
>>
>>
>> *********************************************************
>> return address changed to prevent spamming
>> Remove "NOSPAM" in the return address
>> Maxine Gerber
>> PCG Systems
>> *********************************************************
*********************************************************
return address changed to prevent spamming
Remove "NOSPAM" in the return address
Maxine Gerber
PCG Systems
*********************************************************
------------------------------
Date: Thu, 26 Feb 1998 14:49:57 -0600
From: Mike Frohme <frohme@memphis.edu>
Subject: Prob: perl5 lib version, how to clean up?
Message-Id: <34F5D575.633B4FF6@memphis.edu>
Hello,
I'm having problems with a system that's had several versions of perl
installed. 5.001m was installed and used for a while, then "upgraded"
to 5.003. Apparently during that process, some files weren't re-located,
as I now have version conflicts trying to install external modules, i.e.
% perl5 -v
This is perl, version 5.003 with EMBED
built under solaris at Oct 10 1996 22:47:15
+ suidperl security patch
(etc...)
When installing any module, I get:
% make install
Perl lib version (5.001) doesn't match executable version (5.003)
BEGIN failed--compilation aborted at /usr/local/lib/perl5/ExtUtils/Install.pm line 8.
BEGIN failed--compilation aborted.
*** Error code 2
make: Fatal error: Command failed for target `pure_site_install'
I can see an older Config.pm in /usr/local/lib/perl5 that looks like
its causing problems, but want to make sure I clean *everything* up
correctly. What's going to be my best approach at this point.
I have perl5.004 built and ready to install, but it doesn't look like
it will do any moves of old stuff by default.
Wiping all perl5 versions and clean installing 5.004 is a possibility,
but one I'd rather avoid as operations will be adversely affected.
Suggestions greatly appreciated. Thanks.
--
Mike Frohme frohme@memphis.edu
Information Systems - The University of Memphis 901/678-8820
------------------------------
Date: Fri, 27 Feb 1998 14:19:18 -0800
From: "Nitin Gupta" <niting@raleigh.ibm.com>
Subject: Search script logic
Message-Id: <6d7dvo$k4o$1@sjnews.sanjose.ibm.com>
Hi All,
I am in the process of writing a script which searches thru all the html
pages of a site for keywords, I know there is a score of such scripts
available for download but I wanted to indulge myself on this one :-)
I wanted to get ideas on how indexing is done, this particular site I am
writing this script for has about 3000 pages and I wanted to create an index
for the site which would be searched instead of opening all the pages and
searching/matching a keyword (Which is the method employed by almost all
scripts available on the Net). How does one determine what is a keyword and
what is not?
Any input to this discussion is appreciated.
-Nitin
------------------------------
Date: Fri, 27 Feb 1998 17:13:43 -0600
From: schwern@starmedia.net
To: li_sen@yahoo.com
Subject: Re: Stupid Perl file handler limitation!
Message-Id: <6d7has$pgr$1@nnrp1.dejanews.com>
I die at #254...
dbf_254 - Too many open files at work/perl/test.pl line 7.
Yep. A quick chat with the #perl crowd reveiled that this is OS dependent.
You can check this with either 'limit' or 'ulimit -a' or something similar.
On RH5 Linux-i586
[schwern@rocinante schwern]$ ulimit -a
core file size (blocks) 1000000
data seg size (kbytes) unlimited
file size (blocks) unlimited
max memory size (kbytes) unlimited
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 256
pipe size (512 bytes) 8
open files 256
virtual memory (kbytes) 2105343
Keeping 60 files open in one process can't be pleasant anyway. Try
restructuring your data.
In article <6d70od$tps$1@nnrp1.dejanews.com>,
li_sen@yahoo.com wrote:
>
> What's up with Perl? I ran some tests and found that Perl hits a limit of
> about 62 files before it chokes! That is, I open files until I can't
anymore
> (The code is below)and the script stops at 61 files. Shouldn't this be a
> system limitation and not a Perl limitation? I'm running Solaris 2.6 with
> 128MB of RAM.
>
> The relevance of this limit is that I can' open more than 60 or so DBM files
> at any one time. I need more than that for the application I'm writing!
>
> Many thanks for anyone who can give me an answer/workaround for this
problem!
>
> =========SAMPLE CODE============
> #!/usr/local/bin/perl
>
> for (1..100)
> {
> $v = "dbf_$_";
> print "$v\n";
> open($v,">$v") || die ("$!");
> }
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
---
Stupidity hath its Privledges
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sat, 28 Feb 1998 01:50:04 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Talking to a CGI script with Perl Via Post
Message-Id: <ebohlmanEp2FrG.LLv@netcom.com>
pauld@finepoint.com wrote:
: For my latest job, I have to communicate with a credit card verification
: script. To communicate with it, I must use the post method. I have the
: orriginal code for this (it is in Delphi), and I have to port it to Perl. Well
: I have been researching for hours, trying to figure out what the best method
: was....
The LWP module, available at finer CPAN sites near you, is almost
certainly going to be your friend. It comes complete with the LWP
Cookbook, which should tell you everything you need to know about sending
POST requests. If you think that's a hint that you should read the LWP
Cookbook before asking questions about how to use LWP here, you're
absolutely right.
------------------------------
Date: Fri, 27 Feb 1998 17:29:49 -0800
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
To: "David M. Ransier" <david_ransier@intercept.com>
Subject: Re: testing for variable type
Message-Id: <34F7688D.3476D82F@cks.ssd.k12.wa.us>
David M. Ransier wrote:
> Is there a way to test for variable type? I've looked through several books
> and haven't found a reference, except that Perl will change the type of
> variable depending upon the operation.
>
> Here is my problem, I am writing a subroutine to convert units of numbers
> (i.e., MM to INches) in an array. My array may contain strings and I only
> want to convert the number elements.
>
> @array = qw ( 1 2 3 fred mary 34 ted 100 );
>
> @new_array = convert_MM_2_IN(@array);
>
> @new_array should have ( .039 .078 .118 fred mary 1.338 ted 3.937 )
>
> Is there a way to walk an array (Yes, I can do that) and test each element
> to see if it is a string or number?
How about
foreach(@array)
{
next if (/\D+/);
# Do your conversions here
}
I think. YMMV!
Jerome
------------------------------
Date: 28 Feb 1998 02:40:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: testing for variable type
Message-Id: <6d7tep$2g9$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "David M. Ransier" <david_ransier@intercept.com> writes:
:Is there a way to test for variable type?
Look at the first character: $scalar, @array, %hash.
:to see if it is a string or number?
Oh. That's completely different. And it's in the stadanrd perlfaq4 manpage
and also in the standard perldata manpage. Is there something about
the standard documentation shipped with every Perl installation that
is unclear about this point?
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Your csh still thinks true is false. Write to your vendor today and tell
them that next year Configure ought to "rm /bin/csh" unless they fix their
blasted shell. :-) --Larry Wall in Configure from the perl distribution
------------------------------
Date: Fri, 27 Feb 1998 19:25:00 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: The Ineffable Tom C.
Message-Id: <34F77535.F7AFE7DF@5sigma.com>
However, there is a danger of scaring away *customers*, both
clients for our training classes and buyers of my book, so I
personally try not to be a jerk. I may be nitpicky and semi-
intolerant but hopefully not a complete hoser. Of course there
are those times when I lose it, but I hope those aren't that
frequent.
-joseph
Peter Samuelson wrote:
> There is not, repeat, *not* a danger of scaring away potential Perl
> programmers/developers. [...]
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 28 Feb 1998 01:45:53 GMT
From: jev@pconline.com (John Erjavec V)
Subject: Re: top like module out there?
Message-Id: <6d7q8h$blg$1@bell.pconline.com>
david (david@jemez.kellogg.nwu.edu) wrote:
: I don't know if a module with this capability exists, but the most recent
: copy of The Perl Journal (http://www.tpj.com) had a SWIG tutorial in which
: they created a Top interface to Perl. You may want to look into that.
David-
Actually, I read the article in the Perl Journal (excellent magazine, and I
wholeheartedly recommend subscribing to anyone). The thing is, it looks
like it just wraps the program in perl code. Actually, I realize that it
is more complex than that, but if the program outputs using curses, I would
expect that the wrapper would also. If I am wrong, please let me know,
since I would love to be wrong about this. Anyone with any other ideas?
-JEV
--
John Erjavec V PGP fingerprint:
jev@pconline.com 7593 1B5A AE11 C0FE BA09 EB5E 8DE9 D2E5 BF5B 87AD
------------------------------
Date: Sat, 28 Feb 1998 03:25:23 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: webserver configuration/cgi.pm/nt
Message-Id: <34F78276.1226EB25@fccjmail.fccj.cc.fl.us>
Service Pack 3 is available and highly recommended.
Why are you mimicing cgi-lib functionality?
CGI.pm allows html output, headers and all.
I say the problem is - service Pack 3 required...
(I've been wrong before :-)
HTH,
Bill
anne_lee@mailexcite.com wrote:
> I am not sure what the problem is (webserver/security), cgi.pm usage, perl for
> win32, so I hope someone can point me in the right direction. I have the
> following code that works when I run it on the system but not with webserver
> (this usually means it is a security problem - but I have permission everyone
> - full control). If I commented out the lines that use cgi.pm it will work
> with the webserver.
>
> Platform: NT 4.0 Service pack 1
> Perl: ActiveState Perl for Win32 (Build 315 - based on 5.003_07 Core Perl
> code)
> cgi.pm: 2.36
> perl directory:
> c:\perl
> c:\perl\lib where cgi.pm is
> c:\perl\lib\cgi where *.pm from cgipm package
> c:\perl\bin where perl.exe is
> webserver: EMWAC 0.991
> Permission: all files on my system everyone - full control
> (this is a test system within a firewall)
>
> code: "<-" my way of marking stuffs
> $cgilib_dir = "c:/perl/lib/"; # location of cgi.pm <- 1
> push (@INC, $cgilib_dir); <- 2
>
> use CGI qw(:cgi-lib); <- 3
>
> print "Content-type: text/html\n\n";
>
> print <<"print_tag";
> <html>
> <head>
> <title>testing</title>
> </head>
> <body>
> hello
> </body>
> </html>
> print_tag
> __END__
> :endofperl
>
> This is a simple code that print out hello when called, but with line marked 3
> in, I will get a 404 URL not found, but if I leave them out, it will print out
> hello in the webpage. Removing 1,2 does not matter. It works fine used
> without webserver.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 28 Feb 1998 02:26:56 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What does this one-liner do?
Message-Id: <6d7slg$2g9$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Mark Conty <mconty@year.grain.cargill.com> writes:
:... but the expression "$x = ( ($a) = ... )" is evaluating a list that
:is _one_ element long, not three! After all, $a is a scalar, not a
:list.
You are very confused. The only thing that matters is the dots
you've left out.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
I hope to get Perl 5 out this summer, for certain values of summer.
-- <1993Jun5.052825.3897@netlabs.com>
------------------------------
Date: Fri, 27 Feb 1998 16:52:44 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Why doesn't this program print out matches?
Message-Id: <MPG.f60ffb8e733b3a798974b@news.concentric.net>
[courtesy cc of this posting sent to cited author via email]
lamber45@EGR.msu.edu said...
: #!/opt/bin/perl
Don't fail to not forget to neglect not to use -w.
: /^(From|(Errors|Reply)-To|(X-)?Sender):.*(([a-zA-Z0-9_.+-]{2,40})@([a-zA-Z0-9-]{1,26}\.)+(a-z){2,3})/o
^
don't you mean \s ?
--
#!/usr/bin/perl -w -- Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Fri, 27 Feb 1998 17:03:47 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Why doesn't this program print out matches?
Message-Id: <34F73843.41BF@min.net>
David Lee Lambert wrote:
>
> I'm trying to write a perl program (to be run from with procmail, perhaps
> with perl -e) which scans an E-mail message and tries to find out everyone
> who is responsible for it. Here's what I've tried:
>
> #!/opt/bin/perl
> while (<>) {
> if (
>
> /^(From|(Errors|Reply)-To|(X-)?Sender):.*(([a-zA-Z0-9_.+-]{2,40})@([a-zA-Z0-9-]{1,26}\.)+(a-z){2,3})/o
> ) { print "$4, " ; } ; } ;
>
> My problem is that it doesn't actually print anything. Any help?
David, I have two comments.
1. You really need to try a little harder on your formatting.
This program is very hard to read. Also, those semicolons
at the end of the 'if' and 'while' blocks are completely
superfluous.
2. Your program is getting screwed up on the part of the input
lines after the ': ' -- that is, on the email addresses.
Don't try to match an email address. You'd be surprised how
many strings are legal, functional email addresses. DO NOT
attempt to validate an email address.
That said, your program can be simplified to this:
while (<>) {
chomp; # get rid of the newline
if ( /^(From|(Errors|Reply)-To|(X-)?Sender): / ) {
print "$'\n"; # everything to the right of the match
}
}
If you want to print the addresses in anything else than
one per line, I recommend putting them into an array, then
printing out the array, e.g.:
my @addresses;
while (<>) {
chomp; # get rid of the newline
if ( /^(From|(Errors|Reply)-To|(X-)?Sender): / ) {
push @addresses, $';
}
}
# print them all on one line, with commas:
print join( ', ', @addresses );
# or even:
$" = ', ';
print "Addresses: @addresses \n";
hth,
John Porter
------------------------------
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 1991
**************************************