[8096] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1715 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 23 17:07:49 1998

Date: Fri, 23 Jan 98 14:00:24 -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           Fri, 23 Jan 1998     Volume: 8 Number: 1715

Today's topics:
    Re: #Ancor  in a jump.pl script <rootbeer@teleport.com>
    Re: /x regex mystery (Mark-Jason Dominus)
    Re: /x regex mystery (brian d foy)
    Re: ? random text string <rootbeer@teleport.com>
    Re: [Q] Database Reccomendations for Perl on Unix <woerns@dwc.ch>
        Beginner question re: evaluating home directories (Lynne Seamans)
    Re: Buffered IO (brian d foy)
    Re: CGI downloads (brian d foy)
    Re: CGIWRAP & cookies <rootbeer@teleport.com>
    Re: chown -h <mark.moe@medtronic.com>
    Re: custom scripts (calling all perl and/or w3-msql exp (brian d foy)
    Re: Help with an Array of instances (brian d foy)
    Re: Help with Stripping charactes from strings based up (Craig Berry)
    Re: Help with Stripping charactes from strings based up (Russell S. Virgilio)
    Re: how to emulate csh "set verbose" in perl <rootbeer@teleport.com>
    Re: How to print right off the webpage? (brian d foy)
    Re: HTTP debugger. Does that exist? (brian d foy)
        MacPerl CD-ROM, Version 0.5 (Rich Morin)
    Re: Mail::Tools Question <woerns@dwc.ch>
        nested +?* in regexp (Robert J. Kent)
    Re: perl 5.003 negation bug? (brian d foy)
    Re: perl auto update: (brian d foy)
    Re: piping to postmail? <rootbeer@teleport.com>
    Re: Please please help a beginner... (brian d foy)
        Simple Question - Hopefully! <eric@recordernews.com>
    Re: Socket size in bytes <rootbeer@teleport.com>
        Subroutine prototype puzzlement (Warren Jones)
        Sys::Syslog <woerns@dwc.ch>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 23 Jan 1998 13:24:46 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Baehr <mbaehr@softline.de>
Subject: Re: #Ancor  in a jump.pl script
Message-Id: <Pine.GSO.3.96.980123132126.17597J-100000@user2.teleport.com>

On 22 Jan 1998, Michael Baehr wrote:

> #!/usr/local/bin/perl

Probably you should use warnings and 'use strict'.

> if($ENV{'REQUEST_METHOD'} eq "GET")

Probably you should use CGI.pm.

>         if($buffer eq "")

Odd. You've never stored anything into $buffer.

> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs)
> {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

Probably you should do this right! :-)

> print "Location: $value\n\n";

Probably you didn't want to do this in a loop.

> }

Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!




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

Date: 23 Jan 1998 15:51:47 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: /x regex mystery
Message-Id: <6aavt3$fj9$1@monet.op.net>
Keywords: artifact dicta exclaim upshot


