[8881] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2498 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 5 01:06:53 1998

Date: Mon, 4 May 98 22:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 4 May 1998     Volume: 8 Number: 2498

Today's topics:
        [Q] subsitute <darknerd@shell4.ba.best.com>
        Backend (B) compiler in Perl5004.64. Need Help! <fenyvesi@cadvision.com>
        Bad interaction between eval and require: perl bug? <mgregory@asc.sps.mot.com>
    Re: basic email parser? (Gary M. Greenberg)
    Re: cd with a perl-script (Martien Verbruggen)
    Re: Checking for Ping reply??? (Martien Verbruggen)
    Re: Checking for Ping reply??? <andrew@iaccess.com.au>
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) <eryq@zeegee.com>
    Re: CPAN & Module gripes (was Re: Ever Wonder...?) (Mike Heins)
    Re: Directory usage in Perl for win32 (Martien Verbruggen)
        directorys and Files? <bazaillion@primary.net>
    Re: Help with DBM files (Mike Heins)
    Re: If Perl had immediate subroutines... (Tom Rokicki)
        Is this a safe lock? <keith@comcore.com>
    Re: Is this a safe lock? <tchrist@mox.perl.com>
    Re: Length of a variable <rjk@coos.dartmouth.edu>
        list from regexp <langlois@sni.net>
    Re: malformed header? (Martien Verbruggen)
        Open to suggestions (Curtis Hoffmann)
    Re: Perl Net App doesn't play well w/ C Net App (Philosopher King)
        Perl Socket and proxy Server <test@net.net>
    Re: Perl2Exe file for Unix? (Martien Verbruggen)
    Re: Printing in Perl (Martien Verbruggen)
    Re: Regex Question <rjk@coos.dartmouth.edu>
    Re: Replacement for grep using map <rjk@coos.dartmouth.edu>
    Re: Splain a regex to me <rjk@coos.dartmouth.edu>
    Re: Translating crontab(5) file to a format that can be (Alan Barclay)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 4 May 1998 21:52:39 -0700
From: <darknerd@shell4.ba.best.com>
Subject: [Q] subsitute
Message-Id: <Pine.BSF.3.96.980504215049.20272C-100000@shell4.ba.best.com>


How would I take a date in the format of 5/4/98 at the beginning of a line
and change it to 980504.

I know the answer is pretty simple, but alas I haven't been scripting in
sooo long, reexp escapes me. (no pun intended)

 - darknerd@shell4.ba.best.com



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

Date: Sat, 2 May 1998 14:12:44 -0600
From: "Joe" <fenyvesi@cadvision.com>
Subject: Backend (B) compiler in Perl5004.64. Need Help!
Message-Id: <354e9888.0@news.cadvision.com>

I recently downloaded and compiled the latest beta version of Perl, 5004.64,
which includes the B backend module. I have found using this with the CC
option
fairly easy and straightforward and I have had little trouble with compiling
vanilla
perl scripts into applications using Visual C++ 5.0. However, I can't figure
out
how to include extensions that require the loading of DLLs (It was Tk that I
was
mainly interested in, but I found that no dynamic library will work.) Does
anyone
know how I can use the backend compiler to generate executables that use
dynamic (or statically) loaded libraries? Does anyone know where I can get
some documentation for the compiler?

Thanks very much,
Louis

BTW,
Sorry about the cross-post to both groups. I couldn't figure out which group
I should send the to, given the subject matter.




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

Date: 05 May 1998 10:57:06 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Bad interaction between eval and require: perl bug?
Message-Id: <r8hg35ld79.fsf@asc.sps.mot.com>


Hello,

I did this:

 1) put this script into foo.pl:

----------------------------------------------------------------------
my $Scalar = "xxx";
my @Array = ("abc");

print "Scalar = >>$Scalar<<\n";
print "Array = >>@Array<<\n";

eval 'require($Scalar)';

warn $@ if $@;

print "Scalar = >>$Scalar<<\n";
print "Array = >>@Array<<\n";
----------------------------------------------------------------------

 2) perl -w foo.pl

