[10263] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3856 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 30 09:07:22 1998

Date: Wed, 30 Sep 98 06:00:23 -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           Wed, 30 Sep 1998     Volume: 8 Number: 3856

Today's topics:
    Re: About CPAN <domi@barrayar.grenoble.hp.com>
    Re: assign name and content of a variable provided from (Joergen W. Lang)
        CGI & Zip <j.alpers@clear.net.nz>
        Date cim@online.ee
    Re: Date (David A. Black)
    Re: delayed $aa += $n desired <aeb@saltfarm.bt.co.uk>
    Re: Execute perl on win32 with no console? (Andreas Grueninger)
        File manipulation <ben@isolve.net>
    Re: Find NbOfCpu <qdtcall@esb.ericsson.se>
    Re: Getting thePerl script's directory name (Gerhard Grasboeck)
    Re: how can I build array of lists (Jeffrey R. Drumm)
    Re: how can I build array of lists (Joergen W. Lang)
    Re: How do I sort a multidimensional array???? <smaring@gte-es.com>
    Re: Internal Server Error (Premature end of script head (Andreas Grueninger)
    Re: mod_perl file closing problem (Ryan McGuigan)
    Re: need a 10 milsec delay (Matthew Bafford)
    Re: need a 10 milsec delay <erhmiru@erh.ericsson.se>
        new faq on year 2000 date bug <jml@hotmail.com>
    Re: Perl and ODBC? <thaynes@openlinksw.co.uk>
    Re: Perl Training <perlguy@inlink.com>
    Re: POLL: Perl features springing into your face (Johan Vromans)
        script output to a file (_cim_)
        Searching a search-engine script <miguel@aljamir.com>
    Re: Simple database recommendation needed (zentara)
        Substitution-Problem guelkev@de.polygram.com
    Re: Uploading file to browser <sergio@mail.pt>
    Re: URL & strings searches <erhmiru@erh.ericsson.se>
        What is the maining of "Bare word" (Wong Kin Sang)
    Re: What is the maining of "Bare word" <prw@suarez.bestweb.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 30 Sep 1998 14:35:38 +0200
From: Dominique Dumont <domi@barrayar.grenoble.hp.com>
Subject: Re: About CPAN
Message-Id: <vkzogrxixr9.fsf@barrayar.grenoble.hp.com>

"news.space.ru" <gzhel@space.ru> writes:

> How download all CPAN or only latest versions of Perl-modules?
> 

First you should install the CPAN modules (from the CPAN archive). 
This module will enable you to manage all other perl modules.

Cheers
 
-- 
Dominique_Dumont@grenoble.hp.com


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

Date: Wed, 30 Sep 1998 14:14:37 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: assign name and content of a variable provided from a file
Message-Id: <1dg66h4.1ntgi9ax3t2vsN@host018-210.seicom.net>

> Organization: SEL Verteidigungssyteme GmbH

Hmm I just wonder what would happen if they used hash, errr, hashes for
the developement of their "Verteidigungssysteme". 
Stoned cruise missiles ? ;-)

Joergen

Schimpeler U. DP/EVA <USchimpeler@pfh.sel.alcatel.de> wrote:

> Who can give a newcomer some useful hints concerning the following
> problem:
> 
> 1. a file contains lines representing a variable's name followed by none
> or some values to be assigned; the lines are randomly ordered.
> 
> example lines:
>   var_name_1 para_1a para_1b
>   var_name_2
>   var_name_3 para_3
> 
> 2. the problem: How to define a variable with the name given in column 1
> and assign the values stated in the columns following the name?
> 
> The result shall be as if i would have written the following code in my
> perl script:
>   @var_name_1 = qw(para_1a para_1b) ;
>   @var_name_2 = () ;
>   @var_name_3 = qw(para_3) ;
> to allow addressing of the variables directly with their respective
> names.
> 
> Thank you for your help
> 
> Uli


-- 
  To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
#!/usr/bin/perl -w
print pack q,h52,,unpack q,H52,,join q,,,map chr,split q, ,,q,164 87 55
71 2 22 230 246 71 134 86 39 2 5 86 39 198 2 132 22 54 182 86 39 2 18,;


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