In article <6aatbg$q0$1@aurwww.aur.alcatel.com>,
John M. Klassa <klassa@aur.alcatel.com> wrote:
>Can somebody explain why this happens?
>	$string = 'Tom Christiansen < tchrist@mox.perl.com >';
>	print (($string =~ /Tom Christiansen .* perl .* com/x)
>	      ? "yes\n" : "no\n");
>  [Prints `no']
>
>Shouldn't the /x just make the spaces around ".*" go away, effectively?

Yup.  And it also makes the space between `Tom' and `Christiansen' go away.



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

Date: Fri, 23 Jan 1998 17:01:01 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: /x regex mystery
Message-Id: <comdog-ya02408000R2301981701010001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6aatbg$q0$1@aurwww.aur.alcatel.com>, klassa@aur.alcatel.com posted:


>        print (($string =~ /Tom Christiansen .* perl .* com/x)
>              ? "yes\n" : "no\n");
>
>Shouldn't the /x just make the spaces around ".*" go away, effectively?

it makes all the whitespace go away.  are you try to match
TomChristiansen? :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 13:44:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Lars Kr. Lundin" <lkl@runge.uni-c.dk>
Subject: Re: ? random text string
Message-Id: <Pine.GSO.3.96.980123134250.17597P-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Lars Kr. Lundin wrote:

> Can anybody tell me how to produce a random text string that matches
> /^\w{8}$/ ?
> 
> I would be surprised if it is difficult...

It's not difficult at all, as others have shown. But it's not a trivial
task to generate good secure passwords, as you may know. Cheers! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 23 Jan 1998 19:05:14 +0100
From: Christoph Wernli <woerns@dwc.ch>
Subject: Re: [Q] Database Reccomendations for Perl on Unix
Message-Id: <34C8DBDA.BB615CC3@dwc.ch>

Robert Lubej wrote:
> 
> On Wed, 14 Jan 1998 17:00:36 -0700, Brandon Pulsipher
> <Brandon@byu.edu> wrote:
> 
> >MS-Access databases (at least that I know of).  Therefore, does anyone
> >have suggestions for what to convert these database to, so that I can
> >work with them thru Perl 5 on Unix?  I will be using a virtual host and
> 
> mySQL is a free SQL RDBMS, and there are tools to convert to and from
> MS Access (but don't remember where).

http://www.tcx.se


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

Date: Fri, 23 Jan 98 16:32:54 EST
From: LSEAMANS@mu3.millersv.edu (Lynne Seamans)
Subject: Beginner question re: evaluating home directories
Message-Id: <17EE7E8B6S86.LSEAMANS@mu3.millersv.edu>

Sorry to post such a beginner question, but I've had this
plopped on me to be done by monday and I've never perled
before.
 
The short form of the question is how do I do the csh
equivalent of " ~userid" ?   In other words, I've got
a userid and I need to get his home directory.
 
we've trying to clean up our automated account maintenance
before the beginning of the semester (ie, MONDAY) and the
person who wrote it is of course long gone.
 
Thanks for any assistance.
__________________________________________________________________
Lynne Seamans       <><     |  Millersville University of PA      |
Systems Programmer          |  lseamans@MU3.MILLERSV.EDU          |
  opinions belong to LS -------- not MU !!                        |
-------------------------------------------------------------------


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

Date: Fri, 23 Jan 1998 16:38:14 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Buffered IO
Message-Id: <comdog-ya02408000R2301981638140001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34C8F38E.483DAA78@dkstat.com>, Jean-Paul Cozzatti <jp@dkstat.com> posted:

>Are there any modules or  references regarding buffered I/O in perl.
>Is there a "funky" variable I can set that will allow me to set the
>block size?

there are IO sorts of modules available from CPAN.  some of them
might do what you want.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 16:36:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI downloads
Message-Id: <comdog-ya02408000R2301981636580001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6aal8c$9l9@stratus.CAM.ORG>, charlot@CAM.ORG (Richard Bellavance) posted:

>In article <885573898.754.0.nnrp-04.c246a73e@news.demon.co.uk>,
>David Fisher <dfisher@adc.metrica.co.uk> wrote:

>>by Internet explorer on the Windows system, but using Netscape on the UNIX,

>>print "Content-Disposition: form-data; name=$thing; filename=$thing;\n";
>>print "Content-Type: text/plain\n\n";
>                      ^^^^^^^^^^
>
>Either you're lying to the browser, or to us...  Anyway, this is a CGI
>problem, and will very likely be better answered in comp.infosystems.www.cgi

some browsers think they can subvert HTTP by guessing at file
extensions despite what they've been told by Content-Type.  it's
not good to use such an agent in development for just this reason.

it's not a CGI problem, it's a stupid client problem :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 13:38:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Andrew Spiers <andrew.spiers@virgin.net>
Subject: Re: CGIWRAP & cookies
Message-Id: <Pine.GSO.3.96.980123133555.17597O-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Andrew Spiers wrote:

> I am trying to set a cookie to stop a user doing something twice. The
> problem is that all of my CGI scripts have be run using CGIWRAP. This
> means the cookies end up coming from my ISP instead of me. I am
> therefore unable to check to se if the cookies exist. Any ideas how I
> can get round this ?

Ignore cookies; they don't work on all browsers. If you're trying to
prevent someone from hammering on the 'submit' button of your form, here's
one idea: Keep a small file with (a checksum of) all requests submitted in
the past minute or so. If you get a duplicate request (from the same IP
address, of course) just feed back a quick page telling them to be
patient. 

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps! 

   http://www.stonehenge.com/merlyn/WebTechniques/

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 23 Jan 1998 15:04:30 -0600
From: Mark Moe <mark.moe@medtronic.com>
Subject: Re: chown -h
Message-Id: <sdjvhvazyu9.fsf@medtronic.com>


I'm using Solaris 2.5... and yes, it is "cosmetic",
but I thought if /bin/chown had -h, then why not
perl.  But, I guess it doesn't really matter...

- Mark

-- 
Mark Moe
mark.moe@medtronic.com


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

Date: Fri, 23 Jan 1998 16:47:49 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: custom scripts (calling all perl and/or w3-msql experts)
Message-Id: <comdog-ya02408000R2301981647490001@news.panix.com>
Keywords: from just another new york perl hacker

In article <5nudORAhOGy0EwcG@cydaps.co.uk>, James <James@cydaps.nospam.co.uk> posted:

>I, as the company's web designer (but not a programmer!) have been asked
>by my boss to create a searchable database for the company's new website
>due out soon. I was wondering if anyone would be interested in creating
>a perl script that searches a pipe delimited text file exported from
>Access 97 onto a UNIX server running Perl5?

>The site will be used for searching though jobs, IT and Finance 
>especially with upto 20,000 jobs in the database at any one time, but 
>normally the average will be around 10,000. 

you want to use a flat file database for 10k+ records?  ouch...

if the pointy haired bosses are skimping on the budget, you might
suggest something fairly useable and inexpensive, like msql. then
you can use w3-msql as you said in the subject line.

>The alternative is to use the same w3-mSQL as job.co.uk have, but I 
>received a quote for this at around #320,000 ($35,000 or so I think 
>that equates to! Ouch!!!!)

a little steep, but i think my company would come in around the
same price for the complete solution (but we're not interested in
working on this :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 16:42:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help with an Array of instances
Message-Id: <comdog-ya02408000R2301981642300001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34c81bc5.142403637@news.mindspring.com>, chaos@mindspring.com (Dave Frascone) posted:

>I am trying to make an array of instances.  For some reason, I can't
>quite get it to work.  This is not my exact code, but this is what I
>am trying:

sometimes it's a bit of the exact code that is wrong - and it's
something not reproduced in an example snippet...


>package Something;
>
>@Instances=();
>sub initialize {
>        my $instance;
>        my $i;
>           
>        for $i (0 .. 10) {
>          $instance = Something->new($i);
>          push @Instances, $instance;
>        }
>}
>
>When I get out of the loop, and look at @Instances, all of them are
>the same!  (They contain the same data.)  I've tried storing
>references (push @Instances, \$instance)

based on that snippet i can't see anything wrong.  there's nothing
special about storing objects in a list, either.  perhaps
the constructor is not doing what you expect?  perhaps you'd
like to localize $instance to within the for loop?

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: 23 Jan 1998 20:44:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Help with Stripping charactes from strings based upon patterns
Message-Id: <6aavfq$iol$1@marina.cinenet.net>

Russell S. Virgilio (ccastrv@acmex.gatech.edu) wrote:
: I have this string that looks like this, and I want to pull out everything
: after the .edu and also just the hm30_ leaving just the alias.  I am
: having trouble finding good documentation and would appreciate any help
: you gurus can dish out :)  Thanks in advance, here is a sample line
: 
: hme0  johnson.university.edu 255.255.255.255    07:00:20:8e:ef:5f

Your wording is a bit unclear; here's a way to pull out all four 
space-delimited fields and do what you want with them.

 $_ = 'hme0  johnson.university.edu 255.255.255.255    07:00:20:8e:ef:5f';

 my ($first, $hostname, $ipmask, $last) = split;

Obviously, you could probably choose better names for the fields.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 23 Jan 1998 21:10:58 GMT
From: ccastrv@acmex.gatech.edu (Russell S. Virgilio)
Subject: Re: Help with Stripping charactes from strings based upon patterns
Message-Id: <6ab112$qiv@catapult.gatech.edu>

Russell S. Virgilio (ccastrv@acmex.gatech.edu) wrote:
: I have this string that looks like this, and I want to pull out everything
: after the .edu and also just the hm30_ leaving just the alias.  I am
: having trouble finding good documentation and would appreciate any help
: you gurus can dish out :)  Thanks in advance, here is a sample line

