[8351] in Perl-Users-Digest
Perl-Users Digest, Issue: 1968 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 25 00:13:36 1998
Date: Tue, 24 Feb 98 21:00:28 -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 Tue, 24 Feb 1998 Volume: 8 Number: 1968
Today's topics:
Re: better way to do this? uri@sysarch.com
Re: CGI.pm a part of Perl (was Re: Cookies) (Abigail)
Re: CGI.pm a part of Perl (was Re: Cookies) (Martien Verbruggen)
Re: DBD::mSQL <lutz@muc.de>
dbm files <indu@healtheon.com>
Does anyone have a signup/confirm script? (123) (Nick Halloway)
Re: HELP: Modules load as root, not user. (Martien Verbruggen)
Re: max limit on dbms open? <zenin@best.com>
Re: musings on autoincrement <danboo@negia.net>
Re: Perl & Sockets <zenin@best.com>
Re: Perl HTML checker (Chris Chubb)
Re: Perl subroutine call error msg... <rjk@coos.dartmouth.edu>
perl5.004_04 fails on make <harryn@cerf.net>
POD style comments revisited <rjk@coos.dartmouth.edu>
proper filename extensions <walrus@qis.net>
Q: obscuring Perl scripts? (Mark Watson)
Re: Q: obscuring Perl scripts? (Steve Linberg)
Re: Q: obscuring Perl scripts? (Martien Verbruggen)
Re: REGEX : change string in HTML but not in HTML tag (Eric Loriaux)
Socket question for Win32 <andyj@scn.org>
TFTP from a PERL Script? <ggraham@micrord.com>
Re: The Ineffable Tom C. (Abigail)
Re: The Ineffable Tom C. (Martien Verbruggen)
Re: ts: double vs single quotes uri@sysarch.com
Re: ts: multiple keys for same value? <zenin@best.com>
Using .exe programs within Perl? <smacmillan@iname.com>
Using strings as filehandles <luis@utdallas.edu>
Verifying a form field <cactus@mpinet.net>
Re: Win95 - Running scripts from browser? (Steve Linberg)
Re: Year 10000 Compliance <PeretzD@worldnet.att.net>
Re: Year 10000 Compliance (x)
Re: Year 2000 Compliance: Lawyers, Liars, and Perl <csweber@flash.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Feb 1998 23:31:08 -0500
From: uri@sysarch.com
Subject: Re: better way to do this?
Message-Id: <x7d8gc2tmb.fsf@sysarch.com>
mocat@NOSPAM.best.com (blacktape) writes:
> On Sat, 21 Feb 1998 20:47:44 -0500, see-below@crocker.com (Steve
> Linberg) wrote:
>
> >In article <34ef6e05.687476@nntp.best.com>, mocat@NOSPAM.best.com
> >(blacktape) wrote:
> >
> >> After learning a bit more about regexps, I've started work on a script
> >> that'll clean up my html files a bit. I was wondering if there is a
> >> better way to do this... I know it's crude, but it works. ;)
> >
> >What about this:
> >
> ><p>here is some HTML causing the IMG tag to wrap: <img
> >src="/foo.gif"></p>
>
> i thought about this, how could i make the script catch such hidious
> html code such as that?
> i've been reading a bunch and can't find anything that would allow me
> to do that...
> thx
you could still use the regex code i submitted but you have to slurp the
entire file in at one time. to do this set $/ to undef (file mode). then
use the /g modifier to loop over the file and the /e option to execute
the replacement code (tested slightly):
$/ = undef ;
$html_file = <> ;
$html_file =~ s[(<img.*?>)][
$img = $1 ;
# sub src="string" with alt="string" src="string". this also removes
# the white space before and after the =
$img =~ s/src\s*=\s*"(.*?)"/alt="$1" src="$1"/i
unless $img =~ /alt\s*=/ ; # keep same if it has alt=
$img ]exsig ; # execute, extended, . matches newline, case insensitive, global
print $html_file ;
hope this helps,
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: 25 Feb 1998 03:06:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: CGI.pm a part of Perl (was Re: Cookies)
Message-Id: <6d01qp$abv$2@client2.news.psi.net>
Bart Lateur (bart.mediamind@tornado.be) wrote on 1638 September 1993 in
<URL: news:34f445ad.7607057@news.tornado.be>:
++
++ CGI.pm is part of the distribution. But it's a module. Modules are NOT
++ part of Perl. They are merely additions, written in plain Perl (= plain
++ text).
I've a hard time imagining that Exporter or FileHandle aren't part of Perl.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: 25 Feb 1998 03:50:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CGI.pm a part of Perl (was Re: Cookies)
Message-Id: <6d04e8$pum$3@comdyn.comdyn.com.au>
In article <34f445ad.7607057@news.tornado.be>,
bart.mediamind@tornado.be (Bart Lateur) writes:
> CGI.pm is part of the distribution. But it's a module. Modules are NOT
> part of Perl. They are merely additions, written in plain Perl (= plain
> text).
Semantics. If you want to be that precise, you will also have to add
things like: modules can also partly be written in C.
You should be even more precise, and talk about them being part of
perl, not Perl.
What about the core modules, like CORE, UNIVERSAL, SUPER, Dynaloader,
Exporter, etc.. etc.. Are they not part of perl? What about the
pragmatic modules? strict? diagnostics? vars? builtin?
I see the point you are trying to make though: The sources for these
things are available. You can read them. or wasn't that the point?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Tue, 24 Feb 1998 17:40:13 +0100
From: Lutz Albers <lutz@muc.de>
To: kgraham@alpha.furman.edu
Subject: Re: DBD::mSQL
Message-Id: <34F2F7ED.96AD0C26@muc.de>
kevin graham wrote:
> my $h_idexists = $dbh->prepare($SQL) || die $dbh->errstr;
>
> print "hope";
> $h_idexists->execute($SQL) || print "dammit"; #die $dbh->error
Hmm, why do give a parameter to execute ? $h_idexists->execute; should be
enough, it worked for me this way.
ciao
lutz
--
Lutz Albers, lutz@muc.de, pgp key available from <http://www.pgp.net>
Do not take life too seriously, you will never get out of it alive.
------------------------------
Date: Tue, 24 Feb 1998 19:13:06 -0800
From: Indu Bingham <indu@healtheon.com>
Subject: dbm files
Message-Id: <34F38C42.EDF16BF7@healtheon.com>
How do I delete a record from the dbm file??
Thanks
--
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Happiness is not getting what you want, but wanting what you have.
Indu Bingham
Healtheon Corporation
indu@healtheon.com
*/
------------------------------
Date: 25 Feb 1998 03:45:47 GMT
From: snowe@rain.org (Nick Halloway)
Subject: Does anyone have a signup/confirm script? (123)
Message-Id: <6d045b$c4s$1@news.rain.org>
... like a mailing list would use to sign someone up? I'm especially
looking for the part that extracts the basic email address from the
From: line.
Thanks much.
------------------------------
Date: 25 Feb 1998 03:43:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP: Modules load as root, not user.
Message-Id: <6d0406$pum$2@comdyn.comdyn.com.au>
In article <6cuuh7$b17$1@news.nyu.edu>,
donahue@acf2.nyu.edu (Adam Donahue) writes:
> as root, it does what it's supposed to. (Well, assume I actually make an
> image using the GD functions.) However, if I run it as a regular user, I
> get an error:
>
> Can't locate loadable object for module GD in @INC (@INC contains:
> /usr/local/lib/perl5/sun4-solaris/5.00404 /usr/local/lib/perl5
> /usr/local/lib/perl5/site_perl/sun4-solaris/usr/local/lib/perl5/site_perl .) at - line 1
> BEGIN failed--compilation aborted at - line 1.
Check the permissions on all the directories and all the files under
the directories in @INC. You'll probably find that some of them are
readable and accessible by root, but not by the user you were trying.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd. | am.
NSW, Australia |
------------------------------
Date: 25 Feb 1998 03:22:11 GMT
From: Zenin <zenin@best.com>
Subject: Re: max limit on dbms open?
Message-Id: <888377167.131273@thrush.omix.com>
Li Sen <sen@ftd.com> wrote:
: The problem:
: I need to open many dbm files (with tie or dbmopen). However, at times
: that I have opened more than 30 or so dbms, I can't seems to access that
: dbm. That is, I can't even loop through the keys.
>snip<
Run "ulimit -a" or "limit -a", if you are using an sh or csh style
shell respectively. Look for the "open files" value. If it's too
low, try using ulimit/limit to adjust it (see the man page for your
shell to get the correct options). If that fails, you probably have
your "hard" user limits set too low. You'll have to ask your
sysadmin to raise your hard limit if this is the case.
--
-Zenin
zenin@best.com
------------------------------
Date: Tue, 24 Feb 1998 19:12:43 -0500
From: Dan Boorstein <danboo@negia.net>
Subject: Re: musings on autoincrement
Message-Id: <34F361FB.80C46F7@negia.net>
Kevin B Cohen wrote:
>
> In article <34F2FED9.69E70402@shopcfn.com>,
> Dan Boorstein <dboorstein@shopcfn.com> wrote:
> >> and if you then evaluate it in a conditional, e.g.
> >>
> >> if ($scalar < 18) { $age = "pediatric"}
> >> elsif ($scalar >= 18) {$age = "adult"}
> >>
> >> you'll get the Right Thing, i.e. $age = adult.)
> >
> >well, i get 'pediatric' from this example, but not after a warning:
> >
> > Argument "5-year-old male asthmatic" isn't numeric in lt at...
>
> i've never gotten that warning. maybe this is a difference between
> unix (presumably yours) and win32 (my) implementations of perl?
> that's my only guess.
did you try it with '-w'? i get the warning on unix and win32.
> >out of curiosity, why does the above code (once compilable) only
> >generate a single warning (for 'lt' but not 'ge')? can only a single
> >comparison operator warn at any given time?
>
> i would guess that this is because only one part of the conditional is
> being reached? does it act as if the first part is evaluating to T?
don't think so. the same behavior is observed if the 'elsif' is
changed to 'if'.
dan boorstein
------------------------------
Date: 25 Feb 1998 03:38:24 GMT
From: Zenin <zenin@best.com>
Subject: Re: Perl & Sockets
Message-Id: <888378139.367546@thrush.omix.com>
[ posted & mailed ]
Holly Sommer <hsommer@micro.ti.com> wrote:
: I figured the best way to go would be some little server listening on
: port 23, and sending a message to anything attempting to connect there
: that "This machine is currently in Windows 95, please try later."
>snip<
Off the top of my head and with little error checking, but it runs
ok on my FreeBSD box:
#!/usr/local/bin/perl -w
use strict;
use IO::Socket;
use Socket;
my $server = IO::Socket::INET->new (
Listen => SOMAXCONN,
LocalAddr => INADDR_ANY,
LocalPort => 23,
Proto => 'tcp',
Reuse => 1,
) or die "Can not create socket: $!, stopped";
while (1) {
my $client = $server->accept
or (warn "accept(): $!, ignoring", next);
$client->print ("This machine is currently in Windows 95, please try later\n");
$client->close;
}
__END__
I'd say Perl is the perfect choice for such a job.
Yes, I was a little bored. :-)
--
-Zenin
zenin@best.com
------------------------------
Date: Wed, 25 Feb 1998 03:40:05 GMT
From: cchubb@codegurus.com (Chris Chubb)
Subject: Re: Perl HTML checker
Message-Id: <6d051v$niu$1@news1.mnsinc.com>
In article <34F25D69.6C21D116@indiana.edu>, Josh Goodman <jogoodma@indiana.edu> wrote:
>Does anyone know where I can get a perl script that checks for HTML
>code errors in HTML documents?
Check out the HTML::* modules on CPAN. There are at least two that
do what you want.
- Chris Chubb (cchubb@codegurus.com)- http://www.monumental.com/cchubb/
- Code Gurus: Custom solutions programmed for your business.
- Fair rates, fast response, rock-solid code. Initial consultation free.
- Visual Basic, Tiered databases, Java, Perl, Internet programming.
------------------------------
Date: Tue, 24 Feb 1998 21:01:41 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: gbrock@email.sjsu.edu
Subject: Re: Perl subroutine call error msg...
Message-Id: <34F37B88.B5CA40A1@coos.dartmouth.edu>
[posted and mailed]
gbrock@email.sjsu.edu wrote:
>
> I was just curious if anybody could help me out.
> I am writing a subroutine, but keep getting the run-time error:
> Undefined subroutine &main::sub_name called at ..., <STDIN> chunk 3.
> What does this chunk mean? I don't know why this is doing this,
> I have made sure to require the function beforehand, and made
> sure it returns a "1". In fact, I checked it out with another program,
> and the subroutine that gets called seems to be okay.
> Can someone explain what this means?
'<STDIN> chunk 3' means that this error was encountered after your program
read in the 3rd chunk from <STDIN>. ('chunk' and not 'line' because you might
not be reading in other than one line at a time.) In some cases, that part of
the error message is useful, and in others, it isn't.
So, your problem probably has nothing to do with the <STDIN> chunk thing.
Make sure you're doing everything correctly, such as spelling the function
name correctly. Can't offer any more advice without seeing the code.
--
_ / ' _ / rjk@coos.dartmouth.edu
( /)//)//)(//)/( chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
It's funny 'cause it's true ... and vice versa.
------------------------------
Date: Tue, 24 Feb 1998 19:29:45 -0800
From: Hoang Nguyen <harryn@cerf.net>
Subject: perl5.004_04 fails on make
Message-Id: <Pine.SOL.3.94.980224192144.24208A-100000@staff.cerf.net>
I was trying to compile perl5.0004, when I do 'make'
it ran for a while then gave me this error:
................
rm -f libperl.a
ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o dump.o
util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
doop.o doio.o regexec.o taint.o deb.o universal.o globals.o perlio.o
gcc -o miniperl miniperlmain.o libperl.a
Undefined first referenced
symbol in file
log libperl.a(pp.o)
pow libperl.a(pp.o)
sqrt libperl.a(pp.o)
floor libperl.a(pp.o)
atan2 libperl.a(pp.o)
exp libperl.a(pp.o)
sin libperl.a(pp.o)
cos libperl.a(pp.o)
ld: fatal: Symbol referencing errors. No output written to miniperl
*** Error code 1
make: Fatal error: Command failed for target `miniperl'
...........................
Does anybody know what am I missing? I really appreciate any
hint!
I'm compiling it with gcc-2.7.2 on Solaris 2.5.1, sparc4
Hoang Nguyen
hoang@cerf.net
------------------------------
Date: Tue, 24 Feb 1998 21:13:02 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: POD style comments revisited
Message-Id: <34F37E32.6E1285F2@coos.dartmouth.edu>
If you remember the recent debate about block commenting with POD-style
comments, you'll remember that I was not satisfied with them. By the end of
the debate, those in favor of POD-style comments had made a lot of good points.
So, here's something I just discovered which I think proves my key point, that
POD-style comments are not part of the syntax of Perl, no matter that the
interpreter can recognize them:
~> cat temp1
$a = (
#
#blah
#
1);
~> perl temp1
~>
Now, replace those #'s with the easier to maintain POD-style comments, and:
~> cat temp2
$a = (
=head1
blah
=cut
1);
~> perl temp2
syntax error at temp2 line 2, near "="
Number found where operator expected at temp2 line 5, near "1"
(Missing semicolon on previous line?)
Execution of temp2 aborted due to compilation errors.
~>
No tricky ambiguity here; POD-style comments cause a syntax error where
regular # comments work correctly, plain and simple.
--
_ / ' _ / rjk@coos.dartmouth.edu
( /)//)//)(//)/( chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
It's funny 'cause it's true ... and vice versa.
------------------------------
Date: Tue, 24 Feb 1998 22:36:34 -0500
From: "Charles E. Burleson" <walrus@qis.net>
Subject: proper filename extensions
Message-Id: <Pine.GSO.3.96.980224222016.10751A-100000@eclipse>
I would like to know the proper extensions to use for a perl
script. In the past I have named mine "something.pl", and as far as I knew
that was the correct extension for my programs. The other night on Efnet
in the #perl channel I saw that was not the proper way, and that only the
clueless use this.(I am obviously clueless)
I have been reading through the faq's and could not find anything
to tell me what type files have what extensions. Also visited several web
pages with tutorials which also used the .pl extension. In the "Advanced
Perl Programming" book were also examples with .pl extensions. Would
someone please tell me what the proper file extensions are, and what they
are for so I could think of myself as less clueless?
******************************************************************************
Chuck Burleson
visit me at http://www.qis.net/~walrus/index.shtml
walrus@qis.net
******************************************************************************
------------------------------
Date: Wed, 25 Feb 1998 03:10:13 GMT
From: markw@markwatson.com (Mark Watson)
Subject: Q: obscuring Perl scripts?
Message-Id: <34f38a0c.37879968@news.sedona.net>
Sorry if this is a FAQ (I looked), but are there any
tools for (slightly) obscuring Perl scripts; something
simple like converting variable names to a1, a2, etc.?
Thanks for any info,
Mark
*********************************************
* Mark Watson, author (10 books on AI, *
* Java, and C++) and a Java consultant *
* See www.markwatson.com for Java shareware *
*********************************************
------------------------------
Date: Tue, 24 Feb 1998 22:33:46 -0500
From: see-below@crocker.com (Steve Linberg)
Subject: Re: Q: obscuring Perl scripts?
Message-Id: <see-below-2402982233470001@pri03-016.oldcity.dca.net>
In article <34f38a0c.37879968@news.sedona.net>, markw@markwatson.com (Mark
Watson) wrote:
> Sorry if this is a FAQ (I looked), but are there any
> tools for (slightly) obscuring Perl scripts; something
> simple like converting variable names to a1, a2, etc.?
Did you look in Deja News?
This question makes most people around here mad, just so you know.
--
slinberg@ com
crocker.
Try that one, spambots!
------------------------------
Date: 25 Feb 1998 03:53:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Q: obscuring Perl scripts?
Message-Id: <6d04jc$pum$4@comdyn.comdyn.com.au>
In article <34f38a0c.37879968@news.sedona.net>,
markw@markwatson.com (Mark Watson) writes:
> Sorry if this is a FAQ (I looked), but are there any
> tools for (slightly) obscuring Perl scripts; something
perldoc perlfaq3
/How can I hide the source for my Perl program?
Martien
I'll have a party on the day that more than 20% of the questions on
this group cannot be answered by a referral to the documentation.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Wed, 25 Feb 1998 02:44:15 GMT
From: Eric.Loriaux@ping.be (Eric Loriaux)
Subject: Re: REGEX : change string in HTML but not in HTML tag
Message-Id: <34f583fa.15252118@news.ping.be>
I've found a solution for the problem :
1) change (s//) "<" into "\n<" and ">" into ">\n"
2) split on \n
3) foreach element of the splitted string, s// if substr(...,0,1) ne
'<' change the string change the string (add <font size=4
color=red>...</font>)
4) join => modified HTML obtained.
The search script it up and running.
The form can be found at http://www.ping.be/~ping1475/search.html
This is the source of the routine ($buffer is the original html
string, %FORM contains certain form options, @terms is the list of
words or string the script has to look for)
sub colortext {
$count=($buffer=~s/</\n</g);
$count=($buffer=~s/>/>\n/g);
@Buffer=split(/\n/,$buffer);
if ($FORM{'string'} eq 'Words Only')
{
foreach $Buffer (@Buffer) {
print LOG "$Buffer\n";
if (substr($Buffer,0,1) ne '<')
{
foreach $term (@terms) {
if ($FORM{'case'} eq 'Case Insensitive') {
$count=($Buffer=~s/(\W|\A)($term)(\W|\Z)/$1<font color=red
size=4>$2<\/font>$3/gi);
}
elsif ($FORM{'case'} eq 'Case Sensitive') {
$count=($Buffer=~s/(\W|\A)($term)(\W|\Z)/$1<font color=red
size=4>$2<\/font>$3/g);
}
}
}
}
}
else
{
foreach $Buffer (@Buffer) {
print LOG "$Buffer\n";
if (substr($Buffer,0,1) ne '<')
{
foreach $term (@terms) {
if ($FORM{'case'} eq 'Case Insensitive') {
$count=($Buffer=~s/($term)/<font color=red
size=4>$1<\/font>/gi);
}
elsif ($FORM{'case'} eq 'Case Sensitive') {
$count=($Buffer=~s/($term)/<font color=red
size=4>$1<\/font>/g);
}
}
}
}
}
$buffer=join('',@Buffer);
}
Best regards,
Eric Loriaux's System/390 home page,
http://www.ping.be/~ping1475 (Europe)
http://www.instantweb.com/l/loriaux/s390 (USA)
------------------------------
Date: Tue, 24 Feb 1998 16:33:33 -0800
From: "Andy Jacobs" <andyj@scn.org>
Subject: Socket question for Win32
Message-Id: <6cvotn$j7i@news.microsoft.com>
I'm trying to use perl to automate a telnet session I do frequently. I'm
using perl 5.003_07 on NT Server.
I've basically copied the tcp-clt example and modified it to print out
everything it receives. If I connect it to an NNTP server (with port 119),
it works exactly as I expect. But when I connect it to the telnet host, I
only get some garbage characters (when using read() rather than <S>). If I
connect to this telnet host using a normal telnet client, I receive a few
lines of text before the login prompt, so I'd expect my perl script to
display the same thing. Every telnet host I've tried gives similar results.
Any idea what's going wrong? Here's the script (with the default host and
port):
#Copied and modified from the sample: tcp-client
($them, $port) = @ARGV;
$port = 'telnet' unless $port;
$them = 'infonet.kcls.org' unless $them;
$AF_INET = 2;
$SOCK_STREAM = 1;
$SIG{'INT'} = 'dokill';
sub dokill {
kill 9,$child if $child;
}
$sockaddr = 'S n a4 x8';
($name,$aliases,$proto) = getprotobyname('tcp');
($name,$aliases,$port) = getservbyname($port,'tcp')
unless $port =~ /^\d+$/;;
($name,$aliases,$type,$len,$thisaddr) =
gethostbyname($hostname);
($name,$aliases,$type,$len,$thataddr) = gethostbyname($them);
$this = pack($sockaddr, $AF_INET, 0, $thisaddr);
$that = pack($sockaddr, $AF_INET, $port, $thataddr);
if (socket(S, $AF_INET, $SOCK_STREAM, $proto))
print "socket ok\n";
}
else {
die $!;
}
if (bind(S, $this)) {
print "bind ok\n";
}
else {
die $!;
}
if (connect(S,$that)) {
print "connect ok\n";
}
else {
die $!;
}
select S; $| = 1;
select STDOUT; $| = 1;
while(<S>) {
print STDOUT $_;
}
- Andy Jacobs
andyj@scn.org
------------------------------
Date: Tue, 24 Feb 1998 21:52:55 -0600
From: "George Graham" <ggraham@micrord.com>
Subject: TFTP from a PERL Script?
Message-Id: <6d04jl$qen$1@usenet85.supernews.com>
I have a simple perl program that allows my employees to update a file on
one server. I use TFTP to transfer it to another server. I would like to
automate the tftp step so that the perl script that allows them to update
the file also automatically uploads it to a different server. Is there any
easy way to do this using Perl? Any help would be appreciated. Thanks.
George Graham
Micro R.&D., Inc.
------------------------------
Date: 25 Feb 1998 03:03:24 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: The Ineffable Tom C.
Message-Id: <6d01ls$abv$1@client2.news.psi.net>
Bert Robbins (brobbins@tis.com) wrote on 1638 September 1993 in
<URL: news:34F30086.4A1@tis.com>:
++ Brendan Knox wrote:
++ >
++ > Maybe we should form comp.lang.perl.newbies. Your opinion will change
++ > when you see such newbies ask the same question week after week. Why
++ > should any of us have to refrain from being sarcastic to people that
++ > haven't
++ > tried to find out themselves? Furthermore, if anyone is hurt to the
++ > point
++ > of dismissing Perl and/or this newgroup to sarcasm, then you really have
++ > to
++ > wonder what type of person they are. Perhaps if they can't take the
++ > heat,
++ > they too should get out of the kitchen.
++
++ What an arrogant attitude. If I express a interest in something
++ I don't expect the old timers to laugh in my face and say well
++ if you can't figure out how we got here then you obviosly aren't
++ smart enough for us to talk to.
Rubbish. But if you fail to read the excellent documentation that
same old timers carefully created, then those old timers are
quite right to ignore you. If you can't read, don't ask for help
on Usenet....
++ The Perl community is best servered by being friendly and
++ courteous to newcomers. We need to advocate Perl as the
++ solution to problems that Perl is best suited to accomplish.
++ We need to take a leadership role in ensuring that Perl is
++ understood and used to the benefit of all.
That's why there are tons of documentation in the Perl distribution.
++ Just think about youself in similar situations where you found
++ something that interested you and how you expanded your
++ knowledge in that area. If in an endeavor like this you were
++ handed a pile of paper and told to read it and figure it out
++ yourself then I feel that you were treated grossly. And, if
++ you decided to drop your interest in that area then you were
++ recipient of the same treatment you are subjecting others to.
Well, that's how I learned Perl (and not to mention, a gazillion other
things). In grammer school, you can expect that people aren't clever
enough to read the material provided. But rapidly after that, you're
expected to do self study. Don't forget people are here to help FREE OF
CHARGE. The documentation is free. Perl is free. This groups and the
advice offered here is free. Doing a bit of self study isn't too much
to ask.
Abigail
--
perl -we '%_ = map {local $_ = $_; y/a-z/n-za-m/; ($_, $_)} @_ = map {lc} <>;
print grep {$_{$_}} @_' < /usr/dict/words
------------------------------
Date: 25 Feb 1998 03:36:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: The Ineffable Tom C.
Message-Id: <6d03j8$pum$1@comdyn.comdyn.com.au>
In article <34f33e5c.1759735@news.clara.net>,
wrdcom@clara.net (Sean Ahern) writes:
>> newbies in any newsgroup have never taken the time to bother
>> looking at any form of documentation be it manpages, online web
>> pages, textfiles or books.
>
> Proof?
The messages that get posted.
>> If they have tried, I'd be quite amazed, as most of this stuff is
>> easy to find and easy to understand.
>
> From the perspective of one who already understands.
For anyone with enough sense to look at a URL like
http://www.perl.com/ or http://www.perl.org/. For anyone with enough
sense to see if there maybe was some doucmentation that came with that
neat little programming thingie. For anyone with enough sense to look
around on yahoo.
>> If it isn't... well that's a whole other rant
>> about people being allowed to access programming languages and
>> interpreted scripting tools. :>
>
> Aaaaah, its elitist time....
whose? And the term 'elitism' in this context is just a term used by
people who are jealous of other people's accomplishments.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd. | again. Then quit; there's no use being
NSW, Australia | a damn fool about it.
------------------------------
Date: 24 Feb 1998 23:38:06 -0500
From: uri@sysarch.com
Subject: Re: ts: double vs single quotes
Message-Id: <x7btvw2tap.fsf@sysarch.com>
bland <bland@warped.nirvana.net> writes:
> tsatan@hotmail.com writes:
>
> > As a C programmer I am in the habit of using only double-quoted strings in
> > perl. Such strings are subject to variable interpolation and backslash
> > interpretation. Is there enough of a performance penalty here that I should
> > consider using single-quoted strings by default?
>
> I would highly doubt it, but you should benchmark to be sure.
i use the appropriate quote for the string. this is for semantic
purposes as it shows to me (and other who look at the code) which
strings are constants and which are interpolated. i find it annoying
when i see:
$foo = "constant string" ;
even though it is legal it looks wrong to me.
also single quotes reduce the need for quoting metachars that expand in
double quotes.
uri
--
Uri Guttman SYStems ARCHitecture and Software Engineering
uri@sysarch.com Have Perl, Will Hack
http://www.sysarch.com (781) 643-7504 x*2 FAX: (781) 643-2710
Try the Best Search Engine on the Net --------> http://www.northernlight.com
------------------------------
Date: 25 Feb 1998 03:45:53 GMT
From: Zenin <zenin@best.com>
Subject: Re: ts: multiple keys for same value?
Message-Id: <888378589.100062@thrush.omix.com>
tsatan@hotmail.com wrote:
: Is it possible in a DBM file to have more than one key per
: value?
Huh? And point to the same value, no.
: Does anyone have any better ideas?
Maybe.
: Is it possible to use references in a DBM?
No. At least, not hard references. You can of course hold
string values that can be keys for other info or other DBMs
though.
Also check out the MLDBM module.
--
-Zenin
zenin@best.com
------------------------------
Date: Tue, 24 Feb 1998 23:00:06 -0500
From: "Scott A. MacMillan" <smacmillan@iname.com>
Subject: Using .exe programs within Perl?
Message-Id: <34F39746.A89BA17B@iname.com>
This is a multi-part message in MIME format.
--------------4CE2DD3B3182CDD81E8E6791
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm trying to write a small utility that will convert image files from
one format to another using an .exe program that I already have and then
rename them with padded 0s.
I've got the renaming portion written and working fine but I can't
figure out how to get the Perl script to run the executable within the
while loop.
Any suggestions for a rookie scripter?
Thanks
Scott
--
" If I'm ever a flash in the pan,
I shall consider myself lucky to have at least
been in the pan "
paraphrased from David Carson
--------------4CE2DD3B3182CDD81E8E6791
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Scott A. MacMillan
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Scott A. MacMillan
n: MacMillan;Scott A.
org: Sheridan College
adr: 802-350 Lynnwood Dr.;;;Oakville;Ontario;L6H 1M8;Canada
email;internet: smacmillan@iname.com
title: Computer Animator
tel;work: (905) 845-9430 x2615
tel;fax: (905) 337-7216
tel;home: (905) 337-7216
note: SoftImage Character Animator
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------4CE2DD3B3182CDD81E8E6791--
------------------------------
Date: Tue, 24 Feb 1998 22:23:15 -0600
From: "Luis J. Martinez" <luis@utdallas.edu>
Subject: Using strings as filehandles
Message-Id: <6d06e8$doc@sjx-ixn7.ix.netcom.com>
Is there a way to use very large strings as files?
------------------------------
Date: Tue, 24 Feb 1998 23:45:26 -0500
From: Cactus <cactus@mpinet.net>
Subject: Verifying a form field
Message-Id: <34F3A1E6.7D30CE23@mpinet.net>
Hello, I'm writing a Perl script to read in a number from the
query_string and verifly that it is only a number and no letters or
neg-nums. Any clues as to how I can verify this?
$order = $ENV{'QUERY_STRING'};
($Label,$Amount) = split(/=/,$order);
#if($Amount)is a number!
Thanks in Advance...
Mike
cactus@mpinet.net
------------------------------
Date: Tue, 24 Feb 1998 22:29:52 -0500
From: see-below@crocker.com (Steve Linberg)
Subject: Re: Win95 - Running scripts from browser?
Message-Id: <see-below-2402982229520001@pri03-016.oldcity.dca.net>
In article <6cv9dp$s1u$1@bashir.ici.net>, burt@ici.net (Burt Lewis) wrote:
> Hi,
>
> I just installed Perl in Windows95 and all is great running from the DOS
> prompt.
>
> Problem is when I try to open a script in my browser, it wants to open it in
> Notepad.
>
> I have the script in the bin directory. Is there something I'm missing or
> need to do to get this to execute via a browser.
You need to run a web server. A browser can't execute a script.
This is a CGI question, and would be better directed to one of the CGI groups.
--
slinberg@ com
crocker.
Try that one, spambots!
------------------------------
Date: 25 Feb 1998 03:46:20 GMT
From: "Peretz Dissen" <PeretzD@worldnet.att.net>
Subject: Re: Year 10000 Compliance
Message-Id: <6d046c$mrk@bgtnsc02.worldnet.att.net>
> Not a problem. There will be no need for computers come the year 6000, if
> indeed we must wait that long.
>
Or computers will be part of the scheme of things then.
------------------------------
Date: Wed, 25 Feb 1998 04:20:35 GMT
From: x@x.x (x)
Subject: Re: Year 10000 Compliance
Message-Id: <34f39beb.21236053@news3.newscene.com>
On Tue, 24 Feb 1998 16:27:18 GMT, Binyamin_Dissen@theoffice.net
(Binyamin Dissen) wrote:
>Not a problem. There will be no need for computers come the year 6000, if
>indeed we must wait that long.
Why? What happens then?
------------------------------
Date: Tue, 24 Feb 1998 21:11:08 -0600
From: Spaceman Spiff <csweber@flash.net>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34F38BCC.5967@flash.net>
lvirden@cas.org wrote:
>
> According to Colin Dooley <colin@medit3d.com>:
> :In a billion years the Sun will explode and you won't need to
>
> Hey - have they issued a hardware alert on that one? Which specific
> server or desktop machine - or do you mean all of them....
>
> ;-)
My Sun didn't explode, but it caught fire.
I poured Java on it, and that took care of the problem.
;-)
------------------------------
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 1968
**************************************