[9619] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3213 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 21 10:17:24 1998

Date: Tue, 21 Jul 98 07:00:50 -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           Tue, 21 Jul 1998     Volume: 8 Number: 3213

Today's topics:
    Re: "reset" does not work ?! (M.J.T. Guy)
    Re: %vHash = $vScalar doesn't work, why? (Aaron B. Dossett)
        'use diagnostics' with Win32-perl <spettay@lgc.com>
        anyone working on CDO or CDONTS module? <tim@hcirisc.cs.binghamton.edu>
        Better way of saying this. <domainsource@usa.net>
    Re: Can a Crontab run perl script magyir@my-dejanews.com
    Re: client/server help 2 (Joseph M Carlton)
        DBD::Oracle for Oracle 8 (NT) gloriat44@my-dejanews.com
        DBD::Oracle for Oracle 8 (NT) gloriat44@my-dejanews.com
    Re: dumb questions Re: Problem with DBD::Oracle <kucerar@hhmi.org>
        expressions <gcushing@exchange.nih.gov>
    Re: Finding new files (create after a time stamp) (Jeffrey Drumm)
    Re: Fun with large hashes (Ilya Zakharevich)
    Re: Guidance.. (Eric Harley)
    Re: How to connect to a socket ? <davidc@selectst.com>
    Re: How would I associate the alphabet with numbers? (Craig Berry)
    Re: Locking SDBM files <clint@netcomuk.co.ukXX>
    Re: Need help with POST <file@job.to>
    Re: newbie question on pattern match (Larry Rosler)
    Re: Perl Beautifier Home Page (Ilya Zakharevich)
    Re: Perl Setup on NT (Steve Linberg)
    Re: Perl zipping files?? <barnett@houston.Geco-Prakla.slb.com>
        regexp question <tim@hcirisc.cs.binghamton.edu>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 15 Jul 1998 17:44:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: "reset" does not work ?!
Message-Id: <6oippn$he4$1@seletar.ap.deuba.com>

Yakov Yukhnovetsky  <jak@tx1.elex.co.il> wrote:
>I perform several sequential pattern searches, OK.
>.
>$_  = "1111  fffffff 7777777777 jjjjjjjjjjjj";
>
># the first search:
>/(\d+)\s+(\w+)\s+(.+)/;
>print "$1\n$2\n$3\n\n";
>
># the second one:
>/(\d+)\s+(RRR)(\w+)\s+(.+)/;
>print "$1\n$2\n$3\n";
>
>Obviously, the second search will fail, but $1, $2 and $3 are still exist from
>the first search.

You seem to have some confused program logic.

If a match has failed, you shouldn't be looking at $1 etc.

If you want to check if a match has succeeded, look at the result of
the match, not the values of $1 etc.

Note that $1 etc can be undefined even though a match succeeded, e.g.
after matching       /(a)|(b)/    one of $1, $2 will be undef.


Mike Guy


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

Date: 16 Jul 1998 17:52:11 GMT
From: aarond@alpha.ewl.uky.edu (Aaron B. Dossett)
Subject: Re: %vHash = $vScalar doesn't work, why?
Message-Id: <6olekb$3mj$1@seletar.ap.deuba.com>

Scott Cherkofsky (crusader@bilbo.ShireNet.com) wrote:
> 
> I've got a simple problem that's been driving me bonkers.  why doesn't 
> the following code work?
> 
> 	$vSDFGuts = "NAME,Scott,DESC,5ft10inches";
> 	%hSDFInfo = $vSDFGuts;
> 
> I can't get $hSDFInfo{NAME} to give me back Scott!

Try this.

%hSDFInfo = split /,/, $vSDFGuts;

You can't populate a hash with a single scalar.

-- 
Aaron B. Dossett   |   Finger aarond@london.cslab.uky.edu for PGP key
dossett@bigfoot.com|      
Comp. Sci. Senior  |         http://www.ewl.uky.edu/~aarond
    University of Kentucky    1996 & 1998 NCAA Basketball Champions


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

Date: Wed, 15 Jul 1998 12:30:43 -0500
From: "Steve Pettay" <spettay@lgc.com>
Subject: 'use diagnostics' with Win32-perl
Message-Id: <6oioql$2va$1@seletar.ap.deuba.com>

What's the secret to using "use diagnostics" under Win32-perl?

I get the error:

couldn't find diagnostic data in /pod/perldiag.pod
C:\PERL\lib\i386-win32 C:\PERL\lib . test.pl at
C:\PERL\lib/Diagnostics.pm line 225, <POD_DIAG> chunk 507.

BEGIN failed--compilation aborted at test.pl line 3, <POD_DIAG>
chunk 507.

The string "C:\PERL\lib\i386-win32 C:\PERL\lib ." represents my @INC
array.

I gathered that the problem is that I didn't have the perldiag.pod file,
I had the binary installation so I went and retrieved the perl source
and manually placed all pod files in the existing pod directory:
C:\Perl\lib\Pod\    with no luck.
Do I have to build the perl binary from the source to get this
to work or some other trick?

Anyone?

===================================================================
Steve Pettay (spettay@lgc.com)
Landmark Graphics Corporation
Drilling & Well Services Products Group
6660 S. Sheridan Suite 205
Tulsa, OK 74133

(918) 523-9550
(918) 523-9556 fax
===================================================================





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

Date: 14 Jul 1998 17:40:25 -0400
From: Tim Gray <tim@hcirisc.cs.binghamton.edu>
Subject: anyone working on CDO or CDONTS module?
Message-Id: <t0ww9gjely.fsf@seletar.ap.deuba.com>

At work we use MS Exchange and I would really like to get some more
functionality out of it.  But the way most people do that is with
Outlook forms and other unfriedly or highly proprietary and costly
solutions.  So I was wondering if anyone is working on a module to use
Microsoft's Collaborative Data Objects.


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

Date: Wed, 15 Jul 1998 23:08:49 -0400
From: "David Thompson" <domainsource@usa.net>
Subject: Better way of saying this.
Message-Id: <6ojqkt$6nk$1@seletar.ap.deuba.com>

I have a feeling that I'm carrying C++ to far into Perl here and I'm
missing a good way of doing things.
I have a list of keywords and a string.  I need to see if any of the
keywords are in the string.

Examples (keywords are "joe, bob, mary"):
xxxjoexxx = true
mary = true
xxxxmaryjoe = true
xxx = false
xxxmar = false

Pretty straightforward.  Using my C++ experience I have the following
code, which works, but probably isn't Perl elegant:

----------
$teststring = "something"
$allowed = "";
@allowed = qw (mary joe bob);
foreach $keystring (@allowed)
 {
 if ($teststring =~ /$keystring/i) {$allowed = "yup";}
 }
unless ($allowed eq "yup") {die "Sorry, not found";}
----------

Now, is there an easier way to do that without a foreach?  Thanks much!

David





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

Date: Tue, 21 Jul 1998 12:48:20 GMT
From: magyir@my-dejanews.com
Subject: Re: Can a Crontab run perl script
Message-Id: <6p22mk$5j1$1@nnrp1.dejanews.com>

In article <35B1A56C.85E14798@compugen.co.il>,
  Avi Rosenberg <avir@compugen.co.il> wrote:
> >
> > Wali Haidri <whaidri@ford.com> Said this:
> >
> > >I wrote a perl (actually an oraperl) program. It runs as expected when
> > >submitted from the command line. But when I run it from a crontab, it
> > >does not work.
> > >
> > >Thanks.
> >
> > Anywhere in the script where you use "relative" paths, you will need
> > to make them full paths.....
> >

> Also remember that when you run a script from cron, it might be
> executing
> with a different uid than your interactive checks...
>
> --
> ***********************************************************************
>  Avi Yeshah Rosenberg                   "GCCGTAATCCGG"
>  Compugen Ltd.                          Tel: +972-3-9348482
>  17 Hamacabim St.                       Fax: +972-3-9348489
>  Petach-Tikva, 49220                    E-mail: avir@compugen.co.il
>  Israel                                 WWW: http://www.cgen.com
> **********************************************************************
>
> Wali,
You need to make sure that you reference the location of your Perl compiler in
your cron because the subshell running cron may not have it exported to it.
When u run from command line you're in a particular shell and it obviously
knows where perl is, but the subshell u use fro your crons may not have perl
setup. either 1) export it in the command being cronned or 2) export perl to
this shell, depending on how many perl progs u wanna run at 'crontime'

HTH
Mick Farrell
magyir@my-dejanews.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 16 Jul 1998 17:22:04 GMT
From: carltjm@mail.auburn.edu (Joseph M Carlton)
Subject: Re: client/server help 2
Message-Id: <6olcrs$7c0$1@seletar.ap.deuba.com>