Date: Thu, 01 Oct 1998 00:33:21 +1200
From: "j.alpers" <j.alpers@clear.net.nz>
Subject: CGI & Zip
Message-Id: <36122511.4FA8CA04@clear.net.nz>

Hi, I'm trying to write a CGI script in Perl that zips up a bunch of
files, and have used:

system("zip -0 path/zipfile file1 file2 file3...");

but although the rest of the script functions fine, no zip file is
created. So I guess the line is simply ignored when the script is
called.

Is there another way of doing this, or is there a Perl module for
creating an archive via CGI?



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

Date: Wed, 30 Sep 1998 12:45:33 GMT
From: cim@online.ee
Subject: Date
Message-Id: <361326e7.5916820@news.online.ee>

How can i accurately get tomorrows and day after tomorrows date.
Simply adding +1 or +2 to todays number will not do.
The same goes for yesterday. I could define the max number of days for
each month, but February on some years...!?!?
Any simple methods?

cim


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

Date: Wed, 30 Sep 1998 08:30:56 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: Date
Message-Id: <6ut8a0$5b0$1@earth.superlink.net>

cim@online.ee writes:

>How can i accurately get tomorrows and day after tomorrows date.
>Simply adding +1 or +2 to todays number will not do.
>The same goes for yesterday. I could define the max number of days for
>each month, but February on some years...!?!?
>Any simple methods?

Date::Manip
Date::Calc


David Black
dblack@saturn.superlink.net


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

Date: 30 Sep 1998 13:03:28 +0100
From: Tony Bass <aeb@saltfarm.bt.co.uk>
Subject: Re: delayed $aa += $n desired
Message-Id: <rg7lylst7z.fsf@calf.saltfarm.bt.co.uk>

mjd@op.net (Mark-Jason Dominus) writes:

> In article <rg90j3xcef.fsf@calf.saltfarm.bt.co.uk>,
> Tony Bass  <aeb@saltfarm.bt.co.uk> wrote:
> >mjd@op.net (Mark-Jason Dominus) writes:

> >> In article <6uqci0$crk$1@nntp2.ba.best.com>, Xah <xah@best.com> wrote:
> >> >Is there a way to get something like $aa =+ 2, so that the value of the
> >> >variable is returned before it is incremented?

> >> 	(($aa,$aa+=2)[0])

> >yielding the post-value,

> Yes, my mistake.  As you point out, Perl doesn't dereference the
> variable until after the addition occurs.  This is bizarre, [...]

Precisely my reaction the first time I encountered such a thing; but
as you say, Perl is Perl and C is C, and Perl's `,' is nothing like C's
sequence points.

After I had constructed for myself a little quiz of things like

   do { my $x = 1; reverse +$x, $x + 1, $x + 2, $x = 4; }
      4, 3, 2, 4

   do { my $x = 1; reverse +scalar($x), $x + 1, $x + 2, $x = 4; }
      4, 3, 2, 4

   do { my $x = 1; map +($_, $x++, $_), $x, $x, $x, $x x 3; }
      2, 1, 2, 3, 2, 3, 4, 3, 4, 111, 4, 111

   do { my @a = (0, 1, 2); (map ++$_, map $_, @a), @a; }
      1, 2, 3, 0, 1, 2

   do { my @a = (0, 1, 2); (map ++$_, grep 1, @a), @a; }
      1, 2, 3, 1, 2, 3

   do { my @a = (0, 1, 2); @a, (map ++$_, reverse reverse @a), @a; }
      1, 2, 3, 1, 2, 3, 1, 2, 3

   reverse ('a b c' =~ /(\w+)/g, $1), ('d e f' =~ /(\w+)/g, $1)
      f, c, b, a, d, e, f, f

(list-context values by perl 5.001; other versions may differ) I had a
better understanding of the handling of lists, and I promised myself
never again to write such mixtures.



> 	(($dummy = $aa, $aa+=2)[0])

> and such variations do work.

Yes, I take this to be safe Perl, though I am not sure I could prove
it from the man pages and camel.


-- 
# A E Bass                                      Tel: (01473) 645305
# MLB 3/19, BT Laboratories                     e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 3RE   Do not rely on From: line
#                                               Opinions are my own


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

Date: Wed, 30 Sep 1998 12:22:20 GMT
From: grueni@stuttgart.netsurf.de (Andreas Grueninger)
Subject: Re: Execute perl on win32 with no console?
Message-Id: <36121fcb.8272615@news.lf.net>

