[7148] in Perl-Users-Digest
Perl-Users Digest, Issue: 773 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 24 18:08:06 1997
Date: Thu, 24 Jul 97 15:00:24 -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 Thu, 24 Jul 1997 Volume: 8 Number: 773
Today's topics:
Re: attack of little squares! Help! <jbokma@caiw.nl>
Re: breaking a string into 80 chars (Craig Berry)
CGI, counters, pseudo-databases, perl <root@mail.nl2k.ab.ca>
Re: Checking for valid Email... (Nathan V. Patwardhan)
Re: Creating a directory in a Unix1 (Honza Pazdziora)
Doubt using PERL and NT rcosta@cenapad.unicamp.br
Re: From file handle to filename? (Jahwan Kim)
Re: hashes and <img> (Tad McClellan)
Re: Help with RSH command (Will Morse)
Re: Help! Script fails to call another script! (Danny Aldham)
Help!! Any helpCan't Read File?! <mark@studio-west.com>
Help: cgi script <cascioli@geocities.com>
how to do system(@array) with backticks (Marek Rouchal HL CAD SYS Tel. 25849)
MakeMaker Module <serginho@alpha.hydra.com.br>
Re: Making an optional backreference <ajohnson@gpu.srv.ualberta.ca>
member of an array <bitt@mci.net>
Re: Mysterious new error? <g-fast@ux8.cso.uiuc.edu>
Re: Newbie: Backtracking with regexp <rootbeer@teleport.com>
Re: Newbie: Backtracking with regexp (Ilya Zakharevich)
Re: NNTP Access (Nathan V. Patwardhan)
Re: OraPerl - oracle database objects ? (John D Groenveld)
Perl on AS/400 wreinoehl@compuserve.com
Re: Question. <clark@s3i.com>
request.pm ???! <opx1@rocketmail.com>
String matching.. HELP!! :) (David Millier)
Re: supressing output (Tad McClellan)
Re: supressing output <rootbeer@teleport.com>
Too many people in this group are arrogant #*(@# (Re: C <jbokma@caiw.nl>
Re: turning off "<variable name> used only once" warnin <g-fast@ux8.cso.uiuc.edu>
Re: Wordwrap for form to Email (Nathan V. Patwardhan)
Re: Wrapping HTML with Text::Wrap? (Tim Smith)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Jul 1997 20:21:05 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: attack of little squares! Help!
Message-Id: <01bc986f$3712c4e0$d80ab2c2@Tschai>
Nik Trivedi <nik@ty.com> wrote in article
<33D778A9.A73199C9@ty.com>...
> My text data files always manage to insert lines and lines of
little
> squares causing problems in my scripts - do any of you know where
these
> squares come from? I thought it was the RETURN character, but that
is
> not it. Any other ideas?
>
When your line ends with 0D0D0A then a little square shows up. This
happens
when you transfer a DOS text file to a UNIX machine in binary mode
and read it
back in ASCII mode (I think).
If this is not the case, you can replace the 0d0d0a sequence with
s/\012\012\015$/\n/;
John
--
----------------------------------------------------------------------
Need a Freelance Software Developer (MSc)? (CGI, Perl, Java, C, C++)
http://www.caiw.nl/~jbokma [Java demo's, Curriculum Vitae and
more...]
email: jbokma@caiw.nl phone: +31 10 4291827
------------------------------
Date: 24 Jul 1997 21:12:03 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: breaking a string into 80 chars
Message-Id: <5r8gf3$4gk$1@marina.cinenet.net>
Eric Finley (ez041407@boris.ucdavis.edu) wrote:
: I have 2 arrays, @IN and @OUT, and each element is a single word. I want
: to print this out, comma delimited, and with the lines being broken after
: a word and less than 80 characters. Printing it out as one big line is
: easy using join ", ", @IN. I am sure I could figure out some big
: complicated algorithm that could do this, but is there an easy way. I
: think using sprintf is a start but then how do I break it after the last
: comma before the 80 char. limit. Any ideas?
This script shows one fairly reasonable approach:
#!/usr/bin/perl -w
# clist - Takes a list of words and prints it out comma
# separated, with no more than 80 characters on each line.
use strict;
my @words = qw(This is the time when all good men must come to
the aid of their party and the quick brown fox
jumps over the lazy dog because I really need to
fill this list with enough text to make it span
a couple of eighty column lines and thus I am
rambling on and on in an effort to do so);
my $cols = 80;
my $col = 0;
my $word;
foreach $word (@words) {
my $wordplus = "$word, ";
my $wordplen = length($wordplus);
$col += $wordplen;
if ($col >= $cols) {
$col = $wordplen;
print "\n";
}
print $wordplus;
}
print "\n";
------------------------------
Date: Thu, 24 Jul 1997 14:27:42 -0600
From: System Administrator <root@mail.nl2k.ab.ca>
Subject: CGI, counters, pseudo-databases, perl
Message-Id: <33D7BABE.167EB0E7@mail.nl2k.ab.ca>
More likely keywords.
Right, I with to do the following:
I have and HTML Input Page read by a CGI script
outputting to an html file.
I would:
1) Like this file to be numbered, e.g. 1.html, 2.html etc.
2) ONce a report is generated, the file-counter increments
3) The next file, 3.html is ready for input for example.
4) A report can be generated in CGI perl using these reports
5) An expiry date of 10 or 20 days take effect.
How can I do this?
One other question:
How can one accept multiple entry, say 3 responses, from an HTML script?
Please e-mail, as I have little news time for perl.
--
Dave Yadallee, System Administrator NetLine 2000
Available at (403) 473-4587 or Work (403) 424-6533.
------------------------------
Date: 22 Jul 1997 13:30:34 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Checking for valid Email...
Message-Id: <5r2clq$5iv@fridge-nf0.shore.net>
Maelstrom (maelstrom@deathsdoor.com) wrote:
: Oh _very_ nice. I am in a similair position to the original poster and I
: just decided to do this. All I can find is whiney posts telling people
: to look in Deja News. So I checked the old database and found what I
: suppose was the original thread being referred to. So I started reading
[tirade snipped]
Wouldn't be a bad idea for you to read more carefully. If you checked
the old database you probably would have found an answer. In fact, I
just checked dejanews and I found a variety of suggestions that would
work with varying degrees of success.
The reason posters are getting upset with this question is because
someone asks it every 10 seconds or so. In other words, you're going
to get a lot of perturbed folks with a FAQ like this.
In fact, I'm so tired of reading these kinds of responses from people
that I'm killfiling this subject ... and I'm killfiling you, too.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Tue, 22 Jul 1997 12:09:53 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Creating a directory in a Unix1
Message-Id: <adelton.869573393@aisa.fi.muni.cz>
Brandon Yoo <byoo@celerity.com> writes:
> I'm trying to create a directory in Unix with perl:
>
> mkdir ("xx", 777);
>
> This does not give me a "drwxrwxrwx" access. What mode number should I
> have to use ?
0777, octal number.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Thu, 24 Jul 1997 14:38:15 -0600
From: rcosta@cenapad.unicamp.br
Subject: Doubt using PERL and NT
Message-Id: <869769873.2629@dejanews.com>
I have a matter that I can't solve. I'm using PERL for Windows NT and
IIS Web Server. I have my page on a server where IIS is running and I
want to see some files that are on other computer. These computers belong
to the same network. I'm using the following command on my PERL script:
$var = `dir \\\\another_computer\\sharename`;
In the DOS-prompt I use the command dir \\another_computer\sharename
and it works properly but inside the script it doesn't work. I'm not
using PERLIS.DLL. What can I do to solve this problem ? Could somebody
help me ? I4ve already read all FAQ4s related to this issue.
Thanks in advance.
Ricardo.
Campinas-Brazil.
.....................................
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 24 Jul 1997 21:36:20 GMT
From: jahwan@supernova.math.lsa.umich.edu (Jahwan Kim)
Subject: Re: From file handle to filename?
Message-Id: <slrn5tfimk.icq.jahwan@supernova.math.lsa.umich.edu>
On Fri, 18 Jul 1997 17:33:23 +0200, Per Kistler <kistler@erdw.ethz.ch> wrote:
> Hi All
>
> How do I get the file name from the file handle?
>
> First I store the file handlies like: @handles = ( \*A, \*B,....);
> Then I iterate over it with: for $ref ( @handles ){}
> but then I'd like to know the file name again...
>
> Thanks for a hint, Per.
I remember reading the same question asked in comp.unix.shell. (Of
course the original question was how to get the file name from a file
descriptor.) Basically, the answer is: you can't. But somebody suggested a
method which *might* work if you have really small number of files on your
system, if you *really* need to do that. Check it out on deja news in that
case.
Jahwan
------------------------------
Date: Sun, 20 Jul 1997 18:15:09 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: hashes and <img>
Message-Id: <t56uq5.ll2.ln@localhost>
[ Greg, please follow usual Usenet custom and limit your line
lengths to 70-72 characters, else they get awfully hard to read
after being quoted a few times...
]
Greg Land (gland@ccs.neu.edu) wrote:
: Tom Phoenix <rootbeer@teleport.com> wrote:
: : On 20 Jul 1997, Grey Land wrote:
: : > When it locates the teams I would like it to add the "<img src="...">
: : > with the team name in the order that it finds them at the bottom of the
: : > document.
: : Try a for loop, and print (or push) each one as you find it. If that's not
: : what you're looking for, and if you still can't find it in the docs,
: : please post again with some source code showing what's going wrong. Hope
^^^^^^^^^^^
: : this helps!
: OK... thanks for the suggestions, but I am still a little to new for
: this adding at the end of the document stuff.
Even after reading the
"How do I change one line in a file/delete a line in a file/insert
a line in the middle of a file/append to the beginning of a file?"
question from the Perl FAQ?
: So, here is a piece of the code...
<g>
I think Tom meant Perl code. This is the perl newsgroup after all...
: see if any of you gurus can make some sense of it.
1) I am not a perl guru. Fortunately, complete enlightenment is not
required to solve your particular problem ;-) See below.
2) The gurus for the "code" you provided hang out in
comp.infosystems.www.authoring.html
3) You didn't tell us what can be counted on in the format for
identifying the first field containing the team name. I have
assumed that two consecutive space chars mark the end of the
field.
: The script generates this page...
[ snip HTML markup, included in script below ]
: So now I need a script that opens this file(call it standings) and find "CHICAGO" then "MIAMI" etc... and add the tag <img src="/home/gland/.www/nba/chicago.gif"> <img src="/home/gland/.www/nba/miami.gif"> at the bottom of the file. if at all possible before the </body> and </html> tags.
----------------------------
#! /usr/bin/perl -w
while (<DATA>) {
if (m!</body>!i) { # time to write the <img> tags
while ($team = shift @teams) { # take one team from the array
$team =~ tr/ /_/; # convert spaces to underscore
print qq(<img src="$team.gif">\n); # print the tag
}
}
push(@teams, lc($1)) if /^ \w-([\w ]+?)\s\s/; # save lower cased team names
print; # print the line from the original file
}
__DATA__
<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2><FONT size=+3>Final
1996-97 standings </FONT></H2>
<H3><FONT size=+2>Eastern Conference</FONT></H3>
<PRE>
<B> W L PCT GB HOME ROAD DIV CONF </B>
Z-CHICAGO 69 13 .841 - 39-2 30-11 24-4 44-10
Y-MIAMI 61 21 .744 8 29-12 32-9 16-8 40-14
X-NEW YORK 57 25 .695 12 31-10 26-15 19-6 38-16
X-ATLANTA 56 26 .683 13 36-5 20-21 17-11 34-20
....
</body>
</html>
----------------------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 24 Jul 1997 15:22:40 -0500
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Help with RSH command
Message-Id: <5r8dig$8hm$1@Starbase.NeoSoft.COM>
A couple things to look at:
1. If your default shell is not ksh, you might need a
#! /wherever/ksh
in your remote shell.
2. rsh does not get much of a PATH on the remote machine,
you might want your remote shell to dot-include your
.profile, .kshrc, or whatever or else set up its own
PATH and other needed environment.
3. Depending how you do things, you could set the ENV
environment variable
rsh $nodes -n "ENV=some-initialization-file
directory/kscript.ksh"
The flavor of Unix, release of perl, and release of ksh
may each impact your options here.
Hope this helps
Will
In article <33d6a84c.478241@news.mindspring.com>,
Leon Keylin <ehtics13@mindspring.com> wrote:
>I have not seen this questioned posed and I need help with it. So
>please if you know how, give me a hand.
>
>Here's what I have:
>(definition file is nodes.def which holds a list (big list) of nodes
>that I want to rsh over and run the specific K-shell script.
>
>if (open(NODES, "nodes.def"))
>{
> while($nodes= <NODES>)
> {
> chop($nodes);
> print "$nodes\n";
> }
> foreach $nodes ($b) {
>
> exec "rsh $nodes -n
>directory/k-script.ksh"
>
>The above works only for the local node (in other words I have my own
>machine in the nodes.def file and the above program obviously does not
>r-shell over to the other machines.
>
>Anyway that I can r-shell over to the other machines and run one (or
>multiple) k-shells/commands?
>
>Thanks in advance.
--
# Copyright 1997 Will Morse. Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
# Gravity, # Will Morse
# not just a good idea, # Houston, Texas
# it's the law. # will@starbase.neosoft.com
#
# These are my views and do not necessarly reflect anyone else/
------------------------------
Date: 24 Jul 1997 11:55:22 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Help! Script fails to call another script!
Message-Id: <5r88eq$40k$1@lennon.postino.com>
Balthasar T. Indermuehle (bi@inside.ch) wrote:
: I asked this before, nobody could help me. Now I have abstracted the
: problem to a reproducable level, i.e. please try this at home!
: I have a cgi perl script (a.cgi) which calls upon another script (b).
: Why is the first script not executing the second one? Is that a perl bug
: or a security feature? I'm using perl 5.004, linux 2.0.25, apache 1.2.1
I would look at an Environment variable, specifically the path.
--
Danny Aldham SCO Ace , MCSE , JAPH , DAD
I don't need to hide my e-mail address, I broke my sendmail.
------------------------------
Date: Thu, 24 Jul 1997 10:54:38 +0000
From: Mark <mark@studio-west.com>
Subject: Help!! Any helpCan't Read File?!
Message-Id: <33D7346F.21B8@studio-west.com>
I am having a problem with a file called "Perl Shop".
I downloaded it at:
http://www.arpanet.com/PerlShop/PerlShop.html
I use a mac (don't say I need a pc) and tried
gzip, suntar and macperl. I have tried to open
it in simple text and microsoft word.
Microsoft word gave me this:
------------------------------
Date: Thu, 24 Jul 1997 23:05:53 +0200
From: ".70 Andreas 07." <cascioli@geocities.com>
Subject: Help: cgi script
Message-Id: <33D7C3B1.9B5784E6@geocities.com>
I need some help with a CGI script in Perl, when executed I'd like the
script to pop up a an alert window with some text in it, like
Javascript's "alert()", is that possible? If it is-
what command should I use?
------------------------------
Date: 22 Jul 1997 11:54:29 +0200
From: marek.rouchal@-nospam-HL.Siemens.DE (Marek Rouchal HL CAD SYS Tel. 25849)
Subject: how to do system(@array) with backticks
Message-Id: <5r200l$q49@buffalo.HL.Siemens.DE>
Keywords: backtics,system,exec,shell
I'd like to execute a command (e.g. `date') without invoking an extra shell AND
capture the standard output.
The first requirement is met by system(@array), where array consists of the command
name and the arguments.
The second requirement is met by backticks like `command`, but this seems to invoke
a shell to execute "command" no matter what.
Any pointers are appreciated!
Cheers,
Marek
PS. To reply by mail, please remove -nospam- from the address.
Thank You.
+--------------------------------------------------------------------+
Marek Rouchal
SIEMENS AG Phone : +49 89/636-25849
HL CAD SYS Fax : +49 89/636-23650
Balanstr. 73 mailto:Marek.Rouchal@-nospam-hl.siemens.de
81541 Muenchen PCmail:Marek.Rouchal.PC@-nospam-hl.siemens.de
+--------------------------------------------------------------------+
------------------------------
Date: 24 Jul 1997 18:17:52 GMT
From: "Sergio Stateri Jr" <serginho@alpha.hydra.com.br>
Subject: MakeMaker Module
Message-Id: <01bc985e$4749d4e0$ca75e7c8@Term104>
Hi! When I try to install most of Perl modules that I get in CPAN, I
receive the follow message :
Can't locate ExtUtils/MakeMaker.pm in @INC at makefile.pl line 12.
BEGIN failed--compilation aborted at makefile.pl line 12.
What's hapenning ? I don't have the module MakeMaker.pm in my machine.
Where can I find it ?
Thanks,
--
--------------------------------------------
Sergio Stateri Jr
Sco Paulo (SP) - Brazil
e-mail: serginho@usa.net
--------------------------------------------
------------------------------
Date: Wed, 23 Jul 1997 19:10:05 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Making an optional backreference
Message-Id: <33D69D5D.71CB4314@gpu.srv.ualberta.ca>
Kevin Swope wrote:
>
> I cant seem to make a backreference optional in a regex. This is the sample code I'm
> experimenting on. If I take out the '?', then the b is captured in $3, but then it cant be
> optional. If I put in the '?' then it become optional and the whole string matches, but there
> is nothing in $3. There must be a way. By the way, the 'b' will probably be a larger string
> in practice- thats why I leave the parens in there when I add the '?'. THANKS.
>
> $TheString="abc";
>
> $TheString=~ s/((a).*(b)?.*(c))/++++$1++++/x;
the first .* will zip right past the b and because it's optional,
backtacking won't bother to look back after finding the c because
the match is successful without looking (at least that's how my
mind thinks about it :-)
try using the non-greedy form .*?
s/((a).*?(b)?.*(c))/++++$1++++/;
this way, if the b is there it'll grab it.
regards
andrew
------------------------------
Date: Thu, 24 Jul 1997 16:13:31 -0400
From: Bitt Faulk <bitt@mci.net>
Subject: member of an array
Message-Id: <33D7B76B.53EE9F3C@mci.net>
I'm sure this is a really stupid question one way or another, but....
I seem to remember an operator that functions like this:
$a memberof (1,2,3,4,5)
where memberof is the operator that I can't remember and returns
a boolean as to whether or not $a is either 1, 2, 3, 4, or 5.
I can't find it anywhere, which is starting to lead me to believe
that I'm making it all up or it was in a different language or
or something.
To sum up, HELP!!!!!! I really hate endless ||'s.
Please e-mail BTW, I'm horrible at keeping up here.
-Bitt Faulk - bitt@mci.net
------------------------------
Date: 24 Jul 1997 15:00:50 -0500
From: gregory douglas fast <g-fast@ux8.cso.uiuc.edu>
Subject: Re: Mysterious new error?
Message-Id: <m7gbu3susng.fsf@ux8.cso.uiuc.edu>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> In article <m7goh7urdzg.fsf@ux4.cso.uiuc.edu>,
> gregory douglas fast <g-fast@ux4.cso.uiuc.edu> wrote:
> > Now I've traced the problem to my AUTOLOAD routine, where I was doing
> > Bad Things with my $self, and made the error go away, but I'm now curious
> > as to the why of perl calling my AUTOLOAD routine for DESTROY. It
> > doesn't get called for BEGIN or END... am I just not understanding
> > something gutsy?
>
> Oh, your code is _so_ broken! You answered your question yourself:
> you do not have DESTROY, so the AUTOLOAD is called when a call to
> DESTROY is performed.
Ok. That's clear now. There's still one thing that's confusing me
(and is the reason I never noticed that the AUTOLOAD was trying to
handle the DESTROY): I'm using the AUTOLOAD verbatim from the
perltoot section on autoloaded data methods (verbatim now that I
removed my silly circular ref assignment). The line that handles
unexpected methods uses a croak(), which apparently just gets
ignored during destruction (as does die). warn and carp both give
normal output here, but none of the death functions give any output at
all. Are they just totally ignored since the script is already
exiting?
Thanks for putting up with me... this is most instructive.
--
-- Greg Fast --- g-fast@uiuc.edu -------------------------------------------
"The symbolism of the cheese was essential..."
------------------------------------------------------------------------------
------------------------------
Date: Wed, 23 Jul 1997 08:30:03 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Stefan Berglund <emwsbl@emw.ericsson.se>
Subject: Re: Newbie: Backtracking with regexp
Message-Id: <Pine.GSO.3.96.970723081312.14902G-100000@kelly.teleport.com>
On 23 Jul 1997, Stefan Berglund wrote:
> I want to match one entry (one block between <entry> and </entry>)
> using the expression between <url> and </url> tags.
You want to use grabbiness to your advantage. I think this will do what
you want, if the URL only appears once.
($chunk) = m{
^ # Starting at the top
.* # as much stuff as possible, so that
# we skip all previous entries
( # Memory 1 -> $chunk
<entry>
.*? # minimal match - don't overrun
<url>
\Qhttp://www.perl.com/\E # or whatever
</url>
.*? # minimal match - don't overrun
</entry>
)
}x;
...but trying to do this in just one expression may not be the best way.
You could probably do better by breaking up the text into chunks, with
each chunk being one <entry>...</entry>. Or, you could do this.
($pre, $match, $post) = m{
(^.*) # pre
(\Qhttp://www.perl.com\E) # match
(.*?</entry>) # post
}x;
$pre =~ s#^.*(?=<entry>)##; # Strip previous entries
$entry = "$pre$match$post"
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 24 Jul 1997 20:12:50 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Newbie: Backtracking with regexp
Message-Id: <5r8d02$2pg@agate.berkeley.edu>
In article <33d7633e.5583564@207.126.101.82>,
Ronald L. Parker <ron@farmworks.com> wrote:
> On Wed, 23 Jul 1997 15:26:10 -0700, Tom Phoenix
> <rootbeer@teleport.com> wrote:
> I would have sworn that I saw some documentation somewhere (I thought
> it was perlre) that said minimal matching was slower, but I can't find
> it now. I recommended removing it on the basis of that (apparently
> incorrect) recollection. If it's more efficient, then by all means
> keep it.
*If* minimal match is doing the same as maximal match (i.e., maximal
match does no - or almost no - backtracking), then the minimal match
may be *much* slower.
> Is there a recommended benchmark for regexp-type things? I seem to
> recall that the standard benchmark module won't cut it. I suppose
> it's in Jeffery's book, but...
I think as of 5.004 the problem must be cleared. Most negative
reports in the Hip Owl are either already fixed, or fixed with jumbo
RE patch.
Ilya
------------------------------
Date: 23 Jul 1997 16:43:57 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: NNTP Access
Message-Id: <5r5ccd$1vj@fridge-nf0.shore.net>
Sergio Stateri Jr (serginho@alpha.hydra.com.br) wrote:
: Hi ! Does anyone here know where I can find a Perl Script that access a
: NNTP server ? I'd like a script that use only default perl modules, because
: I want to use this in a server that I can only to put my scripts, but I
: can't to install new modules.
You can install modules in any area on any server where you have write
access with: use lib '/path';
Please refer to:
News::NNTPClient (excellent)
Net::NNTP
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 20 Jul 1997 17:46:03 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: OraPerl - oracle database objects ?
Message-Id: <5qu0ur$943$1@tholian.cse.psu.edu>
In article <868526940.5318@dejanews.com>, <rahuljm@hotmail.com> wrote:
>Pls reply on the above email id, don't
>post it on Usenet. I require this info desparately...
No, I only reply by mail when the person promises to post a summary.
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Ahh, a search engine is a horrible thing to waste. :( This is a FAQ.
BTW I'm sparing c.l.perl.tk from my follow-up, it still has a descent
signal to noise ratio.
John
groenvel@cse.psu.edu
------------------------------
Date: Thu, 24 Jul 1997 20:34:35 -0700
From: wreinoehl@compuserve.com
Subject: Perl on AS/400
Message-Id: <33D81ECB.5F73@compuserve.com>
Is anyone here who knows something about Perl on the AS/400 (RISC)?
Running the IBM test script from www.as400.ibm.com/workshop/perl_rm/htm
some tests failed. Appears like Perl wants to compile CL sources located
in QTEMP, so this does not work. Any help would be appreciated.
-- Wilfried Renoehl
------------------------------
Date: 21 Jul 1997 09:24:45 -0400
From: Clark Dorman <clark@s3i.com>
Subject: Re: Question.
Message-Id: <dg1t8wnaa.fsf@s3i.com>
Brandon Golm <brandon@mrgolm.com> writes:
> To any who. I am currently working on a statistics program that tracks
> large numbers of bandwitdh usage. I have a subroutine that converts
> numbers to there proper bytes units, base on 2**10, 2**20,etcs but when
> the number is over 2_000_000_000 which should be a gig it does not get
> recognized, and converts it to a bytes ( which is the fail all in the if
> else statments. I know there is a big int package so please don't tell
> me to use that becuase I plan on it it seems to be what I need. My
> question is what is the limits that perl can handle an integer? Is
> there some limit that it won't recognized of 2 trillion??
Unless there is a limit due to your system that somehow got put into perl,
then the limiting factor here is not perl. Try:
#!/home/dorman/bin/perl -w
$|++;
$value = 1;
for (1..400) {
$value *= 2;
print " Value is up to ($value)\n";
}
As you can see, the numbers get far bigger than 2 trillion.
Some older operating systems have problems with 2 gig files, if I recall
correctly. So, if it thinks that there is a file or other object too big,
the operating system might have problems with it.
You really need to do the standard debugging sorts of things: isolate the
problem, use the debugger, find out which command is having problems, fix
it. Repeat.
--
Clark Dorman "Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html -Francis Crick
------------------------------
Date: 20 Jul 1997 22:58:42 GMT
From: "RaNDoM" <opx1@rocketmail.com>
Subject: request.pm ???!
Message-Id: <01bc9560$65197ee0$3399f1c3@random>
Hi,
I read in a file that it is not needed to use all that parse_form shit as
in perl4 (?)
but that u can use a module called request.pm
Is this true and where can i download it from?>> couldn't find it on
activeware
and perl.com
pls reply to my e-mail thanx
------------------------------
Date: Thu, 24 Jul 1997 18:56:41 GMT
From: DavidX_J_Millier@ccm.co.intel.com (David Millier)
Subject: String matching.. HELP!! :)
Message-Id: <33d7a2bf.267872187@news.co.intel.com>
Ok, ive got a problem matching a multi line string...
The way i have it set up is:
|string to be matched|
Text... blahblahblahblah
blahblahblahblahblahblahblah
blahblahblahblahblahblah|
My script will match the text within the first two pipe symbols, and
then i want it to output the text beween the second pipe symbol and
the last one to an output file.
Problem is i cant get it to match anything not on the first line...
even using multi line string matching..
Heres the string im trying to match with:
$line =~ /\|$dir\|.*\|/im
$dir contains the text to match.
So what am i doing wrong here?
------------------------------
Date: Sun, 20 Jul 1997 18:22:38 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: supressing output
Message-Id: <uj6uq5.5m2.ln@localhost>
Greg Land (gland@ccs.neu.edu) wrote:
: Here is another problem I have...
Still formatted awfully...
: unrelated to the previos post.
Separate posts for separate questions. That is how it is supposed to
be done. Thank you.
: I have a dos based file and want to remove the ^M's.
How did you get the DOS file to Unix?
If you use ftp in ASCII mode, it will convert the line endings for
you during the file transfer.
: I know that the unix command to do this is dos2unix,
: but that prints out a message saying:
: could not open /dev/kbd to get keyboard type US keyboard assumed
: could not get keyboard type US keyboard assumed
: This is not a big deal, but I prefere it not be there. does perl have its own dos2unix command or is there a way to redirect the output to somewhere that I do not see it?
# perl one-liner
perl -p -e 's/\r//' dos_line_ends >unix_line_ends
How to redirect STDERR is a Unix/shell question, not a perl question, but
I'll answer that since I'm here already:
# in a Bourne type shell
dos2unix dos_line_ends >unix_line_ends 2>/dev/null
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Sun, 20 Jul 1997 17:52:29 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Greg Land <gland@ccs.neu.edu>
Subject: Re: supressing output
Message-Id: <Pine.GSO.3.96.970720174926.11907C-100000@kelly.teleport.com>
On 20 Jul 1997, Greg Land wrote:
> I have a dos based file and want to remove the ^M's.
If you upload them to a Unix machine, your FTP client's text mode should
take care of the line ends. But once they're on your Unix machine, you
could use a command like this one.
perl -pi -e 's/\015//g' files*
(If you want to do this on a DOS/Windows machine, you'l probably need to
use double quotes instead of single ones.) Is that what you're looking
for? Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 24 Jul 1997 20:31:53 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
Message-Id: <01bc9870$b95a6740$d80ab2c2@Tschai>
Too many people (even some famous ones, yes you know that I mean
you!) reply
on too many posting with "Read the FAQ", DejaNews.
Or what I really hate, when someone asks "How can I do this without
using the
... lib/module?" that the answers is: "Why not? It worked for me.
Instead of
answering the original question.
If that's the only thing you want to share
with this group, please don't. There is enough noise already. Stupid
questions don't
need stupid answers, just don't answer them
John
The reason for this posting? After reading to much RTFM RTFF etc, the
following
posting triggered this one:
Maelstrom <maelstrom@deathsdoor.com> wrote in article
<869565507.30614@dejanews.com>...
> In article <5q2oaj$147@fridge-nf0.shore.net>,
> nvp@shore.net (Nathan V. Patwardhan) wrote:
> >
> > Brandon Wilkins (wilkins@digitaldaze.com) wrote:
> >
> > : How do I go about checking if a email address is basically
valid (In
> > : form...)?
> >
> > You check Dejanews for the answer to this frequently asked
question,
> > and use the examples you find there to answer your question.
>
> Oh _very_ nice. I am in a similair position to the original poster
and I
> just decided to do this. All I can find is whiney posts telling
people
> to look in Deja News. So I checked the old database and found what
I
> suppose was the original thread being referred to. So I started
reading
> that and could find nothing but flames and arguments in varying
intensity
> on varous subjects. After 30 minutes I was disconected, having
just used
> my four hours worth of time. Incidentally I had just come from the
FAQ at
> www.perl.com and looking at the section for 'How do validate input'
I
> recieved the following gem of information "See the more specific
> questions(numbers, email addresses, etc.) for details". Where? Is
there
> some kind of lobotomy you need to have before you can understand
Perl
> that takes away any ability to communicate helpful information in
written
> english?
>
> Last time I asked for help here I got about three helpful replies
and 7
> flames. I guess that's a standard ratio for any comp group so I'm
hoping
> for similair good results this time. Does anyone want to tell me
how I
> can make sure a form input ($RESULTS{'email'}) contains a '@'
character
> and no spaces?
>
> Bear in mind that I'm writing this free, for a friend who wont be
making
> any profit of it either so it's hardly fair to disembowl me for
asking a
> stupid question. If anyone would like to help me and thinks they
can do
> so without causing this newsgroup to implode in a bandwith-wasting
> inferno it would be great. If you would rather flame then feel
free but
> don't be suprised or offended when you're ignored.
>
> --Maelstrom
>
> "It's comments like these that remind me of the story about a
little
> mouse. Seems this mouse was always complaining to the other mice.
"I want
> more!" said the mouse. "And I want it now." This went on day after
day,
> month after month, year after year. Well, the other mice soon tired
of
> this routine, and beat the living crap out of that mouse. I think
we
> could all learn a lesson from that little mouse, Mr. Futz" Bobby
Hodad
> ___ |\ | \ \ \Whoo look, I have 7 lines in my sig instead of 4.
Now
> you have to kill me!
>
> -------------------==== Posted via Deja News
====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>
------------------------------
Date: 24 Jul 1997 16:16:09 -0500
From: gregory douglas fast <g-fast@ux8.cso.uiuc.edu>
Subject: Re: turning off "<variable name> used only once" warning
Message-Id: <m7goh7sqhgm.fsf@ux8.cso.uiuc.edu>
gt5146c@acmez.gatech.edu (+jeff) writes:
> I've looked every I can think of but can't seem to figure out
> how to do this, any ideas?
#!/usr/bin/perl -w
use vars($x);
$x = "foo";
--
-- Greg Fast --- g-fast@uiuc.edu -------------------------------------------
"The symbolism of the cheese was essential..."
------------------------------------------------------------------------------
------------------------------
Date: 20 Jul 1997 22:40:13 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Wordwrap for form to Email
Message-Id: <5qu44d$ek8@fridge-nf0.shore.net>
Davek (davek@ix.netcom.com) wrote:
: I am using Perl for the first time to process e-mail forms. The problem is
: that most e-mail clients will not wrap long textarea input strings.
[snip]
Use the Text::Wrap module that was included with your Perl
distribution. Text::Wrap is contains documentation in pod format that
you can convert to troff (pod2man), html (pod2html), or text (pod2text).
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 24 Jul 1997 11:25:25 -0700
From: trs@azstarnet.com (Tim Smith)
Subject: Re: Wrapping HTML with Text::Wrap?
Message-Id: <5r86mm$k1d@web.azstarnet.com>
In article <33D67B72.46E2@pvo.com>, Thomas Winzig <tsw@pvo.com> wrote:
>Hello,
>
>I am trying to wrap HTML with Text::Wrap, but am running into problems
>when long URLS and hyperlinks are in the text.
It might work best to parse the HTML (using HTML::Parser, perhaps) so
you can count only the length of the 'text'. This way you won't get
mixed up with <A href>s and also every other formatting code. If you
use HTML::Parser, I would try storing the text in a package variable.
Every time your text() method is called, you add the new text onto
the old text. If it spills over (you can check for your beginning
of line: wrap('', '*UNIQUE*', $text); if (/\Q*UNIQUE*\E/) {...}) then
you print all of the completed lines and store the leftover in your
package text variable. The other methods for HTML::Parser should
just print out the item, whatever it is.
Just an idea,
Tim
------------------------------
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 773
*************************************