Well, I finally got the client/server examples in the book working.  I'm 
just trying to get the socket and table search working  before I try to 
do it through the web.  I need to send an id number to the server, so it 
can do the table search and return the data.  Does anyone know how I send 
the ID number?  Is in done with the connect statement or is there some 
other command to send it in?  

Thanks,
Joey

Joseph M Carlton (carltjm@mail.auburn.edu) wrote:
: From page 354 of Programming Perl:
: "For example, let's say that you have a long running database server 
: daemon that you want folks from the World Wide Web to be able to
: access, but only if they go through a CGI interface. You'd have a small, 
: simple CGI program that does whatever checks and logging you feel
: like, and then acts as a Unix-domain client and connects to your private 
: server. "

: This is EXACTLY what I need to do.  But I don't know how to get the 
: client and server working.  Someone please help.  See also my other posts.
: Thanks.

: --

: Joey Carlton
: Senior, Computer Engineering
: Auburn University
: carltjm@mail.auburn.edu

--

Joey Carlton
Senior, Computer Engineering
Auburn University
carltjm@mail.auburn.edu


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

Date: Tue, 21 Jul 1998 13:53:16 GMT
From: gloriat44@my-dejanews.com
Subject: DBD::Oracle for Oracle 8 (NT)
Message-Id: <6p26gc$9uk$1@nnrp1.dejanews.com>

Hi everybody!

I have just installed Oracle 8 and I didn't have a previous version already
installed on the Windows NT server.

I have followed the discussions about the DBD::Oracle drive and its use with
oracle 8. I have installed DBI - 0.90 and been trying (with no success) to
install DBD - Oracle 0.47. The problem is that I don't have any oracle.mk
file. Actually there's no trace of any *.mk file in the Orant directory nor
on the Cd-Rom.

What can I do to install the DBD - Oracle interface? Is there anybody that has
already had this same problem?

Thank you for your help.

Regards

Gloria Taurisano

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 21 Jul 1998 13:53:16 GMT
From: gloriat44@my-dejanews.com
Subject: DBD::Oracle for Oracle 8 (NT)
Message-Id: <6p26gd$9ul$1@nnrp1.dejanews.com>

Hi everybody!

I have just installed Oracle 8 and I didn't have a previous version already
installed on the Windows NT server.

I have followed the discussions about the DBD::Oracle drive and its use with
oracle 8. I have installed DBI - 0.90 and been trying (with no success) to
install DBD - Oracle 0.47. The problem is that I don't have any oracle.mk
file. Actually there's no trace of any *.mk file in the Orant directory nor
on the Cd-Rom.

What can I do to install the DBD - Oracle interface? Is there anybody that has
already had this same problem?

Thank you for your help.

Regards

Gloria Taurisano

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 21 Jul 1998 09:54:13 -0400
From: Richard J Kucera <kucerar@hhmi.org>
Subject: Re: dumb questions Re: Problem with DBD::Oracle
Message-Id: <35B49D86.FC3B07DF@hhmi.org>

