[11195] in Perl-Users-Digest
Perl-Users Digest, Issue: 4795 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 1 07:07:26 1999
Date: Mon, 1 Feb 99 04:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 1 Feb 1999 Volume: 8 Number: 4795
Today's topics:
Re: A little help, thanks. (Tad McClellan)
alternative perl NG for newbies? <23_skidoo@geocities.com>
Re: CGI form processing <chromyak@usa.net>
Re: code to recurse directories (Tad McClellan)
Re: DBI and Win32::ODBC - build or download???? <jcounts@voicenet.com>
Re: Double Writing in Logs... Why? (Bart Lateur)
Help building regex needed <derek@fortstar.demon.co.uk>
Re: Help building regex needed <garethr@cre.canon.co.uk>
Re: how to code a between() with regex? (Sam Holden)
Re: how to code a between() with regex? (brian d foy)
Re: how to code a between() with regex? <garethr@cre.canon.co.uk>
How to get Perl for Red Hat Linux 5.2? <franky123@canada.com>
Re: How to get Perl for Red Hat Linux 5.2? (brian d foy)
Re: How to support both short and long option styles? (Johan Vromans)
Re: Newbie question on regular expressions <dgris@moiraine.dimensional.com>
Re: Newbie question on regular expressions bhoylma@uswest.com
Re: outputting perl errors as html? (Louie)
Re: outputting perl errors as html? (brian d foy)
Re: Perl Criticism topmind@technologist.com
perl on psion 5? <23_skidoo@geocities.com>
Re: Perl script doesn't execute, instead displays conte (Tad McClellan)
Soft reference question (Louie)
The behaviour of split() - followup <michael.preminger@jbi.hioslo.no>
Win95 and perl5 <jboyd99@hotmail.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 1 Feb 1999 02:30:35 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: A little help, thanks.
Message-Id: <bno397.ql9.ln@magna.metronet.com>
Justin Saul (wfs-dominion@worldnet.att.net) wrote:
: I am kind of new at this stuff, but I learn quickly and have one quick
: problem I need fixed. Please tell me how I can manage the following problem:
: I want to open a file that has data in it and make it into a variable. For
: example file X.dat has my data and I want to have the data from that file
: become variable $x, so that later I can use $x as a printible object.
open(XDAT, 'X.dat') || die "could not open 'X.dat' $!";
{ local $/;
$x = <XDAT>;
}
close(XDAT);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 01 Feb 1999 11:24:23 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: alternative perl NG for newbies?
Message-Id: <36B58EE2.110B@geocities.com>
i know that there are a lot of very busy people in this newsgroup who
know more about perl than is probably healthy :) some of these people
seem to get 'snappish' when a newbie asks a question and that's fair
enough, you're not here to write code for other people. however, some
people seem to enjoy helping others out and i was wondering if it was
worthwhile setting up another newsgroup for just this reason. no one
would _have_ to use it, perhaps no one would but it would give a more
helpful direction for the busy people to point rather than 'rtfm' or
references to 'perlfunc, perlfaq4, and perlre manuals'.
there's a huge range of programming ability in this NG, perhaps
somewhere for the less experienced to swap ideas and help eachother out
would be a good idea.
whatcha all think?
-23
p.s. just to clarify before i get flamed, i'm not asking for people to
write my code for me, i'm not flaming people on this NG who give rtfm
resonses, i just think the experienced would be happier without the
newbie questions and the newbies might not get as discouraged by the
frequent put downs or referrals to the huge faq which isn't beginner
reading.
------------------------------
Date: Mon, 1 Feb 1999 06:41:15 -0300
From: "Kostyantyn Chromyak" <chromyak@usa.net>
Subject: Re: CGI form processing
Message-Id: <5Het2.39$6b.1179845@news.randori.com>
Excuse me Olivier, I feel you don't understand
my intention: my reaction was not flame; I
simply suggested you the more appropiate groups
where you could get more help. And if you'll read
the whole message, you can find the answer after
newsgroup suggestion.
From your private mail I understood you want to prepare
this script at your own. Well, good luck, it obviously
can be useful. If you will not take offence, I think
you could find some tips at:
http://hoohoo.ncsa.uiuc.edu/overview.html
(The Common Gateway Interface);
http://www.halcyon.com/sanford/cgi/index.html
(CGI Resources);
http://www.cc.ukans.edu/info/cgi/cgi-with-perl.html
(Building blocks for CGI scripts in Perl), etc.
There are more links there.
About your problem: the idea is to inicialize
the form fields with the same values obtained from
submitted form (then your user will see filled
form) and to add some words about error (if any).
It will be more simple if you prepare the primary form
with the same script (if script is called with GET
method, you generate the blank form; if it was POST,
you read the values submited, check if exists any error
and if not, process the data as you want and post the
"Thank you" page; if error exists, you generate the same
form, but fill the fields with submitted values and
add error message to generated html.
BTW, perl is quite universal and you can express
any algorithm with it; the CGI is only text based protocol,
*not language-specific*. If you ask if CGI script can
be programmed with perl, the answer is "yes"; You can
use perl, C, Bourn shell, apple script and so on.
Every tool which can be used to read environment
variables and standard input and write into standard
output stream can be used to solve your problem.
Once more, excuse me and good luck.
Kostyantyn.
Olivier wrote <36b52903.0@news.one.net>...
>Sorry Konstantyn,
>
>but this question IS PERL specific since I am asking whether this can
be
>done in PERL or not. If you had a bad day please take out it on
somebody
>else. Maybe you should not read newsgroups if your first reaction is
such a
>negative one.
>
>Olivier
>
>
>Kostyantyn Chromyak wrote in message ...
>> Hi!
>>
>> First of all, this question is not perl-specific
>>and therefore this group is not the best place to
>>post it. You need web-programming and it is *not*
>>exactly perl (however perl can be used and frecuently
>>is used for this purpose). You should look for help
>>in (for example) comp.infosystems.www.authoring.cgi
>>or comp.lang.javascript rather then comp.lang.perl.misc.
>>
>> Secondly, the answer is *yes*, you can do it
>>with perl using CGI or any other server-side
>>technology, and can do the job with client-side
>>programming too; what is the best for you,
>>depends on your biases ;-) and (alas!) details
>>about the error you want to be processed.
>>For example, if your user have forgotten
>>to type his address in mail order form,
>>you can detect this error in situ, and process it
>>locally, without quering a server; javascript
>>or vbscript or (if your browser support it!!!)
>>client-side perl all are appropiate for this
>>purpose; this way you win the performance.
>>But if the problem is that (for example) your
>>database can't save the duplicate record, you
>>probably don't know about this error before submit
>>the data to server-side script. This way you
>>could process the first error (empty field) too.
>>Server-side processing is much more universal,
>>secure and flexible. But you pay for it by
>>loosing the performance.
>>What I am trying to say you is that the optimal
>>solution depends on many details and in many cases
>>the best way is to combine the server-side and
>>client-side processing for different errors.
>>
>> You can find a lot of books in virtually
>>every bookstore; there are a lot of tutorials
>>in web; you have to search for CGI or javascript.
>>And of course you have to write this short
>>script in language of your choice.
>>
>> If you will need the professional help,
>>(i.e. to outsource this job), let me know.
>>It is simple and therefore is not expensive.
>>But I'll need more details.
>>
>> Good luck. Kostyantyn.
>>
>>
>>--
>>
>>__________________________________
>>The best solutions in programming, physics,
>>electronics and automatic control.
>>
>>To reply delete ".NOSPAM" from reply address.
>>I don't read (filter!) letters from well-known spammers.
>>I don't read(filter) anything @yahoo.com
>>
>>e-mail: <chromyak@usa.net.NOSPAM>
>>________________________________
>>ICQ 13497907, tel. (54-11) 4811-7913
>>(ukranian, spanish, english, russian)
>>Kostyantyn Chromyak
>>________________________________
>>Olivier escribis en mensaje <36b3ec40.0@news.one.net>...
>>>Hello,
>>>
>>>I am new to PERL. I am lookng to process a form . I found a lot of
>>>freeware but nothing that does what I want. Usually when there is
some
>>>error checking done on the form input, the error message appears on a
>>>separate HTML page which end by " please go back, etc...". I'd like
to
>>>generate my error message at the top of the actual form which would
>>still
>>>contain the answers previously given by the user. Is this doable in
>>PERL ?
>>>If so is there any code out there I could start from ?
>>>
>>>Thank you for any help,
>>>
>>>Olivier
>>>
>>>
>>
>>
>
>
------------------------------
Date: Mon, 1 Feb 1999 02:16:25 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: code to recurse directories
Message-Id: <psn397.0k9.ln@magna.metronet.com>
sysop (grynberg@hotmail.com) wrote:
: Hi. I am trying to write a program to print all the files on my hard
: drive
Yikes!
Pity the poor trees.
Don't print all the files, just print all the filenames :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 1 Feb 1999 04:27:58 -0500
From: "John Counts" <jcounts@voicenet.com>
Subject: Re: DBI and Win32::ODBC - build or download????
Message-Id: <793sp0$nq6@world6.bellatlantic.net>
Tom Williamson wrote in message <36B50605.8F4DD282@action.cnchost.com>...
>I am working on a Perl project on Windows NT, trying to connect to
>MS-SQL Server. (I know this is going over great with the Solaris and
>Oracle folks.) Anyway, I have never worked with Perl before. I have
>inherited some legacy code from the previous programmer which uses
>DBI::W32ODBC and Win32::ODBC modules, neither of which I have.
>
>I downloaded and installed Perl from ActiveState and have the basic Perl
>5 modules. The previous programmer on the project swears that DBI came
>with his Perl installation and that he was able to download and install
>a pre-built version of Win32::ODBC.
I have lots of CGI scripts that use Win32::ODBC and OLE I'm pretty sure that
both of these are installed with ActiveState's default installation of Perl.
I've never used DBI on Win32 so I don't know about that. Win32::ODBC and
OLE are both extremely easy to use.
If you do need additional modules the best source for binary versions is
activestate's repository.
What you do is go to www.activestate.com/packages There will be an opening
screen that asks if you are using VPM, just say yes and the next screen will
be a list of all packages that are available(the names are slightly
different than the standard Perl names for these packages). Once you know
the name that ActiveState uses for the package just run PPM (it comes with
ActiveState's Perl download it's located in \perl\bin) from a DOS prompt and
type install [packagename] PPM has activestates FTP address already coded
in so all you need to know is the package name. There is a command in PPM
itself to retrieve a list of available packages, but the list just scrolls
off of the page with no opportunity to scroll backwards that I can find.
Thus the necessity to go to ActiveState's WWW page to get the list.
Good Luck
John Counts
------------------------------
Date: Mon, 01 Feb 1999 07:55:15 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Double Writing in Logs... Why?
Message-Id: <36b55b2e.1268547@news.skynet.be>
E. Preble wrote:
>I have several cgi (perl) log file programs (some that I've
>written, some that others have written). The common thread to all
>of them is that they all seem to "double log" things occasionally.
>Anyone know why?
It could be that the CGI programs get called twice. The Netscape browser
I'm using (v3) is a notorious example of that (with me ;-). Ever seen a
"transfer interrupted!" screen when you push a post button?
Bart.
------------------------------
Date: Mon, 01 Feb 1999 11:18:05 +0000
From: Derek Fountain <derek@fortstar.demon.co.uk>
Subject: Help building regex needed
Message-Id: <36B58D6D.9C42132C@fortstar.demon.co.uk>
I'm trying to put together a regular expression in Perl 5 which will
match most words but not all. Specifically it's to pick the function
names of of C source, so what I need is something like:
any-word-chars then optional-whitespace then (
thus:
(\w+)\s*\( # $1 gives me the function name
That's good enough for what I need, but, it picks out ifs, whiles and
dos as well as the functions. Is it possible to say \w+ except when its
an i-f or w-h-i-l-e etc?
I've redone the job with substring slicing at the moment but it's
SLOOOOOW!
Del
------------------------------
Date: Mon, 1 Feb 1999 11:33:28 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: Help building regex needed
Message-Id: <si3e4q5pfb.fsf@cre.canon.co.uk>
Derek Fountain <derek@fortstar.demon.co.uk> wrote:
> (\w+)\s*\( # $1 gives me the function name
>
> That's good enough for what I need, but, it picks out ifs, whiles and
> dos as well as the functions. Is it possible to say \w+ except when its
> an i-f or w-h-i-l-e etc?
Use a zero-width negative lookahead assertion (see perldoc perlre). For
example:
\b(?!(?:if|while|for|do)\b)(\w+)\s*\(
--
Gareth Rees
------------------------------
Date: 1 Feb 1999 06:33:14 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: how to code a between() with regex?
Message-Id: <slrn7baila.e29.sholden@pgrad.cs.usyd.edu.au>
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>
>> Of course by the look of your code which is contains at least one obvioud perl
>> syntax error on each line you mightn't understand that.
>
>That's a rather uncalled-for remark, considering that the code was
>clearly labelled as pseudo-code.
By the look of the code (psuedo though it may have been, when is the last
time you used a '$' prefix in psuedo code....) and the question itself, I
thought that the person asking the question would probably not understand
the solution.
I said so, and pointed them to documentation that may help them. I took the
psuedo code statement to mean here is some code with a function that I know
doesn't exist but does what I want...
Not the real definition of psuedo code, I know, but given the context that is
how I understood it, if I was wrong and the poster knows perl well enough to
understand my answer then good for them. I thought I'd mention that they
probably wouldn't so that they would spend ages trying to work it out but
instead look in the docs...
--
Sam
Simple rule: include files should never include include files.
--Rob Pike
------------------------------
Date: Mon, 01 Feb 1999 06:16:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: how to code a between() with regex?
Message-Id: <comdog-ya02408000R0102990616380001@news.panix.com>
In article <slrn7baila.e29.sholden@pgrad.cs.usyd.edu.au>, sholden@cs.usyd.edu.au posted:
> Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
> >Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
> >
> >> Of course by the look of your code which is contains at least one obvioud perl
> >> syntax error on each line you mightn't understand that.
> >
> >That's a rather uncalled-for remark, considering that the code was
> >clearly labelled as pseudo-code.
>
> By the look of the code (psuedo though it may have been, when is the last
> time you used a '$' prefix in psuedo code....)
i use a $ prefix in pseudo code all the time. relax. you'll live longer.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 1 Feb 1999 11:40:15 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: how to code a between() with regex?
Message-Id: <si1zka5p40.fsf@cre.canon.co.uk>
Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
> By the look of the code (psuedo though it may have been, when is the
> last time you used a '$' prefix in psuedo code....) and the question
> itself, I thought that the person asking the question would probably
> not understand the solution.
The pseudo-code in <news:1103_917831699@c690507-a> mixes postfix$ with
$prefix, so I think the questioner is probably coming to Perl from a
Basic background. So it's no wonder he or she thinks in terms of
mid$-like functions rather than regexps.
--
Gareth Rees
------------------------------
Date: Mon, 1 Feb 1999 01:42:18 -0500
From: "Franky" <franky123@canada.com>
Subject: How to get Perl for Red Hat Linux 5.2?
Message-Id: <36b54ea9.0@news.total.net>
Hi, I've just installed Linux 5.2 (red hat) and would like to know how I can
get Perl for Appache installed... I'm new to setting up my own web server so
I'd appreciate any help I can get... I would like to know where to get it
how to install and set it up, thanks.
Franky
------------------------------
Date: Mon, 01 Feb 1999 06:14:31 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How to get Perl for Red Hat Linux 5.2?
Message-Id: <comdog-ya02408000R0102990614310001@news.panix.com>
In article <36b54ea9.0@news.total.net>, "Franky" <franky123@canada.com> posted:
> Hi, I've just installed Linux 5.2 (red hat) and would like to know how I can
> get Perl for Appache installed...
http://www.perl.com
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 01 Feb 1999 08:53:33 +0100
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: How to support both short and long option styles?
Message-Id: <wl3btjeo8zm.fsf@plume.nl.compuware.com>
abigail@fnx.com (Abigail) writes:
> Uhm, I tried. The documentation suggests setting "bundling_override".
"bundling" should be sufficient. This requires the force option to be
specified as "--force" (double dash).
With "bundling_override" a single dash works as well for long options.
> However, that leads to runtime errors in Getopt::Long.
I wouldn't call "warnings" run-time errors, but anyway, these were
fixed in the 2.19 release of Getopt::Long, available for some time now
on CPAN, authors/id/JV/GetoptLong-2.19.tar.gz.
-- Johan
Author and maintainer of Getopt::Long
------------------------------
Date: 31 Jan 1999 23:25:18 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Newbie question on regular expressions
Message-Id: <m3679m63ox.fsf@moiraine.dimensional.com>
tadmc@metronet.com (Tad McClellan) writes:
> 1)
> if ('www.blah.com ' =! /http:/i)
^^
I think you meant !~.
> 3)
> if ( ! 'www.blah.com ' =~ /http:/i)
^^^^^^^^^^^^^^^^^
I think you meant to include more parens. :-)
! has a higher precendence than =~. What you wrote is the
same as
if ( (!'www.blah.com') =~ /http:/i)
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Mon, 01 Feb 1999 07:40:50 GMT
From: bhoylma@uswest.com
Subject: Re: Newbie question on regular expressions
Message-Id: <793lq1$bah$1@nnrp1.dejanews.com>
In article <79254h$boi$1@news.ipf.de>,
"Ulrich Petri" <UloPe@hotmail.com> wrote:
>
> if ("www.blah.com " !=~ /http:/i)
>
Use the '!~' operator.
Bruce W. Hoylman (303-541-6557) -- bhoylma@uswest.com ._ 0
- __0 "I intend to live forever... /\/\ /\ / //\.
- - - _-\<,_ so far, so good." /~/~~\/\/~~\ ' \>> |
- __(_)/_(_)_____________________________/\ / \ \/\ \________\\ `_
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 01 Feb 1999 10:35:08 GMT
From: louie@visca.com (Louie)
Subject: Re: outputting perl errors as html?
Message-Id: <36b582f0.4497950@news.jet.es>
"Chris Denman" <c-denman@dircon.co.uk> wrote:
>Sorry, last message made no sense.
>
>Should read as follows:
>
>I need to output perl error messages as html, instead of getting the typical
>default server error page.
>
>Sorry about the confusion!
One way to do this is by including the following snippet in your CGI
scripts:
BEGIN {
open (STDERR, ">/yourpath/error.log");
}
There are more details on this at:
http://www.visca.com/clueless/useful.html
Lou Hevly
http://www.visca.com
------------------------------
Date: Mon, 01 Feb 1999 06:14:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: outputting perl errors as html?
Message-Id: <comdog-ya02408000R0102990614000001@news.panix.com>
In article <36b582f0.4497950@news.jet.es>, louie@visca.com posted:
> "Chris Denman" <c-denman@dircon.co.uk> wrote:
> >I need to output perl error messages as html, instead of getting the typical
> >default server error page.
> One way to do this is by including the following snippet in your CGI
> scripts:
>
> BEGIN {
> open (STDERR, ">/yourpath/error.log");
> }
you probably don't want to do that. besides not solving the problem,
you'll keep overwriting the log file.
however, The Perl Journal issue #9 has an article that summarizes
the various ways that this problem can be solved :)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Mon, 01 Feb 1999 06:41:59 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <793ibn$8mq$1@nnrp1.dejanews.com>
In article <slrn7b2rg5.fpl.dformosa@godzilla.zeta.org.au>,
dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
> In article <78qigd$ssa$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
> >In article <slrn7au5am.ivr.dformosa@godzilla.zeta.org.au>,
> > dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
> [...] Indeed I would argue that given that these are
> >> quite commen in most langages most programers will be expecting them
> >> and therefore a lanague without them would be more confising.
> >
> >
> >I did *not* advocate doing away with short-circuit booleans altogether.
> >It is using them as alternatives to IF's that I apposed to.
>
> But if there useable as boolean short cuts then they will be used as
> condistionals.
Its tougher to do if a language has strict boolean types.
However, I am not (yet) proposing strict boolean types.
Also, if a language offers an "easy" version of an IF
statement (Such as my proposed "DO" indicator),
then jurryrigged IF's are less likely to be
used.
Further, many languages must have an assigment statement
in order to have a boolean expression:
something = this or that;
They would not allow for:
this or that;
as a single statement. Thus, it does not save keystrokes
over a good 'if' design.
Good question! You are thinking about the topic instead
of flaming. Kudos my man!
>
> --
> Please excuse my spelling as I suffer from agraphia. See
> http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
> How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
>
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 01 Feb 1999 11:07:51 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: perl on psion 5?
Message-Id: <36B58B03.4135@geocities.com>
just wondering if there is any implementation of perl that runs on a
psion series 5? i understand i can get a variant of C for it and was
wondering if perl is an option.
-23
------------------------------
Date: Mon, 1 Feb 1999 02:24:46 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl script doesn't execute, instead displays contents of file.
Message-Id: <eco397.0k9.ln@magna.metronet.com>
Seshubabu Pasam (seshu@cs.wpi.edu) wrote:
: Why doesn't my perl script run.
Try yelling "BOO!" while making a scary face.
That usually makes perl run.
:-)
: When I view the file from browser it
: displays the contents of the file, instead of displaying the result.
Your server is not configured correctly.
Ask your server admin or in a newsgroup that has some
connection to servers:
comp.infosystems.www.servers.mac
comp.infosystems.www.servers.misc
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.servers.unix
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 01 Feb 1999 10:35:07 GMT
From: louie@visca.com (Louie)
Subject: Soft reference question
Message-Id: <36b582b6.4439589@news.jet.es>
Greetings:
I am using CGI.pm to do a simple upload:
#!/usr/local/bin/perl -w
use CGI;
my $q = new CGI;
my $upload = $q->param('upload');
my $upload_dir = '/www/test';
(my $filename = $upload) =~ s/^.*?([^\\\/]+)$/$1/;
my $updir = "$upload_dir/$filename";
open (UPLOAD, ">$updir") or die $!;
my ($Buffer);
while (read($upload,$Buffer,8192)) {
print UPLOAD $Buffer;
}
close UPLOAD or die $!;
print "Content-type: text/html\n\n";
print qq~Upload successfully concluded.~;
If I try to use strict with this script, I get an error saying soft
references aren't allowed with strict on. I've read the perlref man
pages and chapter 4 in Programming Perl (also the refs to soft
references in Effective Perl Programming), but I still don't
understand where my soft reference is in this script. (The error
message says "line 20", which is the "close UPLOAD or die $!;" line.)
Thank-you
Lou Hevly
http://www.visca.com
------------------------------
Date: Mon, 01 Feb 1999 10:52:11 +0100
From: Michael <michael.preminger@jbi.hioslo.no>
Subject: The behaviour of split() - followup
Message-Id: <36B5794B.E7BBF671@jbi.hioslo.no>
Michael wrote:
> Hello!
>
> I have encountered difference in behaviour of the split function that
> I do not understand:
>
> In two different scripts I have strings like:
> "0.01 -5.24 ...."
>
> Those I split into an array using split(/\s+/, $string )
>
> In one script the first element is found in the array, and in the other
> it is not.
> Any explanation?
>
> Michael
I have repeated some comments regarding my use of split, which I took
consequences of.
But the problem I was posing somehow drowned.
I have looked at the two scripts again (using exactly the same string).
One of them uses a package (wrapped with SWIG from a C library).
When I comment away the use and package directives then the problem
disappears, which means split's behaviour becomes more predictable.
This package has apparently nothing to do with split, USE'ing it changes
the
behaviour of this function. This is abit scaring.
Can this be a perl bug?
------------------------------
Date: Mon, 01 Feb 1999 02:14:24 -0500
From: Jason Boyd <jboyd99@hotmail.com>
Subject: Win95 and perl5
Message-Id: <36B5544F.9E22123@hotmail.com>
This is a repost, but I still haven't had a great answer.
When I run perl, or a script, in Win95, it opens an MS-DOS window to run
in, and as soon as the script is finished, the window closes. Simply
trying to open a DOS session (or reboot in DOS mode) won't run perl at
all, telling me either "This program cannot be run in DOS mode," or
"This program must be run in Win32." I have had this problem both with
ActivePerl (509) and the standard perl 5.004_02 for Win32.
Please note that I HAVE used the workaround of putting in a final line
like:
$finish = <STDIN>;
so don't bother answering with this suggestion. I really just want to
know why these distributions claim to be for WinNT/95/98, when this
obvious problem exists.
Someone please help me!!!!!
Jason Boyd
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4795
**************************************