[7228] in Perl-Users-Digest
Perl-Users Digest, Issue: 853 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 12 12:17:14 1997
Date: Tue, 12 Aug 97 09: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 Tue, 12 Aug 1997 Volume: 8 Number: 853
Today's topics:
Re: [Q]How to write in textarea with over 30000 charact (Jeremy D. Zawodny)
Re: [Q]How to write in textarea with over 30000 charact (Tina Marie Holmboe)
any SMTP servers require domain name <serginho@alpha.hydra.com.br>
Re: complex argument passing <rootbeer@teleport.com>
filehandles denis@mathi.uni-heidelberg.de
Re: filehandles (Mike Stok)
Re: filehandles <rootbeer@teleport.com>
Re: foreach problem <rootbeer@teleport.com>
Re: foreach problem (Sami Sandqvist)
Re: Hashes in Perl 5.004_01 (Chris Nandor)
Help, Help, Help... This is killing me... <webmaster@sony.com>
Re: Help, Help, Help... This is killing me... <rootbeer@teleport.com>
HELP: symbolic ref vs. symbol table <mark@cvp.com>
Re: How to treat "\n" as "\n" ? <rootbeer@teleport.com>
Re: Interfacing to a database, but how? <thor@primenet.com>
Re: Is it possible to use HTPASSWD within Perl? <rootbeer@teleport.com>
Re: Large Data Base question (Mike Stok)
looking for winperl scripts (Kevin Kubish)
Newbie ?? Can PERL scan for substrings from serial port <zahrndtj@agcs.com>
Re: Newbie ?? Can PERL scan for substrings from serial <rootbeer@teleport.com>
Re: NEWBIE QUESTION <rootbeer@teleport.com>
Re: perl and libaries <rootbeer@teleport.com>
Problem with 5.004_01 <felicity@eclectic.kluge.net>
Re: Seeking object enlightenment (Bart Lateur)
Re: Sharing Variables <bsugars@sunpub.com>
SYSTEM Date in NT. <perrella@ehsn19.cen.uiuc.edu>
Re: SYSTEM Date in NT. (Jeremy D. Zawodny)
Re: SYSTEM Date in NT. <rootbeer@teleport.com>
Re: Trouble using an Array <rootbeer@teleport.com>
Re: url_get undefined subroutine <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Aug 1997 13:56:27 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: [Q]How to write in textarea with over 30000 characters.
Message-Id: <33f06b5e.342902067@igate.hst.moc.com>
[cc'd to original author]
On Mon, 11 Aug 1997 09:40:45 +0200, Erlend Ytterstad
<webmaster@drs.no> wrote:
>I've got a big problem whith the textarea tag.
>I want to display a text, which is over 30000 characters,
>and at the same time I want to make changes in it.
Uhm, what does this have to do with Perl?
Nothing? I thought so. Keep it in c.i.w.*
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: 12 Aug 1997 14:25:57 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
Subject: Re: [Q]How to write in textarea with over 30000 characters.
Message-Id: <5sprpl$596$9@news1.sol.no>
[newsgroup-list edited]
[follow-ups set to comp.infosystems.www.authoring.misc]
In article <33EEC1FD.2A20@drs.no>,
Erlend Ytterstad <webmaster@drs.no> writes:
> I've got a big problem whith the textarea tag.
> I want to display a text, which is over 30000 characters,
> and at the same time I want to make changes in it.
As has been pointed out, this is not an Perl issue. In fact, it isn't even
an HTML issue, so followups are set to a MISC group.
Just one comment:
> all characters, but I can't put in new characters in
> the textarea-form before the size is below 30000 character.
> Max characters at each line is 1024.
This is browser dependent.
> I've tried to adust the cache on my computer, but this have
> no effect. The only attributes, in my knowledge, to the textarea tag
> is :NAME,ROWS,COLS,WRAP. This attributes have nothing to do
> whith my problem.
There is no WRAP attribute to the TEXTAREA element in the current HTML
standard(s).
--
Tina Marie Holmboe tina@mail.scandinaviaonline.se
The opinions expressed above are mine, and should in no way or under any
circumstances be associated with Scandinavia Online AB unless this disclaimer
is explicitly revoked.
------------------------------
Date: 12 Aug 1997 14:03:06 GMT
From: "Sergio Stateri Jr" <serginho@alpha.hydra.com.br>
Subject: any SMTP servers require domain name
Message-Id: <01bca728$db0687e0$ca75e7c8@AFXTD_202.Autofax>
Hi ! When I log in a SMTP server, I've to send HELO command...The problem
is that, if I'm in my home (Acessing using an internet provider), I don't
have a domain name, and any SMTP servers require it (If I'm in the office,
always's OK because I've a domain name). The internet provider send me a
dynamic IP. I'd like to know if it's possible to emulate a domain name for
the SMTP servers that require one.
Thanks in advance!
--
----------------------------------------------------------
Sergio Stateri Jr
Sco Paulo (SP) - Brazil
e-mail: serginho@mail.serve.com
----------------------------------------------------------
------------------------------
Date: Tue, 12 Aug 1997 07:59:46 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Dean Hoover <dhoover@textwise.com>
Subject: Re: complex argument passing
Message-Id: <Pine.GSO.3.96.970812075856.15021I-100000@julie.teleport.com>
On Tue, 12 Aug 1997, Dean Hoover wrote:
> union semun {
> int val;
> struct semid_ds *buf;
> ushort *array
> } arg;
>
> I need to set the "val" member of the union and pass
> it to the semctl (perl) function. How do I do it???
I think you're looking for Perl's pack function, documented in the
perlfunc(1) manpage. 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: Tue, 12 Aug 1997 16:03:11 +0200
From: denis@mathi.uni-heidelberg.de
Subject: filehandles
Message-Id: <33F06D1F.41C6@mathi.uni-heidelberg.de>
hallo,
i try to hand a filehandle over to a subroutine. only the name arives..
i tried something like this:
open(XXX, "xxx");
yyy(XXX);
sub YYY
{
@array= <$_[0]>
print "@array";
}
now the output of YYY is not - as i expected - the file xxx, but the
string XXX.
how can i correct this?
thanks
denis
------------------------------
Date: 12 Aug 1997 14:46:16 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: filehandles
Message-Id: <5spsvo$h81@news-central.tiac.net>
In article <33F06D1F.41C6@mathi.uni-heidelberg.de>,
<denis@mathi.uni-heidelberg.de> wrote:
>hallo,
>
>i try to hand a filehandle over to a subroutine. only the name arives..
>i tried something like this:
If you look at section 5 of the perl list of frequently asked questions
there's this question and answer:
How can I make a filehandle local to a subroutine? How do
I pass filehandles between subroutines? How do I make an
array of filehandles?
You may have some success with typeglobs, as we always had
to use in days of old:
local(*FH);
But while still supported, that isn't the best to go about
getting local filehandles. Typeglobs have their
drawbacks. You may well want to use the FileHandle
module, which creates new filehandles for you (see the
FileHandle manpage):
use FileHandle;
sub findme {
my $fh = FileHandle->new();
open($fh, "</etc/hosts") or die "no /etc/hosts: $!";
while (<$fh>) {
print if /\b127\.(0\.0\.)?1\b/;
}
# $fh automatically closes/disappears here
}
Internally, Perl believes filehandles to be of class
IO::Handle. You may use that module directly if you'd
like (see the IO::Handle manpage), or one of its more
specific derived classes.
Once you have IO::File or FileHandle objects, you can pass
them between subroutines or store them in hashes as you
would any other scalar values:
use FileHandle;
# Storing filehandles in a hash and array
foreach $filename (@names) {
my $fh = new FileHandle($filename) or die;
$file{$filename} = $fh;
push(@files, $fh);
}
# Using the filehandles in the array
foreach $file (@files) {
print $file "Testing\n";
}
# You have to do the { } ugliness when you're specifying the
# filehandle by anything other than a simple scalar variable.
print { $files[2] } "Testing\n";
# Passing filehandles to subroutines
sub debug {
my $filehandle = shift;
printf $filehandle "DEBUG: ", @_;
}
debug($fh, "Testing\n");
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 12 Aug 1997 08:05:46 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: denis@mathi.uni-heidelberg.de
Subject: Re: filehandles
Message-Id: <Pine.GSO.3.96.970812080523.15021L-100000@julie.teleport.com>
On Tue, 12 Aug 1997 denis@mathi.uni-heidelberg.de wrote:
> i try to hand a filehandle over to a subroutine. only the name arives..
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq5/
How_can_I_make_a_filehandle_loca.html
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: Tue, 12 Aug 1997 07:48:01 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Sami Sandqvist <samiss@lehtori.cc.tut.fi>
Subject: Re: foreach problem
Message-Id: <Pine.GSO.3.96.970812073849.15021G-100000@julie.teleport.com>
On 12 Aug 1997, Sami Sandqvist wrote:
> while (<SISAAN>) {
> if (/^<01>(.*)$/) {
> chomp $1;
> $luokat{$1}=[()];
> }
> }
You can't chomp $1 - it's a read-only value. And you probably don't
need to, since it can't end with a newline character in this case.
> close SISAAN;
> print STDERR keys %luokat; ####HERE
Without the contents of the file, we can't see what that would print. But
it is going to run the keys all together, with no spaces in between. I'd
use this sort of thing to print the keys in a nice format.
print STDERR
map "'$_'\n", keys %luokat;
> foreach $ali (keys %luokat) {
> print STDERR "!\n"; ####HERE
Nothing wrong with that, if it does what you want. :-)
> $temp = $ali;
> do {
[snip]
> last;
> }
> } while (length($temp) != 0);
That last doesn't jump out of the do/while (which is not a true while
loop, for technical reasons). It jumps out of the foreach loop, and that's
probably not what you want. If you want a loop to test at the "bottom",
try this method.
{
# do something
redo unless $whatever;
}
In that code, the redo will redo the "naked block".
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: 12 Aug 1997 15:21:09 GMT
From: sami@d246a.mtalo.ton.tut.fi (Sami Sandqvist)
Subject: Re: foreach problem
Message-Id: <slrn5v0vss.ec.sami@d246a.mtalo.ton.tut.fi>
On Tue, 12 Aug 1997 07:48:01 -0700, Tom Phoenix <rootbeer@teleport.com> wrote:
>That last doesn't jump out of the do/while (which is not a true while
>loop, for technical reasons). It jumps out of the foreach loop, and that's
>probably not what you want. If you want a loop to test at the "bottom",
>try this method.
>
> {
> # do something
> redo unless $whatever;
> }
>
>In that code, the redo will redo the "naked block".
>
>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/
Thanks to all who replied. I should have re-read the man pages.
Sami
------------------------------
Date: Tue, 12 Aug 1997 10:54:11 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Hashes in Perl 5.004_01
Message-Id: <pudge-ya02408000R1208971054110001@news.idt.net>
In article <33F047FE.78C7@intershop.de>, Eckard Brauer <ecki@intershop.de>
wrote:
# 2. Making a Hash empty with 'my(%hashvar) = {};' doesn't work. (also
# O.K., I'm using 'my(%hashvar) = ();')
It's not supposed to work. %hashvar = {} makes %hashvar equal to an
anonymous array reference, which is exactly one element. A hash needs an
even number of elements.
This also fails:
%h = {a=>1};
You need to do either:
%h = (a=>1);
or:
$h = {a=>1};
# 3. Using a construct like 'my(%hashvar, $scvar) = @_;' to leave $scvar
# undef'd with an even count of arguments and let it be the last arg
# with an odd count doesn't work too.
I am not sure about what the behavior SHOULD be. I do know that it works
fine with an even count, and that it "fails" with an odd count; however,
though you get a mandatory warning, it seems $scvar still gets populated
with the odd element and the program runs to completion.
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
------------------------------
Date: Tue, 12 Aug 1997 07:47:41 -0700
From: "Stephon" <webmaster@sony.com>
Subject: Help, Help, Help... This is killing me...
Message-Id: <01bca72f$71d642e0$40c82399@default>
I'm stumped... Can anyone figure way the hell this piece of script is not
working??? And I am pretty sure the answer is simple. Here are the
details:
This is a piece of my main script that I am using for a link exchange.
Though I am not recieving 500 Server errors; I am getting nothing. Okay so
when I load the script everything appears correct. Except when I have it
search my database it searches for the correct word but clams it is nowhere
to be found. Now I checked to make sure that all file names and access
count information was included but nothing seems to matter! Please help...
Here is that piece of the script:
# Opening Log for Search #########################################
open (LOG, "$logfile");
@log = <LOG>;
close (LOG);
# Searching Log ##################################################
print "Content-type: text/html\n\n";
print "<html><body>\n";
open(LOG,">$logfile");
foreach $log (@log) {
($log,$num)=split(/:/,$log);
if ($log =~ /$files[$num]/) {
$num++;
print "$files[$num] - $log:$num\n";
print LOG "$log:$num";
}
else {
print LOG "$log:$num";
}
}
close(MAIN);
print "</body>\n</html>\n";
Well there it is... HELP, HELP, HELP...
P.S. - I don't care if you use this piece of the script for anymeans just
HELP me out here.
-Stephon
------------------------------
Date: Tue, 12 Aug 1997 08:21:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephon <webmaster@sony.com>
Subject: Re: Help, Help, Help... This is killing me...
Message-Id: <Pine.GSO.3.96.970812082035.15021O-100000@julie.teleport.com>
On Tue, 12 Aug 1997, Stephon wrote:
> Subject: Help, Help, Help... This is killing me...
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Though I am not recieving 500 Server errors; I am getting nothing.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!
http://www.perl.com/perl/
http://www.perl.com/perl/faq/
http://www.perl.com/perl/faq/idiots-guide.html
--
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: Tue, 12 Aug 1997 09:33:49 -0500
From: Mark Blythe <mark@cvp.com>
Subject: HELP: symbolic ref vs. symbol table
Message-Id: <33F0744D.A4714210@cvp.com>
Hi,
What is the best, or at least the most efficient, way of
accessing a hash value when the name of the hash is stored
in a scalar variable? I've discovered two:
The symbolic reference method:
$name = "hash";
${$name}{key} = "value";
The symbol table method:
$name = "hash";
$main::{$name}{key} = "value";
They seem to actually be different in the low-level operations,
since the symbol table method works even with use strict 'refs'.
I also have the same situation with initializing and creating
a hard reference to this hash:
The symbolic reference method:
$name = "hash";
$hash_ref = \%$name;
The symbol table method:
$name = "hash";
$hash_ref = $main::{$name} = {};
Any thoughts on which is more efficient?
Thanks!
Mark Blythe
Creativision Publishing
mark@cvp.com
------------------------------
Date: Tue, 12 Aug 1997 07:23:50 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
Subject: Re: How to treat "\n" as "\n" ?
Message-Id: <Pine.GSO.3.96.970812071822.15021D-100000@julie.teleport.com>
On Tue, 12 Aug 1997, Kriang Lerdsuwanakij wrote:
> To replace $foo to its value, you will have to use eval
No, you don't _have_ to. That's just one way to do it, and maybe not the
best one.
s/\$foo/$foo/g; # Replace $foo with its value
s/(\$\w+)/$1/gee; # Replace simple scalars with their values
s/\$(\w+)/${$1}/g; # Another way to do it, if no strict refs
But those are not necessarily the best ways, either. :-) 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: 12 Aug 1997 07:33:00 -0700
From: Thornton Prime <thor@primenet.com>
Subject: Re: Interfacing to a database, but how?
Message-Id: <5sps6s$gfs@nntp02.primenet.com>
Heath Morrison <whm@gleim.com> wrote:
: perl, but I do not know if that is the fastest way...and I have
: absolutely NO idea how to do the server-side stuff in Java. Any insight,
: suggestions, or directions would be great.
Servlets are JavaSoft's answer to server-side Java.
http://jserv.javasoft.com
They are substantially faster than Perl, and with JDBC, you probably have
a larger selection of available databases.
--
+__ ___/+ __ \ __ \_ _/ |++ | ___|
Thornton K. Prime +++ /++++ /++/ / /++/ / / |+ | |++++
thor@primenet.com ++ /++++ ____ / __/ / /| | /| | _|++
+ /++++ /++++ /+ |++ / /+| /+| | |++++
_/ _/+ _/++++ _/++_|____/_/++|_/++|_|_____|
------------------------------
Date: Tue, 12 Aug 1997 08:19:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: J%org Knappen <knappen@iphcip1.Physik.Uni-Mainz.DE>
Subject: Re: Is it possible to use HTPASSWD within Perl?
Message-Id: <Pine.GSO.3.96.970812081832.15021N-100000@julie.teleport.com>
On 12 Aug 1997, J%org Knappen wrote:
> Subject: Re: Is it possible to use HTPASSWD within Perl?
> P.S. I had a similar problem recently, look under the subject
> Re: Bidirectional Communication, Comm.pl for more information.
That's the hard way to do it. :-)
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq9/
How_do_I_edit_my_htpaswd_and_.html
--
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: 12 Aug 1997 14:14:43 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Large Data Base question
Message-Id: <5spr4j$fpr@news-central.tiac.net>
In article <33F06613.8995E057@huron.net>, Stephen Hill <buck@huron.net> wrote:
>I am going to have a large database, about 1 gig. Would perl be
>appropriate to use to search this database or would some other language
>be more appropriate?
>
>Any tips on handling a large database would be appreciated.
If you're doing serious database work on the data (as opposed to just
scanning it or counting records which meet simple criteria) then it's
ptobably worth using a commerical (or free) dataase engine and perl with
DBI and the appropriate DBD driver (see the documents at:
http://www.hermetica.com/technologia/perl/DBI/ )
Perl is a good language for data manipulation, but you have to be aware
that some innocent looking constructs like
@data = <FILE>;
can consume a load of memory if you're dealing with big files, and there
can be a big difference between
foreach $line (<FILE>) {
...
}
and
while (defined ($line = <FILE>)) {
...
}
for example counting lines in /usr/dict/words on my system using programs
like:
#!/usr/local/bin/perl
$file = '/usr/dict/words';
open FILE, "<$file" or die "open $file failed ($!)\n";
foreach $line (<FILE>) {
$lines++;
}
print "got $lines line(s)\n";
(as try.pl) and changing the loop to the while for try2.pl I get things
like:
[mike@stok tmp]$ time perl -e 1
0.01user 0.02system 0:00.02elapsed 107%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (181major+23minor)pagefaults 0swaps
[mike@stok tmp]$ time ./try.pl
got 45402 line(s)
0.70user 0.05system 0:00.75elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (200major+575minor)pagefaults 0swaps
[mike@stok tmp]$ time ./try2.pl
got 45402 line(s)
0.46user 0.01system 0:00.47elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (200major+25minor)pagefaults 0swaps
Also if you're operating on large volumes of data some database features
like indexing and stored procedures and optimised queries can help a lot,
but if your data is simple then some of the "simple" key/value databases
(e.g. DB_File) which are supported by perl can be very effective - you
need to still be aware of their limitations (e.g. max record size, multi
user access, etc.) and see if they are important in your application.
So my answer would be that perl is a good language for small to middle
sized projects, but it depends on the nature of your applicatrion and you
should try and make life as easy for you and your CPU as possible.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 12 Aug 1997 15:04:44 GMT
From: kkubish@nei.com (Kevin Kubish)
Subject: looking for winperl scripts
Message-Id: <33f079d5.66138922@209.69.36.106>
The local SMTP server is a cc:mail link to smtp gateway that doesn't
have telnet service. The web server is a Windows NT Server 4.0
machine. Most scripts don't work since they try to access the smtp
gateway via telnet. However, a few scripts seem to work but only in
certain instances. The problem is in the 'sendmail' portion, so
scripts that use an external mailer like WindMail won't help me much.
I was wondering where I could find more Perl form mailing scripts that
I could play with and hopefully figure how the working scripts send
the mail. They send it fast, which makes it hard to believe that they
would be using an external smtp gateway somewhere. I get the mail in
my cc:mail mailbox within a couple of minutes.
Any ideas?
(WindMail only works when a perl script uses it. It won't work from
the command line)
Thanks in advance for any suggestions.. I've been struggling with this
for a while with not much luck.
------------------------------
Date: Tue, 12 Aug 1997 09:34:15 -0500
From: Jim Zahrndt <zahrndtj@agcs.com>
Subject: Newbie ?? Can PERL scan for substrings from serial port data?
Message-Id: <33F07467.1433@agcs.com>
I've been out of programming for a couple of years and now need to get
something operational in PERL (while I'm reading the Learning PERL
books).
I need to write a script that would process files and ship them out
to suppliers using XMODEM. I'd like to write the PERL script
to wait for input (i.e., "ssword:", "ogin:", etc.) from the remote
system and then continue on.
The development system is an HP with future migration to Sun.
Question: 1) Is this possible using PERL?
2) Are there any examples anywhere out there?
(My searches so far haven't been successfull).
Thanks in advance for any/all help!
--
Jim Zahrndt
zahrndtj@agcs.com
Any opinions stated are my own and not my employer's!
------------------------------
Date: Tue, 12 Aug 1997 08:14:20 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jim Zahrndt <zahrndtj@agcs.com>
Subject: Re: Newbie ?? Can PERL scan for substrings from serial port data?
Message-Id: <Pine.GSO.3.96.970812080726.15021M-100000@julie.teleport.com>
On Tue, 12 Aug 1997, Jim Zahrndt wrote:
> I need to write a script that would process files and ship them out
> to suppliers using XMODEM. I'd like to write the PERL script
> to wait for input (i.e., "ssword:", "ogin:", etc.) from the remote
> system and then continue on.
> Question: 1) Is this possible using PERL?
Yes. But it wouldn't necessarily be easy.
It also might not be the best way to distribute your files. It's certainly
going to be interesting if any remote system has a different protocol than
you've expected! :-) I would recommend making your files available via
non-anonymous FTP, or possibly putting them on the other sites with that
method. You could also consider sending them by e-mail.
There are modules on CPAN which may help.
http://www.perl.com/CPAN/
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: Tue, 12 Aug 1997 07:57:00 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Xu Chu <xuchu@iscs.nus.edu.sg>
Subject: Re: NEWBIE QUESTION
Message-Id: <Pine.GSO.3.96.970812075101.15021H-100000@julie.teleport.com>
On 12 Aug 1997, Xu Chu wrote:
> Subject: NEWBIE QUESTION
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> hello, i am new in perl. can someone help me out with this question?
> $blunk = %name;
> i run it and gets "$blunk=2/8". can u tell me why it is the result?
Yes. Evaluating the name of a hash in a scalar context (which is the fancy
way of describing what you're doing) gives the hash's internal statistics.
Essentially, you can use this to tell whether there's anything in a hash.
warn "No values in %name" unless %name;
But when you actually look at the value, it's giving some stats which are
mostly useful for debugging Perl's internal hashing algorithm. The value
2/8 tells me that there are eight "buckets", and two of them are currently
in use.
Now that you know this, you can safely forget it. :-) It will probably
never be useful to know, so it's just a waste of brain cells. :-)
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: Tue, 12 Aug 1997 07:31:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: denis@mathi.uni-heidelberg.de
Subject: Re: perl and libaries
Message-Id: <Pine.GSO.3.96.970812072429.15021E-100000@julie.teleport.com>
On Tue, 12 Aug 1997 denis@mathi.uni-heidelberg.de wrote:
> i tried to use the perl standard libaries, but i noticed that they are
> not installed on my machine.
In that case, I would ask my sysadmin to install 5.004 and all the
trimmings. There's no telling how much good stuff you may be missing!
> so i got the sorces end copied the lib files in a directory.
That can work with simple libraries and modules. In general, you may need
to use other methods.
> next i added a $INC[0]=libdir; in my script.
I hope that that wasn't your code. Even if you meant to use a path in
quotes where you wrote "libdir", you're overwriting one of the valuable
path items already in @INC. You probably want 'use lib'; see the docs for
lib.pm for more information. 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: 12 Aug 1997 14:58:17 GMT
From: Theo Van Dinter <felicity@eclectic.kluge.net>
Subject: Problem with 5.004_01
Message-Id: <5sptm9$m98$1@bigboote.WPI.EDU>
I just installed 5.004_01 to upgrade from 5.004, and most of my scripts
now cause this error message from perl:
perl: can't resolve symbol 'safemalloc'
I'm dropping back to plain vanilla 5.004 for now, but ... Any ideas what's
causing the above error? Thanks.
------------------------------
Date: Tue, 12 Aug 1997 15:57:00 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Seeking object enlightenment
Message-Id: <33f4824a.3389971@news.tornado.be>
Randal Schwartz <merlyn@stonehenge.com> wrote:
>Doing things manually:
>
> $something = [35, "happy", 12];
>
>creates a reference, and
>
> bless $something, "Some::Random::Package";
>
>"blesses" it into the package Some::Random::Package, so that:
>
> $something->foo("bar");
>
>will start by looking for the subroutine called
>Some::Random::Package::foo, passing it $something and "bar" as
>parameters.
>
>If that's not found, the packages in @Some::Random::Package::ISA are
>also searched, recursively, for a subroutine named foo.
>
>That's all there is to the mechanism. Nothing terribly magic.
Call me stupid, but I don't understand why this is called "to bless".
Nothing in the discribtion above makes me think of blessing. Unless its
something really weird like "Go and Multiply", sortof. In short: what's
the metaphor?
I think OOP in Perl is daunting to a lot of people like me, because of
this rather strange naming convention.
HTH,
Bart.
------------------------------
Date: Tue, 12 Aug 1997 11:44:18 -0400
From: Benjamin Sugars <bsugars@sunpub.com>
Subject: Re: Sharing Variables
Message-Id: <33F084D2.2E66@sunpub.com>
Tom Phoenix wrote:
>
> On 11 Aug 1997, Arielle Sumits wrote:
>
> > How can I share variables across several perl scripts?
>
> There are some good suggestions in the perlipc(1) manpage. Hope this
> helps!
Coincidently, I just posted today a message to
comp.lang.perl.modules about my *experimental* module
that will allow you to share variables... if you have
System V IPC.
The source is at
http://interact.canoe.ca/~bsugars/ipc_shareable-0.16.tar.gz
or
ftp://ftp.canoe.ca/pub/ipc_shareable-0.16.tar.gz
-Ben
--
Ben Sugars <bsugars@canoe.ca>
Senior Webmaster,
CANOE Canadian Online Explorer,
http://www.canoe.ca/
------------------------------
Date: Tue, 12 Aug 1997 08:58:22 -0500
From: perrella andrew c <perrella@ehsn19.cen.uiuc.edu>
Subject: SYSTEM Date in NT.
Message-Id: <Pine.SOL.3.95.970812085636.9728A-100000@ehsn19.cen.uiuc.edu>
Hello,
I am trying to define a variable that gives the system date, but I
can't get anything to work (using NT).
I have tried
$date = system("date /t");
but
print $date; returns 0.
any ideas?
thanks,
andrew
perrella@uiuc.edu
------------------------------
Date: Tue, 12 Aug 1997 14:21:06 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: SYSTEM Date in NT.
Message-Id: <33f0713c.344403516@igate.hst.moc.com>
[cc'd to original author]
On Tue, 12 Aug 1997 08:58:22 -0500, perrella andrew c
<perrella@ehsn19.cen.uiuc.edu> wrote:
>
>Hello,
>
> I am trying to define a variable that gives the system date, but I
>can't get anything to work (using NT).
>
>I have tried
>
>$date = system("date /t");
>but
>print $date; returns 0.
Use something that isn't system-dependant, like the localtime() system
call.
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 12 Aug 1997 08:00:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: perrella andrew c <perrella@ehsn19.cen.uiuc.edu>
Subject: Re: SYSTEM Date in NT.
Message-Id: <Pine.GSO.3.96.970812080008.15021J-100000@julie.teleport.com>
On Tue, 12 Aug 1997, perrella andrew c wrote:
> I am trying to define a variable that gives the system date, but I
> can't get anything to work (using NT).
How about this?
$date = localtime;
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: Tue, 12 Aug 1997 07:16:47 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: ken <babyvis@mail.teleport.com>
Subject: Re: Trouble using an Array
Message-Id: <Pine.GSO.3.96.970812071457.15021C-100000@julie.teleport.com>
On 12 Aug 1997, ken wrote:
> I'm trying to read a file, stuff each new line of text into an
> array so I can use the sort function to organize the
> file (by line). All the examples I've seen so far seem to
> use arrays to contain the elements within a line...?
Probably because that's a frequent way to do that. :-)
> @array_of_lines = <LOG>; Hoping that this "loads" the array
> array_of_lines[0] = first line in LOG
> array_of_lines[1] = second line, etc
Close, but put a dollar sign in front of those names.
> sort(@array_of_lines);
The sort function returns a sorted list, but it doesn't modify its
arguments. You probably want something like this.
@sorted = sort(@array);
> print(@array_of_lines);
Nothing wrong with that. 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: Tue, 12 Aug 1997 08:31:57 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Eric Bresie <ebresie@ccwf.cc.utexas.edu>
Subject: Re: url_get undefined subroutine
Message-Id: <Pine.GSO.3.96.970812083009.15021Q-100000@julie.teleport.com>
On 11 Aug 1997, Eric Bresie wrote:
> Undefined subroutine &ftp::SYS_gethostname called at ftplib.pl line 36.
That may mean that some library files are mis-installed on your machine.
Possibly you have an old version of some file, where you need a newer one.
Try having Perl 5.004 installed. Then, if you still have that problem,
please post again. Good luck!
--
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: 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 853
*************************************