On Wed, 30 Sep 1998 05:11:31 GMT, martin.oakley@usa.net (Martin
Oakley) wrote:

>Can perl scripts be executed without a console process?
>

If you use NT (you wrote only Win32):
You may use the AT command or better SOON of the nt resource kit to
start the perl jobs in the background without the interactive switch.
You hve to be sure that the jobs will end an not wait for some user
input.
Of course a background job uses cpu time and the users will have less
cpu time for the foreground jobs (see control panel->system-> ration
between background and foreground processing))
---------------------------
Andreas Grueninger

PRIVATE: grueni@stuttgart.netsurf.de
 OFFICE: grueninger@lfl.bwl.de
---------------------------


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

Date: Wed, 30 Sep 1998 08:18:52 +0000
From: Ben Duncan <ben@isolve.net>
Subject: File manipulation
Message-Id: <3611E96C.6B0B6D24@isolve.net>

Hello!

I'm using a simple formmailer for a web site, over the few weeks
I've been getting quiet the number of submissions - the current
formail is real ugly, it simply mails me any input. 

I would like to database my submissions mbox, I wrote a quick
and nasty perl script which databases most of the mbox, but not
all! Here is my problem.

This is what each submissions looks like in my mbox:

----
New submission, posted from Fred (fred@domainname.com)
name: Fred
subject: your web site
comments: great job!
---

I can extract the values with a : beside them (using split) but
I'm dammed to figure out how to extract the email address! (It's
wrapped in ()'s, not seperated by a :)

How can I extract the email address?

Thanks,


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

Date: 30 Sep 1998 14:47:24 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Find NbOfCpu
Message-Id: <islnn1vkbn.fsf@godzilla.kiere.ericsson.se>

Christopher Marquis <Christopher.Marquis@fairchildsemi.com> writes:

> Does anyone know of a module, function or some spawned shell trick to
> find the number of cpu's running on a Solaris or HP/UX box?

Not that it has anything to do with Perl, but on Solaris 2.x (at least 
for x>=4) /usr/sbin/psrinfo gives one line of output for every CPU.
-- 
   Calle Dybedahl, qdtcall@esavionics.se, http://www.lysator.liu.se/~calle/
      "I came out of that meeting so full of enthusiasm that I spent the
              next two hours updating my resume" -- Paul Tomblin


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

Date: Wed, 30 Sep 1998 12:02:57 GMT
From: ggrasboeck@unisys.co.at (Gerhard Grasboeck)
Subject: Re: Getting thePerl script's directory name
Message-Id: <3612138e.13162666@mozart.unisys.co.at>

On Tue, 29 Sep 1998 14:49:22 -0700, Bart Thielges <bart@oxsigen.com>
wrote:

>When I write applications that are actually clusters of several
>executables (a main script calls subordinate scripts), I usually
>want to make that cluster relocatable without requiring the user
>to set search paths or special environment variables.  In the past
>I have done this by checking a system variable which returns the
>fully qualified path name of the script that is currently running.  I
>then strip the directory portion of this path off and use it during
>subsequent calls to subordinate scripts.  For example consider
>the following segment of pseudo-code :
>
>   $myFileName = getExecutablePath(); # returns full filename for this
>script
>   $myDirectory = dirName($myFileName); # returns directory portion
>   .....
>   system("perl -w $myDirectory/subtask1.pl");
>
>Does anyone know how to do this in Perl ?  More specificially,
>how do I do the getExecutablePath() in Perl - I know how do
>do the rest.
>
>Thanks,
>Bart Thielges
>

The following small code snippet would do your task:


# use nice English (or awk) names for ugly punctuation variables
use English;

use File::Basename;  # module for path splitting

# extract just the directory from a path
$dirname = dirname($PROGRAM_NAME);

system("perl -w $dirname/subtask1.pl");



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

Date: Wed, 30 Sep 1998 11:26:34 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: how can I build array of lists
Message-Id: <36120bab.513917293@news.mmc.org>

[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]

On Wed, 30 Sep 1998 07:25:46 GMT, nfigaro@rocketmail.com wrote:

>hello,
>
>I'd like to make an array of lists.
>( or an array of arrays )
>
>my $list1 = (a b c d);
>my $list2 = (1 2 3 4);