Scalar = >>xxx<<
Array = >>abc<<
Can't locate xxx in @INC (@INC contains: /project/djarraba/cte/lib /project/djarraba/prototype/lib /home/eda/app/perl/lib/sun4-solaris /home/eda/app/perl/lib/sun4-solaris/5.00404 /home/eda/app/perl/lib /home/eda/app/share/lib/site_perl/sun4-solaris /home/eda/app/share/lib/site_perl/sun4-solaris /home/eda/app/share/lib/site_perl /home/eda/app/pkgs/perl-5.004_04/sun55/lib/sun4-solaris/5.00404 /home/eda/app/pkgs/perl-5.004_04/sun55/lib /home/eda/app/pkgs/perl-5.004_04/sun55/lib/site_perl/sun4-solaris /home/eda/app/pkgs/perl-5.004_04/sun55/lib/site_perl .) at (eval 1) line 1.
Scalar = >>xxx<<
Array = >>abc<<

This is good.  The fact that the require failed has been warned about.

 3) touch xxx                    (created empty file called xxx)
 4) perl -w foo.pl

Scalar = >>xxx<<
Array = >>abc<<
Use of uninitialized value at /home/mgregory/bin/foo.pl line 15.
Scalar = >><<
Array = >><<


This is VERY BAD.  Where did my variable values go?  Why didn't the
fact that the require fails get reported?

 5) Just to make sure, I removed the eval:

----------------------------------------------------------------------
my $Scalar = "xxx";
my @Array = ("abc");

print "Scalar = >>$Scalar<<\n";
print "Array = >>@Array<<\n";

require($Scalar);

warn $@ if $@;

print "Scalar = >>$Scalar<<\n";
print "Array = >>@Array<<\n";
----------------------------------------------------------------------

Scalar = >>xxx<<
Array = >>abc<<
xxx did not return a true value at /home/mgregory/bin/foo.pl line 7.


This is good again.  The require failed.

This looks like a perl bug to me - I'm supposed to be able to use 'eval'
to check out 'require': the blue camel tells me so!

Any help appreciated - email copies doubly so!

Thanks,

Martin.


  


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

Date: Tue, 05 May 1998 03:21:29 GMT
From: garyg@gator.net (Gary M. Greenberg)
Subject: Re: basic email parser?
Message-Id: <ZAv31.1205$mu1.396906@news.randori.com>

In article <35468EEB.9ADC08CE@corp.home.net>, James Davis <james.davis@corp.home.net> wrote:
> Can anyone recommend a PERL module/process for parsing through emails?
> 
Jim,
Before I ever heard of perl, I wrote a program in C to parse email. The source 
and a description of what it does is online at:

        http://www.gator.net/~garyg/txts/mailsplitter.html

The page has my old address but the code is still valid (Guess I need to 
update this asap). Notice that I ask for users of this code to either donate 
to me or the Randal L. Schwartz legal defense fund -- he still needs the $$$.

Maybe you can use the code to write a perl version; maybe I'll do it.

Hope it's useful.

regards,

Gary

gary         -=-  The C Programmers' Reference  -=-
              http://www.gator.net/~garyg/C/c.html
        -=-  Avenue Programmers' Classes' Requests  -=-
             http://www.gator.net/~garyg/class.htm


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

Date: 5 May 1998 02:30:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: cd with a perl-script
Message-Id: <6iltkq$244$2@comdyn.comdyn.com.au>

In article <354DE8B4.4323@iosat.com>,
	John Andrea <jandrea@iosat.com> writes:

> perl has a chdir function
> isn't that what's wanted ?

Nope. This only changes the directory for the current process. What
was wanted was something to change the directory in the shell that
calls the perl script.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd.       | excuse - Lazarus Long
NSW, Australia                      | 


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

Date: 5 May 1998 02:45:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Checking for Ping reply???
Message-Id: <6ilug9$244$4@comdyn.comdyn.com.au>

In article <6ilp9v$fjt@sleipnir.iaccess.com.au>,
	"Andrew Specht" <andrew@iaccess.com.au> writes:
> Hi,
> 
> I was wondering if there is an option in perl to ping a host and then to
> check for a reply.  And if there is a reply, then do something else and so
> on

use Net::Ping;

# perldoc Net::Ping;