The socket is there listening on Oracle,  don't you just have to talk to it correctly?
Why involve Pro*C?
These network JDBC drivers work pretty good(can't be smoke & mirrors because the classes
port without
changes from NT to Solaris,  we're talking nachos here).
TIA

Matthew O. Persico wrote:

> Partially because the DBDs all eventually access the VENDOR's API
> LIBRARY, which is proprietary and cannot be linked into a binary
> distribution and passed around like so many nachos at a superbowl party.
> And compiling using the shared versions of the vendors libraries is an
> even worse option. There would have to be multiple version kept around
> to account for additional entry ponuts as the verndor libraries were
> updated.
>
> Quite frankly, I've had zero truble building Perl modules. If you're
> mucking around with gcc, try the native compiler. ANd may I suggest that
> if you have to muck around with gcc, it probably wasn't built right.
>
> Richard J Kucera wrote:
> >
> > Why aren't there pre-built DBD's for major vendors and platforms?
> > It seems like Perl would take off in popularity if there were just some pre-built
> > packages...
> > especially a pre-built Apache + mod_perl + Oracle DBD...
> >
> > I would gladly switch to Apache & DBI from Java Web Server & Oracle type 4 JDBC
> > but I simply don't have the time for such mucking around with running gcc anymore
> > (I'd love to do it,  but I'd get in trouble).
> >
> > Also,  if Perl networking is so great,   why don't they write network drivers like
> > they've done with Java,  rather than continue to rely on native drivers?   It seems
> > like
> > it would make life simpler.
> >
> > ... if I could just get a pre-built DBD
> > I could start using it immediately for some quick CGI jobs where servlets are
> > cumbersome,  rather than keep proliferating Java.
> >
> > -R Kucera,  Web Apps Developer.
> >
> > Eric Zylberstejn wrote:
> >
> > > Ralf Orlowski wrote:
> > > > As I could need some data from the Oracle-Database in this scripts I tried
> > > > to install the DBI and the DBD-Oracle module to access the Database from
> > > > within perl.
> > > > But during the installation of the DBD module I had to recognize that this
> > > > module needs some header files from oracle for the installation that are
> > > > not included in my runtime Version of Oracle.
> > >
> > > Hi,
> > >
> > > I think you need Oracle's Pro*C module, because DBD::Oracle is partly written
> > > in C. Once you get Pro*C on your computer everything will run correctly. I have
> > > been using DBI and DBD::Oracle for quite some time now.
> > >
> > > Take a look at:
> > > http://www.hermetica.com/technologia/perl/DBI/index.html
> > >
> > >         Eric
> > >
> > >   ------------------------------------------------------------------------
> > >
> > >   Eric Zylberstejn <Eric.Zylberstejn@wanadoo.com>
> > >   FTI
> > >
> > >   Eric Zylberstejn
> > >   FTI                      <Eric.Zylberstejn@wanadoo.com>
> > >   41 r Camille Desmoulins  Work: 01 41 33 94 59
> > >   Issy-les-Moulineaux      Netscape Conference Address
> > >   92130                    Netscape Conference DLS Server
> > >   France
> > >   Additional Information:
> > >   Last Name  Zylberstejn
> > >   First Name Eric
> > >   Version    2.1





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

Date: Fri, 17 Jul 1998 11:58:58 -0400
From: George Cushing <gcushing@exchange.nih.gov>
Subject: expressions
Message-Id: <35AF74C2.3E6AE057@seletar.ap.deuba.com>

I am reading a log as input and wants to scan every line to pick up
fields. My fifth field is not scanning right (request). Here is my
script:
#!/usr/bin/perl

 $logfl = "Jun.log.newfmt";
 open(IN,$logfl);
    while (<IN>) {
($annr, $rfc931, $authuser, $timestamp, $request, $status, $bytes) =
    /^(\S+) (\S+) (\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;
$cnt = $cnt +1;
if ($cnt < 5) {
print "annr     =$annr\n";
print "rfc931   =$rfc931\n";
print "authuser =$authuser\n";
print "timestamp=$timestamp\n";
print "request  =$request\n";
print "status   =$status\n";
print "bytes    =$bytes\n";
               }
}

Here is my output:

annr     =165.112.136.45
rfc931   =-
authuser =-
timestamp=19/Jun/1998:18:27:15 -0400
request  =GET /images/employee.jpg HTTP/1.0" 200 2097
"http://eos16.dcrt.nih.go)
status   =GET
bytes    =/images/employee.jpg

MY QUESTION IS WHY THE SCAN FOR request field DIDNOT WORK?

\"(.+)\"  should have scaned for the 2th quotes but it went to the last
quote of the line.
Did I have the wront expression?  There was a quote before GET.  (That
was the fist quote).  I need up here!  Am I not understanding the
expression for the request first?

Any help will be appreciated.  Thanks.

George
gcushing@exchange.nih.gov




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

Date: Tue, 21 Jul 1998 13:16:11 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Finding new files (create after a time stamp)
Message-Id: <35b482c6.90519656@news.mmc.org>

[posted and mailed]

On Mon, 20 Jul 1998 20:35:06 GMT, drubin@gatekeeper.cb.att.com wrote:

>Hello,
>
>What is the best way (using ksh or perl) to find all files in a directory
>created after a timedate stamp (such as 07/20/98:10:10)?  I was hoping this
>would be simple, but I keep coming up with very messy solutions.
>
>Thanks for any suggestions.
>

One thing to keep in mind with all of the other answers posted here is that
Unix doesn't keep track of the "creation time" of a file. The times
maintained are:

 mtime - time of the last modification to file
 ctime - time of last modification to inode (size, permissions, links)
 atime - time of last access to file

Given the above, the File::Find module can be quite useful if you need to
search an entire directory tree, as it provides virtually all of the
functionality of the Unix 'find' command from within Perl. If your needs
are less comprehensive (for example, needing only to check the contents of
a single directory), readdir and the unary file test operators (-M, -C and
-A for the times listed above) are probably the way to go.

'perldoc perlfunc' for implementation details.

-- 
                           Jeffrey R. Drumm, Systems Integration Specialist
                                  Maine Medical Center Information Services
                                     420 Cumberland Ave, Portland, ME 04101
                                                        drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me


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

Date: 21 Jul 1998 09:49:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Fun with large hashes
Message-Id: <6p1o6s$1m3$1@seletar.ap.deuba.com>

[A complimentary Cc of this posting was sent to M.J.T. Guy
<mjtg@cus.cam.ac.uk>],
who wrote in article <6p1cge$h58$1@pegasus.csx.cam.ac.uk>:
> Wrong.   You are talking about the wrong error message.
> 
> Perl confusingly has two error messages which are very similarly worded.
                   ^^^
had!

> From   perldoc perldiag:
> 
>      Allocation too large: %lx
>          (X) You can't allocate more than 64K on an MS-DOS
>          machine.
> 
>      Allocation too large
>          (F) You can't allocate more than 2^31+"small amount"
>          bytes.

Mea culpa!  But not any more!  This is why I did not find this message
when grepping 5.004_72.

Nowadays (nowamorrow? ;-) all the out-of-memory messages start with
(guess?) "Out of memory".

Ilya


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

Date: Wed, 15 Jul 1998 10:17:47 -0700
From: eharley@pacbell.net (Eric Harley)
Subject: Re: Guidance..
Message-Id: <eharley-1507981017480001@seletar.ap.deuba.com>

> The script is an online entry editor..  With it, you can view entries
> (which simply displays the text file), or add entries (each entry is
> just a line of text).  However, I am wanting to implement a delete
> feature.  This is not as easy as I had hoped it would be, though.  I
> figured the best layout to do this would be to put a checkbox next to
> each entry (each line).  To delete an entry, you would simply check the
> checkbox next to the corresponing entry.  You would then submit,
> confirm  (I'm clear on how to do the confirming part), and it would
> delete the appropriate line from the text file.

Here is a script that I wrote for a client that handles features similar
to yours. The file uses two sharps (##) to separate fields. When a request
is received, only one ID is passed along so it doesn't do exactly what you
want. However, adding processing for multiple IDs is trivial.

Original Script:
#!/usr/local/bin/perl

use CGI;

$query = new CGI;

$data_file = "af_data.txt";
$journal_file = "af_journal.txt";

$LOCK_UN = 8;
$LOCK_EX = 2;

print $query->header();

$id_num         = $query->param('id');
$who            = $query->param('who');
$comments       = $query->param('comments');

@date_fields = localtime(time);
$date = "$date_fields[3]/$date_fields[4]/$date_fields[5]";

open DATA,"<$data_file";
open JOURNAL,">>$journal_file";

lock_DATA();
lock_JOURNAL();

while(<DATA>) {
        /(^[0-9]+)##/;
        if( $1 == $id_num ) {
                print JOURNAL "$date##$who##$comments##$_";
        } else {
                print DATA;
        }       
}

unlock_DATA();
unlock_JOURNAL();

sub lock_DATA {
        flock DATA,$LOCK_EX;
        #And in case someone appended
        #while we were waiting...
        seek DATA, 0, 2;
}
sub lock_JOURNAL {
        flock JOURNAL,$LOCK_EX;
        #And in case someone appended
        #while we were waiting...
        seek JOURNAL, 0, 2;
}
sub unlock_DATA {
        flock DATA,$LOCK_UN;
}
sub unlock_JOURNAL {
        flock JOURNAL,$LOCK_UN;
}

You will notice that this script prints out the deleted line to a journal
for archive purposes.
This script processes an array and preforms the exact same function as above:

#!/usr/local/bin/perl

use CGI;

$query = new CGI;

$data_file = "af_data.txt";
$journal_file = "af_journal.txt";

$LOCK_UN = 8;
$LOCK_EX = 2;

print $query->header();

$who            = $query->param('who');
$comments       = $query->param('comments');

@date_fields = localtime(time);
$date = "$date_fields[3]/$date_fields[4]/$date_fields[5]";

foreach $id_num(@ids) {
   open DATA,"<$data_file";
   open JOURNAL,">>$journal_file";

   lock_DATA();
   lock_JOURNAL();

   while(<DATA>) {
         /(^[0-9]+)##/;
         if( $1 == $id_num ) {
                 print JOURNAL "$date##$who##$comments##$_";
         } else {
                 print DATA;
         }       
   }

   unlock_DATA();
   unlock_JOURNAL();

   close DATA;
   close JOURNAL;
}

sub lock_DATA {
        flock DATA,$LOCK_EX;
        #And in case someone appended
        #while we were waiting...
        seek DATA, 0, 2;
}
sub lock_JOURNAL {
        flock JOURNAL,$LOCK_EX;
        #And in case someone appended
        #while we were waiting...
        seek JOURNAL, 0, 2;
}
sub unlock_DATA {
        flock DATA,$LOCK_UN;
}
sub unlock_JOURNAL {
        flock JOURNAL,$LOCK_UN;
}


If you need further help with your script, just ask.

-- 
Eric Harley
Freelance Programmer
  You need it done, I'm your man.

eharley@pacbell.net
http://burn.victim.com/~eharley


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

Date: Tue, 21 Jul 1998 19:45:48 +1000
From: David Coldrick <davidc@selectst.com>
Subject: Re: How to connect to a socket ?
Message-Id: <35B4634C.27D27E92@seletar.ap.deuba.com>

Well, so far, there's not much happening on clp.moderated - at least,
after it's been moderated :-)

Jim Brewer wrote:
> 
> Tom Christiansen <tchrist@mox.perl.com> writes:
> 
> > You didn't use the strict pragma.
> > You didn't use the Socket module.
> > You didn't use the -w flag.
> >
> > And I don't think you read the perlipc(1) manpage,
> > which answers this question in exhaustive detail.
> >
> > --tom
> 
> Who cares, you now have clp.moderated. Why are you still here? You got
> what you wanted. Why are you still here? There is no need. You are no
> safe from newbies and morons and idiots. What is your problem? Are you
> going to continue to your diatribes despite the delivered salvation
> you so endlessly pinned for? Why, oh why?
> 
> Jim Brewer,


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

Date: 19 Jul 1998 17:11:27 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How would I associate the alphabet with numbers?
Message-Id: <6ot9bv$85r$4@seletar.ap.deuba.com>

Chocolate (poohba@io.com) wrote:
: I would like to make a=100000 and b=200000 and c=300000...  How would I do
: this?

I'd recommend doing this with hash vals rather than scalars, makes things
a bit more tractable.  Here's how I'd do it:

  @dict{'a'..'z'} = map { $_ * 100000 } ( 1..26 );

Then $dict{a} is 100000, $dict{b} is 200000, and so forth.

: what I want is
: 
: if a=100000 then a00001 = 100001;

I can't make sense of that syntax.  Could you try again, writing it in
more Perlish pseudocode?

---------------------------------------------------------------------
   |   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: Tue, 14 Jul 1998 18:22:37 +0100
From: "Clinton Gormley" <clint@netcomuk.co.ukXX>
Subject: Re: Locking SDBM files
Message-Id: <6og455$pp3$1@seletar.ap.deuba.com>

Also, is there any need to lock the database if you are just reading?  ( in
fact, what is a shared lock?)

and lastly, is there an NT port of the Berkley DB available?

thanks






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

Date: Tue, 21 Jul 1998 15:09:55 +0200
From: "file" <file@job.to>
Subject: Re: Need help with POST
Message-Id: <6p23ti$e06$1@usenet51.supernews.com>

no... I  didn't make myself clear ...

what i am looking for is a way to post something very quickly and with as
little traffic as possible to another script... this has nothing to do with
sending mail with a script... from a form...

There is no code... but lets say I wanted to post to
www.abc.com/script.cgi the following varialbes name with the value "file" -
email with the value "something@else" etc... and then the same fashion for
other scripts as well... i basically want to simulate the pressing of a
submit-button...

Thanks


Tony Curtis schrieb in Nachricht
<7xhg0b2x02.fsf@fidelio.vcpc.univie.ac.at>...
>Re: Need help with POST, file <file@job.to> said:
>
>file> Hi, What is the quickest (as little traffic as
>file> possible) way to post information to an outside site
>file> without wanting to know what it answers within a perl
>file> script?....
>
>    use Royal::Mail;
>
>
>
>What do you mean by "post" exactly?
>Which protocol, if any, do you want to use?
>
>Post some code, fergoodnessake! :-)
>
>tony
>--
>Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax -
13
>Liechtensteinstrasse 22, A-1090 Wien, AT |
<URI:http://www.vcpc.univie.ac.at/>
>"You see? You see? Your stupid minds!    | personal email:
>    Stupid! Stupid!" ~ Eros, Plan9 fOS.  |     tony_curtis32@hotmail.com




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

Date: Wed, 15 Jul 1998 10:39:38 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie question on pattern match
Message-Id: <MPG.1016893833e30ac2989716@seletar.ap.deuba.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6oikfp$kqu$2@marina.cinenet.net> on 15 Jul 1998 16:13:45 GMT, 
Craig Berry <cberry@cinenet.net> says...
> Abigail (abigail@fnx.com) wrote:
> : wings (xuchu@iscs.nus.edu.sg) wrote on MDCCLXXIX September MCMXCIII in
> : <URL: news:6oh5uk$eb13@id4.nus.edu.sg>:
> : ++ thx for all replies. i am clear now:) yes, my original thought was
> : ++ 	s/(\d)(\d\d\d)(\D)*/$1,$2/; and s/(\d)(\d\d\d)(\D)+/$1,$2/;
> : ++ but neither of them worked. i was confused at that time coz the output
> : ++ ate the trail of my original string.
> : 
> : Note that all the proposed solutions, correct or not, suffer from
> : one thing: they are quadractic in the size of the number. Note a
> : problem if you numbers are below a million, but a potential one
> : if the numbers are huge.
> 
> Note that N here is not the size of the number in the sense of its
> magnitude, but rather in the sense of its left-of-the-decimal digit
> count...which is roughly the base-10 logarithm of the (absolute value of
> the) number.  I don't think even a quadratic algorithm is a problem for Ns
> in perhaps the low teens at most (which takes us up into the trillions). 

Abigail hit it right on the head.  The crossover on my system is one 
million.  As demonstrated:

#!/usr/local/bin/perl -w
use Benchmark;
timethese(1 << (shift || 0), {
    Reverse => sub {
        $_ = '1' x 7;
        s((\d+))(local $_ = reverse $1;
            s((\d\d\d)(?=\d))($1,)g; reverse)e;
    },
    While => sub { 
        $_ = '1' x 7;
        1 while s/(\d)(\d\d\d)(?!\d)/$1,$2/;
    },
});

Benchmark: timing 16384 iterations of Reverse, While...
   Reverse: 15 secs ( 3.46 usr  0.03 sys =  3.49 cpu)
     While: 17 secs ( 3.76 usr  0.02 sys =  3.78 cpu)

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 15 Jul 1998 18:23:44 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Beautifier Home Page
Message-Id: <6ois3g$akn$1@seletar.ap.deuba.com>

[A complimentary Cc of this posting was sent to John Porter 
<jdporter@min.net>],
who wrote in article <35ACD585.3D4@min.net>:
> Ilya Zakharevich wrote:
> > 
> > [A complimentary Cc of this posting was sent to Tom Christiansen
> > <tchrist@mox.perl.com>],
> > who wrote in article <6ob6ql$rd8$1@csnews.cs.colorado.edu>:
> > > :CPerl works on Perl code.  What is at this URL is not Perl.
> > >
> > > Yeah, right.  My Perl compiler works find on it, and so does yours.
> > 
> > Which proves nothing.  It is not Perl4, since it uses isn't_programmer
> > without leading &, and is not Perl5 since it uses isn::t_programmer
> > without ::.  Thus it is not Perl.
> 
> Whoa.
> If what you're saying is true, then there is no Perl interpreter;
> the machine we have does not conform to the specification.

Failed logic.  Perl4 code is not Perl5 code, but it is parsed by Perl
v5 interpreter.  There is no restrictions what code is *illegal*, but
there are tons of descriptions of what is *legal*.

But why

    aa/bb/;

parses still beats me hard!  ;-)

> Personally I favor the notion that the interpreter defines the
> language, and the documentation exists to express the behavior of
> the interpreter for human readers.  I.e. that there is a doc bug.
> 
> But you take the opposite viewpoint.

There is no "the interpreter".  My home machine has hundred(s?) of
versions of perl, all slightly different.

Ilya


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

Date: Wed, 15 Jul 1998 13:44:11 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl Setup on NT
Message-Id: <linberg-1507981344110001@seletar.ap.deuba.com>

In article <6oiop5$7cm$1@news-1.news.gte.net>, "tdean" <tdeanatgtedotnet> wrote:

So perl c:\perl\bin\perlscript.pl doesn't work?


> perlscript.pl is in c:\perl\bin
> 
> --
> ICQ 7305805
> replace at with @ and dot with .
> Steve Linberg wrote in message ...
> >In article <6ogu63$nje$1@news-2.news.gte.net>, "tdean" <tdeanatgtedotnet>
> wrote:
> >
> >> I want to execute my perl scripts from within the Dos box on NT4SP3 from
> C:\
> >> I have added the following to the path environment variable:
> >> C:\;C:\Perl\bin and rebooted the machine to take effect
> >> when I then open a NT Dos box which defaults to c:\ and I try to execute
> a
> >> perl script:
> >> perl perlscript.pl  I get the following msg:
> >> "can't open perl script perlscript.pl. No such file or directory"
> >> guys, whats the fix for this?
> >
> >where is perlscript.pl?
> >_____________________________________________________________________
> >Steve Linberg                       National Center on Adult Literacy
> >Systems Programmer &c.                     University of Pennsylvania
> >linberg@literacy.upenn.edu              http://www.literacyonline.org
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Wed, 15 Jul 1998 12:34:10 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: e.christensen@netjob.dk
Subject: Re: Perl zipping files??
Message-Id: <35ACE812.49F705B8@seletar.ap.deuba.com>

[courtesy cc to cited author]

Ernst Christensen wrote:
> 
> Hi
> I have a Perl program running on a server, that produces a nummber of
> html-files. My problem is to make a perlscript, that can zip theese
> files.
> I have tried with pkzip etc.. something like this:
> 
> system("pkzip.exe new.zip file.htm")
> 
> But (ofcource) this dosn't work, since the server can't recognize
> pkzip.exe.
Why can't the server recognize it?  (I'm going to assume your server is
Win 95/NT based, since you don't say, but are talking about pkzip.)
Do you get an error message?
What is the message?
What happens if you include the entire path to pkzip.exe in the
command?  i.e. system("c:/pkzip/pkzip.exe new.zip file.htm");  (I think
that will work, if not use c:\\pkzip\\pkzip.exe instead)
Perhaps your path isn't set correctly on the server so pkzip.exe cannot
be found?
Perhaps the script is running as an unpriviledged user, and has no
access to pkzip.exe, even if it does find it.....
Perhaps winzip might be an alternative?
Maybe you could check to see if you are getting a return code from
pkzip, something like:  system(...) == 0 or die "Cannot execute pkzip:
$!\n"; should hopefully provide some insight, if it falls over.


> Any solutions (i have checked CPAN)
I don't know where it is, exactly, but I thought there was a module for
gzip/gunzip.  As I understand things, gzip is the (originally) unix
equivalent to pkzip/pkunzip (winzip 6.2 understands gzipped files). 
Maybe that would work for you?  I think gzip is a freeware product
available at http://www.fsf.org, but don't quote me on that.  In theory
it could be compiled on a Win* style OS.

> 
> reg
> Ernst

Keep in mind, I deal with unix 99% of the time, so my responses may be
'crack-pot' at best, but I think it should give you a place to start
looking.

HTH.
Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

----------------------------------------------------------------------
Dave Barnett                 U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng    U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------


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

Date: 21 Jul 1998 09:33:22 -0400
From: Tim Gray <tim@hcirisc.cs.binghamton.edu>
Subject: regexp question
Message-Id: <t07m17e3bx.fsf@hcirisc.cs.binghamton.edu>


I am trying to come up with a regexp that will match the size
attribure in an HTML <FONT> tag and am failing miserably.

Why doesn't this expression
m/<font.*?\s(SIZE=.*?)[>\s]/

match this string?
<font COLOR="#006600" SIZE="+1">

I know that '<font' matches. Then match all the characters up until
the first instance of a whitespace character folowed by 'SIZE='.  Then
match what the size is set to, then match the end of the attribute
because or the whitespace or match the end of the tag '>'.

I am trying to write a one-liner that will go through and remove all
the relative font sizes from a web site.  Any help is appreciated.
Thanks.

Tim Gray


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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