[10648] in Perl-Users-Digest
Perl-Users Digest, Issue: 4240 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 17 14:07:15 1998
Date: Tue, 17 Nov 98 11:00:22 -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, 17 Nov 1998 Volume: 8 Number: 4240
Today's topics:
Re: a problem (Larry Rosler)
Re: attaching a jpeg <gary.ennis@strath.ac.uk>
Re: Automatically identifying the website user in HTML, <roger@nospam.nationwideisp.net>
Re: CGI database? (zentara)
cgi-lib.pl for file upload <mikej@1185design.com>
Cwd module <ktlb@accessv.com>
DBM - I just don't get it?? (Burt Lewis)
Re: DBM - I just don't get it?? <Allan@due.net>
Re: DBM - I just don't get it?? <ludlow@us.ibm.com>
File downloading <ktlb@accessv.com>
HELP !Displaying images through ODBC from databases oricum@hotmail.com
HELP !Displaying images through ODBC from databases oricum@hotmail.com
Re: how to get `date` in perl for win32 (newbie) <webmaster@bpaserver.net>
Re: iis 4 problem with perl .... <rliu2@ford.com>
Re: Intermediate Perl questions (Greg Ward)
Re: Intermediate Perl questions <perlguy@technologist.com>
Re: Intermediate Perl questions (Larry Rosler)
Re: Intermediate Perl questions <m.kaiser@sz-sb.de>
Re: Intermediate Perl questions <r28629@email.sps.mot.com>
Re: Linux: Help reading from serial port <rootbeer@teleport.com>
Re: Passing value to shell script <bill@fccj.org>
perl help files (Allen Septon)
Re: Perl vs C (Ben Coleman)
Re: Perl Win32, finding all drives, need help (Larry Rosler)
Re: qq|, " and ' (Greg Ward)
Re: qq|, " and ' (Larry Rosler)
Seeking Perl/CGI programmer in Northern Colorado (Joseph A. DiVerdi, Ph.D.)
Re: test for.t failure due to bad rounding <rootbeer@teleport.com>
Re: using "format" instruction. (Greg Ward)
Re: Wanted: Development Partner <bill@fccj.org>
Re: Zombie process <rootbeer@teleport.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Nov 1998 09:19:32 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: a problem
Message-Id: <MPG.10bb4ff9f403e85989913@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <3651a77d.4816695@news.online.ee> on Tue, 17 Nov 1998
16:43:58 GMT, _cim_ <cim@online.ee> says...
> how can i see if all elements in an array match a certain criteria
> (eg. < 0) and if they do print something.
Two answers.
The more concise (but less efficient, because every element of the array
is examined even if the first element fails to match the criterion):
print 'something' unless grep $_ >= 0, @array;
The more efficient:
my $match = 1;
foreach (@array) {
next if $_ < 0;
$match = 0;
last;
}
print 'something' if $match;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 17 Nov 1998 17:14:48 +0000
From: Gareth Ennis <gary.ennis@strath.ac.uk>
Subject: Re: attaching a jpeg
Message-Id: <3651AF08.1CFB@strath.ac.uk>
Martien Verbruggen wrote:
> - Never pass strings to a shell unless you know absolutely certain
> that there's no problematic character in them.
>
> In the case of sendmail, you just call it with the -t flag. ....
Thanks for all the advice guys.... ive since changed my scripts to use
'sendmail' with the -t flag.....
Is this really That much safer????
--
Gareth Ennis
ABACUS - Strathclyde University
email: gary.ennis@strath.ac.uk
http://iris.abacus.strath.ac.uk/new/
------------------------------
Date: Tue, 17 Nov 1998 18:19:18 +0000
From: Roger <roger@nospam.nationwideisp.net>
Subject: Re: Automatically identifying the website user in HTML, Javascript, Java, or Perl?
Message-Id: <3651BE26.FB02E084@nospam.nationwideisp.net>
You can get their IP address using JavaScript. Not a lot of use for
ISPs that allocate IP addresses dynamically, though. Otherwise it's the
dreaded cookies, as the other posts have explained.
Bill Chapman wrote:
>
> I am writing a club website.
> I want each user to have customizations kept separately, I think
> logging in every time would be far too cumbersome. I have seen some
> sites, such as www.snap.com, that identify who you are without an
> explicit login.
> I am trying to figure out how to find out these things while the
> user is running my web site so I don't have to ask him who he is.
> Can one get the user's reply e-mail address using HTML, Javascript,
> Java, or Perl? Anyone know of any way? Is there other information we
> are privy to (to
> check against people changing their reply-to to prentend to be someone
> else).
> Any additional information that you could tell me how to gather
> would be most useful.
>
> If it's not too much trouble, please cc my e-mail. Thanks!
>
> Bill Chapman
------------------------------
Date: Tue, 17 Nov 1998 18:25:37 GMT
From: zentara@mindspring.com (zentara)
Subject: Re: CGI database?
Message-Id: <3658bf35.8685925@nntp.mindspring.com>
On Tue, 27 Oct 1998 15:17:45 GMT, Brent Michalski
<perlguy@technologist.com> wrote:
>William wrote:
>>
>> Dear All
>>
>> How can I write a CGI database?
>By writing the code to do what you want!
>
>> Which language can I use?(Perl, C++, Visual Basic,etc.)
>Any of the above.
>
>I use Perl. I already wrote one and you can have it for free! It is
>at:
>http://webreview.com/wr/pub/98/10/23/perl/index.html
>
>Have fun with it!
>Brent
Hey, I just looked at this database of yours. It is a really well done
tutorial on perl databases.
Thanks for the nice code comments and explanations.
------------------------------
Date: Tue, 17 Nov 1998 10:29:35 -0800
From: mikej <mikej@1185design.com>
Subject: cgi-lib.pl for file upload
Message-Id: <3651C089.8D61A2DD@1185design.com>
Hi All,
Im using cgi-lib to upload files and it works great on a Mac, but when I
try it out on a Windows machine it will upload the file along with the
full path of the file on the machine, instead of just giving me the name
of the file by itself. For example if I uploaded a file on the Mac named
"image.gif", the variable $cgi_cfn{'upfile1'} would have "image.gif" as
its value, and upload the image with that name. But on a Windows
machine, with the same graphic, it would upload the file as something
like "C: \images\image.gif" for the name of the file. How can I get it
to upload the files without the full pathnames, or chop off the pathname
like it does with mac files?
Thanks in advance!
-Mike
------------------------------
Date: Tue, 17 Nov 1998 17:45:32 GMT
From: Ken Tang <ktlb@accessv.com>
Subject: Cwd module
Message-Id: <3651B488.E35A88CA@accessv.com>
Hi,
Is it possible that the Cwd module or function is disabled or not
available
on certain ISP servers. When I use "use Cwd():" the program seems to
terminate abnormally.
TIA
K.T.
------------------------------
Date: 17 Nov 1998 17:25:30 GMT
From: burt@ici.net (Burt Lewis)
Subject: DBM - I just don't get it??
Message-Id: <72sbia$mtf$1@bashir.ici.net>
Hi,
Maybe I'm trying to do too much with this but I thought this was an easy way to
work with databases. I've read all the chapters and examples and still can't
get to square one. This is what I thought I could do:
I have a small sample data file like this:
Tom apples pears grapes oranges
Joe sticks stones nuts forks
Mary red brown green yellow
I'm looking for a simple example that would let me add change and delete fields
and records.
Do I need to first convert my text file to a DBM file and how?
I have Learning Perl, Programming Perl and Perl For Dummies, yet I'm still
having trouble finding a simple plain English example.
Any ideas, help or suggestions would be appreciated.
Thanks!
Burt Lewis
------------------------------
Date: Tue, 17 Nov 1998 12:59:15 -0500
From: "AmD" <Allan@due.net>
Subject: Re: DBM - I just don't get it??
Message-Id: <72sd95$6hg$1@samsara0.mindspring.com>
Burt Lewis wrote in message <72sbia$mtf$1@bashir.ici.net>...
>Hi,
>
>Maybe I'm trying to do too much with this but I thought this was an easy
way to
>work with databases. I've read all the chapters and examples and still
can't
>get to square one. This is what I thought I could do:
>
>I have a small sample data file like this:
>
>Tom apples pears grapes oranges
>Joe sticks stones nuts forks
>Mary red brown green yellow
>
>I'm looking for a simple example that would let me add change and delete
fields
>and records.
>Do I need to first convert my text file to a DBM file and how?
>I have Learning Perl, Programming Perl and Perl For Dummies, yet I'm still
>having trouble finding a simple plain English example.
Get thee to:
http://webreview.com/wr/pub/at/Script_of_the_Week
see:
A Complete Database Application in Perl
by Brent Michalski Oct. 9, 1998
All will be made clear.
AmD
[cc to author as a courtesy]
------------------------------
Date: Tue, 17 Nov 1998 12:44:10 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: DBM - I just don't get it??
Message-Id: <3651C3FA.F9C75ED1@us.ibm.com>
Burt Lewis wrote:
> I'm looking for a simple example that would let me add change and delete fields
> and records.
You didn't say what you were having trouble with. Opening the file?
Reading in the data? Finding individual records? Perhaps if you posted
a small piece of the code that you do have, we could be of more help.
> I have Learning Perl, Programming Perl and Perl For Dummies, yet I'm still
> having trouble finding a simple plain English example.
Since you already own Learning Perl, I'd suggest going through that book
and working through every example until you understand what each program
is doing, and how it's doing it. If you do that, you'll be able to
solve problems like the one you posted with no trouble at all.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Tue, 17 Nov 1998 17:54:56 GMT
From: Ken Tang <ktlb@accessv.com>
Subject: File downloading
Message-Id: <3651B6BC.C9D17FFF@accessv.com>
Hi,
I'm trying to set up a secure file download site using Perl.
I can set up a form which will have links to download each file,
and have the files fed via a small perl program. However the
filename sent to the browser for saving the file to be downloaded
becomes the name of the script instead of the name of the file.
Is there a way around this without revealing the URL of the actual file?
TIA.
K.T.
------------------------------
Date: Tue, 17 Nov 1998 16:47:22 GMT
From: oricum@hotmail.com
Subject: HELP !Displaying images through ODBC from databases
Message-Id: <72s9aq$cb$1@nnrp1.dejanews.com>
HEllo !
I'm trying to write a perl cgi script for displaying a image field from a
database .I'm using Win32::ODBC from www.roth.com and Perl5 for Wni32
I'm using a Access database with a OLE type "column" in order to store the
image.When I fetch the data from the table , , the subroutine returns"no more
records" even if I 'm having data in the table !!!
sub getData
{
$sql = "SELECT * FROM customer;";
$dsn = "sql422";
$db = new Win32::ODBC($dsn); $db->Sql($sql); while ($db->FetchRow()) {
(@picture, $name, $city , $city) = $db->Data("picture", "name" , "city");
#here will come outputing the results } $db->close; I can't find a example
which deals with image data type (i've seen plenty with "normal" data types
:characters , numbers etc;).I've downloaded examples from
http://multiweb.lib.calpoly.edu/odbc/
Any help is appreciated !
Should I use another type of database in order to use Roth's ODBC ?
Thanks in advance
Adrian Sorescu
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 17 Nov 1998 16:48:19 GMT
From: oricum@hotmail.com
Subject: HELP !Displaying images through ODBC from databases
Message-Id: <72s9cj$dm$1@nnrp1.dejanews.com>
HEllo !
I'm trying to write a perl cgi script for displaying a image field from a
database .I'm using Win32::ODBC from www.roth.com and Perl5 for Wni32
I'm using a Access database with a OLE type "column" in order to store the
image.When I fetch the data from the table , , the subroutine returns"no more
records" even if I 'm having data in the table !!!
sub getData
{
$sql = "SELECT * FROM customer;";
$dsn = "sql422";
$db = new Win32::ODBC($dsn); $db->Sql($sql); while ($db->FetchRow()) {
(@picture, $name, $city , $city) = $db->Data("picture", "name" , "city");
#here will come outputing the results } $db->close; I can't find a example
which deals with image data type (i've seen plenty with "normal" data types
:characters , numbers etc;).I've downloaded examples from
http://multiweb.lib.calpoly.edu/odbc/
Any help is appreciated !
Should I use another type of database in order to use Roth's ODBC ?
Thanks in advance
Adrian Sorescu
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 17 Nov 1998 18:08:28 +0100
From: Marius Schaefer <webmaster@bpaserver.net>
Subject: Re: how to get `date` in perl for win32 (newbie)
Message-Id: <3651AD8C.2BF0D7A0@bpaserver.net>
Hi,
j9feng@my-dejanews.com wrote:
> The following codes work fine under linux,
>
> my $date=`date`;
try
($sec,$min,$hour,$mday,$mon,$year) = (localtime())[0,1,2,3,4,5];
++$mon;
if (length($hour) == 1) { $hour = "0" . "$hour"; }
if (length($min) == 1) { $min = "0" . "$min"; }
if (length($sec) == 1) { $sec = "0" . "$sec"; }
if (length($mday) == 1) { $mday = "0" . "$mday"; }
if (length($mon) == 1) { $mon = "0" . "$mon"; }
> Is there a way to get the current date?
>
> thanks in advance
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
Mit freundlichen Gr|_en
Marius Schdfer
schaefer@bpaserver.net
black point arts
soft- & webservice
http://www.bpaserver.net
eschersheimer landstr. 471
60431 frankfurt
tel. 069-952-181-50
fax. 069-952-181-41
------------------------------
Date: Tue, 17 Nov 1998 13:07:29 -0500
From: Roger Liu <rliu2@ford.com>
To: Adam Carden <adam@2kmedia.co.uk>
Subject: Re: iis 4 problem with perl ....
Message-Id: <3651BB60.199B371A@ford.com>
> >#! c:\perl\bin\perl
print "Content-type: text/html\n\n";
>
> >
> >print "<meta http-equiv='Content-Type' content='text/html;
> >charset=windows-1253'>\n";
Roger
------------------------------
Date: 17 Nov 1998 17:26:16 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Intermediate Perl questions
Message-Id: <72sbjo$d2m$2@news0-alterdial.uu.net>
On Tue, 17 Nov 1998 16:48:20 +0100, Markus Kaiser <m.kaiser@sz-sb.de> wrote:
>looking 4 a efficient way to look at each char of a string.
>At the moment I'm using substr( $_, -1, 1 ) in a while loop
>and of course regexp would be possible too.
>But I'm curious: Is there a better (means faster) way ?
Not really. The tr///, m//, and s///, split, and join operators are the
main ways to hack up strings in Perl. If you absolutely positively need
to look at each character, and are really concerned about performance,
you're probably better off writing it in C -- and that opens up a whole
new can of worms. It's usually easier to scratch your head and think
hard until you figure out how to do it with the pattern-matching
operators.
>Another issue occured some days ago: How do I break out of
>a "do { ... } while( ... );" construction. Could'nt find a solution using
>'next' or 'last'.
'next' or 'last' should do what you need. It might help if you showed a
snippet (10 lines or less) of code, explained what you expected and what
actually happened -- then someone can help.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Tue, 17 Nov 1998 17:18:38 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Intermediate Perl questions
Message-Id: <3651AFEE.D51DF040@technologist.com>
Markus Kaiser wrote:
> looking 4 a efficient way to look at each char of a string.
> At the moment I'm using substr( $_, -1, 1 ) in a while loop
> and of course regexp would be possible too.
> But I'm curious: Is there a better (means faster) way ?
Try something like:
$string = "Brent Michalski";
@chars = split(//,$string);
Then all of the characters are stored in the array @chars. Then they
are easy to access.
> Another issue occured some days ago: How do I break out of
> a "do { ... } while( ... );" construction. Could'nt find a solution using
> 'next' or 'last'.
I know I'll be corrected if I am wrong, but why not do something like
this:
LABEL: while (something){
code, code, code...
last LABEL if(something else);
}
HTH,
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Tue, 17 Nov 1998 10:18:52 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Intermediate Perl questions
Message-Id: <MPG.10bb5de5a573e8ca989878@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <72sbjo$d2m$2@news0-alterdial.uu.net> on 17 Nov 1998 17:26:16
GMT, Greg Ward <gward@thrak.cnri.reston.va.us> says...
...
> >Another issue occured some days ago: How do I break out of
> >a "do { ... } while( ... );" construction. Could'nt find a solution using
> >'next' or 'last'.
>
> 'next' or 'last' should do what you need.
No, they won't, without special pleading. The following is from
perlsyn:
do {
$line = <STDIN>;
...
} until $line eq ".\n";
See *do*. Note also that the loop control statements described later
will NOT work in this construct, because modifiers don't take loop
labels. Sorry. You can always put another block inside of it (for next)
or around it (for last) to do that sort of thing. For next, just double
the braces:
do {{
next if $x == $y;
# do something here
}} until $x++ > $z;
For last, you have to be more elaborate:
LOOP: {
do {
last if $x = $y**2;
# do something here
} while $x++ <= $z;
}
...
Basic BLOCKs and Switch Statements
A BLOCK by itself (labeled or not) is semantically equivalent to a loop
that executes once. Thus you can use any of the loop control statements
in it to leave or restart the block. (Note that this is NOT true in
eval{}, sub{}, or contrary to popular belief do{} blocks, which do NOT
count as loops.)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 17 Nov 1998 19:10:54 +0100
From: "Markus Kaiser" <m.kaiser@sz-sb.de>
Subject: Re: Intermediate Perl questions
Message-Id: <72se7m$e4n$1@hades.rz.uni-sb.de>
| > Another issue occured some days ago: How do I break out of
| > a "do { ... } while( ... );" construction. Could'nt find a solution
using
| > 'next' or 'last'.
|
|LABEL: while (something){
| code, code, code...
| last LABEL if(something else);
|}
Hi Brent,
thx a lot for your help. Below a snippet of my code
to explain the do...while loop topic.
BTW, is '$text eq "\x11"' the same as '$text == 0x11'?
Markus
-- snip --
$line = <FH>;
...
do
{
last if( $line eq "\x11" ); # <-- does'nt work
# some lines of perl code
# deleted.
} while( defined($line = <FH>) );
------------------------------
Date: Tue, 17 Nov 1998 12:26:10 -0600
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Intermediate Perl questions
Message-Id: <3651BFC2.9759C933@email.sps.mot.com>
Brent Michalski wrote:
>
> Markus Kaiser wrote:
> > looking 4 a efficient way to look at each char of a string.
> > At the moment I'm using substr( $_, -1, 1 ) in a while loop
> > and of course regexp would be possible too.
> > But I'm curious: Is there a better (means faster) way ?
>
> Try something like:
> $string = "Brent Michalski";
> @chars = split(//,$string);
>
> Then all of the characters are stored in the array @chars. Then they
> are easy to access.
if the whole purpose was (at statement in the original post) to "look at
each char of a string", the using substr() should be more efficient
(speed and space) then split(). Of cause should a matter of style and
the performance might be the comparable if the string is small.
#!/usr/local/bin/perl -w
use Benchmark;
$string = '0123456789' x 20;
timethese (1000, {
by_split => sub {
$sum1 = 0;
@ch = split //, $string;
foreach (@ch) {
$sum1 += $_;
}
},
by_substr => sub {
$sum = 0;
$len = length $string;
for ($i=0; $i < $len; $i++) {
$sum += substr ($string, $i, 1);
}
},
}
);
Benchmark: timing 1000 iterations of by_split, by_substr...
by_split: 4 wallclock secs ( 4.51 usr + 0.00 sys = 4.51 CPU)
by_substr: 4 wallclock secs ( 3.47 usr + 0.00 sys = 3.47 CPU)
> > Another issue occured some days ago: How do I break out of
> > a "do { ... } while( ... );" construction. Could'nt find a solution using
> > 'next' or 'last'.
>
> I know I'll be corrected if I am wrong, but why not do something like
> this:
>
> LABEL: while (something){
> code, code, code...
> last LABEL if(something else);
> }
the problem with while{} is that you usually need to 'precondition'
before entering the while{} loop, which sometime make more awkward to
implement. And again, it is just a matter of style.
-TK
------------------------------
Date: Tue, 17 Nov 1998 18:55:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Linux: Help reading from serial port
Message-Id: <Pine.GSO.4.02A.9811171055060.27321-100000@user2.teleport.com>
On 17 Nov 1998, Jere Julian - Personal Account wrote:
> while (<CDR> && $count < 100) { # Only get 100 records for debugging.
Did you mean to throw away one line from CDR here? :-) Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 17 Nov 1998 13:05:12 -0500
From: Bill Jones <bill@fccj.org>
Subject: Re: Passing value to shell script
Message-Id: <3651BAD3.AA8C34C0@fccj.org>
Sebastiaan van Dijk wrote:
>
> Hi,
>
> Perhaps a stupid question, but is it possible to pass a value from a
> perl script to a shell script
>
> ksh:
> value=`perl script.pl`
>
> Does anybody know how this can be done? The 'exit' does not do the
> job.
>
> Thanx in advance,
>
> Sebastiaan van Dijk
>From perl to shell or vice-versa?
Isn't this a FAQ ?
In perl to shell, it's sort of like -
my $value = "stuff";
`find . -name $value -print`;
Is that what you mean? Or maybe you wanted -
http://www.perl.com/CPAN-local/doc/manual/html/pod/perlfaq8.html#How_can_I_convert_my_shell_scrip
HTH,
-Sneex- :]
------------------------------
Date: Tue, 17 Nov 1998 18:16:25 GMT
From: ah950@torfree.net (Allen Septon)
Subject: perl help files
Message-Id: <F2Kw3D.CL0.0.queen@torfree.net>
Hi,
Is there a web site with PERL help in Windows Help format that is
downloadable ?
Please respond via email.
Thanks
Allen
--
Allen Septon
Toronto Freenet
ah950
------------------------------
Date: Tue, 17 Nov 1998 17:57:43 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: Perl vs C
Message-Id: <3651b8f8.104049995@news.mindspring.com>
On Tue, 17 Nov 1998 13:55:28 GMT, nvp@shore.net (Nathan V. Patwardhan)
wrote:
>I'm sure that Hilter could've taken every last square mile of Europe
>and maybe even Asia by the time this thread will have come to an end.
Who's this Hilter fella?
Ben
--
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA
------------------------------
Date: Tue, 17 Nov 1998 10:02:28 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl Win32, finding all drives, need help
Message-Id: <MPG.10bb5a0efdfcb69a989876@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <365155B7.392BC376@gfc-net.de> on Tue, 17 Nov 1998 11:53:43
+0100, J|rgen Ibelgaufts <ibelgaufts@gfc-net.de> says...
...
> how can i find all valid drive letters with perl on win-nt (using GS perl 5.005)?
#!perl -w
use strict;
foreach ( 'A' .. 'Z' ) { -e "$_:/" and print "$_ exists.\n"; }
__END__
If all you want is the list, you can do this:
my @drives = grep -e "$_:/", 'A' .. 'Z';
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 17 Nov 1998 17:23:03 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: qq|, " and '
Message-Id: <72sbdn$d2m$1@news0-alterdial.uu.net>
>I know this question is way offtopic here and I am sorry, but I do not know
>the english word for thos things ( " and ' )
They're generally called quotes, or quotation markers, or something like
that. ' is also called apostrophe, but not often in a programming
context. (That's because it's usually used for quoting strings, but not
always -- see Perl4, MATLAB for example.)
>Would anyone know how to place something like this:
>
><A HREF="javascript:action('home')"
>onmouseover="glow('home','on');window.status='Home';"
>onmouseout="glow('home','of');window.status='';"><IMG
>SRC="../images/home3.gif" NAME="home" NOSAVE BORDER=0 ></A>
>
>in a variable??? Like I want DW$ to contain this sentence, then
>document.write(DW$) using javascript.....
(I think you mean $DW, not DW$ -- this is Perl, not BASIC.)
Well, there are five basic ways to quote a string in Perl: ' " q qq and <<.
The first two aren't really an option here, because you'd have to
sprinkle your string liberally with backslashes. The q and qq operators
are really cool, because you can take your pick of delimiters (as long
as you can find a one-character, non-alphanumeric delimiter). For
instance, a short stretch of hairy HTML/Javascript might be quoted
as follows
$hairy = q+<A HREF="javascript:action('home')"+
where the delimiter is +. Of course, if your quoted code includes a +
character, you'll have to pick a different delimiter. You could easily
do this for a long string like your example, but the readability is less
than ideal, and the chances of picking a bad delimiter increase linearly
with the size of the string. What you want is a "here document"
(borrowed from the Unix shell):
$very_hairy = <<JUNK;
<A HREF="javascript:action('home')"
onmouseover="glow('home','on');window.status='Home';"
onmouseout="glow('home','of');window.status='';"><IMG
SRC="../images/home3.gif" NAME="home" NOSAVE BORDER=0 ></A>
JUNK
Here, the delimiter 'JUNK' is an arbitrary string -- so you can pick
whatever you like, as long as it doesn't occur at the beginning of
a line in your quoted string. Note that here documents are very
whitespace sensitive -- don't have *anything* else on the stop-line
with JUNK, and you'll be fine.
See the perlop man page for details on quoting operators (' " q qq) --
look for 'Quote and Quote-like Operators'. Here documents should be
covered there too, and you'll also find everything you need to know in
the Camel Book.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Tue, 17 Nov 1998 10:10:40 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: qq|, " and '
Message-Id: <MPG.10bb5bf9319c4be0989877@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <72sbdn$d2m$1@news0-alterdial.uu.net> on 17 Nov 1998 17:23:03
GMT, Greg Ward <gward@thrak.cnri.reston.va.us> says...
...
> The q and qq operators
> are really cool, because you can take your pick of delimiters (as long
> as you can find a one-character, non-alphanumeric delimiter). For
> instance, a short stretch of hairy HTML/Javascript might be quoted
> as follows
>
> $hairy = q+<A HREF="javascript:action('home')"+
>
> where the delimiter is +. Of course, if your quoted code includes a +
> character, you'll have to pick a different delimiter. You could easily
> do this for a long string like your example, but the readability is less
> than ideal, and the chances of picking a bad delimiter increase linearly
> with the size of the string. ...
You have omitted the possibility of using matched brackets -- (), {},
<>, [] -- as delimiters, which will work unless the quoted string has
unmatched brackets of the same kind. Thus all except <> would be OK in
your example.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 17 Nov 1998 11:10:46 -0700
From: diverdi@XTRsystems.com (Joseph A. DiVerdi, Ph.D.)
Subject: Seeking Perl/CGI programmer in Northern Colorado
Message-Id: <diverdi-1711981110460001@weena.xtrsystems.com>
Seeking Perl/CGI programmer in Northern Colorado
XTR Systems is seeking a highly motivated and creative programmer of
Perl/CGI applications with a B.S. in computer science or other related
field. Strong structured programming skills and habits are required. A
strong documented record of success in Perl programming are a plus but not
required. Applicants should also possess excellent interpersonal and
communications skills, and the ability to function well with a small,
highly professional, and entrepreneurial team.
Responsibilities for the position include the development, maintenance,
and support of natural language information processing CGI engines, site
traffic analysis engines, and site maintenance tools. Adherence to modern
programming standards is an absolute requirement of all work.
Additionally, the successful candidate in expected to make significant
conceptual and intellectual contributions to XTR's growing EduSpace (TM)
project.
It is preferred that the position is filled by an full time, in-house
candidate. However, strong applicants who wish to operate on an outside
contract basis will also be considered.
The successful candidate will be offered a competitive compensation
package, optionally including equity participation.
XTR Systems is a founding stage firm, located in Fort Collins, CO, which
develops and markets internet-delivered educational tools and is committed
to an exciting team environment emphasizing personal challenge and
achievement together with professional career development.
Qualified applicants should send a brief statement of interest and resume
to the address given below. PDF formatted documents are appreciated but
other popular formats are acceptable. Please be prepared to provide the
names of two professional references.
To ensure full consideration, applications should be received by 15
December 1998.
XTR Systems is an Equal Employment Opportunity employer and does not
discriminate against persons on the basis of race, religion, national
origin, sexual orientation, gender, marital status, age, or disability.
All resumes will be held in confidence.
--
Joseph A. DiVerdi, Ph.D. 970.221.3982 (voice)
diverdi@XTRrsystems.com (email) 970.224.3723 (fax)
http://www.XTRsystems.com
------------------------------
Date: Tue, 17 Nov 1998 18:10:06 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: test for.t failure due to bad rounding
Message-Id: <Pine.GSO.4.02A.9811170852420.27321-100000@user2.teleport.com>
On Tue, 17 Nov 1998 everybodydies@my-dejanews.com wrote:
> thanks for the test code, tom. it says it's a problem with the
> stringification. what file/function is that happening in (i've never
> walked through any of the perl sources before, but i'm more than comfy
> digging in a debugger)?
Well, _if_ my test code was correct and the problem really is the
stringification, I _think_ that's always done by your system's library
routines. (Gconvert, gcvt, or sprintf, I believe.) I don't know as much as
I'd like to know about Perl's internals. So, either those library routines
are buggy, or Perl is calling them incorrectly, I think.
Check to see what Configure is doing about "how to convert floats to
strings". (Search for that text.) It may be getting the wrong idea on your
system. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 17 Nov 1998 17:28:33 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: using "format" instruction.
Message-Id: <72sbo1$d2m$3@news0-alterdial.uu.net>
On Tue, 17 Nov 1998 17:06:52 +0100, Serge <klootch@wanadoo.fr> wrote:
>I need to modify the folowing loop ( This is part of Formmail program)
>
> foreach $value (keys %FORM) {
> # Print the name and value pairs in FORM array to html.
> print MAIL "$value: $FORM{$value}\n\n";
> }
>
>The output of this give a very bad looking (format is text).
>Because the size of name and size of value are very diffirent.
>I've tried to introduce some tabs \t\t\t, looks little better.
You *can* do it with Perl's formatting stuff, but it's pretty ugly. I'd
look into the Text::Wrap module -- it's included with Perl, and does
exactly what you want.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Tue, 17 Nov 1998 13:10:34 -0500
From: Bill Jones <bill@fccj.org>
Subject: Re: Wanted: Development Partner
Message-Id: <3651BC13.CB9BC6AF@fccj.org>
Adam Turoff wrote:
>
> Ethan H. Poole <ehpoole@ingress.com> wrote:
> >I'm a little concerned about this 'accidental' loss of a Perl developer. I
> >mean, like, was he/she struck down by lightning while attempting to maintain
> >one of those scripts? ;-)
>
> I'm a little concered about why they want to take '100+ well documented
> Perl5 scripts' and turn them into 'Java/SQL/CORBA'. :-)
>
> Z.
THAT'S prolly what 'killed' him! Couldn't stand
to see his work go down the drain...
:]
-Sneex-
------------------------------
Date: Tue, 17 Nov 1998 18:58:08 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Zombie process
Message-Id: <Pine.GSO.4.02A.9811171057090.27321-100000@user2.teleport.com>
On Tue, 17 Nov 1998, marcelschmidt wrote:
> Subject: Zombie process
Have you seen what the FAQ says in section eight about zombie processes?
> open(TEMP,$file);
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4240
**************************************