: hme0  johnson.university.edu 255.255.255.255    07:00:20:8e:ef:5f

: thanks again.

: Russ

I figured my wording may be a little vague.  I tried to use the split
command and that worked fine, only problem is upon using the grep command,
which is where the above output comes from, several lines similar to the
above are outputted.  By using the 

$_ = `/usr/xpg4/bin/grep -f ether2 list `;
my ($first, $hostname, $ipmask, $last) = split;

method it only processes the first line and seems to ignore the rest of
the lines.  I was considering using a loop of some sort, but i'm not
familiar with how the split command would work with mulitple lines.  Any
help is appreciated, you can respond here or at my email address.  Thanks
again.

Russ



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

Date: Fri, 23 Jan 1998 13:31:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Renshaw <michaelr@titan.lndn.tensor.pgs.com>
Subject: Re: how to emulate csh "set verbose" in perl
Message-Id: <Pine.GSO.3.96.980123132923.17597L-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Mike Renshaw wrote:

> does anyone know how to emulate csh "set verbose" so that the script
> will print the code as it runs ? I find verbose a great way to debug
> scripts. also can the debugger print statistics on % of time spent in
> each subroutine to find potential slow bits of code ? 

I have a feeling of deja vu. How odd. Does John Crawshaw impersonate Mike
Renshaw, or vice versa?

