[12410] in Perl-Users-Digest
Perl-Users Digest, Issue: 6010 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 15 22:07:26 1999
Date: Tue, 15 Jun 99 19:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 15 Jun 1999 Volume: 8 Number: 6010
Today's topics:
Cant make PPM work. <pjdurai@my-deja.com>
compile error <jackiech@kt.co.kr>
Re: Dynamic Regular Expression (Ilya Zakharevich)
Re: Emailing Binary Files rad91@my-deja.com
Re: FEAR FAD <cassell@mail.cor.epa.gov>
Re: Help needed !!!!!!! (David Efflandt)
Re: Help needed !!!!!!! (Tad McClellan)
Re: I dont understand system calls <juex@my-dejanews.com>
including another variable into an array <splinter@monmouth.com>
Re: including another variable into an array <vmurphy@gamora.ndhm.gtegsc.com>
Re: including another variable into an array (I R A Aggie)
Re: Is it better perl than awk ? (Charles Demas)
Re: Is it better perl than awk ? (Henry Churchyard)
Re: newbie learning "my" declarations (Sam Holden)
Re: Page Refresh (David Efflandt)
Re: param($variable) <rootbeer@redcat.com>
Re: Perl and CGI <rootbeer@redcat.com>
proxy server/web recording tool aoh@my-deja.com
Re: saving uploaded file (David Efflandt)
separate file <leonid76@erols.com>
Re: single vs. double quotes (Tad McClellan)
Re: sprintf padding with zeroes <cassell@mail.cor.epa.gov>
Stopping the input...????? Me don't want buffer overfl <portmaster@port17.com>
Stopping the input...????? Me don't want buffer overflo <portboy@home.com>
this charecter @ ruined my day!! <bd@albany.net>
Re: this charecter @ ruined my day!! <tchrist@mox.perl.com>
Re: this charecter @ ruined my day!! <technology@workmail.com>
Re: this charecter @ ruined my day!! <technology@workmail.com>
Re: this charecter @ ruined my day!! <bd@albany.net>
Re: this charecter @ ruined my day!! (Sam Holden)
Re: WIN32 USERADMIN DOESN'T WORK <cassell@mail.cor.epa.gov>
Re: writing to a gzip file (David Efflandt)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jun 1999 22:26:40 GMT
From: pj durai <pjdurai@my-deja.com>
Subject: Cant make PPM work.
Message-Id: <7k6juk$3ju$1@nnrp1.deja.com>
greetings.
I am trying to use ActiveStates PPM to install some packages. It always
craps out with the following error.
[I dont have an NT. So I cant compile CPAN Stuff myself. I have to rely
on Zipped modules from ActiveState.]
bash$ ppm.bat install XML-Parser.ppd
Element 'OPTIONS' must have a 'TRACE' attribute. at C:\PERL\lib/PPM.pm
line 1711
.
Element 'OPTIONS' must have a 'TRACEFILE' attribute. at C:
\PERL\lib/PPM.pm line
1711.
PPM interactive shell (0.9.6) - type 'help' for available commands.
PPM>
Any ideas ?
Appreciate your time.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 16 Jun 1999 10:20:56 +0900
From: jackie chong <jackiech@kt.co.kr>
Subject: compile error
Message-Id: <3766FBF8.9A54544E@kt.co.kr>
hi,
I am trying to build and make perl 5.005.03 in irix 6.2.
I came across this warning says "toke.c, cast between pointer to object
and pointer to function. I have about three same warning messages and it
took forever(more than 2 hours) to make that I had to call interupt in
the middle.
If anyone had a similar problem before, your feedback would be greatly
appreciated.
Thank you for your time.
Jackie
------------------------------
Date: 16 Jun 1999 00:14:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Dynamic Regular Expression
Message-Id: <7k6q9e$f20$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Uri Guttman
<uri@sysarch.com>],
who wrote in article <x7ogihfju4.fsf@home.sysarch.com>:
> BTW do you know you can put the results of multiple qr//'s into a single
> regex and still save the compile time?
STOP THIS NONSENSE!
qr// HAS NOTHING TO DO WITH COMPILATION.
It is a quote-operator. This operator produces a Regexp object.
This object might be compiled - but it has nothing to do with qr//
at all.
Now repeat it 10 times. Ouph. Thank you.
[Well, in some cases qr// MAY compile things and use the compiled form
later, but not in the case you propose below]
> $rx1 = qr/a+b/ ;
> $rx2 = qr/c?d+/ ;
>
> m/$rx1$rx2/ ;
Ilya
------------------------------
Date: Tue, 15 Jun 1999 23:30:40 GMT
From: rad91@my-deja.com
Subject: Re: Emailing Binary Files
Message-Id: <7k6nn1$4t4$1@nnrp1.deja.com>
Thank you very much for your suggestion. It looks exactly like what I
want. And it looks TOO easy!
-ronnie
In article <375F92F6.142E6DFE@bigfoot.com>,
Andrzej Filip <anfi@bigfoot.com> wrote:
> rad91@my-deja.com wrote:
>
> > I'm interested in a module/technique I can use to email binary
files.
> > I assume that I would first have to encode the file to base64. Is
that
> > correct? How would I do that? Your help would really be
appreciated.
>
> Have you tried mime::LITE ?
> --
> Andrzej (Andrew) A. Filip
> http://www.bigfoot.com/~anfi
> E-mail: anfi@bigfoot.com
> I NO LONGER USE anfi@polbox.com
> Posting history (all addresses):
> http://www.dejanews.com/profile.xp?author=Andrzej%20Filip&ST=PS
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 15 Jun 1999 17:35:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FEAR FAD
Message-Id: <3766F16B.DC14EB56@mail.cor.epa.gov>
sean-whitestone wrote:
>
> Y2K MILLENNIUM BUG:THE LATEST FEAR FAD "I sought the Lord and He answered
> [BIG SNIP]
Why do I have this awful temptation to give this guy Jocelyn's
e-mail address? And _vice_versa_?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 16 Jun 1999 01:08:55 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Help needed !!!!!!!
Message-Id: <slrn7mdu57.hd.efflandt@efflandt.xnet.com>
On Tue, 15 Jun 1999 21:28:17 +0200, Dav <silver98@lycosmail.com> wrote:
>Hi,
>
>I have got a home page on VirtualAve.
>Now, my perl script doesn't work.
>
>I always get the error:
>
>Internal Server Error (500)
The script looks correct and virtualave.net automatically sets proper file
permissions to 755 for files ending with '.cgi' or '.pl', my guess is that
you uploaded as default binary and forgot to set your ftp program to
upload as ASCII. That will automatically strip those nasty carriage
returns that will choke a script in Unix.
>the simple script I'm using as a test is:
>
>#!/usr/bin/perl
>
>print "Content-type:text/html\n\n";
>print "<html><head><title>Form Output</title></head><body>";
>print "<h2>Results from FORM post</h2>\n";
>print "</body></html>";
>
>I put the script into the right directory and did all I had to do but
>nothing ...
>
>Who can help ?
http://cgi-help.virtualave.net (my own site, not employed by virtualave)
--
David Efflandt http://www.de-srv.com/
efflandt@xnet.com http://www.xnet.com/~efflandt/
------------------------------
Date: Tue, 15 Jun 1999 12:07:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help needed !!!!!!!
Message-Id: <uot5k7.7qe.ln@magna.metronet.com>
Dav (silver98@lycosmail.com) wrote:
: Internal Server Error (500)
See Perl FAQ, part 9:
"My CGI script runs from the command line but not the browser.
(500 Server Error)"
for a whole bunch of help with using Perl for CGI applications.
That is not a Perl message (because it does not appear in
the 'perldiag.pod' standard Perl doc).
You have some sort of CGI related problem.
You should ask CGI related questions in a CGI related newsgroup.
This is not one of those newsgroups, but the one below is:
comp.infosystems.www.authoring.cgi
: print "Content-type:text/html\n\n";
^^
^^ maybe you need a space there...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Jun 1999 17:02:24 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Re: I dont understand system calls
Message-Id: <7k6phr$hq4@news.dns.microsoft.com>
Mark Conlin <Mark.Conlin@bridge.bellsouth.com> wrote in message
news:37667742.9F485A10@bridge.bellsouth.com...
> I am having problems understanding the system command.
>
> I want to use system to look for a file, How can I get
> the results from
>
> system("ls"); or
> system("find", "myfile");
Please define "result".
To capture the return value of the system call, then use
$foobar= system(....)
jue
--
J|rgen Exner
------------------------------
Date: Tue, 15 Jun 1999 20:54:59 -0400
From: "Matt" <splinter@monmouth.com>
Subject: including another variable into an array
Message-Id: <7k6skk$q34$1@news.monmouth.com>
Hey,
Very simple question.
I have an array. I have a variable. I want the variable appended onto that
array.
Obviously I can't just do
@array .= $variable
So what should I do?
-Matt
------------------------------
Date: 15 Jun 1999 21:03:18 -0400
From: Vincent Murphy <vmurphy@gamora.ndhm.gtegsc.com>
Subject: Re: including another variable into an array
Message-Id: <xjghfo9hs89.fsf@gamora.ndhm.gtegsc.com>
>>>>> "Matt" == Matt <splinter@monmouth.com> writes:
Matt> Hey,
Matt> Very simple question.
Matt> I have an array. I have a variable. I want the variable appended onto that
Matt> array.
Matt> Obviously I can't just do
Matt> @array .= $variable
push( @array, $variable );
see perldoc -f push for more details.
HTH.
--
Vinny
------------------------------
Date: 16 Jun 1999 01:38:07 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: including another variable into an array
Message-Id: <slrn7me067.s9h.fl_aggie@thepentagon.com>
On Tue, 15 Jun 1999 20:54:59 -0400, Matt <splinter@monmouth.com>, in
<7k6skk$q34$1@news.monmouth.com> wrote:
+ So what should I do?
Read up on 'push'??
James - as opposed to 'pop'
------------------------------
Date: 16 Jun 1999 00:51:47 GMT
From: demas@sunspot.tiac.net (Charles Demas)
Subject: Re: Is it better perl than awk ?
Message-Id: <7k6sf3$8v4@news-central.tiac.net>
In article <3766d75e@cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting mailed to cited author]
>
>In comp.lang.perl.misc, "Claudio Gutierrez" <cgutierr@firstcom.cl> writes:
>:As this news are read by people with a problem similar to mine currently
>:solved, I ask the referenced question.I donM-4t attempt to begin a
> ^^^^
> That was illegal MS-ASCII!
>
>See http://language.perl.com/misc/ms-ascii.html for details.
>
>:philosophical discussion, I just would like to know if it is better to
>:invest time to learn perl or awk to solve the next situation
>
>Awk is a venerable, powerful, elegant, and simple tool that everyone
>should know. Perl is a superset and child of awk, but has much more
>power that comes at expense of sacrificing some of that simplicity.
In simpler words, you'll get more done more quickly learning awk
first. Perl is more powerful and cryptic, and much harder to
learn because there's so much more to it (I'm trying to learn it).
As you can infer, I think there's value to learning Perl, but
I found awk much easier to master and get things done with while
learning.
Chuck Demas
Needham, Mass.
--
Eat Healthy | _ _ | Nothing would be done at all,
Stay Fit | @ @ | If a man waited to do it so well,
Die Anyway | v | That no one could find fault with it.
demas@tiac.net | \___/ | http://www.tiac.net/users/demas
------------------------------
Date: 15 Jun 1999 20:53:32 -0500
From: churchyh@ccwf.cc.utexas.edu (Henry Churchyard)
Subject: Re: Is it better perl than awk ?
Message-Id: <7k702s$ivs@piglet.cc.utexas.edu>
In article <3766d75e@cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, "Claudio Gutierrez" <cgutierr@firstcom.cl> writes:
>> As this news are read by people with a problem similar to mine currently
>> solved, I ask the referenced question.I donM-4t attempt to begin a
> ^^^^
> That was illegal MS-ASCII!
Actually, Microsoft refers to it as "Windows ANSI" or "Code page 1252"
(and people who don't use Emacs may have no idea what you mean by "M-4").
> See http://language.perl.com/misc/ms-ascii.html for details.
> 3. A short-term alternative is to change what your server returns as
> its content type for those pages from "text/html" or "text/plain"
> to something reflective of its true content type, such as
> "text/x-ms-html" and "text/ms-ascii" respectively,
The quasi-accepted solution here is to use HTTP headers such as:
Content-Type: text/plain;charset=windows-1252
(See http://ppewww.ph.gla.ac.uk/~flavell/charset/internat.html etc.)
--%!PS
10 10 scale/M{rmoveto}def/R{rlineto}def 12 45 moveto 0 5 R 4 -1 M 5.5 0 R
currentpoint 3 sub 3 90 0 arcn 0 -6 R 7.54 10.28 M 2.7067 -9.28 R -5.6333
2 setlinewidth 0 R 9.8867 8 M 7 0 R 0 -9 R -6 4 M 0 -4 R stroke showpage
% Henry Churchyard http://uts.cc.utexas.edu/~churchh
------------------------------
Date: 16 Jun 1999 01:21:31 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: newbie learning "my" declarations
Message-Id: <slrn7mdv0q.lg6.sholden@pgrad.cs.usyd.edu.au>
On Tue, 15 Jun 1999 22:35:12 GMT, aaronp@removeme-shore.net wrote:
> I have a question about using the 'my' and 'local' declarations. I'm new
>to perl and am at the stage of teaching myself how to make scripts not
>just work, but work right, based on info from this newsgroup.
>
>I want to do this:
>
>my $total++;
my creates a lexically scoped variable. Incrementing in the my doesn't
really make any sense. Declare the variable. Increment the variable later.
>From the error message I would guess that perl parses this differently
than you suspect. It tries to make a my variable based on the result of
the increment, as opposed to increment a my variable.
This works for example (but doesn't make any sense really) :
(my $total)++;
That increments $total. You would never use this however, since the my
creates $total and so it has the value undef so you might as well do
my $total = 1;
>
> It won't let me do that, neither will 'local'. I thought from reading
>page 108 of the Camel book that local would at least work. Any ideas on
>where I should go from here to learn more about this? The llama and ram
>books dont cover this much.
local has the same parsing as my above. local and my are parsed the same
way as functions (at a basic level anyway) ++ binds tighter than the
function call.
>
> FWIW, here is my script as is. Its supposed to be a replacement for
>WU-FTPD's "ftpwho" tool, showing who is logged into an ftp site and what
>they're doing.
>
> thanks..
>
>#!/usr/bin/perl -w
>#use strict;
>
>open(PS, 'ps ax --cols=200 |') or die "can't ps: $_";
You want $! not $_ in the die message...
>
>while(<PS>) {
>
> chomp;
> my @psnfo = split(/ +/);
> my $pid = $psnfo[1];
> my $user = $psnfo[7];
> my $host = $psnfo[6];
>
> if ( $psnfo[5] =~ /ftpd/) {
> my @file = split(/:/); # use colons for files because filenames have
> # spaces
> my $filename = "$file[4]";
Useless quotes that just confuse the matter
> $filename =~ s/ +$//; # strip trailing whitespace
> printf " $pid $user $host $filename\n";
Why are you using printf when you aren't using formatting. Try print.
> $total++; # add up number of users
> }
>}
>printf "Total of $total Users/n";
As above... use print.
>close(PS) or die "can't close ps: $_";
Again $! not $_.
--
Sam
Another result of the tyranny of Pascal is that beginners don't use
function pointers.
--Rob Pike
------------------------------
Date: 16 Jun 1999 01:27:11 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Page Refresh
Message-Id: <slrn7mdv7h.hd.efflandt@efflandt.xnet.com>
On Tue, 15 Jun 1999 08:39:52 -0700, Raj <technology@workmail.com> wrote:
>Hi ,
>How do i refresh the previos CGI/Perl script Page when the browser back
>button is clicked? TIA,
>~Raj
For a perl way to do it see "CREATING A DEFAULT BUTTON" in CGI.pm
There is a Javascript way to do that, I have seen it done, but it is
frustrating when you actually want to use the previous data for testing.
But I know nothing about it and it is not related to this newsgroup.
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
Date: Tue, 15 Jun 1999 17:02:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: param($variable)
Message-Id: <Pine.GSO.4.02A.9906151650520.10614-100000@user2.teleport.com>
On Tue, 15 Jun 1999, James Stewart wrote:
> I'm trying to read a list of fields from a form using CGI.pm. The
> fields are named NDD1, NDD2 ... NDD10 etc.
> The variable $entriesone contains the final form number and I tried to
> use the following code snippet to move the values to an array. The only
> problem is that it doesn't seem to receive anything into $NW.
>
> for ($loop=1; $loop<=$entriesone; $loop++) {
It makes no difference to Perl, but I prefer names like $entries_one, with
underscores separating words, since it's easier to see what they mean.
(Although, in this case, there may be a more-descriptive name yet.) Also,
it would be easier to make the loop like this.
for my $loop (1..$entries_one) {
> $variable = "NDD".$loop;
> my $NW = param($variable);
> push @NWONE, $NW;
> }
Why are you using variable names in all caps? But it looks to me as if
you're not finding anything in $NW after the loop because it's a my()
variable (as it should be, if you'll use it at all). But your data should
be in the global(?) @NWONE.
But this may be more to the point:
my @nw_one = map scalar(param("NDD$_")), 1..$entries_one;
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 17:19:12 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl and CGI
Message-Id: <Pine.GSO.4.02A.9906151718310.10614-100000@user2.teleport.com>
On Sun, 13 Jun 1999, Chen & Jinlin wrote:
> I have a web server that doesn't support CGI!
Then you probably wouldn't have any need for the docs, FAQs, and
newsgroups about CGI programming, but maybe you should check them out
anyway. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 15 Jun 1999 23:54:50 GMT
From: aoh@my-deja.com
Subject: proxy server/web recording tool
Message-Id: <7k6p46$5b5$1@nnrp1.deja.com>
Hello,
I'm trying to automate some testing I have to do for a web application
using Perl, and I'm having some problems. I was wondering if someone
on here could help me.
My idea is to write a proxy server that I can set my browser to to
record all of the http transactions between it and a web server. Then, I
plan to use the generated recording (with all of the GET and POST
messages) to replay all of the transactions using a client.
Being new to Perl network programming, I'm having problems getting this
whole thing to work--especially the proxy server. I've been using Mr.
Randal Schwartz's anonymizing and gzip proxy server examples as a guide,
but I have to admit that I'm still having problems modifying his
examples for my purposes.
Has anyone done or seen anything similar to what I've been trying to do
in Perl? If so, could you please help me? I would really appreciate
it. Thank you.
-Allen
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 16 Jun 1999 01:37:53 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: saving uploaded file
Message-Id: <slrn7mdvrk.hd.efflandt@efflandt.xnet.com>
On Tue, 15 Jun 1999 22:05:13 GMT, Ryan Corder <uucon@my-deja.com> wrote:
>ok, following the advice of the newsgroup community, i have managed to
>configure my script with CGI.pm so that a user can upload a file. Now, how
>do i save the file in a particular dir. I want to be able to save the
>uploaded image in: /home/<username>/images here is the code i used to read
>the filename and the MIME type so that users can only upload images:
If the script is not running suid as the user, make sure that the images
directory has 777 permission (747 or 707 might work). Other than that,
follow the instructions in CGI.pm.
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
Date: Tue, 15 Jun 1999 21:17:16 -0400
From: "Leonid Goltser" <leonid76@erols.com>
Subject: separate file
Message-Id: <7k6tst$du0$1@autumn.news.rcn.net>
I tried to use several files for my program. I use
"require "filename";
but I got message that says that structure does not return true.
What does it mean and how to fix it?
------------------------------
Date: Tue, 15 Jun 1999 12:17:48 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: single vs. double quotes
Message-Id: <cbu5k7.7qe.ln@magna.metronet.com>
Weborium (weborium@aol.com) wrote:
: If I'm printing a statement using double quotes, and I want to use double
: quotes in the statement, will using single quotes get the same effect?
No.
: Like in
: line 4 below, I want it to say <body bgcolor="black"> however I can't use (" ")
: or it'll mess it up.
There are approximately a bazillion ways to overcome that
small difficulty (UNTESTED):
print CUSTOM "<body bgcolor=\"black\">\n"; # UGLY and hard to maintain
^ ^
^ ^
print CUSTOM qq(<body bgcolor="black">\n); # much better
print CUSTOM qq/<body bgcolor="black">\n/; # choose your own delimiter
print CUSTOM <<ENDHTML; # see 'here-doc' in perldata.pod
<body bgcolor="black">
ENDHTML
You have several very serious problems apart from the quoting
issue as well:
: open (CUSTOM, ">/edited.htm");
You should *always*, yes *always*, check the return value from
open() calls:
open (CUSTOM, ">/edited.htm") || die "could not open '/edited.htm' $!";
: flock (CUSTOM, 2);
^
You should import the constants instead of hard coding them.
: print CUSTOM "<html><head><title>Console</title></head>\n";
: print CUSTOM "<body bgcolor='black' text='white' link='yellow'>\n";
: print CUSTOM "<h2>Welcome\n";
: print CUSTOM "</body></html>\n";
: flock (CUSTOM, 8);
You should never explicitly unlock!!
In attempting to avoid a problem, you have made your program
vulnerable to that very problem! Data may get corrupted...
See the several Perl FAQs with "lock" in the question text.
: close (CUSTOM);
: ..
: ..
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 15 Jun 1999 17:28:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: sprintf padding with zeroes
Message-Id: <3766EF9E.6AE3A09A@mail.cor.epa.gov>
Tom Christiansen wrote:
> In comp.lang.perl.misc,
> "Paul Wood" <john.wood@diamond.co.uk> writes:
> :Ah, thanks for that. I work in Windows (I know, I know), so I don't have
> :access to the man pages. Is there anywhere online that I can look up man
> :pages?
>
> You have them -- they're just not called that. Try to find
> where the HTML versions are installed (use web browser) locally,
> or the pods (use pod2text).
If that wasn't clear enough, let me point out that you have the
program perldoc (which TomC hates - for good reasons) which will
show you the manpages in a command prompt window, as well as
doing half a dozen other things.
And a shortcut to the HTML tree should already be sitting in
your Start Menu, where ActiveState installed it. Read over
the FAQ and the Win32 Faq, and be amazed at the work others
have done for you.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 16 Jun 1999 00:57:28 GMT
From: Port=dik= <portmaster@port17.com>
Subject: Stopping the input...????? Me don't want buffer overflow...
Message-Id: <37668698.D1D232E1@port17.com>
Here are a couple pieces of code I use to receive user input:
sub get_line
{
my($an);
$an = <STDIN>;
chomp $an;
$an =~ s/[\x00-\x1f\x7f-\xff]//g;
$an;
}
sub get_it {
my($wh,$def) = @_;
&show( "$wh [$def] >");
my($an) = &get_line;
$an = $def if ($an =~ /^\s*$/);
$an;
}
So, essentially you call:
$ans = &get_it("Enter something you foo:", "default");
and you get:
Enter something you foo: [default] >
Well, the problem is that the user can type for forever. NOT A GOOD
THING!!! So, my question is, how can I setup a bounds of say 20
characters where the cursor stops and no longer takes anymore input?
Thanks,
.mitch
p.s. the subroutine show is nothing more than a print statement.
------------------------------
Date: Wed, 16 Jun 1999 01:00:20 GMT
From: Mitch <portboy@home.com>
Subject: Stopping the input...????? Me don't want buffer overflow...
Message-Id: <37668744.55DA77FB@home.com>
Sorry if you are seeing this a second time. However, if you reply to
the first message, it will probably bounce - since the e-mail addr is
all screwed up. Sorry!!!!
Here are a couple pieces of code I use to receive user input:
sub get_line
{
my($an);
$an = <STDIN>;
chomp $an;
$an =~ s/[\x00-\x1f\x7f-\xff]//g;
$an;
}
sub get_it {
my($wh,$def) = @_;
&show( "$wh [$def] >");
my($an) = &get_line;
$an = $def if ($an =~ /^\s*$/);
$an;
}
So, essentially you call:
$ans = &get_it("Enter something you foo:", "default");
and you get:
Enter something you foo: [default] >
Well, the problem is that the user can type for forever. NOT A GOOD
THING!!! So, my question is, how can I setup a bounds of say 20
characters where the cursor stops and no longer takes anymore input?
Thanks,
.mitch
p.s. the subroutine show is nothing more than a print statement.
------------------------------
Date: Tue, 15 Jun 1999 20:26:19 -0500
From: Brian Dodd <bd@albany.net>
Subject: this charecter @ ruined my day!!
Message-Id: <3766FD3B.343A@albany.net>
I am wrining a script that creates a html page. One part of the page is
a link to ane-mail address. Every time I put the @ charecter in my cgi
wont run??? if I put <A HREF="mailto:you yourdomain.com"> the script
will run. If I put <A HREF="mailto:you@yourdomain.com"> the script
dies. I cant read the error log because it is 33 meg. I cant telenet
either. The @ is not an operator is it. Is their a way to write a @
without a @? I tried to put th @ into a variable an then just put the
variable where the @ should go.
------------------------------
Date: 15 Jun 1999 18:46:36 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: this charecter @ ruined my day!!
Message-Id: <3766f3ec@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, bd@albany.net writes:
:I am wrining a script that creates a html page. One part of the page is
:a link to ane-mail address. Every time I put the @ charecter in my cgi
:wont run??? if I put <A HREF="mailto:you yourdomain.com"> the script
:will run. If I put <A HREF="mailto:you@yourdomain.com"> the script
:dies. I cant read the error log because it is 33 meg. I cant telenet
Give up now. If you can't get at your own errors, there's really
very little hope.
:either. The @ is not an operator is it. Is their a way to write a @
:without a @? I tried to put th @ into a variable an then just put the
:variable where the @ should go.
[I think you should go back and edit that paragraph for massive typos!]
% perl -cwe 'print "you@yourdomain.com"'
In string, @yourdomain now must be written as \@yourdomain at
-e line 1, near "you@yourdomain"
Now, was there some particular part of "now must be written as
\@yourdomain" is unclear? :-)
--tom
--
For all we know, this is just an elaborite simulation running in a cube on
someone's desk. --Captain Jean-Luke Picard (ST:ng)
------------------------------
Date: Tue, 15 Jun 1999 17:51:21 -0700
From: Raj <technology@workmail.com>
Subject: Re: this charecter @ ruined my day!!
Message-Id: <3766F509.CAA5D60F@workmail.com>
try:
mailto:me\@mydomain.com
it shud work.
~Raj
Brian Dodd wrote:
> I am wrining a script that creates a html page. One part of the page is
> a link to ane-mail address. Every time I put the @ charecter in my cgi
> wont run??? if I put <A HREF="mailto:you yourdomain.com"> the script
> will run. If I put <A HREF="mailto:you@yourdomain.com"> the script
> dies. I cant read the error log because it is 33 meg. I cant telenet
> either. The @ is not an operator is it. Is their a way to write a @
> without a @? I tried to put th @ into a variable an then just put the
> variable where the @ should go.
------------------------------
Date: Tue, 15 Jun 1999 17:53:37 -0700
From: Raj <technology@workmail.com>
Subject: Re: this charecter @ ruined my day!!
Message-Id: <3766F591.AD925EAB@workmail.com>
mailto:me\@mydomain.com shud work. Thanx.
~Raj
Brian Dodd wrote:
> I am wrining a script that creates a html page. One part of the page is
> a link to ane-mail address. Every time I put the @ charecter in my cgi
> wont run??? if I put <A HREF="mailto:you yourdomain.com"> the script
> will run. If I put <A HREF="mailto:you@yourdomain.com"> the script
> dies. I cant read the error log because it is 33 meg. I cant telenet
> either. The @ is not an operator is it. Is their a way to write a @
> without a @? I tried to put th @ into a variable an then just put the
> variable where the @ should go.
------------------------------
Date: Tue, 15 Jun 1999 21:07:30 -0500
From: Brian Dodd <bd@albany.net>
Subject: Re: this charecter @ ruined my day!!
Message-Id: <376706E2.436C@albany.net>
Brian Dodd wrote:
>
> I am wrining a script that creates a html page. One part of the page is
> a link to ane-mail address. Every time I put the @ charecter in my cgi
> wont run??? if I put <A HREF="mailto:you yourdomain.com"> the script
> will run. If I put <A HREF="mailto:you@yourdomain.com"> the script
> dies. I cant read the error log because it is 33 meg. I cant telenet
> either. The @ is not an operator is it. Is their a way to write a @
> without a @? I tried to put th @ into a variable an then just put the
> variable where the @ should go.
It worked
Thanks so much. I am just learning Perl. It would have taken me a long
time to figure that out. \ means take next charecter as literal? like
would \$ make a $ insted of a variable?
------------------------------
Date: 16 Jun 1999 01:23:38 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: this charecter @ ruined my day!!
Message-Id: <slrn7mdv4q.lg6.sholden@pgrad.cs.usyd.edu.au>
On Tue, 15 Jun 1999 21:07:30 -0500, Brian Dodd <bd@albany.net> wrote:
>Brian Dodd wrote:
>>
>Thanks so much. I am just learning Perl. It would have taken me a long
>time to figure that out. \ means take next charecter as literal? like
>would \$ make a $ insted of a variable?
You can read the documentation and find out what it actually means
instead of guessing wrong...
--
Sam
Many modern computer languages aspire to be minimalistic. They either
succeed in being minimalistic, in which case they're relatively useless,
or they don't succeed in being truly minimalistic, in which case you can
actually solve real problems with them. --Larry Wall
------------------------------
Date: Tue, 15 Jun 1999 17:14:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: WIN32 USERADMIN DOESN'T WORK
Message-Id: <3766EC64.16BC2D6D@mail.cor.epa.gov>
sam@cheapnet.co.uk wrote:
>
> I just bought the OReilly octopus book "NT USER ADMIN" and downloaded
> the accompanying scrpits.
> however i cannot get any of the modules to work.
> i am trying to us the UserAdmin module to create NT accounts.
> anyone have any joy with this ?
> i am using the latest port from active state v517
>
> i get the error message "cant locate loadable object for module
> win32::useradmin in @INC (where @INC contains d:/perl/lib
> d:/perl/site/lib"
That usually means that you didn't install the module into the
right location, and then you didn't tell Perl where to find
that ill-placed module. Perhaps you need to review the
installation directions and re-install it.
I mean, you did install it, right? Because I don't think it
comes with the scripts from the book...
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 16 Jun 1999 01:53:00 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: writing to a gzip file
Message-Id: <slrn7me0nt.hd.efflandt@efflandt.xnet.com>
On Wed, 9 Jun 1999 11:01:24 -0600, Sean Sidelko
<sidelko@stripe.Colorado.EDU> wrote:
>i know you can read from a gzipped file, but is there a way to write to
>file while it is gzipped?
>
>Sean
Have you ever heard of 'man' pages? It looks like you can simply:
gzip -c file2 >> foo.gz
--
David Efflandt efflandt@xnet.com http://www.xnet.com/~efflandt/
http://www.de-srv.com/ http://cgi-help.virtualave.net/
------------------------------
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 6010
**************************************