[7665] in Perl-Users-Digest
Perl-Users Digest, Issue: 1291 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 9 01:07:32 1997
Date: Sat, 8 Nov 97 22:00:22 -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 Sat, 8 Nov 1997 Volume: 8 Number: 1291
Today's topics:
Re: @ARGV Limits or Attempts to avoid "glob: Too many a <tommyd@halcyon.com>
Re: An excellent example of perl madness (or "split stu (Charles DeRykus)
Another (potentially) simple regex <ahecker@interport.net>
Re: Another (potentially) simple regex (Jason Gloudon)
Re: Another (potentially) simple regex (Tad McClellan)
Re: Better Way in Perl (Peter Samuelson)
Bidirectional pipes ? <robert.friberg@eductus-vast.com>
Re: Bidirectional pipes ? (Tad McClellan)
Re: Chomp vs Chop <youngej@magpage.com>
Client / Server stuff <rbgreene@students.uiuc.edu>
Re: entering data (Charles DeRykus)
Re: ExecCGI <jeff.melrose@quintus.com>
Re: New to Perl - How to get Windows version (Greg Teets)
output to a file <myleslawrence@email.msn.com>
Re: Passing Variables <myleslawrence@email.msn.com>
PERL Novice Needs a Little Help (Peter Wellens)
Re: PERL Novice Needs a Little Help (Tad McClellan)
perl with procmail <tomh@u1.abs.net>
Re: Perl->Java? Java->Perl? Gaaaaa! <jeff.melrose@quintus.com>
Please help: make test fails for Perl 5.004_04 (Michael A. Schwager)
Question on module "get.pl" (Claudia Ma)
self_url <myleslawrence@email.msn.com>
Updating current HTML page with Perl CGI... HELP!! <gdoucet@ait.acl.ca>
Re: Updating current HTML page with Perl CGI... HELP!! (brian d foy)
Re: Variable FileHandles (Jason Gloudon)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 8 Nov 1997 14:40:15 -0800
From: "Jonathan Miller" <tommyd@halcyon.com>
Subject: Re: @ARGV Limits or Attempts to avoid "glob: Too many arguments" message
Message-Id: <642pm7$p2k$1@brokaw.wa.com>
gshibona@unconfigured.xvnews.domain wrote in message
<63l73l$rrc@butch.lmms.lmco.com>...
>I created two "do nothing" scripts; a while and a for, each operating on
>script command line input i.e. @ARGV.
[code snipped out for brevity]
>
>@ARGV seems to have a limit that I'm exceeding in both test scripts when
the
>input "parameter" is a splat(*). What's interesting is the results from
>the test scripts when the input "parameter" is *mtx; that limit seems to be
>different! Look at line 35. Also, look at the error messages; the
implication
>is that I'm encountering different problems.
>
>By what means does one process an unlimited (via "*") number of files on
the
>the command line and avoid seeing that "glob: ..." message?
This is a limit of your shell, not PERL.
A command line sent to a program from the shell can only be so long (not
sure of the exact size). PERL will never see the "*", but rather the shell
expands (globs) the splat into a list of all the files in your directory.
To get around this, have your script do the pattern matching on the files in
the directory instead. This makes things a bit more complicated, but you'll
live =)
try this:
$ set noglob
then run your program and see if it inspires you..
Also try taking a close look at the program 'find' that should live in
/usr/bin. It uses a similar technique of globbing for files itself instead
of using the shell.
------------------------------
Date: Sat, 8 Nov 1997 23:27:24 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: An excellent example of perl madness (or "split stupidity")
Message-Id: <EJCp5o.JCG@bcstec.ca.boeing.com>
In article <34631765.7570@hotlava.com>,
Gary Howland <ghowland@hotlava.com> wrote:
>Steve Kilbane wrote:
>>
>
>>
>> ...omitted...
>
> ...omitted...
>
>Or is there a "legitimate" need to specify a regex as a
>string?
>
Yes, from the Blue Camel pg 221:
.split(" ") can be used to emulate awk's default behavior...(Other
than this special case, if you supply a string instead of regular
expression, it'll be interpreted as a regular expression anyway.
Of course, maybe the awk emulator string taints your
remembrance that in all other cases a regex is required.
Possibly a "split -awk EXPR" would've saved a few stumbles.
However, the split documentation clearly specifies a regex
as the first argument. I agree the caveat about what happens
to a string argument hides really well in that 2 plus pages
though :)
Regards,
--
Charles DeRykus
------------------------------
Date: Sat, 08 Nov 1997 17:29:27 -0500
From: Alan <ahecker@interport.net>
Subject: Another (potentially) simple regex
Message-Id: <3464E7C7.B4653011@interport.net>
Folks,
Well, I've got another regex question for y'all... I need to find a
string from the command line that contains "special" characters, like
$var or &boo at the end. No spaces, but I can't seem to get it to go.
I've even tried to narrow the problem down by looking specifically for
$var, but no luck. And, from the shell, $var is entered in single
quotes, so as not to be taken as a shell variable. What I've gotten to
so far is this:
/\$var$/
or
/[\$var]$/
Neither works. Any ideas?
- Alan Hecker
--
"Never send a Monster to do the work of an Evil Scientist."
------------------------------
Date: 9 Nov 1997 00:11:26 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Another (potentially) simple regex
Message-Id: <642v3e$dlh$1@daily.bbnplanet.com>
Alan (ahecker@interport.net) wrote:
: Folks,
: Well, I've got another regex question for y'all... I need to find a
: string from the command line that contains "special" characters, like
: $var or &boo at the end. No spaces, but I can't seem to get it to go.
: I've even tried to narrow the problem down by looking specifically for
: $var, but no luck. And, from the shell, $var is entered in single
: quotes, so as not to be taken as a shell variable. What I've gotten to
: so far is this:
I'd ask you to re-word this and ask your question again. You confused me,
but then again that's easy to do.
/\$var$/ will match '$var' at the end of a line.
If you are trying to use the value of a variable in your regexp
you need to quote the special characters in it.
Best way to do that would be to say :
/\Q$cmdlinestring\E/ where $cmdlinestring contains $var or whatever
you entered at the commandline.
Jason Gloudon
------------------------------
Date: Sat, 8 Nov 1997 18:09:39 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Another (potentially) simple regex
Message-Id: <30v246.6h6.ln@localhost>
Alan (ahecker@interport.net) wrote:
: Well, I've got another regex question for y'all... I need to find a
: string from the command line that contains "special" characters, like
: $var or &boo at the end. No spaces, but I can't seem to get it to go.
: I've even tried to narrow the problem down by looking specifically for
: $var, but no luck. And, from the shell, $var is entered in single
: quotes, so as not to be taken as a shell variable. What I've gotten to
: so far is this:
: /\$var$/
That should work if the value of $_ ends with the four characters '$var'.
Did you copy the argument into $_ ?
Or did you mean say:
$ARGV[0] =~ /\$var$/;
??
: or
: /[\$var]$/
That one is definitely wrong.
It is only checking for a match on the very last character in $_
(ie. ONE character, not a four character string)
: Neither works. Any ideas?
If you post some broken code (that we can actually run),
someone will likely help you fix it.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Nov 1997 17:42:27 -0600
From: psamuels@sampo.creighton.edu (Peter Samuelson)
Subject: Re: Better Way in Perl
Message-Id: <642td3$bmt$1@sampo.creighton.edu>
--I-HATE-NETSCAPE
Content-Type: text/plain
[Abigail <abigail@fnx.com>]
> perl -e'map{`mv $_ $\``if/\.cin$/}<*>'
> ls|perl -ne'/\.cin$/&&`mv $_ $\``'
> for f in *;do mv $f `basename $f .cin`;done
> ls *|xargs -i mv {} `basename {} .cin`
I can only get the first and third to work (though I don't see offhand
what's wrong with #2), but those are as good as I've seen on this
thread. HOWEVER ... everyone, as far as I can tell, seems to have
missed [.foo.cin => .foo].
Unix shells (and, by extension, perl's <*>-style operations) do not
consider `.*' to glob in `*'. So Abigail's two examples that I got to
work should actually be more like:
perl -e'map{`mv $_ $\''if/\.cin$/}<*>,<.*>'
for f in * .??*; do mv $f `basename $f .cin`;done
Longer, but they catch the other cases.
--
Peter Samuelson
<psamuels at sampo.creighton.edu>
--I-HATE-NETSCAPE
Content-Type: text/html
<BODY>This post is best viewed with a <B><I>real newsreader</I></B>.</BODY>
--I-HATE-NETSCAPE--
------------------------------
Date: 8 Nov 1997 21:21:48 GMT
From: "Robert Friberg" <robert.friberg@eductus-vast.com>
Subject: Bidirectional pipes ?
Message-Id: <01bcec8c$226d5b60$c82da8c0@akilles.ittek.org>
Where do I catch the output of a program opened as below?
open(ST, "|telnet $host $port") or die $!;
print ST "$usr\n$pwd\n";
# Is it as simple as reading STDIN ?
# How do I now how many chars are waiting?
TIA,
-robban
#######################################
#
# Robert Friberg
# robert.friberg@eductus-vast.com
#
#######################################
------------------------------
Date: Sat, 8 Nov 1997 22:16:45 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Bidirectional pipes ?
Message-Id: <dfd346.4a7.ln@localhost>
Robert Friberg (robert.friberg@eductus-vast.com) wrote:
: Where do I catch the output of a program opened as below?
You don't.
Output goes to STDOUT and STDERR as normal.
: open(ST, "|telnet $host $port") or die $!;
: print ST "$usr\n$pwd\n";
: # Is it as simple as reading STDIN ?
No.
: # How do I now how many chars are waiting?
You don't.
Perl FAQ, part 8:
"How can I open a pipe both to and from a command?"
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Nov 1997 02:50:05 GMT
From: Ed Young <youngej@magpage.com>
To: Matt Pezzuto <mpezzuto@link.com>
Subject: Re: Chomp vs Chop
Message-Id: <6438ct$51n$1@204.179.92.220>
Matt Pezzuto wrote:
>
> "When would ever not know what
> your chopping off?"
I used to get bit with this regularly using
perl 4.036 and "chop"ing the last line of a
file. some editors don't put a newline on
the last line of a file unless you ask for
it. Neither do some applications.
The newbie wins this argument...
------------------------------
Date: Sat, 08 Nov 1997 09:54:34 -0600
From: Rawley Greene <rbgreene@students.uiuc.edu>
Subject: Client / Server stuff
Message-Id: <34648B3A.1146D62D@students.uiuc.edu>
Hi, I'm experimenting with programming client and server stuff in
Perl.. I've got the basic connections and stuff like that down.
But the current limitation is that it only takes one connection at a
time, and I wouldn't be able to issue any commands or anything
server-side.
So, my question is, if I can, how can I enable it to have multiple
connections going and be able to do stuff on the server side?
Rawley
rbgreene@uiuc.edu
------------------------------
Date: Sat, 8 Nov 1997 23:47:56 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: entering data
Message-Id: <EJCq3w.JwF@bcstec.ca.boeing.com>
In article <346332d6.88048343@news.cmc.ec.gc.ca>,
Sylvain Juneau <sjuneau@microtec.net> wrote:
> I have this problem: when I enter $answer and press return it just sit
> there and does not execute the rest of the sub unless i ctrl-d the
> thing. any idea why?
>
> sub send {
> print "Enter the name of the bulletin to resend\n";
> chop($bulletin=<STDIN>);
> $bulletin =~ tr/a-z/A-Z/; # put everything in uppercase
> @filelisting= `ls /usr/local/cis/OUT/alpha/`;
> $numberoffiles=$#filelisting + 1;
> for($i=0;$i<$numberoffiles;$i++){
> open(FILE, "/usr/local/cis/OUT/alpha/$filelisting[$i]") || die"can't
> open: $!\
> n";
> $/ ="\001";
> $* = 0;
> while (<FILE>){
> if ($_=~/$bulletin/){
> @a[$i]=$_}}
> close FILE;
> open(OUTPUT,">header");
> foreach $I (@a) {
> print OUTPUT $I;
> }
> close (OUTPUT);
> }
> @b= `grep '$bulletin' header`;
> print @b;
> print "\nIs this the bulletin(s) that you want to resend?";
> $answer=<STDIN>;
> etc...................
>
Because you've left the input record separator "\001".
Restore the default again:
$/ = "\n";
$answer = <STDIN>;
...
HTH,
--
Charles DeRykus
------------------------------
Date: Sat, 08 Nov 1997 21:27:15 -0800
From: Jeff Melrose <jeff.melrose@quintus.com>
Subject: Re: ExecCGI
Message-Id: <346549B2.74FB6DDC@quintus.com>
Nuno Gomes wrote:
> Apache error message when i tried to run a script that handles a form
> and creates & save files - " ExecCGI off in this directory "
> And yes i'm new at perl cgi progaming...what i'm doing wrong?
Check the access.conf in the <your web server root>/conf directory
the entry of where your script resides should read ---> Options
ExecCGI
this should already be set for the cgi-bin directory you are probably
using another directory that does not have this flag set.
Good Luck
Jeff
------------------------------
Date: Sun, 09 Nov 1997 02:07:08 GMT
From: teetshd@email.uc.edu (Greg Teets)
Subject: Re: New to Perl - How to get Windows version
Message-Id: <346519f9.168378532@news.ececs.uc.edu>
I downloaded PFE last night and it is great. I was getting all
frustrated at work writing Perl in Notepad, FTP to UNIX, etc, etc.
I was saying I was gonna go home and try to write an editor to take
care of it. Fortunately, I came home and found your message.
I like it real well.
I also learned a new expression "It beats Notepad all hollow".
I assume that's similar to "Beats the hell outa Notepad."
Thanks
Greg in Cincinnati
On Sat, 4 Oct 1997 12:45:03 -0700, "Creede Lambard"
<$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> wrote:
>Run, do not walk, to
>
>http://www.activeware.com
>
>and pick up the Activeware port. I am currently using it on my home Win95
>machine and have had absolutely no problems with it. Use Winzip to unzip and
>extract it, and install.bat will place all of the registry entries that make
>using Perl a lot easier on Win95.
>
>I also recommend PFE (http://www.lancs.ac.uk/people/cpaap/pfe/) as a
>freeware editor that has Notepad beat all hollow.
>
>
>Steinar Kleven wrote in message <34365691.F907B490@ahs.hist.no>...
>>Try http://www.perl.org/CPAN/ports/win32
>>
>>There are two releases there: Standard and NOT Standard ;-)
>>
>>Greg Teets wrote:
>>>
>>> I am using Perl at work on UNIX. I'd like to fool around with it at
>>> home on a Win95 box to get more familiar with it. Please let me know
>>> where I can get a port for Win95.
>>>
>>> Thanks
>>> Greg Teets
>>> Cincinnati, Ohio
>
>
------------------------------
Date: Sat, 8 Nov 1997 20:14:38 -0800
From: "Myles Lawrence" <myleslawrence@email.msn.com>
Subject: output to a file
Message-Id: <umt5RVM78GA.198@upnetnews03>
I use a dababase query to format html pages. How dcan I get that output to a
formateed fie so I bring it into Word without a lot of additional
formatting?
myleslawrence@msn.com
------------------------------
Date: Sat, 8 Nov 1997 20:26:41 -0800
From: "Myles Lawrence" <myleslawrence@email.msn.com>
Subject: Re: Passing Variables
Message-Id: <un5iAcM78GA.244@upnetnews03>
I tried this under NT and nothing. Is there and equivalent to the $ENV
variables?
myleslawrence@msn.com
Mark Mielke wrote in message ...
>Dale Chavez <dale@horizonint.com> writes:
>
------------------------------
Date: Sat, 08 Nov 1997 14:58:00 -0800
From: peterl@cet.com (Peter Wellens)
Subject: PERL Novice Needs a Little Help
Message-Id: <peterl-0811971458000001@spk-95.cet.com>
I'd like to write a formatted string to a disk file using the <printf>
function. However, printf apparently doesn't take a filehandle as an
argument like <print> does, but instead wants to sent output to STDOUT.
How can I get around this? I could write my own code to do the very simlpe
field padding I want done, but I would rather use a single function. I'm
sure this is a simple one for any experienced PERLER. Your help would be
greatly appreciated. Thanks.
Please email me your reply as well as posting to group.
-Pete <peterl@cet.com>
------------------------------
Date: Sat, 8 Nov 1997 22:25:57 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: PERL Novice Needs a Little Help
Message-Id: <l0e346.ac7.ln@localhost>
Peter Wellens (peterl@cet.com) wrote:
: I'd like to write a formatted string to a disk file using the <printf>
: function.
No problem.
: However, printf apparently doesn't take a filehandle as an
^^^^^^^^^^
: argument like <print> does, but instead wants to sent output to STDOUT.
Uhhh, where did it "appear" that it won't take a filehandle?
It didn't work when you tried it?
(you didn't even try it before posting, did you?)
(or maybe you _did_ try it but you put a comma after the filehandle?)
: How can I get around this?
Oh I dunno...
Maybe by looking up printf() in the documenatation that is shipped
with every perl distribution?
Radical, its true, but often effective nonetheless.
"=item printf FILEHANDLE FORMAT, LIST"
Looks like it takes a filehandle to me (that's what it means when
it says FILEHANDLE there)
: I could write my own code to do the very simlpe
: field padding I want done, but I would rather use a single function. I'm
: sure this is a simple one for any experienced PERLER.
Experienced programmers check the docs that shipped with the software
when they have a question about the software.
Seems like common sense.
: Your help would be
: greatly appreciated. Thanks.
Yeah, right.
: Please email me your reply as well as posting to group.
Nope.
Please get the answer in the newsgroup where you asked the question.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 8 Nov 1997 20:00:24 -0500
From: Tom Halligan <tomh@u1.abs.net>
Subject: perl with procmail
Message-Id: <Pine.BSI.3.96.971108194813.26200A-100000@u1.abs.net>
hey just checking to see if anyone has an answer for this. i put a
client of ours onto minordomo a perl script for a moderated mailist of a
limited size. I thought haha that using procmail and a couple of aliases I
could turn it into an unmoderated mailing list. I set up a three reciepes
to redirect mails with a "To: whatever" address to the script each one
handeling a different argument of the script. Well it works up to a point,
those that subscribe get put in the mailing_list file, those that
unsubscribe get deleted. When it come time to mail though everinthing goes
blooey. The following message get sent to the log file that I set up.
procmail: Lock failure on "/var/mail/.lock"
procmail: Error while writing to "/var/mail//"
>From me@34.my.net Sat Nov 8 19:42:54 1997
Folder: /var/mail/meagain
6
67
Insecure $ENV{PATH} while running setgid at /var/www/me/cgi-bin/minordomo
lin
e 226.
I figure of couse that it is a permisions prob, any suggestions?
------------------------------
Date: Sat, 08 Nov 1997 22:26:39 -0800
From: Jeff Melrose <jeff.melrose@quintus.com>
Subject: Re: Perl->Java? Java->Perl? Gaaaaa!
Message-Id: <3465579E.BAE64288@quintus.com>
dg50@chrysler.com wrote:
> This time, however, it a little bit different. In this case, I don't
> have
> the luxury of a web server with Perl running behind it to act as my
> API
> manager. Instead, the application has to run offline - quite possibly
> on a
> *gasp* Wintel box. :(
> I also can't count on having perlwin32 on this PC, nor can I count on
> this application staying on any particular machine. Next week, it may
> need to run on a Mac, or on Linux, or whatever.
>
> So, Java, right? "Write once, run anywhere" right? (I can count on
> having
> access to a Java-enabled web browser, at least)
Wrong Java is a complete paradigm shift. Write once run anywhere.
really means write once debug everywhere. Yes even with the same
browser.
Did I hear an amen from the mac foks??
OK suggestions:
1) use components... some expensive some not... net dynamics, novera
etc...
these are components that have been tested across platforms to WORK.
Unlike most of the AWT in JDK 1.0 and even 1.1
2) Wait for Microsoft to come out with Virtual Machines to support
Visual Basic
<< OK OK bad joke >>
3)write in some other interpreted language
but then you get into the how do we send this to everybody i.e. admin
nightmare
4)make Netscape 4.0.3 a corporate standard and use the incuded visigenic
orb to bring peace and harmony to the galaxy with Java.
I would go with 4 if you are looking to deploy crossplatform in 9 months
In 6 months or less do yourself a favor use components number 1.
> So I sketch out a nifty user interface (based loosly on the Win95
> Network
> Control Panel) and call up the AWT specs, and... gaaaa, who designed
> this
> language? It's like trying to read a cookbook written by George Orwell
> in
> a 1984-ish mood, shortly after ingesting some alien hallucinagen!
> People
> actually *use* this and accomplish stuff? Inconceivable!
>
Java ain't that bad... and getting better all the time..
> I want my nice, comprehensible perl code back!
>
> So I guess what I want to do is write this app in perl, with some sort
> of
> ties to a windowing package of some sort, that I can then compile to
> Java
> bytecode (with all the windowing calls mapped to AWT, of course) that
> can
> then be wrapped up in a web page that resides on the user's local
> machine
> to be invoked by a browser bookmark.
>
> Or do I?
>
> I don't care if the compilation process results in my java program
> containing the perl interpreter, I don't care if native Java would
> result
> in a file size 100 times smaller, I just want to get this done without
>
> having to teach myself Java from scratch to accomplish what would be
> an
> hour long job in perl.
>
USE VENDOR COMPONENTS!!!!
> (and there's this issue of reading/writing local files too - this may
> not
> be runnable from a browser window, the machine this runs on may
> require
> the Java RTE no matter what - in which case I have to install some
> sort
> of RT package on the machine no matter what, throwing the
> "univeriallity"
> of Java right out the window...)
>
Writing to local file systems is something the sun guys have been
arguing about forever it seems.
They are going to allow for local file access. I don't know when. ( they
may even have it now
anyone know??) Depending on how much local storage you need and what
you need to store
you could look at writing to the cookie ( Kluge but will work ). Outside
of certifing the app and
writing to a file that way...
Now a question why are you doing this? I hope it's not "gee we heard
this Java stuff runs everywhere so
let's get all our greenscreens to talk to our pc's" boondoggle.
The reason why I ask is you made no mention of Java's primary, if only
in some cases, advantage. No deployment
worries put it on a web server and literally run anywhere. Because if
this is not a problem you should consider other
options. Now next year... well next year we either brew java daily for
this type of problem or can you say VB?
cheers from one who's been there
Jeff Melrose
jeff.melrose@quintus.com
------------------------------
Date: 9 Nov 1997 00:39:43 GMT
From: schwager_nobasura@wwa.com (Michael A. Schwager)
Subject: Please help: make test fails for Perl 5.004_04
Message-Id: <6430of$fjr$1@hirame.wwa.com>
Hi,
I'm trying to install Perl 5.004_4 on a Solaris 2.5 Sparc20. make test
fails on op/pack.t, tests 10 and 22. Looks like it's the pack('w',
blah) test. 'w', for those who don't know, is:
w A BER compressed integer. Its bytes represent an unsigned
integer in base 128, most significant digit first, with as few
digits as possible. Bit eight (the high bit) is set on each
byte except the last.
Now I don't know if I'll ever use this, but it makes me nervous that it
failed. Did I do something wrong when running Configure... did I lie
when I told it to align longs on 8 byte words, or something???
I really can't imagine why this would fail.
Everything else tested great... any help?
Thanks.
Sincerely,
-Mike
================================================
Mike Schwager schwager@nobasura_wwa.com
Remove any _nobasura or nobasura_ from my address to reply!
Speaking for myself.
Playing my congas on the beach when I can.
"Our doubts are traitors," said Lucio, "and make us lose the good
we might often win, by fearing to attempt it." -Wm. Shakespeare
------------------------------
Date: 9 Nov 1997 00:20:11 GMT
From: maclaudi@cps.msu.edu (Claudia Ma)
Subject: Question on module "get.pl"
Message-Id: <642vjr$kip$1@msunews.cl.msu.edu>
Hi there,
I'm using a module "get.pl" from CPAN and got the following error msg:
<89 amlia:/user/web/cgi-user/maclaudi/Hiclas >test.pl
"use" not allowed in expression at subs.pl line 7, at end of line
syntax error at subs.pl line 7, near "(use strict"
The corresponding lines from the "get.pl" are:
#!/usr/local/bin/perl -w
# socket based hypertext version of UNIX cat
use strict;
use Socket; # include Socket module
require 'tcp.pl'; # file with Open_TCP routine
require 'web.pl'; # file with parseURL routine
use vars qw($opt_h $opt_H $opt_r $opt_d);
use Getopt::Std;
"get.pl" is used to submit a query to the url of a search engine and get the result
back.
Can anyone tell me why I got the error and how to fix it ?
Thanks,
Claudia
--
**********************************************************************
-- "Life is an endless process of exploring and creating."
Claudia Y. Ma
Dept. of Computer Science email: maclaudi@cps.msu.edu
Michigan State University http://www.cps.msu.edu/~maclaudi
**********************************************************************
------------------------------
Date: Sat, 8 Nov 1997 20:04:00 -0800
From: "Myles Lawrence" <myleslawrence@email.msn.com>
Subject: self_url
Message-Id: <u$9IVPM78GA.320@upnetnews03>
I've been porting a unix script to NT using CG__LITE in place of CGI and I
find some features missing like:
$cgi=CGI:
$cgi->param('value')
$cgi->self_url
myleslawrence@msn.com
------------------------------
Date: Sun, 09 Nov 1997 05:20:43 GMT
From: Guy Doucet <gdoucet@ait.acl.ca>
Subject: Updating current HTML page with Perl CGI... HELP!!
Message-Id: <3465479B.CB64E34D@ait.acl.ca>
>From an HTML page, I am calling a Perl CGI program. I want this Perl
script to modify the actual HTML file that the script was called from.
But I get an error when trying to open the file with the > write symbol.
Probably because the file is currently open. But I tried calling a
second HTML page from the first one. Then the second HTML page would
call the Perl script. Unfortunately I still can't open the first HTML
file to write to it. Can anyone shed some ideas. Thanks for all info.
Guy Doucet
------------------------------
Date: Sun, 09 Nov 1997 00:53:19 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Updating current HTML page with Perl CGI... HELP!!
Message-Id: <comdog-ya02408000R0911970053190001@news.panix.com>
In article <3465479B.CB64E34D@ait.acl.ca>, gdoucet@ait.acl.ca wrote:
>From an HTML page, I am calling a Perl CGI program. I want this Perl
>script to modify the actual HTML file that the script was called from.
>But I get an error when trying to open the file with the > write symbol.
>Probably because the file is currently open. But I tried calling a
>second HTML page from the first one. Then the second HTML page would
>call the Perl script. Unfortunately I still can't open the first HTML
>file to write to it. Can anyone shed some ideas. Thanks for all info.
there's no reason why you need to guess at why things happen since
perl has facilities for such information:
open(FILE, "> some_file_i_dont_have_write_permissions_for")
or die "$0: open failed - $!\n";
you'll get a message telling you what went wrong. perhaps "Permission
denied".
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 8 Nov 1997 23:26:43 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Variable FileHandles
Message-Id: <642sfj$5pj$1@daily.bbnplanet.com>
Robert Hughes (robert.hughes@amarest.com) wrote:
: David Corcoran wrote:
: > I'm trying to write a sockets module for a specific job at work
: > and was curious if someone knew how to create a variable FileHandle.
: >
: > Currently I have a
: >
: > $remote = accept(TMP,SOCK);
: > $users[$i++] = */TMP;
You aren't creating the glob reference here correctly. You mean \*TMP.
However this is not what you want.
$tmp = new IO::Handle;
$remote = accept($tmp,SOCK);
you have to create a new filehandle for each new connection. you can't
reuse a reference to the same handle.
Jason Gloudon
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1291
**************************************