Well, at least you tried (a little) . . .

Array variables are indicated by the '@' symbol, and your lists aren't valid
constructs anyway.

Try:

my @list1 = qw(a b c d);
my @list2 = qw(1 2 3 4);

or

my @list1 = ('a', 'b', 'c', 'd');
my @list2 = ('1', '2', '3', '4');

>and
>my @TABLEAU;
>
>@TABLEAU[1] = $list1;
>@TABLEAU[2] = $list2;

Arrays are indexed starting at 0, and there's an function that lets you assign
elements sequentially:

push @TABLEAU, ( \@list1, \@list2);

or

push @TABLEAU, [ @list1 ];
push @TABLEAU, [ @list2 ];

You can then access individual elements using:

&do_something_with $TABLEAU[n][m]; # where n and m represents the numeric
                                   # indices

There is excellent on-line documentation for building complex data structures
with Perl. It can be found using the following:

$ perldoc perllol
$ perldoc perldsc

>but it doesn't work.

Read the documentation and you'll know why. :-)

(snip)

>answer by email please

I normally cc via mail because of the vagaries of Usenet, but it's a bit more
polite for you to request that you be cc'ed, rather than emailed only. Many
Usenauts think that you should look for your answer where you posted your
question.

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Wed, 30 Sep 1998 14:14:39 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: how can I build array of lists
Message-Id: <1dg6794.b51x723excaoN@host018-210.seicom.net>

perldoc perllol

(perllol is part of the docs that came with perl and describes the
generation and usage of lists of lists.)

hth, Joergen

<nfigaro@rocketmail.com> wrote:

> hello,
> 
> I'd like to make an array of lists.
> ( or an array of arrays )

<snip>

-- 
  To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"


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

Date: Wed, 30 Sep 1998 11:14:34 +0000
From: Steve Maring <smaring@gte-es.com>
Subject: Re: How do I sort a multidimensional array????
Message-Id: <6ut431$8sf$1@news-1.news.gte.net>

Thank you David!!!!!!!!!

Now I guess I will go back and read through the "Perl references and
nested data structures"
and "Perl Data Structures Cookbook" to try to figure out exactly what it
is doing.  I'm a newbie
at this sort of thing.

Thanks.

-Steve



David A. Black wrote:

> Steve Maring <smaring@gte-es.com> writes:
>
> >I've tried:
>
> >@array = sort($array[$a][0] <=> $array[&b][0]);
> >and
> >sort { $a->[0] <=> $b->[0] } @array;
>
> >neither worked.
>
> The first one asks sort() to sort a list consisting of the
> truth value of a single comparison.  *Definitely* not what
> you want.
>
> The second doesn't assign the sorted list to anything.  *Ditto*.
>
> So - combining the best of both:
>
> @array = sort { $a->[0] <=> $b->[0] } @array;
>
> David Black
> dblack@saturn.superlink.net
>



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

Date: Wed, 30 Sep 1998 12:22:18 GMT
From: grueni@stuttgart.netsurf.de (Andreas Grueninger)
Subject: Re: Internal Server Error (Premature end of script headers)
Message-Id: <36113dde.8125754@news.lf.net>

1. associate .pl with perl.exe and change your path so that perl.exe
is found
2. change the shebang line #!/usr/bin/perl.exe to #!perl.exe
3. check your script at the command line
4. check it with your web server.
It worked for me with Perl 5.00502 at the command line and with Apache
1.3.2

---------------------------
Andreas Grueninger

PRIVATE: grueni@stuttgart.netsurf.de
 OFFICE: grueninger@lfl.bwl.de
---------------------------


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

Date: Wed, 30 Sep 1998 11:51:25 GMT
From: ryan@mail.ramresearch.com (Ryan McGuigan)
Subject: Re: mod_perl file closing problem
Message-Id: <1XoQ1.304$Fl6.6169565@news.abs.net>

you can't use exit; when using mod_perl

David Formosa (dformosa@zeta.org.au) wrote:
: In <m3af3joy6u.fsf@joshua.panix.com> Jonathan Feinberg <jdf@pobox.com> writes:

: >ryan@mail.ramresearch.com (Ryan McGuigan) writes:

: >> How can I close all open files that are still open, if I don't know
: >> what files are open?

: >You can't[*]. Therefore you must *know what files are open*.

:   exit;

: Would solve this problem,  I think that this (untested) code would
: do it as well.

: for (keys %::) {
:   close $::{$_};
: }

: Althoug it most likely has negative side effects.

: -- 
: Please excuse my spelling as I suffer from agraphia. See the URL in my
: header to find out more.



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

Date: Wed, 30 Sep 1998 07:05:08 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: need a 10 milsec delay
Message-Id: <MPG.107bda70ecc6efd19896c1@news.south-carolina.net>

In article <6usmq3$1id$1@nnrp02.primenet.com> on Wed, 30 Sep 1998 
00:18:03 -0700, Doyle Johnson (sales@madm.com) pounded in the 
following text:
=> Hello all,
=> 
=> I need to be able to ad a 10 milsec delay into a script before exicuting the
=> next line of code. I have looked into sleep but that is in seconds and that
=> WAYYY to long. I looked at a few other suggested items and Im not really
=> sure whats the best.

What other items did you look at?

=> Can someone please toss out a bit of code that will invoke a less than 1 sec
=> delay?

If your system supports it, use select:

select(undef, undef, undef, 0.25);

Since the last argument is in seconds, this waits for 250 
miliseconds.

More info in perldoc -f select. :)

=> 
=> Thanks

Hope This Helped!

=> D.Johnson

--Matthew


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

Date: 30 Sep 1998 13:21:11 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
To: sales@madm.com
Subject: Re: need a 10 milsec delay
Message-Id: <lazpbhyhg8.fsf@erh.ericsson.se>

"Doyle Johnson" <sales@madm.com> writes:

> I need to be able to ad a 10 milsec delay into a script before exicuting the
> next line of code. I have looked into sleep but that is in seconds and that
> WAYYY to long. I looked at a few other suggested items and Im not really
> sure whats the best.
> 
> Can someone please toss out a bit of code that will invoke a less than 1 sec
> delay?

The code bellow should sleep for 10 ms (can not work on some systems):

select undef,undef,undef, 0.01;

Regards,

Michal


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

Date: Wed, 30 Sep 1998 14:21:05 +0200
From: freeweb <jml@hotmail.com>
Subject: new faq on year 2000 date bug
Message-Id: <36122231.429F1422@hotmail.com>

A new faq has been setup at http://www.softandco.fr/faq2000

It entends to deals with year 2000 date bug in computer hardware and
software as well as in home hi-fi, video, and electronic apliances.

Please be numerous to post any information you may have gathered here
and there,
as it may help someone in the world to know what you know !

Mainly in english,  but foreign languages are welcome too.

Thank you for your time.

jmREMOVE_THISl@softandco.fr




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

Date: Wed, 30 Sep 1998 12:03:42 GMT
From: Tim Haynes <thaynes@openlinksw.co.uk>
Subject: Re: Perl and ODBC?
Message-Id: <6ut6mu$651$1@nnrp1.dejanews.com>

Hi,

Not just NT, please... with OpenLink and a proper multi-tier generic
architecture, as long as you can link in a client-side library, e.g. with
DBI, you can connect through our broker + generic ODBC agent to an Access
database on Windows - or an RDBMS on unix/VMS/Windows...

Try OpenLink <http://www.openlinksw.com/> for a free non-expiry evaluation
download.

Regards,

~Tim

In article <360FB72A.8BE1B3D2@dotrose.com>,
  Henry Hartley <henry@dotrose.com> wrote:
> I've had no problems doing what you want to do.  I'm also fighting the Perl
> vs. Cold Fusion battle and only having limited success.  Rest assured that
> Perl and ODBC on NT work, however.
>
> David J. Topper wrote:
>
> > Hello there,
> >
> > I'm trying to convince my boss to use perl instead of cold fusion.  The
> > snags are:
> >
> > a)  he needs to use NT (ok ... there is perl for NT)
> > b)  he wants to talk with an MS Access database (preferrably with ODBC)
> >
> > I've heard there are other mechanisms for talking with MS Access, but he
> > seems to really want ODBC stuff.  I don't even know what the hell the
> > difference is. We used to use sybperl back at Time Inc., then later some
> > special functions that opened connections with a Sybase database.
> >
> > Any input would be appreciated.
> >
> > Thanks,
> >
> > Dave Topper
> > --
> > Technical Director, Virginia Center for Computer Music
> > Programmer / Analyst, Dean's Office (School of A&S)
> > http://www.panix.com/~topper
> > (804) 924-6887
>
>

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


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