Is be part of the standard perl 5.004_04 distribution.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Tue, 5 May 1998 14:16:52 +1000
From: "Andrew Specht" <andrew@iaccess.com.au>
Subject: Re: Checking for Ping reply???
Message-Id: <6im3ob$j8@sleipnir.iaccess.com.au>

hmmm... ok  any idea where i can find out about that command?

Thanks again


Andrew


Martien Verbruggen wrote in message <6ilug9$244$4@comdyn.comdyn.com.au>...
>In article <6ilp9v$fjt@sleipnir.iaccess.com.au>,
> "Andrew Specht" <andrew@iaccess.com.au> writes:
>> Hi,
>>
>> I was wondering if there is an option in perl to ping a host and then to
>> check for a reply.  And if there is a reply, then do something else and
so
>> on
>
>use Net::Ping;
>
># perldoc Net::Ping;
>
>Is be part of the standard perl 5.004_04 distribution.
>
>Martien
>--
>Martien Verbruggen                  |
>Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
>Commercial Dynamics Pty. Ltd.       | enough features yet.
>NSW, Australia                      |




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

Date: Tue, 05 May 1998 00:15:14 -0400
From: Eryq <eryq@zeegee.com>
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <354E9252.6C96CAE5@zeegee.com>

Art Cohen wrote:

> Maybe because of the volumes of replies on this newsgroup that simply say
> "There's a module that does that available on CPAN".
> 
> : # interesting one seems to be MIME::Parser.  Clicking on that takes me to a
> : # listing of MIME-{Base64,Lite,tools,ispmailgate}.*.  None of which looks
> : # anything like the MIME::Parser module I asked for.  Going BACK to the
> : # CPAN.html#mime page gives you no hint that you need "MIME-tools.*".
> : # Clicking on various README's will eventually turn up MIME-tools as
> : # being the correct package.
> 
> : Good, you read the docs, that wasn't so hard, now was it?
> 
> Probably not, but it didn't seem to give him any useful information. I
> have experienced similar frustration trying to figure out which of the
> plethora of date and time-related modules will do what I want.
> 
> : # But wait, the comment in CPAN.html says that it's not part of the
> : # libwww bundle.  Do I need libwww?  Is it a prerequisite?  Clicking on
> : # libwww bundle says that MIME is _included_ in libwww.  So which do I
> : # want, libwww or MIME-tools.  (The descriptions for MIME and libwww
> : # in regards to MIME:: are contradictory.   At least _VERY_ confusing.)
> 
> : So what does any of this have to do with CPAN?  Complain to the module
> : authors for better docs.

*Ouch*  :-)  

In case you're interested, the confusion is that MIME::Base64 and 
MIME::QuotedPrint (written I think by Gisle) are included in libwww, 
but MIME-tools is not; it's another bundle entirely, written by
me *on top of* Gisle's stuff.   

Perhaps Gisle's stuff should be extracted from libwww, and 
distributed as MIME-core...?   


> There are plenty of "newbies" (of varying degrees of cluelessness) who
> could become a lot more clueful if CPAN were better organized.

Possibly, but I think that when you consider all that has been done to
support CPAN by Andreas, Tim, and company (including such goodies as
the PAUSE web site and the Perl5 Module List), I'd say you'd be hard-pressed 
to find a much-better reuse repository which is maintained for free
by volunteers. 

-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@zeegee.com)
 / _ \| '_| | | |/ _ ' /  President, Zero G Inc: http://www.zeegee.com/
|  __/| | | |_| | |_| |   
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 5 May 1998 00:47:33 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: CPAN & Module gripes (was Re: Ever Wonder...?)
Message-Id: <354e99e5.0@news.one.net>

Eryq <eryq@zeegee.com> wrote:
> Art Cohen wrote:
>> There are plenty of "newbies" (of varying degrees of cluelessness) who
>> could become a lot more clueful if CPAN were better organized.
>
> Possibly, but I think that when you consider all that has been done to
> support CPAN by Andreas, Tim, and company (including such goodies as
> the PAUSE web site and the Perl5 Module List), I'd say you'd be hard-pressed 
> to find a much-better reuse repository which is maintained for free
> by volunteers. 