# From rootbeer@teleport.com Fri Jan 23 13:29:00 1998
# Date: Mon, 19 Jan 1998 19:19:31 -0800
# From: Tom Phoenix <rootbeer@teleport.com>
# To: John Crawshaw <john.crawshaw@london.pgs.com>
# Newsgroups: comp.lang.perl.misc
# Subject: Re: how do I emulate csh's "set verbose" in Perl
# 
# On Mon, 19 Jan 1998, John Crawshaw wrote:
# 
# > How do I emulate csh'c set verbose syntax in Perl ? I cant seem to find
# > a flag that will do it for me. set verbose in csh I find really usefull
# > for debugging. 
# 
# I don't know what that feature is, but if you're trying to debug
# something, have you seen the perldebug manpage?
# 
# > Also is there a way I can find out what % of time my program spends in
# > each subroutine to find possible slow-bits in my code, I know this can
# > be done in a C debugger but havent come across it in Perl. 
# 
# That would be the profiler. The perldebug manpage talks about that as
# well. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 23 Jan 1998 16:51:20 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to print right off the webpage?
Message-Id: <comdog-ya02408000R2301981651200001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34ca1c4c.5856504@flood.xnet.com>, efflandt@xnet.com (David Efflandt) posted:

>Not really perl related, but it is at the top of your browser called
>File/Print. 8-)  There is no way to have a CGI print directly it to a
>client's machine 

well, there are ways, but i would consider them intranet solutions.
creative use of mime-types and helper applications or plugins can 
do such a thing.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 16:16:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: HTTP debugger. Does that exist?
Message-Id: <comdog-ya02408000R2301981616390001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6aaahh$bvk@fridge.shore.net>, nvp@shore.net (Nathan V. Patwardhan) posted:

>brian d foy (comdog@computerdog.com) wrote:
>
>: >Get LWP.  http://www.perl.com/CPAN/modules/by-module/LWP/
>
>: i would adivse against using LWP in this case.  LWP munges some of the
>: HTTP headers and adds others, so it's very difficult to see exactly
>[snip]
>
>I disagree.  There's an LWP::Debug'ger, isn't there?  And other stuff
>that's probably documented somewhere in the distribution.

the LWP::Debug is more of an LWP debugger than an HTTP debugger.  you
can use it like

   #!/usr/bin/perl

   use LWP::Simple;
   use LWP::Debug qw(+);

   my $data = get('http://ny.pm.org/');

   __END__

most of the output deals with trace()-ing the function calls in
LWP and watching what they are doing (i.e. how many bytes were
read and so on).  the data are printed to STDERR in what appears to
be the chronological order in which LWP thinks about them - for
instance, transferring HTTP data in chunks is likely to get you
parts of the message body interspersed with LWP trace() output.

i don't advise agianst LWP lightly - i've tried to use LWP for
HTTPeek many times (mostly because Clinton Wong kept telling me
to try it), but the abstraction was getting in the way.  if one
wants to play with low level stuff, one has to get one's hands
dirty IMO :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 13:12:03 -0800
From: rdm@cfcl.com (Rich Morin)
Subject: MacPerl CD-ROM, Version 0.5
Message-Id: <rdm-2301981312030001@140.174.42.30>