Date: Wed, 30 Sep 1998 11:53:34 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Perl Training
Message-Id: <36121BBE.82F56DAD@inlink.com>

brian d foy wrote:
> 
> In article <01bdd9d9$f1e41830$dd98c9d0@debhome>, "Deborah Murray" <dmurray@dgesolutions.com> posted:
> 
> >Accelerated Perl Programming Training
> >presented by the UniForum Technology Training Institute
> 
> >http://www.uniforum.org/web/education/perlworkshop.html
> 
> 404 Not Found
> 
> The requested URL /web/education/perlworkshop.html was not found on this server.
> 
> btw, i have a Perl script which can help you find other stale links
> on your server.  if you wanted to add a web form to the real URL,
> <URL:http://www.uniforum.org/web/education/advperl.html>, perhaps you
> can take one of my CGI courses. ;)
> 
>From their "Accelerated Perl Programming" course description:

"No other Perl class (to our knowledge) covers this much material in
such a brief time. "

Let's hope that the people paying $1000 a seat come away from the course
UNDERSTANDING what was just presented to them!

Let's hope they don't offer an "Accelerated Brain Surgery" course!

-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: 29 Sep 1998 10:08:54 +0200
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: POLL: Perl features springing into your face
Message-Id: <wl3pvcf733d.fsf@plume.nl.compuware.com>

ilya@math.ohio-state.edu (Ilya Zakharevich) writes:

> We should collect the list of "Historical"
> features of Perl, which were created to simplify some obscure
> one-liners, but now make serious programming with Perl almost
> impossible.

I could not agree more. Earlier this year we had a "STOP THE PRESSES"
thread on this topic, but it pops up frequently in different shapes.

Nowadays I tend to teach people only a subset of Perl, what I consider
to be a sane, consistent, use of the plethora of Perl constructs. I
am planning a separate update course for people who need to maintain
programs written by other developers. This course would include 'the rest'.

> I hoped that Tom and Random keep a list of their peeves obtained
> when teaching, but apparently these misfeatures bite experienced
> people only: beginner just do not use things which are complicated
> enough, or do not recognize that something is not their fault (or
> even do not recognize that it does not do what they wanted...).

Yes and no. There are peeves that are 'hard to explain', e.g. "0"
being false but "00" not. Others really bite, like the scope of my
variables. Experienced users get bitten more often than beginners, but
usually they quickly recover.

> Hope to hear from you to get an authoritative list.

Are you volunteering to collect the info? That would be great!

-- Johan


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

Date: Wed, 30 Sep 1998 13:46:25 GMT
From: cim@online.ee (_cim_)
Subject: script output to a file
Message-Id: <3612356c.9633796@news.online.ee>

How do i make a script write its output to a specific location in a
file, so that the area is separated by html comments and only the area
between the comments gets overwritten.
Is it difficult to do?


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

Date: Wed, 30 Sep 1998 12:45:32 +0200
From: "Miguel A." <miguel@aljamir.com>
Subject: Searching a search-engine script
Message-Id: <6ut373$sp$1@talia.mad.ibernet.es>

    Hello everybody:

    I'm searching (free or paying) for a search engine script.
    Anybody knows where can I find it?

    Thanks.

--
Miguel A.
miguel@aljamir.com




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

Date: Wed, 30 Sep 1998 11:30:18 GMT
From: zentara@mindspring.com (zentara)
Subject: Re: Simple database recommendation needed
Message-Id: <361211f7.4359088@nntp.mindspring.com>

On Tue, 29 Sep 1998 18:32:56 -0400, Charlie Davies
<cdavies@harris.com> wrote:

>I am working on an UNIX based application where I need a simple
>database. I was looking for a recommendation from this group.
>
>The database will be fairly small 20K-40K records. Each record would
>have 3 text fields, each containing 50-60 characters. During a normal
>session, I will have to open the DB, find a given record, update its
>content, and close the DB.
>
>I don't have access to commercial databases for this application.
>
>Any recommendations would be greatly appreciated.

