[11583] in Perl-Users-Digest
Perl-Users Digest, Issue: 5183 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 19 20:07:45 1999
Date: Fri, 19 Mar 99 17:00:20 -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 Fri, 19 Mar 1999 Volume: 8 Number: 5183
Today's topics:
Re: $query->header problem with cgi module <jamesht@idt.net>
Re: 9-3748fh*42-06815.831.2an <uri@home.sysarch.com>
Can an unchecked checkbox input pass a different value? <greg@nospam.com>
Re: Can't read a text file with weird characters in it. <cassell@mail.cor.epa.gov>
Closing in on Persistance <hojo@i-tel.com>
Re: DBF Format <gellyfish@btinternet.com>
Re: dir command in perl? (Abigail)
Re: dir command in perl? <ruedas@geophysik.uni-frankfurt.de>
Re: Finding the size of a scalar <gellyfish@btinternet.com>
Re: getting keys of hashes of hashes <All@n.due.net>
Re: getting keys of hashes of hashes (Greg Bacon)
Re: GNUfind -mmin and find2perl. <gellyfish@btinternet.com>
Re: Help with Perl's multithread!!! <sugalskd@netserve.ous.edu>
I/F with IBM's MQ Series <japayne@technologist.com>
Re: inserting large numbers into databases <cassell@mail.cor.epa.gov>
Re: join lines from <textarea> <flanker@sonnet.ru>
passwords:crypts <elly139@cableinet.co.uk>
Re: PERl and Server Side Includes <jglascoe@giss.nasa.gov>
Re: PERl and Server Side Includes (Abigail)
perl on OS390 / MVS ... anything to watch out for? <mschube@earthlink.net>
Re: Q: format and write <ruedas@geophysik.uni-frankfurt.de>
Re: question....@ISA /my @ISA <jglascoe@giss.nasa.gov>
Re: Random for Hash <flanker@sonnet.ru>
Re: Several lines into one <jamesht@idt.net>
Simple perl question <wangchuk@bodhisattva.freeserve.co.uk>
Re: Simple perl question <nospam@hotmail.com>
Re: Simple perl question <jacklam@math.uio.no>
Re: The truth about the Pentium III chip and ID --- **b (Tim Roberts)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 Mar 1999 19:17:43 -0500
From: James Tolley <jamesht@idt.net>
To: Phil Buckley <philb@mainstream.net>
Subject: Re: $query->header problem with cgi module
Message-Id: <36F2E926.B240427D@idt.net>
> print $query->header(-target=>'_top');
> Works fine with NN4 but keep the frames with IE4,
Most likely, IE doesn't pay any attention to that HTTP header. In which
case, there's no way to solve the problem with Perl. (incredible as that
notion may seem!)
Try using JavaScript in the html.
<form method="POST" action="whatever" target="_top">
I'm not SURE how to fix it, but you'll have to do something like that.
(Isn't this a CGI => 'comp.infosystems.www.authoring.cgi' question?)
hth,
James
------------------------------
Date: 19 Mar 1999 18:01:31 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: 9-3748fh*42-06815.831.2an
Message-Id: <x7u2vhaxtg.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> In article <10N6uy-0005aZ-00@drule.org> on 17 Mar 1999 03:22:56 -0000,
LR> Anonymous <Use-Author-Address-Header@[127.1] >says...
LR> <SNIP 1551 lines of bullshit>
watch your tongue larry, there may be kids reading these groups! :-)
LR> What did the Perl newsgroup do to deserve this punishment? Please tell
LR> us, lest we sin again and be punished again.
which is why i skipped it. 1500 lines in a perl group means ignore!
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 19 Mar 1999 15:27:59 -0800
From: "Greg" <greg@nospam.com>
Subject: Can an unchecked checkbox input pass a different value?
Message-Id: <Y7BI2.1687$256.15597@news20.ispnews.com>
Hello,
Can un unchecked checkbox input still pass a value (i.e. it passes a value
if checked, but can it pass a different value if unchecked)? Perhaps I need
to be looking to javascript to do this?
Any help is greatly appreciated! :^)
Greg
------------------------------
Date: Fri, 19 Mar 1999 15:36:42 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Can't read a text file with weird characters in it. Help.
Message-Id: <36F2DF8A.1A944862@mail.cor.epa.gov>
Tad McClellan wrote:
>
> Jason Stanley (jstanley@mmm.com) wrote:
> : I am trying to read through the text file below, but when it hits the odd
> : (ascii?) characters it won't read the rest of the file. How do I get it to
> : ignore all the strange characters and read all the words.
>
> If you are on a M$ "OS", then have a look at 'binmode'
> in the perlfunc.pod.
Or, if you have a modern version of ActivePerl, go to the on-line
docs and read in your preferred web browser the section labeled
perlfunc until you hit 'binmode'. Same thing, different process.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 19 Mar 1999 22:53:26 GMT
From: hojo <hojo@i-tel.com>
Subject: Closing in on Persistance
Message-Id: <7cukgt$vdp$1@nnrp1.dejanews.com>
I am getting closer to using database handels that are global for child
processes, however, I am not able (at this point) to reuse the same handle
twice. Is there a way to hand pick the child process a request will use?
note: The database handel is still alive in the previous child process as the
error log shows that I have used all of my logins.
Perhaps this is a mod_perl question, but something tells me that they will
just flame me and send me over here for advice :|
script:
...
my $dbh = itel::db_test->connect('****','********');
my $ret = $dbh->sql("select * from counters");
...
module:
...
my %Connected;
sub connect {
print STDERR "We are in process number -$$\n";
my($self, @args) = @_;
my $Srv = 'IRELAND';
foreach (@args) {
$_ = '' unless $_;
}
my($Uid, $Pwd) = @args;
my $idx = $Uid;
if($Connected{$idx} && ping($Connected{$idx})) {
print STDERR "Already Connected -process-$$-";
return bless($Connected{$idx}, "Apache::Sybase::DBlib");
}
print STDERR "connecting to $idx from $$\n";
my $dbh = Sybase::DBlib->dblogin($Uid, $Pwd, $Srv, "Apache-$$");
if(!$dbh) {
return undef;
}
$Connected{$idx} = $dbh;
bless($Connected{$idx}, "Sybase::DBlib");
}
Errorlog:
We are in process number -1114 connecting to hojo from 1114 We are in process
number -1115 connecting to hojo from 1115 We are in process number -1116
connecting to hojo from 1116 We are in process number -1119 connecting to
hojo from 1119 We are in process number -1117 connecting to hojo from 1117 We
are in process number -1118 connecting to hojo from 1118 We are in process
number -1120 connecting to hojo from 1120 We are in process number -1121
connecting to hojo from 1121 Msg 18458, Level 14, State 1 Server 'Microsoft
SQL Server', Login failed- The maximum simultaneous user count of 10
licenses for thi s server has been exceeded. Additional licenses should be
obtained and registere d via the Licensing application in the NT Control
Panel. DB-Library error: Login incorrect. httpsd: [Fri Mar 19 15:59:14 1999]
[error] Can't call method "sql" on an undefin ed value at
/usr/u1/hojo/htdocs/test.cgi line 16.
=-=-=-=-=-=-=-=-=-=
David Hajoglou
Sys. Admin., Abbreviator
=-=-=-=-=-=-=-=-=-=
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 19 Mar 1999 22:18:48 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: DBF Format
Message-Id: <7cuig8$o4$1@gellyfish.btinternet.com>
On Thu, 18 Mar 1999 22:20:38 GMT mtcorey@my-dejanews.com wrote:
> I was told that it was possible to use the DBD::xBase module to write data
> out in DBF format. I have never used the DBD::xBase module, so I am totally
> lost. What I need to do is extract the data from a Sybase SQL Server
> database (this I can do using sybperl), but I have no idea how to write the
> extracted data out in DBF format using DBD::xBase. Has anyone ever performed
> this? If so any help would be greatly appreciated. Thanks.
>
The beauty of DBI is that you have the same interface for any supported
database (within the constraints of that database of course). Here is a
quick example (Using what seems to have become my ubiquitous phonebook
text file ) - The only drawback of using DBD::XBase is that it doesnt
support indexes at the moment :
#!/usr/bin/perl -w
use strict;
use DBI;
my $dbh = DBI->connect("DBI:XBase:.") or die $DBI::errstr;
my $create_statement = <<EOQUERY;
CREATE TABLE phonebook
(
surname CHAR(20),
forename CHAR(30),
title CHAR(30),
number CHAR(15),
location CHAR(10),
dept CHAR(5)
)
EOQUERY
$dbh->do($create_statement);
my $sth = $dbh->prepare("INSERT INTO phonebook VALUES (?,?,?,?,?,?)")
or die $dbh->errstr();
open(PHONE,"phonebook.txt") or die "Couldnt open - $!\n";
while(<PHONE>)
{
my ( $surname,
$forename,
$title,
$number,
$location,
$dept ) = split /,/,$_ ;
$sth->execute($surname,
$forename,
$title,
$number,
$location,
$dept) or die $sth->errstr();
}
close(PHONE);
Of course here I have created the DBF table which might not be necessary
in your application ...
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Mar 1999 23:54:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: dir command in perl?
Message-Id: <7cuo3k$5nn$2@client2.news.psi.net>
josri (josri@earthlink.net) wrote on MMXXVI September MCMXCIII in
<URL:news:36F2CDB2.A024A42@earthlink.net>:
** hi
** how can i run "dir" command with perl in windows?
**
** I tried
** $dir='dir';
Look up system(), open(), exec() and the `` operator.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Sat, 20 Mar 1999 01:13:06 +0100
From: Thomas Ruedas <ruedas@geophysik.uni-frankfurt.de>
To: josri <josri@earthlink.net>
Subject: Re: dir command in perl?
Message-Id: <36F2E812.1CFB@geophysik.uni-frankfurt.de>
In principle, you run system commands as dir this
system "dir"; # forks and waits for process to finish
or this
exec "dir"; # proceeds w/o waiting
way. system returns the exit status of the process, exec returns
nothing.
What you could try is to write the results of dir into a file and then
read the file. (Probably not the most elegant possible solution, but at
the moment I cannot figure out another.)
HTH,
--
--------------------------------------------
Thomas Ruedas
Institute of Meteorology and Geophysics,
J.W. Goethe University Frankfurt/Main
Feldbergstrasse 47 D-60323 Frankfurt/Main, Germany
Phone:+49-(0)69-798-24949 Fax:+49-(0)69-798-23280
e-mail: ruedas@geophysik.uni-frankfurt.de
http://www.geophysik.uni-frankfurt.de/~ruedas/
--------------------------------------------
------------------------------
Date: 19 Mar 1999 21:29:33 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Finding the size of a scalar
Message-Id: <7cufjt$i0$1@gellyfish.btinternet.com>
On 19 Mar 1999 17:06:04 GMT Frank Hale wrote:
> Say I want to have a scalar that stores a string and I don't want it to
> be larger than 256kb how can I get the size of it to test for this?
>
The length() builtin will give the length of the string in characters -
however this is not really the same as the amount of memory that is being
used to store the scalar but with with a large string the difference will
be relatively insignificant I should imagine.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 19 Mar 1999 23:06:32 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: getting keys of hashes of hashes
Message-Id: <YLAI2.4086$DM5.1721@news.rdc1.ct.home.com>
dana watanabe <dwatanab@uci.edu> wrote in message
news:36F2CD4C.DEB51BD3@uci.edu...
: I'm trying to be incredibly lazy and avoid declaring (or 'my'ing)
variables
: for foreach statements by giving up on foreach altogether
: and just using for (which gives you $_ which is a lot less work to type
anyway)
:
: But i've created a hash of a hash of a hash and was wondering if i could
: 'for' through it.
:
: Three questions:
: Is this possible?
: Is this possible, but bad to do?
: Is using for instead of foreach bad?
:
Well, if you read perlsyn you will find:
"The foreach keyword is actually a synonym for the for keyword, so you can
use foreach for readability or for for brevity. "
So it don't make no nevermind.
HTH
AmD
------------------------------
Date: 19 Mar 1999 23:09:17 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: getting keys of hashes of hashes
Message-Id: <7culet$6vr$3@info2.uah.edu>
In article <36F2CD4C.DEB51BD3@uci.edu>,
dana watanabe <dwatanab@uci.edu> writes:
: I'm trying to be incredibly lazy and avoid declaring (or 'my'ing)
: variables for foreach statements by giving up on foreach altogether
: and just using for (which gives you $_ which is a lot less work to
: type anyway)
Although laziness is usually what drives us to program in the first
place, it is sometimes impossible to reconcile our laziness with what
it is we want to do.
: But i've created a hash of a hash of a hash and was wondering if i could
: 'for' through it.
Not the way you want to.
: Three questions:
: Is this possible?
See above.
: Is this possible, but bad to do?
No and irrelevant.
: Is using for instead of foreach bad?
It's bad when it stops you from doing what you want to do.
: for (keys %a) {
: for (keys %{$a{$_}}) {
: for (keys %{$a{???}{$_}}) { <--- what to do here?
: }
: }
: }
for my $k1 (keys %a) {
for my $k2 (keys %{ $a{$k1} }) {
for my $k3 (keys %{ $a{$k1}{$k2} }) {
print "$k1 $k2 $k3\n";
# and whatever else with the hash...
}
}
}
Although I suspect it might be a little quicker to say
while ( my($k1,$v1) = each %a ) {
while ( my($k2,$v2) = each %$v1 ) {
while ( my($k3,$v3) = each %$v2 ) {
print "$k1 $k2 $k3\n";
# and whatever else with %$v3...
}
}
}
There.. I typed it two ways for you. Cut and paste. :-)
Greg
--
A meeting is an event at which the minutes are kept and the hours are lost.
------------------------------
Date: 19 Mar 1999 21:23:01 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: GNUfind -mmin and find2perl.
Message-Id: <7cuf7l$ht$1@gellyfish.btinternet.com>
In comp.lang.perl.misc milburn@ltpmail.gsfc.nasa.gov wrote:
>
> Is there a way to modify find2perl to handle "-mmin" or does anyone
> know of another method I could use to accomplish this.
>
As you will have noticed find2perl doesnt support the -mmin -amin -cmin
arguments but for instance you could do -mmin 5 like:
sub wanted {
if( (time - (stat($_))[10]) < 300 )
{
print $_,"\n";
}
}
Well you see what I mean dont you :)
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Mar 1999 23:11:49 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: Help with Perl's multithread!!!
Message-Id: <7culjl$7fs$1@news.NERO.NET>
Phuong Le <ple@mitra.com> wrote:
: Hi
: I am having a problem with Perl's multithread and I hope that someone
: can help. First I would like to thank everyone in the newsgroup that
: are trying to help.
: Here my problem along with the perl code:
: I am trying to start up two threads namely $t1 and $t2 and both of them
: having access to the global variable $x which initialize to 0 at the
: beginning. Thread $t1 can only proceed iff $x is not 0. What I am
: trying to do is having thread $t1 wait on the variable $x and have
: thread $t2 set the variable $x to 1 and unblock thread $t1. The
: following is my code. Can somebody pointed out what I did wrong along
: with suggestions. Once again many thanks.
Well, a couple of things:
1) You lock $x then re-lock it while the original lock's still held. Don't
do that.
2) cond_wait re-aquires the lock when the condition's met. You don't need
to re-lock.
Dan
------------------------------
Date: Fri, 19 Mar 1999 23:07:41 -0000
From: "Global News" <japayne@technologist.com>
Subject: I/F with IBM's MQ Series
Message-Id: <7cule9$h4d$1@newnews.global.net.uk>
Hi
I'm new to PERL (Win32) and have been tasked to create in interface to IBM's
MQ Series Client messaging software.
Has anybody had any success in achieving this and if so, offer some
guidance?
Many thanks
Andrew
------------------------------
Date: Fri, 19 Mar 1999 15:09:55 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: inserting large numbers into databases
Message-Id: <36F2D943.E71664C3@mail.cor.epa.gov>
chortik@my-dejanews.com wrote:
>
> Is it possible to prevent perl from casting a 17 digit long string into a
> double before it is inserted into a database. the field in the database
> table is set to recieve a 17 character string, but perl casts it into a
> double, chopping off the least significat digit. is there a way around this?
>
> thanks in advance for the help.
If Perl is casting it as a number, then you must be telling Perl that's
how you want it - either implicitly or explicitly. If it's a string,
put quotes around it. And don't do something to re-convert it to a
number, like asking Perl to add 17 to it.
You're welcome,
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sat, 20 Mar 1999 02:19:45 +0300
From: "Michael Yevdokimov" <flanker@sonnet.ru>
Subject: Re: join lines from <textarea>
Message-Id: <7culv4$17q$1@bison.rosnet.ru>
Ok, but how to restore the text structure after using join() function??
--
Best wishes,
Michael Yevdokimov
Email: flanker@sonnet.ru
ICQ: 30874618
-------------------------------------------------
>> Developers Support Site <<
Web: http://developer.tsx.org
http://www.basicnet.sonnet.ru
-------------------------------------------------
brian d foy ohxer b qnnayemhh ...
>In article <7cu3u9$isb$1@bison.rosnet.ru>, "Michael Yevdokimov"
<flanker@sonnet.ru> posted:
>
>> My form has <textarea> (scrollable box).
>>
>> Script must join all lines from <textarea> into one line.. Note, that
when
>> I'll read this line again and show its content in 'text/html' it must be
>> shown as they were. For example, after joining I need to restore all
CRLFs
>> in the text...
>
>how about using the join() function?
>
>--
>brian d foy
>CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Sat, 20 Mar 1999 00:24:21 +0000
From: Elly <elly139@cableinet.co.uk>
Subject: passwords:crypts
Message-Id: <36F2EAB5.752C@cableinet.co.uk>
Hi
Can anyone help?
I have a db table with usernames and crypted passwords...and then a
webpage..which users can input their usernames and passwords...and I
have a script which should take the password from input form and crypt
is and compare with the password in db table using SQL statements...I
got it input password to crypt except, its different from the one in the
db table everytime I crypt it...I use SALT in it...but then ..that makes
all the input passwords crypts the same..so what am I doing wrong? how
should I crypt my db table passwords?
please email me...thanks...
Elly
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
True Love Never Runs Smooth
*****************************
------------------------------
Date: Fri, 19 Mar 1999 18:11:13 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Stewart Eastham <sme@planetpod.com>
Subject: Re: PERl and Server Side Includes
Message-Id: <36F2D991.5116245C@giss.nasa.gov>
[courtesy copy sent to cited author]
hi Stewart,
this isn't really a Perl question--it's more suited to
newsgroup comp.infosystems.www.authoring.*
But, I don't give a damn. So here goes:
Stewart Eastham wrote:
>
> <!--#exec cmd="helloworld.cgi"-->
You can supply command line arguments like so:
<!--#exec cmd="helloworld.cgi arg1 arg2" -->
and in <36EBC7EE.51969739@ngb.se>, Staffan Liljas scribbled:
>
> You can also use
>
> <!--#include virtual="scriptname.cgi?this=should&work=nicely" -->
This makes "this=should&work=nicely" available to "scriptname.cgi"
through the env. var. "QUERY_STRING". nice, neh?
Staffan went on to say these words:
>
> And I think you want to have a space before "-->". There might be a
> special setting you have to set in one of the Apache initialization
> files for this to work, but I'm not sure. Try.
Jay Glascoe
--
"The number of UNIX installations has grown to 10, with more expected."
--_The UNIX Programmer's Manual_, Second Edition, June, 1972.
------------------------------
Date: 20 Mar 1999 00:04:53 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: PERl and Server Side Includes
Message-Id: <7cuon5$5nn$3@client2.news.psi.net>
Stewart Eastham (sme@planetpod.com) wrote on MMXXVI September MCMXCIII in
<URL:news:36F2D358.158D1088@planetpod.com>:
() I am trying to call a PERL script through a Server Side Include on an
() HTML page. That part I have working fine. The next step is to have the
() Server Side Include pass parameters to the script when it invokes it.
() This I have not figured out how to do.
That's not a Perl problem, but an SSI one. Look in the manual of your
server whether the SSI implementation of your server even allows for
parameters; and if it does, how.
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
------------------------------
Date: Fri, 19 Mar 1999 19:23:34 +0000
From: Max Schubert <mschube@earthlink.net>
Subject: perl on OS390 / MVS ... anything to watch out for?
Message-Id: <Pine.LNX.3.96.990319191709.18354B-100000@mschube.earthlink.net>
Hi,
I may get the opportunity to do some perl development on an OS390
mainframe with perl and DBD::DB2 in the near future ... was just wondering
if anyone on this list has any words of wisdom / things to watch out for
from personal experiences with OS390 / DBD::DB2 ...
Thanks!
Max
------------------------------
Date: Sat, 20 Mar 1999 00:55:01 +0100
From: Thomas Ruedas <ruedas@geophysik.uni-frankfurt.de>
To: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Q: format and write
Message-Id: <36F2E3D5.59E2@geophysik.uni-frankfurt.de>
Thank you very much for your soon answer. Actually, the problem appeared
due to the format termination.
Let me point out, that I terminated the format with a space preceding
the dot because the perlform manpage warns that in mail sending a dot at
the very beginning of the line can cause problem; as I used formatted
output for the first time, I didn't expect that this would be a problem,
especially because I got no error message or warning when invoking the
script. BTW, I had tested it before with perl -cw; strict.pm is not
installed here, and I'm not the sysadmin :(
The other points you mentioned, are right, of course, but I don't expect
them to cause failures.
Thank you for pointing me to the regexp perl FAQ, that's very useful for
my purposes.
Best regards,
--
--------------------------------------------
Thomas Ruedas
Institute of Meteorology and Geophysics,
J.W. Goethe University Frankfurt/Main
Feldbergstrasse 47 D-60323 Frankfurt/Main, Germany
Phone:+49-(0)69-798-24949 Fax:+49-(0)69-798-23280
e-mail: ruedas@geophysik.uni-frankfurt.de
http://www.geophysik.uni-frankfurt.de/~ruedas/
--------------------------------------------
------------------------------
Date: Fri, 19 Mar 1999 17:45:30 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: bhaskaracharya@my-dejanews.com
Subject: Re: question....@ISA /my @ISA
Message-Id: <36F2D38A.F81E51B7@giss.nasa.gov>
bhaskaracharya@my-dejanews.com wrote:
>
> hi
>
> i have a simple package, i always get an error ISA not defined global package
> now error goes away if i define @ISA::A or my @ISA. But i don't seem to have
> error for other packages nor have i seen such behaviour?
"@ISA::A" is an array named "A" in package "ISA". You probably
have no such animal ;^) OTOH, declaring "my @ISA" makes the
array "@ISA" a lexical thingy in your package "A".
The lexical thingy is sad because he's invisible to other packages
[modules], a global "@ISA" is happy because he can be accessed by
"@A::ISA" from other modules. "@ISA" needs to be seen, by someone,
somewhere, because, technically speaking, it's "special".
(...ponder differences between "lexical" and "global" variables...)
hmm. Now, what you wanna do is this:
package A;
use strict;
use Exporter;
use vars qw(@ISA $VERSION @EXPORT @EXPORT_OK); # <-- this line
@ISA = qw(Exporter); "@ISA" is a package global
>
> Could somebody explain?
>
hmm. No.
Jay Glascoe
--
Narf!
------------------------------
Date: Sat, 20 Mar 1999 02:20:38 +0300
From: "Michael Yevdokimov" <flanker@sonnet.ru>
Subject: Re: Random for Hash
Message-Id: <7cum0r$17r$1@bison.rosnet.ru>
Thanks for help
--
Best wishes,
Michael Yevdokimov
Email: flanker@sonnet.ru
ICQ: 30874618
-------------------------------------------------
>> Developers Support Site <<
Web: http://developer.tsx.org
http://www.basicnet.sonnet.ru
-------------------------------------------------
Jay Glascoe ohxer b qnnayemhh <36EEC2F2.D67D933A@giss.nasa.gov> ...
>[courtesy copy of post sent to cited author]
>
>Michael Yevdokimov wrote:
>>
>> I have a hash:
>
>I have a rolling paper and matches ;^)
>
>> How to generate a random number which will be one of the listed keys in
>> hash? I.e. I need to choose a string value from hash by random method but
>> the generated key must be equal to one of the listed hash keys!
>
>my @keys = keys %hash;
>my $rand_key = $keys[int rand @keys]; # may need to call "srand()" first
>my $rand_val = $hash{$rand_key};
>
> Jay Glascoe
>--
>"They'll get my perl when they pry it
> from my cold, dead /usr/local/bin."
> --Randy Futor in
> <news:1992Sep13.175035.5623@tc.fluke.COM>
------------------------------
Date: Fri, 19 Mar 1999 19:23:28 -0500
From: James Tolley <jamesht@idt.net>
To: Michael Yevdokimov <flanker@sonnet.ru>
Subject: Re: Several lines into one
Message-Id: <36F2EA80.C0AD2581@idt.net>
>
> Script must join all lines from <textarea> into one line.. Note, that
> when
> I'll read this line again and show its content in 'text/html' it must
> be
> shown as they were. For example, after joining I need to restore all
> CRLFs
> in the text...
$text =~ s/\r\n\s+/\r\n /g; # to preserve (some) indentation.
$text =~ s/\r\n/<br>/g; # to preserve line breaks when displaying as
html.
That's it.
(by the way, you should be posting this to
'comp.infosystems.www.authoring.cgi'.)
hth
James
------------------------------
Date: Fri, 19 Mar 1999 23:11:54 -0000
From: "Kelsang Wangchuk" <wangchuk@bodhisattva.freeserve.co.uk>
Subject: Simple perl question
Message-Id: <7culi5$hsj$1@news4.svr.pol.co.uk>
Dear Perl peeps,
I started learning Perl about ten minutes ago using the Wall, Christiansen
and Randal text, and already have a question.
I understand that the line...
chop($number = <STDIN>);
...removes the carraige return from the input and places the number in
$number. To me, however, this does not seem intuitive: if this were a C
program, then the result of this line would certainly be CR-free, but since
the chop surrounds the assignment, the $number itself would still have a CR
attached to it. What's going on?
W
------------------------------
Date: Fri, 19 Mar 1999 18:41:56 -0500
From: MicroChip <nospam@hotmail.com>
Subject: Re: Simple perl question
Message-Id: <36F2E0C4.559E@hotmail.com>
In perl at least, chop() and other function act as both procedures (no
return value) or funtction(value returned).
In the case of your example.....
chop($number = <STDIN>); # chop applies the function to $number and
the return value is discarded.
is the same as
$number = chop(<STDIN>); # chop applies the function to what you type
and returns the input minus the newline.
Someone correct me if im wrong, I didnt experiment with it.
MC
Kelsang Wangchuk wrote:
>
> Dear Perl peeps,
>
> I started learning Perl about ten minutes ago using the Wall, Christiansen
> and Randal text, and already have a question.
>
> I understand that the line...
>
> chop($number = <STDIN>);
>
> ...removes the carraige return from the input and places the number in
> $number. To me, however, this does not seem intuitive: if this were a C
> program, then the result of this line would certainly be CR-free, but since
> the chop surrounds the assignment, the $number itself would still have a CR
> attached to it. What's going on?
>
> W
------------------------------
Date: Sat, 20 Mar 1999 01:47:38 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: Simple perl question
Message-Id: <36F2F02A.2551727D@math.uio.no>
MicroChip wrote:
>
> In perl at least, chop() and other function act as both procedures
> (no return value) or funtction(value returned).
No return value? You haven't read the documentation, have you?
perldoc -f chop
chop VARIABLE
chop LIST
chop Chops off the last character of a string and returns the
character chopped. (...)
> In the case of your example.....
>
> chop($number = <STDIN>); # chop applies the function to $number and
> # the return value is discarded.
>
> is the same as
>
> $number = chop(<STDIN>); # chop applies the function to what you type
> # and returns the input minus the newline.
No, it's not the same, and no, it does not return the input minus
the newline.
c:\>echo foo | perl -we "$number = chop(<STDIN>);"
Can't modify <HANDLE> in chop at -e line 1, near "<STDIN>)"
Execution of -e aborted due to compilation errors.
> Someone correct me if im wrong, I didnt experiment with it.
I figured. :-)
Peter
--
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam
------------------------------
Date: Fri, 19 Mar 1999 23:49:25 GMT
From: timr@probo.com (Tim Roberts)
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <36f2dfc1.176003500@news.teleport.com>
(Note: I have removed comp.lang.tcl and comp.lang.python from the crosspost
list because of legitimate complaints from their denizens.)
tng@sosweb.net.nospam wrote:
>On Wed, 17 Mar 1999 10:20:04 -0700, "Michael Barnes"
><barnesm@cain-travel.com> wrote:
>>Every MODEM has a MAC address also...so your friends pc is nicless, but not
>>macless
>
>true. but. MAC addresses on your modem go no further than your isp.
>in fact, your isp doesn't even use your modems mac address because you
>are assigned an ip addres that already has the mac address of the
>modem you connected to so yours never goes out into the net.
You say "true", but I think you are mistaken. What makes you think modems
have MAC addresses? When I dial my ISP, there isn't any specific
identification of my specific modem. There isn't any need for it: it is a
point-to-point connection. The other end knows how to address me because I
am the only device on the other end of the connection.
A MAC address is an Ethernet thing: it represents addressing on the
physical layer of Ethernet. It is not part of TCP, nor IP, nor PPP. It is
only needed on a device communicating over Ethernet (or an Ethernet
derivative). Modems do not do so, and thus do not have MAC addresses.
>your network also has a mac address.
No. Your network ADAPTER has a MAC address. Your network ROUTER has a MAC
address. Not your network.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5183
**************************************