Prime Time Freeware (PTF; http://www.ptf.com) is pleased to announce the
MacPerl CD-ROM (Version 0.5).  This disc, written in HFS format, includes:

  *  Version 5.1.9r4 of MacPerl

  *  PTF's MacPerl Installation and Overview document

  *  An unpacked and HTML-indexed snapshot of the CPAN

  *  Additional Perl documentation, from ADVICE Press

  *  Dozens of technically-oriented Macintosh utilities

MacPerl, a port of Perl 5, runs under both Mac OS and MPW on Macintosh
(and clone) systems.  Both M68000 and PowerPC architectures are supported.
For more information on MacPerl and the MacPerl CD-ROM, visit the MacPerl
Pages (http://www.ptf.com/macperl).

Rich Morin, PTF


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

Date: Fri, 23 Jan 1998 19:09:29 +0100
From: Christoph Wernli <woerns@dwc.ch>
To: Webmaster <bill@astro.fccj.cc.fl.us>
Subject: Re: Mail::Tools Question
Message-Id: <34C8DCD9.C892A9DF@dwc.ch>

Webmaster wrote:
> 
> I have been trying to write a mail aliases userID which calls
> (pwchg: "|/drv2/usr/bin/local/pwchg.pl") a perl script to allow a secure msg

I'm not into aliasing a lot, but if you'ld create a separate
pwchg-account and specify 

"|/drv2/usr/bin/local/pwchg.pl"

in the .forward-file there should be no problem.

Cheers, -werns


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

Date: 23 Jan 1998 16:43:52 -0500
From: k96rk01@cc.kzoo.edu (Robert J. Kent)
Subject: nested +?* in regexp
Message-Id: <6ab2uo$ao4$1@henson.cc.kzoo.edu>

the following program, compiled AS-IS, doesn't work.

#!/usr/bin/perl

$testStr = 'C++ is';
$longStr = 'i think C++ is bloated and slow.';

if($longStr =~ /$testStr/){
	# do "success" case...
}

#proceed with program...

#__end__

because the 'C++' has a nested quantifier.  how do i work around this? 
moreover, the string is ACTUALLY coming from a file, so i can't just type
'C\+\+' even if that WOULD work.  which i don't think it would.  so, long
story short: how do i match nested quantifiers in strings?

BTW, i HAVE browsed a couple of faqs to no avail.  if there's a section i'm
missing, PLEASE enlighten me!
-- 
___________________________________________________________________________
   rob kent   |   k96rk01 @ kzoo.edu   |   http://cc.kzoo.edu/~k96rk01/


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

Date: Fri, 23 Jan 1998 16:34:19 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl 5.003 negation bug?
Message-Id: <comdog-ya02408000R2301981634190001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34C842B4.260EF8C4@coos.dartmouth.edu>, rjk@coos.dartmouth.edu posted:


>I would suggest changing the expression to
>-$x + 0
>to force a numeric interpretation.  That will drop a '+', but leave a '-'.

or as i recall from my FORTRAN days:

   $x * -1;

and in trying that i ran across a curious effect.  compare the
output of

   #!/usr/bin/perl
   
   $\ = "\n";
   
   my $n = '-4';
   
   print -$n;
   print $n * -1;
   
   __END__

with that of

   #!/usr/bin/perl
   
   $\ = "\n";
   
   my $n = '-4';
   
   print $n * -1;
   print -$n;
   
   __END__

using Devel::Peek may be enlightening :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 16:22:25 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: perl auto update:
Message-Id: <comdog-ya02408000R2301981622250001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34C86547.1D2DE812@xarch.tu-graz.ac.at>, jahnel@xarch.tu-graz.ac.at posted:

>is it possible to reload a perl script every 10 seconds to put out new
>datas?

if your perl script needs to output data every ten seconds, why
not just keep it in memory?

perhaps if you told us more about the problem, we could offer
better solutions.  if this is the standard CGI refresh question,
see the CGI Meta FAQ which has references to the documents that
will answer your question.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 13:34:24 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: tricer@hiwaay.net
Subject: Re: piping to postmail?
Message-Id: <Pine.GSO.3.96.980123133211.17597M-100000@user2.teleport.com>

On Thu, 22 Jan 1998 tricer@hiwaay.net wrote:

> From the command line, the following works great, however it doesn't do a
> thing if called from a browser. 

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

>     open (MAIL, "| c:\\postmail\\postmail.exe -s"hello there"
> -Hmailer.address.edu tricer@hiwaay.net");

And you say that that code actually works from the command line? I have a
few doubts. :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 23 Jan 1998 16:18:48 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Please please help a beginner...
Message-Id: <comdog-ya02408000R2301981618480001@news.panix.com>
Keywords: from just another new york perl hacker

Please read this information on how to choose a good subject for a post:
       <URL:http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post>

In article <ewgKm06J9GA.123@upnetnews04>, "Ilia  Lobsanov" <lobsanov_family@email.msn.com> posted:

>Hello, I'm new to Perl, and so my first program doesn't work...

>Here is the script:
>
>#!/usr/bin/perl

using the -w switch to turn on warnings will often point out
mistakes:

   #!/usr/bin/perl -w

>read(STDIN, $input, $ENV{'CONTENT_LENGTH'});

using CGI.pm will fix the broken CGI code

   use CGI.pm;

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 16:31:25 +0000
From: "Eric McClary" <eric@recordernews.com>
Subject: Simple Question - Hopefully!
Message-Id: <34c8c658.0@news6.kcdata.com>

Hi,
  I need to write a perl script that checks for a file (index.html) 
in a certain directory and if it is not there jump to a subroutine.
This should do it right?
($rte= being the route)
open(CHECK,$rte)||&nofile;                              
But it doesn't work - any help would be appreciated.

Eric McClary


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

Date: Fri, 23 Jan 1998 13:19:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: joe@laffey-stl.com
Subject: Re: Socket size in bytes
Message-Id: <Pine.GSO.3.96.980123131835.17597I-100000@user2.teleport.com>

On Wed, 21 Jan 1998, Joe Laffey wrote:

> I am really trying to find a way to check to see if there
> are ANY bytes waiting in a socket.

The four-arg form of select(), perhaps? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 23 Jan 1998 13:35:24 -0800
From: wjones@tc.fluke.com (Warren Jones)
Subject: Subroutine prototype puzzlement
Message-Id: <6ab2es$7m4$1@purdy.tc.fluke.com>
Keywords: subroutine prototype


I'm trying to write a function with the prototype (\@@), and it
doesn't work the way I expect.  I can't seem to pass in a named
list (e.g. "@b") as the second argument to such a function.
Here's a little script that demonstrates the problem:

------------------------------- snip snip -------------------------------
#! /usr/local/bin/perl -w
 
sub foo (\@@) {
    print "count = ", scalar(@_), "\n";
    foreach ( @_ ) {
        print "\t[", defined($_) ? $_ : "UNDEF", "]\n";
    }
    print "\n";
}
 
my @a = ( 1, 2, 3 );
my @b = ( 4, 5, 6 );
my @c;
 
foo @a, @b;             # Why doesn't this work as expected ?
foo @a, ( @b );		# This works.
foo @a, @c = @b;	# So does this.
foo @a, 7, 8, 9;	# This works too.
 
------------------------------- snip snip -------------------------------

And here's the output from the script (run with perl 5.004_03 under
Solaris 2.5):

    count = 2
	    [ARRAY(0xb1aec)]
    Use of uninitialized value at ./foo line 6.
	    []
     
    count = 4
	    [ARRAY(0xb1aec)]
	    [4]
	    [5]
	    [6]

    count = 4
	    [ARRAY(0xb1aec)]
	    [4]
	    [5]
	    [6]
     
    count = 4
	    [ARRAY(0xb1aec)]
	    [7]
	    [8]
	    [9]
 
My questions:

     1. Why doesn't @b work as the second parameter to "foo",
        although "@c = @b" works just fine?  Passing a literal
	list ( 7, 8, 9 ) works too.

     2. Why the warning about "Use of uninitialized value?"
        If the second parameter is uninitialized, why doesn't
        the test for undefined($_) catch it?

Note also that a function with just (@) for a prototype doesn't
have this problem.

Thanks in advance for any enlightenment.

--------------------------------------------------------------------
Warren Jones              | To keep every cog and wheel is the first
Fluke Corporation         | precaution of intelligent tinkering.
Everett, Washington, USA  |                          -- Aldo Leopold


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

Date: Fri, 23 Jan 1998 19:25:01 +0100
From: Christoph Wernli <woerns@dwc.ch>
Subject: Sys::Syslog
Message-Id: <34C8E07D.BA7D6EB7@dwc.ch>

I've been trying to use the Sys::Sylog-module, but with no apparent
reaction whatsover. If I do:


#!/usr/bin/perl -w

use strict;
use Sys::Syslog;

openlog ('watchdog.pl', 'pid', 'user');
syslog ('info', 'this is a test');
closelog();

I don't get any output anywhere and, what strikes me odd, no complaints
either. I checked for

/usr/lib/perl5/Sys/Syslog
/usr/lib/perl5/syslog.pl
/usr/lib/perl5/site_perl/syslog.ph
/usr/lib/perl5/site_perl/sys/syslog.ph

and they're all there.

And yes, I checked that I'm looking at the correct log file :-)

Any pointers as to where to start looking are greatly appreciated.

Thanks, -Christoph


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

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

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