Postgres is free and simple to setup for a small application
like you describe.  It also provides for later expansion if your
database grows.

You use sql to access it.





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

Date: Wed, 30 Sep 1998 12:42:55 GMT
From: guelkev@de.polygram.com
Subject: Substitution-Problem
Message-Id: <6ut90f$8fm$1@nnrp1.dejanews.com>

Hello everybody,
I have a problem with substitution in perl. I want to cut the
"http://serveradress" Part from an URL to become a local URL.

I tried the following statement:
$url =~ s@http://*/@/@;
which should replace the http://..../ with a single /.

The result is, that it replace the part of the string I wrote directly but not
that part which is included in the "*".

Can anybody tell me what my mistake is and how I can fix this problem?
Please answer also by mail, becaue my NNTP-Server is damaged at this time.
Thanks Volker

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


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

Date: Wed, 30 Sep 1998 13:53:18 -0300
From: Sergio Bernardo <sergio@mail.pt>
Subject: Re: Uploading file to browser
Message-Id: <361261FE.ACA86781@mail.pt>

Steve & Debby Caldwell wrote:
> upload to web users.  They are set up as Adobe Acrobat files (PDF) and
> the only way I have been able find to let people download them if by
> using--print "Location: ..."  Trouble is, if the user has the Acrobat

Hi!

I'm a Perl newbie too... but I think this is not a Perl question,
but an HTTP protocol question...

You could solve the problem not sending a redirect to the URL
where the PDF is, but sending the PDF for youself.

By redirecting to the pdf file, the HTTPD will see a .pdf and 
sends to the browser the MIME type: application/pdf... of corse 
you could configure the server to send other MIME type to this
extension, but it would afect all .pdf's!

The solution is to send the pdf from the cgi itself.
Here is an untested example, as I told, I'm also a Perl newbie!!

(...)
  open(PDF,"<".$file_location) || die "Error: $!\n";
  binmode STDOUT;
  print "Content-type: application/unknown\n\n";
  while($line = <PDF>){ print $line;}
  close PFD;
(...)

As long as the borwser does not recognises the application/unknown
MIME type, it works.

The will be other problem, concerning the filename the browser will
use by default, whitch will be the CGI name, I think...

Hope this helps!

Sergio Bernardo
Sergio@navegante.pt


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

Date: 30 Sep 1998 12:45:11 +0200
From: Michal Rutka <erhmiru@erh.ericsson.se>
Subject: Re: URL & strings searches
Message-Id: <la1zotzxoo.fsf@erh.ericsson.se>

"meyrick" <meyricklouiseNOJUNK@btinternet.com> writes:

> I start by admitting I am a complete newbie as far as Perl is
> concerned - apologies to all gurus :-)
> 
> Can anyone help with the following challenge?
> 
> I want a script that will:
[...]

I can write this script for you for a appriotiate fee, i.e. I am taking $150
per hour. Mimimum fee is for one hour. Writing of this script
will not exceed one hour.

Michal


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

Date: Wed, 30 Sep 1998 11:18:40 GMT
From: wongksp@netvigator.com (Wong Kin Sang)
Subject: What is the maining of "Bare word"
Message-Id: <361212f3.14060067@news.netvigator.com>

Hi all of you,

Recently I've got a question about wirting perl script. When I try to
run a perl script, an error " Bare word found where operatior
expected" has appear. What should I do/check for this ? (I've check
that I haven't miss  {    ;    "   or wrong spelling.

Thanks.

Patrick


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

Date: Wed, 30 Sep 1998 07:29:39 -0500
From: Paul Wilson <prw@suarez.bestweb.net>
Subject: Re: What is the maining of "Bare word"
Message-Id: <6ut888$1u5$1@news-1.news.gte.net>

If you post the script, and copy the exact error message (including line
numbers) we would probably be able to help. But right now, all I can say
is "you did something wrong".

Paul.

Wong Kin Sang wrote:
> 
> Hi all of you,
> 
> Recently I've got a question about wirting perl script. When I try to
> run a perl script, an error " Bare word found where operatior
> expected" has appear. What should I do/check for this ? (I've check
> that I haven't miss  {    ;    "   or wrong spelling.
> 
> Thanks.
> 
> Patrick


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

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

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