Not only that -- I would be interested to see a reference to anything
else that is better. Commercial or free. Who has an example of one? If
there are things to learn, I am sure the CPAN folks will.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
There ain't nothin' in this world   131 Willow Lane, Floor 2  | ||  _ \
that's worth being a snot over.     Oxford, OH  45056         | || |_) |
--Larry Wall                        <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


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

Date: 5 May 1998 03:10:13 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Directory usage in Perl for win32
Message-Id: <6ilvul$2al$1@comdyn.comdyn.com.au>

In article <354E72F7.9B719F19@selectst.com>,
	David Coldrick <davidc@selectst.com> writes:

You're reinventing the wheel. File::Find does a better job at this,
does it platform independently and it comes with perl.

But OK, if you insist:

> use English;
> 
> my $pathsep = "\\";

Why not just '/'?

> sub lookin {
>     my ($dir, $function_ref) = @ARG;
> 
>     opendir DIR, $dir or die "Can't open $dir: $OS_ERROR\n";
>     my @files = readdir DIR;
> 
>     foreach $f (@files) {
>         next if ($f eq '.' or $f eq '..');  # ignore the DOS weirdness

Weirdness? DOS?

You could have done that with a grep on the readdir line, as has been
suggested often on this newsgroup, and is even suggested in the
documentation for readdir:

# perldoc -f readdir

And it really doesn't answer the original question, does it?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: Mon, 04 May 1998 22:51:35 -0500
From: darkcyde <bazaillion@primary.net>
Subject: directorys and Files?
Message-Id: <354E8CC7.964@primary.net>

Is there any commands in perl for instance if you gave it a directory it
could traverse it and obtain all the names and files in the directory? 

-mike


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

Date: 5 May 1998 00:23:35 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Help with DBM files
Message-Id: <354e9447.0@news.one.net>

Tracy J. Gough <tgough@ols.net> wrote:
> I am somewhat new with Perl and I am using DBM files with a project. The
> problem I am having is trying to store scalar values to the DBM file hash. I
> don't having any problems storing values to the DBM hash if they are from
> another hash. In this example $fields{'keyvalue'} and $fields{'formvalue'}
> represents values from the HTML form data that called the Perl script.

>     dbmopen(%itemrecs, "catalog", 0644)  || die "Can't open orders database
> file\n";
>     $somevalue = "Hello world";
>     $itemrecs{$fields{'keyvalue'}} = "$fields{'formvalue'}::$somevalue";

> The key and first field, $fields{'formvalue'}, will be stored. The
> $somevalue field will not be stored. The '::' isn't even stored. How do I
> store the scalar $somevalue?

There is nothing wrong with the code above as far as Perl 5.004 is
concerned. It tests just fine for me. You might mention your version --
if it is an ancient one like 5.001 or earlier then there could have been
a bug somewhere.

How are you accessing the value? Did you try just printing it?  If it is
used in some contexts the two colons could be interpreted as a package
separator.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
"The U.S. Senate -- white           131 Willow Lane, Floor 2  | ||  _ \
male millionaires working           Oxford, OH  45056         | || |_) |
for YOU!" -- Dave Barry             <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\





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

Date: 4 May 1998 20:04:51 -0700
From: rokicki@cello.hpl.hp.com (Tom Rokicki)
Subject: Re: If Perl had immediate subroutines...
Message-Id: <6ilvkj$erb@cello.hpl.hp.com>

> Does anybody here remember Forth? That very peculiar - and powerful -
> language had a notion of 'immediate' subroutines:

And various flavors of Lisp have macros as well.

I actually like this idea a lot.  Presently I'm engaged in building a
medium-sized system in Perl (5K lines) out of a lot of little objects.
These objects are all implemented by anonymous hashes, and the
overhead of the getter/setter functions just turned out to be
tremendous.  And while speed isn't *too* critical, well, things were
just too slow, even on really peppy hardware (one simple test showed
about 200x slower than the equivalent C).  So I feel back on 
eliminating the getter/setter functions and using direct reference
to the hashes instead.  That helped, at some price in extensibility
and reusability.

The problem is, there's no simple single inner loop or common
subroutine; instead, I'm spending my time entering and exiting all
sorts of various subroutines, and dereferencing anonymous hashes.
(A profiling version of Perl shows this to be the case.)

Being able to inline some of these functions might help a lot.
Or am I wrong?

-tom


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

Date: Mon, 04 May 1998 20:16:27 -0700
From: Keith Vertrees <keith@comcore.com>
Subject: Is this a safe lock?
Message-Id: <354E848B.ED3F30ED@comcore.com>

I've checked out the FAQ and its discussion of the flock function, but
I'm wondering if people will agree with me that the following code is a
safe locking mechanism.  It creates a file called LOCK, with only owner
write permission set, that locks my entire database.  Until someone else
can create the file (i.e. I've deleted it) they will be blocked. 
Everyone must call this same glock routine to create the LOCK file
(unless they cheat).

What do you think?  It's not exactly the same kind of sleep code that
was frowned on in the FAQ, because "open" should be an atomic operation
 ...

Regards,
Keith

#
# function glock
#
# Locks the database
#
sub glock {
  my ($lockfile,$oldumask);
  local *LOCK;
  $lockfile = $ENV{LOCK_PATH} . "/LOCK";
  if (-o $lockfile) {
    unlink($lockfile);
  }
  $oldumask = umask;
  umask(022);
  sleep(3) while (!open(LOCK,"> " . $lockfile));
  print LOCK `date`;
  umask($oldumask);
  close (LOCK);
}

-- 
     _/_/_/  _/_/_/  _/    _/  _/_/_/  _/_/_/  _/_/_/  _/_/_/
   _/      _/    _/ _/_/_/_/ _/      _/    _/ _/   _/ _/
  _/      _/    _/ _/ _/ _/ _/      _/    _/ _/_/_/  _/_/
 _/      _/    _/ _/    _/ _/      _/    _/ _/   _/ _/
 _/_/_/  _/_/_/  _/    _/  _/_/_/  _/_/_/  _/   _/ _/_/_/

Keith Vertrees                       mailto:keith@comcore.com
ComCore Semiconductor, Inc             http://www.comcore.com
5075 Shoreham Place, Suite 260            phone: 619-535-0074
San Diego, CA 92122                         fax: 619-535-0084


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

Date: 5 May 1998 03:57:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Is this a safe lock?
Message-Id: <6im2o5$si8$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Keith Vertrees <keith@comcore.com> writes:
:I've checked out the FAQ and its discussion of the flock function, but
:I'm wondering if people will agree with me that the following code is a
:safe locking mechanism.  

It's not.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


Unix never says `please.'  -- Rob Pike


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

Date: Mon, 04 May 1998 23:56:36 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Length of a variable
Message-Id: <354E8DFA.DF3A465@coos.dartmouth.edu>

Dan Boorstein wrote:
> 
> Ronald J Kimball wrote:
> >
> > $length = () = split //, $_;
> 
> oops, this look familiar.

Don't assign split to an empty list!  *bam*  Don't assign split to an empty
list!  *bam*

I'll get it eventually.  :-)

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 04 May 1998 22:26:48 -0600
From: Bruce Langlois <langlois@sni.net>
To: theo@acsp.com
Subject: list from regexp
Message-Id: <354E9507.E5392CDA@sni.net>

If I have a string with an indeterminate number of repeating groups, preceeded
by some other
characters, say:

    @dbgddbggdbbgddd-b

and I want to insert a seperator between the groups so it looks like this:

    @dbg.ddb.ggd.bbg.ddd-b

I can do it by getting the various substrings out with a regexp, then run a
while loop on
the groups to add the '.'.  What I was wondering is if there is a way to get a
regexp to
return backreferences as a list?  If there is, then I could do this as a single
substitution,
rather than as part of a loop.

This is the basic regexp which I use to extract the pre, match, and post
portions:

  m/[^dbg]*([dbg]{3}*)[^dbg]*/

--
Everything goes better with a delayed blast fireball.  =(:)
bruce@acsp.com
langlois@sni.net




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

Date: 5 May 1998 02:29:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: malformed header?
Message-Id: <6iltho$244$1@comdyn.comdyn.com.au>

In article <354CBD56.51A3@sonic.net>,
	~arthur <star@sonic.net> writes:

> print header, start_html("Ice Cream Stand"), h1("Ice Cream Stand");
> if (param()) {  
>     my $who = param("name");

> I get these errors
> # syntax error, near "my"
> File 'StarMax HD:Desktop Folder:Mac_Perl:extra folder:ice_cream_stand';

Which version of perl are you using? Sounds like you might be using a
perl 4.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 


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

Date: Tue, 05 May 1998 03:55:54 GMT
From: curtish@gte.net (Curtis Hoffmann)
Subject: Open to suggestions
Message-Id: <6im2ku$en$1@gte2.gte.net>


  To all,
  
   I find myself in the middle of a Perl programming project that is
actually a small part of a larger effort.  And, I'm hoping that one of
you can point me to existing code that does roughly what I need.

   Basically, we're using Adobe Acrobat (on a Win 95 platform) to
submit form data from a user, on the company's intranet.  The form
data will go to a CGI script, which only has to store the data to the
hard disk.  (Once on the server, the data will be imported into an
Access database.)  The form data is pre-formatted by Acrobat, but it
doesn't have any field name data (it's all fixed position.)

   What I'm asking for is pointers to a Perl script that can take a
block of text data and store it to a particular subdirectory on the
server.  The file names should be sequential, (i.e. - File0001.txt,
File0002.txt, File0003.txt, etc.)  And, if there are any security
holes here, it'd be nice to know about them.

   Any help will be greatly appreciated.  Thanks.


-----------------------------------
Curtis H. Hoffmann
<http://home1.gte.net/curtish/index>
curtish@gte.net.nospam

Home of anime and manga summaries.  
Currently selling my anime cels, manga, and stuff.
-----------------------------------


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

Date: Tue, 05 May 1998 03:51:24 GMT
From: holcojh5@REMOVEMEwfu.edu (Philosopher King)
Subject: Re: Perl Net App doesn't play well w/ C Net App
Message-Id: <354f8b62.8610220@enews.newsguy.com>

On Mon, 04 May 1998 13:28:51 -0700, Kirk Metz <kirk.metz@waii.com>
wrote:


>	I'm running Linux with kernel 2.0.18,Red Hat 4.0 on a x86 machine if it
>makes a diff.  The perl version I believe is 5.0.0.2
>

I don't know about the sockets question, but you *really* need to
think about getting a newer kernel. 2.0.18 is loaded with bugs and you
could be getting bitten by one of them on this. You might want to
consider upgrading your version of Perl as well. The current version
is 5.004_4, which contains some relatively significant differences. I
don't know if this will help you with your sockets question or not,
but it certainly couldn't hurt. I had some really bad experiences with
networking under some of the 2.0.1x kernels that disappeared when I
upgraded.

Good luck,

Heath

--
Heath Holcomb                  * I want to be more like the ocean
holcojh5@REMOVEMEwfu.edu       * No talking, man...
holcomb@REMOVEMEmthcsc.wfu.edu * All action
http://www.wfu.edu/~holcojh5/  * - Perry Farrell


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

Date: Tue, 05 May 1998 13:05:46 +1000
From: ayl <test@net.net>
Subject: Perl Socket and proxy Server
Message-Id: <354E820A.41C67EA6@net.net>

I am trying to use port 80 to have a diirect connection for http
request.
The problem is, this is not permitted. I have to have my perl script
talk to a Proxy server first.
Does anyone know how to talk to a proxy server, sending an URL request
to a proxy server?
BTW I dont want to use any of the CPAN module.


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

Date: 5 May 1998 02:32:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl2Exe file for Unix?
Message-Id: <6iltnu$244$3@comdyn.comdyn.com.au>

In article <354d8bb7.0@newsread1.dircon.co.uk>,
	"Tan" <tan@jettech.dircon.co.uk> writes:
> Is there any way that I can convert a Perl script into an executable under
> unix? Basically I am developing some code and would prefer it if people
> couldn't see the underlying Perl script. I am using HPUX 9 & 10.

# perldoc perlfaq3
/How can I compile my Perl program into byte code or C

> Would be grateful for any help received.

Help yourself. Spend some time reading the documentation and faqs that
come with perl. You'll learn a lot.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 5 May 1998 03:28:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Printing in Perl
Message-Id: <6im11q$2dj$1@comdyn.comdyn.com.au>

In article <6ilt2l$ivu$1@nnrp1.dejanews.com>,
	indhiraa@hotmail.com writes:
> Hi:
> 
> here is my code:
> 
>   use FileHandle;
> 
>   my $helpMsg = "help\n";
>   my $pfh = new FileHandle "| /usr/openwin/bin/filep -l";
>   (defined $pfh) or return "Can't print.: $!\n";

You can write this as 

my $pfh = new FileHandle "| /usr/openwin/bin/filep -l" or 
	return "Can't print: $!\n";

Are you sure that $! has a meaning here?

> 
>   print $pfh "$helpMsg";

$pfh->print($helpMsg);

The double quotes don't do anything.

>   undef $pfh;

An explicit close might be better: 

$fh->close();

> I am invoking this subroutine at the press of a button.
> I get this error:
> 
> Tk::Error:      (in cleanup) Not a GLOB reference

I can't see too much wrong with the code above, unless filep does
something odd. Are you sure that Tk::Error is complaining about that
code? Are you sure you're using /usr/openwin/bin/filep correctly? Have
you tried something like this from the command line:

# echo "help" | /usr/openwin/bin/filep -l

and did that do what you want?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Tue, 05 May 1998 00:24:49 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Regex Question
Message-Id: <354E9499.3BAB88DE@coos.dartmouth.edu>

Craig Berry wrote:
> 
>   $string =~ s/[(){}/].*$//;

Don't forget to backslash the /.  :-)

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 04 May 1998 23:54:36 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Replacement for grep using map
Message-Id: <354E8D81.D314BD4F@coos.dartmouth.edu>

bart.mediamind@tornado.be wrote:
> 
> I stumbled across a neat trick the other day. I don't think it's a well-known
> idiom, well, *I* hadn't encountered it before. :-) It could even be useful at
> times.

Well, it's at least well known enough to be in the Camel book.  From the
description for grep:

  The following two statements are functionally equivalent:

    @out = grep { EXPR } @in;
    @out = map { EXPR ? $_ : () } @in;

But, I wouldn't have known it was there if you hadn't inspired me to look for it!


On the other hand, I have found a case in which they are not equivalent:

  DB<1> @list = -1..1

  DB<2> @foo = 0

  DB<3> x grep { @foo } @list
Bizarre copy of ARRAY in leave at (eval 16) line 2.
  DB<4> x map { @foo ? $_ : () } @list
0  '-1'
1  0
2  1
  DB<5>

Looks like a bug, especially since that's a panic error.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 05 May 1998 00:10:56 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Splain a regex to me
Message-Id: <354E9157.C053CEA0@coos.dartmouth.edu>

kathryn.nelson@usa.net wrote:
> 
> I have been learning Perl for about a month now and while reading a lot of
> code from various places, it would be very helpful if there was a script
> which would take as input a regex and output a sentence describing what
> this regex would match.
> 
> i.e. /[ab].+:(\s*)/
> "starts with the letter a or b followed by one or more characters followed
> by a colon and zero or more whitespaces which are remembered as $1..."

I have a toy script which takes a regex and generates a string that the regex
will match.  It only accepts a subset of Perl's regex language, however.  In
particular, it doesn't do zero-length assertions or non-capturing parentheses.

Anyway, the script could probably be hacked to output an English description
of the regex, rather than a matching string.  But, as has already been pointed
out, an English description of a regex is not very useful.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 5 May 1998 03:39:14 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: Translating crontab(5) file to a format that can be compared to dates
Message-Id: <894339543.681003@elaine.drink.com>

In article <894329119.495442@elaine.drink.com>,
Alan Barclay <gorilla@elaine.drink.com> wrote:
>I'm looking to read in a crontab(5) file, and use this in some date
>math, then re-write the crontab file based upon the adjusted times.

I've been informed that later versions of Date::Manip have a new
function ParseRecur() which manipulates recurring dates. Looks
like it will do the trick.



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

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

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