[9227] in Perl-Users-Digest
Perl-Users Digest, Issue: 2822 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 9 14:08:30 1998
Date: Tue, 9 Jun 98 11:00:44 -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, 9 Jun 1998 Volume: 8 Number: 2822
Today's topics:
Re: Am I looking at an anonymous array (Kevin Reid)
Associative Array Keys - Names <intern.bill.goerlich@bentley.com>
Re: Associative Array Keys - Names (Andrew E Page)
Re: Associative Array Keys - Names <tchrist@mox.perl.com>
Re: Associative Array Keys - Names (Kevin Reid)
Re: Comm.pl (Tom Harrington)
Re: Date Manipulation (Larry Rosler)
Re: How to create a file... <steph@hotkey.net.au>
how would i automaticly post email messages to a newsgr <khemani@javacomponents.com>
Re: I'm having problems: (Kevin Reid)
Re: lambda fun in Perl (Kevin Reid)
Latest Perl on Slakeware 2.0.33 <emccoy@tra.com>
mailspinner.cgi redpeppa@my-dejanews.com
Re: McCabe complexity analysis (Abigail)
Re: passing multiple hashes and keeping them seperate? <tchrist@mox.perl.com>
Re: passing multiple hashes and keeping them seperate? (Mike Stok)
Re: Perl Books? (Mike Stok)
Perl for Win32 <achowd01@cs.fiu.edu>
Re: print with << <thanh.d.hoang@boeing.com>
Re: Reading a file from the bottom up <rootbeer@teleport.com>
Re: Reading Directories <aqumsieh@matrox.com>
Return cell contents to HTML dropdown menu <hannum@oak.cat.ohiou.edu>
Re: Return characters from a string (Abigail)
Re: Return characters from a string <rootbeer@teleport.com>
Re: Return characters from a string <quednauf@nortel.co.uk>
Re: Return characters from a string ptimmins@netserv.unmc.edu
sendmail on NT IIS4 (Don Bayless)
Re: sendmail on NT IIS4 <bowlin@sirius.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 9 Jun 1998 13:39:41 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Am I looking at an anonymous array
Message-Id: <1da9vec.1aywygg1b5fg4lN@slip166-72-108-242.ny.us.ibm.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, kpreid@ibm.net (Kevin Reid) writes:
> :sub isanon ($$) {
>
> my $var = "you can't find me";
Um. You've got a point there.
BTW, here's a revised version which doesn't require the second
parameter:
#!perl -w
sub packs ($) {
my $package = $_[0]=~/::$/?$_[0]:$_[0]."::";
my @packages = grep /::$/, keys %$package;
my @retlist = ($package);
foreach (@packages) {
push @retlist, packs($package . $_) unless $_ =~ /main/;
}
map {s/::$//; $_} @retlist;
}
sub isanon ($) {
my ($ref) = @_;
my ($pack, $value, $notanon);
$notanon = 0;
foreach $pack (packs 'main') {
foreach (sort keys %{$pack . "::"}) {
*val = ${$pack . "::"}{$_};
$value = *val{ref $ref};
$notanon ||= 1 if $value == $ref;
}
}
return !$notanon;
}
$var = "x";
$ref = \$var;
print "\$ref is @{[isanon($ref) ? 'now' : 'not']} anonymous.\n";
print "Deleting symbol table entry...\n";
delete $main::{var};
print "\$ref is @{[isanon($ref) ? 'now' : 'not']} anonymous.\n";
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Tue, 09 Jun 1998 11:54:58 -0400
From: William Goerlich <intern.bill.goerlich@bentley.com>
Subject: Associative Array Keys - Names
Message-Id: <357D5AD2.183582D0@bentley.com>
I want to retrieve the value from an associative array which has a key
that has spaces in it.
ex:
$value = $junk{internet technology group};
this doesn't work, it gives the error:
cgi-parse-output reports: the cgi program /.../.../.../filename did not
produce a valid header
(name without value: got line "can't locate object method "internet" via
package "technology" at /.../.../.../filename line xxx
My question is why and how do I fix it.
Thanks alot!
Bill
------------------------------
Date: Tue, 9 Jun 1998 17:17:56 GMT
From: aep@world.std.com (Andrew E Page)
Subject: Re: Associative Array Keys - Names
Message-Id: <EuAo1w.3Lu@world.std.com>
In article <357D5AD2.183582D0@bentley.com>,
William Goerlich <intern.bill.goerlich@bentley.com> wrote:
IF it's really written as:
$value = $junk{internet technology group};
Then the answer is
$value = $junk{'internet technology group'};
Otherwise the parser is going to see those three bare-words
and try to convert it to some kind of a function/method call
rather than glue them together into a single bareword for you.
>I want to retrieve the value from an associative array which has a key
>that has spaces in it.
>
>ex:
>$value = $junk{internet technology group};
>
>this doesn't work, it gives the error:
>
>cgi-parse-output reports: the cgi program /.../.../.../filename did not
>produce a valid header
>(name without value: got line "can't locate object method "internet" via
>package "technology" at /.../.../.../filename line xxx
>
>My question is why and how do I fix it.
>
>Thanks alot!
>
>Bill
>
--
Andrew E. Page (Warrior Poet) | Decision and Effort The Archer and Arrow
Mac Consultant | The difference between what we are
Macintosh and DSP Technology | and what we want to be.
------------------------------
Date: 9 Jun 1998 17:12:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Associative Array Keys - Names
Message-Id: <6ljqd8$vj$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
William Goerlich <intern.bill.goerlich@bentley.com> writes:
:I want to retrieve the value from an associative array which has a key
:that has spaces in it.
:
:ex:
:$value = $junk{internet technology group};
Why aren't you quoting that? Are you telling me that
expect:
$name = internet technology group;
to pass the compiler's watchful eye? This is not a shell
programming langauge, you know.
--tom
--
"If you don't ask, you already know the answer". --me
------------------------------
Date: Tue, 9 Jun 1998 13:39:52 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Associative Array Keys - Names
Message-Id: <1dacy0m.go3q9k18n57nkN@slip166-72-108-242.ny.us.ibm.net>
William Goerlich <intern.bill.goerlich@bentley.com> wrote:
> I want to retrieve the value from an associative array which has a key
> that has spaces in it.
>
> ex:
> $value = $junk{internet technology group};
>
> this doesn't work, it gives the error:
>
> cgi-parse-output reports: the cgi program /.../.../.../filename did not
> produce a valid header
> (name without value: got line "can't locate object method "internet" via
> package "technology" at /.../.../.../filename line xxx
>
> My question is why and how do I fix it.
You can only omit quotes around hash keys if the keys match /^\w+$/.
$value = $junk{'internet technology group'};
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 9 Jun 1998 16:45:55 GMT
From: tph@longhorn.uucp (Tom Harrington)
Subject: Re: Comm.pl
Message-Id: <6ljos3$r763@eccws1.dearborn.ford.com>
David Fetter (dfetter@shell4.ba.best.com) wrote:
: kin <kin@c-cube.com> wrote:
: > Hi,
: > I'm looking for examples of how to use the expect() function
: > in this package I found on CPAN.
: Don't use Comm.pl. Use Expect.pm--it's a lot more up to date, and
: works right out of the .tar.gz.
It does? I haven't been able to get it to work. I have a fairly large
program which relies on Comm.pl, which I'd like to convert to Expect.pm
for better portability, but I haven't been able to use Expect. In fairness,
the problem is not in Expect.pm, but in IO::Tty, which Expect.pm requires.
Maybe I'm just being dense, but I don't know what to do with IO::Tty
to get it working. I get the following:
% perl -e "use Expect;"
Can't locate loadable object for module IO::Tty in @INC (@INC contains: /apps/perl/lib/sun4-solaris/5.00404 /apps/perl/lib /apps/perl/lib/site_perl/sun4-solaris /apps/perl/lib/site_perl .) at IO/Pty.pm line 7
BEGIN failed--compilation aborted at IO/Pty.pm line 7.
BEGIN failed--compilation aborted at Expect.pm line 14.
BEGIN failed--compilation aborted at -e line 1.
The IO::Tty module is in the same directory as IO::Pty, so I don't know
why Perl would complain about @INC. I mean, it found IO::Pty, and
IO::Tty is in the same place.
Any tips on what I need to do here? Presumably I missed one or more
installation steps, but IO::Tty seems to be free of any installation
help.
--
Tom Harrington --------- tph@rmii.com -------- http://rainbow.rmii.com/~tph
"Imagine 100,000 articles a week on every topic under the sun in no
particular order!" -Bob Allisat on his vision for the ideal Usenet
Cookie's Revenge: ftp://ftp.rmi.net/pub2/tph/cookie/cookies-revenge.sit.hqx
------------------------------
Date: Tue, 9 Jun 1998 10:16:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date Manipulation
Message-Id: <MPG.fe70dc820dfd7dd989686@nntp.hpl.hp.com>
In article <6ljj77$oqp$1@nnrp1.dejanews.com>, ptimmins@netserv.unmc.edu
says...
...
Each of your snippets could benefit from a little polish, or at least
another way to think about expressing the ideas, all of which are
acceptable (and a lot more desirable -- to me -- than using one of the
large Date modules).
> if (/^(\d{2})(\d{2})(\d{2})/ {
> $temp_year = $1;
> $temp_month = $2;
> $temp_day = $3;
> }
($temp_year, $temp_month, $temp_day) = /^(\d{2})(\d{2})(\d{2})/;
> You could build hashes in your program so that the $temp_month variable above
> could be easily converted to the desired format. eg:
>
> %month = ('01' => January,
> '02' => February,
> '03' => March,
> '04' => April,
> '05' => May,
> '06' => June,
> '07' => July,
> '08' => August,
> '09' => September,
> '10' => October,
> '11' => November,
> '12' => December,
> );
An array is more natural than a hash here. Either index by $temp_month -
1, or prepend a dummy zeroth array element. A leading zero in
$temp_month becomes irrelevant.
@month = qw( January February March April May June July August September
October November December );
> You would then have to decide what years belong in the 20th century and which
> in the 21st. eg: 00 to 09 means 2000 to 2009, not 1900 to 1909. You could do
> this by something like:
>
> if ($temp_year =~ /(0\d)/) {
> $year = $temp_year + 2000;
> } else {
> $year = $temp_year + 1900;
> }
Not all problems need to be solved by regexes.
$year = $temp_year + ($temp_year < 10 ? 2000 : 1900);
> You would also have to remove the padding zero's from days prior to the 10th.
> eg:
>
> if ($temp_day =~ /0(\d)/ {
> $day = $1;
> } else {
> $day = $temp_day;
> }
Not all problems need to be solved by regexes.
$day = $temp_day + 0;
There. All that should save some paper, or at least some screen space.
:-)
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Wed, 10 Jun 1998 03:46:40 +1000
From: Stephan Carydakis <steph@hotkey.net.au>
Subject: Re: How to create a file...
Message-Id: <357D7500.8C@hotkey.net.au>
Jonathan A. Laub wrote:
>
> How does one create a new file using perl5? I have a working cgi script in
> which I wish to write it's output to a "log" file. I have tried printf and
> write(filehandle) with no success. Any ideas?
>
> Thanks - Jon
I'm a newbie to Perl as well, so I'll show some mercy. I hope no one
minds me replying because, really you are being a tad lazy if ya can't
do the basics!
First, the directory to where you want to write your file on the server
must have write permissions for users of your type.
The Perl part goes like this:
{
open(FILE,">$your_file");
print FILE "$some_data";
close FILE;
}
Maybe you should consider buying a manual or book.
As Bob Trieger pointed out, alot can be gained from RTFM!
Stephan Carydakis.
mailto:steph@hotkey.net.au
"Never Say Die" --James Bond
------------------------------
Date: Tue, 09 Jun 1998 12:39:30 -0400
From: Yash Khemani <khemani@javacomponents.com>
Subject: how would i automaticly post email messages to a newsgroup?
Message-Id: <357D6542.2AB339C5@javacomponents.com>
hi folks,
i was wondering if someone has tackled this problem already.
i'd like to post email messages directly to a newsgroup on a
secure (ssl enabled) news server. any help you might be able
to provide on how to accomplish this would be greatly appreciated!
thanks,
yash
------------------------------
Date: Tue, 9 Jun 1998 13:39:43 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: I'm having problems:
Message-Id: <1da9vnt.j3n1r815nfep2N@slip166-72-108-242.ny.us.ibm.net>
Jonathan Stowe <Gellyfish@btinternet.com> wrote:
> On Sun, 7 Jun 1998 16:12:08 -0400, Kevin Reid wrote :
>
> >Randal Schwartz <merlyn@stonehenge.com> wrote:
> >
> <snip>
> >>
> >> Please stop reinventing File::Find.
> >
> >I think the name File::Find is misleading. It ought to be called
> >File::DirRecurse or something like that.
> >
>
> Not in the least. It carries out some of the same functionality as
> the find command in Unix. It was developed (as I understand) to
> support the find2perl utility. Lets not forget the heritage here.
Yes, but if somebody has never heard of File::Find before, they may
misunderstand what it does.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Tue, 9 Jun 1998 13:39:46 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: lambda fun in Perl
Message-Id: <1daba78.172v6xy1sj5vagN@slip166-72-108-242.ny.us.ibm.net>
Randal Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "Xah" == Xah Lee <xah@shell13.ba.best.com> writes:
>
> Xah> Is there a way to create lamda function in perl? i.e. compose and
> Xah> apply arbitrary anonymous function in a line of code.
>
> Here's one way (requires a modern Perl):
>
> sub { print "@_"; } -> (sort qw(b c d a));
>
> In this, the anon func that prints its args within a double-quoted
> string context (causing spaces between elements) is handed the args of
> the result of sort. You can use the result from the func further.
>
> That should be sufficiently flexible for you. :-)
This version avoids confusion with more typical uses of anonymous
subroutines:
sub lm (&) {$_[0]}
lm{print "@_"} -> (sort qw(b c d a));
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 9 Jun 1998 16:57:27 GMT
From: "Earl E. McCoy" <emccoy@tra.com>
Subject: Latest Perl on Slakeware 2.0.33
Message-Id: <357D69B6.9F6BC556@tra.com>
I am new to this group, so if this has been covered please
bear with me.
I am having trouble installing Perl 5.004.04 on Slakeware Linux
2.0.33. Bombs out on some C code.
Has anyone successfully got this to intall on 2.0.33?
Thanks in advance. Earl McCoy
------------------------------
Date: Tue, 09 Jun 1998 16:10:27 GMT
From: redpeppa@my-dejanews.com
Subject: mailspinner.cgi
Message-Id: <6ljmpj$u1k$1@nnrp1.dejanews.com>
if anyone has a copy of mailspinner.cgi plz email me..im 18 and i really
cant afford paying $1,000 when all im looking for is a personal web email
client...thanks
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 9 Jun 1998 16:07:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: McCabe complexity analysis
Message-Id: <6ljmjc$rkg$2@client3.news.psi.net>
Charlie Stross (charlie@antipope.org) wrote on MDCCXLIII September
MCMXCIII in <URL: news:slrn6nqlgc.m99.charlie@cs.ed.datacash.com>:
++ In the name of Kibo the Compassionate, the Merciful,
++ on 8 Jun 1998 15:55:35 GMT,Tom Christiansen
++ the supplicant <tchrist@mox.perl.com> implored:
++
++ >Why do people write code that's hard to grok with too many conditionals
++ >and branches within loops? Is it because they're Prisoners of Pascal?
++ >We end up getting really wicked code like this:
++
++ [ snipped -- yuck ]
++
++ I suspect it's because the unless statement is alien to Pascal;
That's a silly argument, as Pascal has if and not.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: 9 Jun 1998 16:13:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: passing multiple hashes and keeping them seperate?
Message-Id: <6ljmvv$pbb$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, <arr@oceanwave.com> (A. Rich) writes:
:How do I keep the two hash tables separate when I pass them to the
:routine?
This is clearly described in the perlsub manpage which accompanies
every Perl distribution.
Furthermore, that "local" thing you keep doing doesn't make local
variables, you know. Once again, read the fine perlsub manpage.
--tom
--
Be consistent.
--Larry Wall in the perl man page
------------------------------
Date: 9 Jun 1998 16:54:23 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: passing multiple hashes and keeping them seperate?
Message-Id: <6ljpbv$srp@news-central.tiac.net>
In article <86hg1uh8fa.fsf@smallberries.office.oceanwave.com>,
<arr@oceanwave.com> wrote:
>I have a routine that takes, among other things, two hashes as
>arguments. I need to keep these two hash tables separate even though
>they have keys in common (exact, to be truthful). The hashes have the
>same keys because they keep track of different attributes of the same
>thing like size and permission of a file, for instance).
>
>How do I keep the two hash tables separate when I pass them to the
>routine?
>
>I'm attempting something like:
>
>&func("text","more text","yet more text",%hash1,%hash2);
>
>sub func {
> local ($a) = shift(@_);
> local ($b) = shift(@_);
> local ($c) = shift(@_);
>
Assuming you're uings a relatively recent perl you can say
&func ("text", "more text", "yet more text", \%hash1, \%hash2);
sub func {
my ($a, $b, $c, $hRef1, $hRef2) = @_;
foreach $key (keys %$href1) {
print "$key -> $hRef1->{$key}\n";
}
...
}
This stuff's explained in the perlref and perllol man pages anomgst other
placess (and in an upcoming article in the Perl Journal
http:://www.tpj.com too)
If you're using some version of perl with a small footprint and fast
start-up time yet lacking in references (e.g. 4.036) then you can
investigate using type globs (untested code below...)
&func ("text", "more text", "yet more text", *hash1, *hash2);
sub func {
local ($a, $b, $c, *h1, *h2) = @_;
foreach $key (keys %h1) {
print "$key -> $h1{$key}\n";
}
...
}
but be aware that using a glob gives you all the things of that name, so
if you use $h1 in your sun then $hash1 is what you're really messing with.
Hoep 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@colltech.com | Collective Technologies (work)
------------------------------
Date: 9 Jun 1998 17:08:19 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Perl Books?
Message-Id: <6ljq63$srp@news-central.tiac.net>
In article <6ljlgt$pf1$1@taliesin.netcom.net.uk>,
The Dukester <web1@netcomuk.co.uk> wrote:
>Dear All,
> I'm in the UK and was wondering if anyone could suggest a good Perl
>book, which would be able to get my head around (I've done
>basic, little bits of C+ and assembly) and use as a refernce guide? I
>wouldn't want to spunk #50 on rubbish.
Programming Perl by Wall Christiansen & Schwartz is a good reference book,
you should probably use it in conjunction with the on-line docs on your
system as time has moved on since it was published. Also, check out the
errata page on O'Reilly's web site
http://www.oreilly.com/catalog/pperl2/pperl2.current and mark up your
copy.
It's a good reference, and has a little tutorial material in it. If
you want a tutorial book too then consider Learning Perl which is also
published by O'Reilly.
www.perl.com has some book reviews on line.
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@colltech.com | Collective Technologies (work)
------------------------------
Date: Tue, 09 Jun 1998 11:57:59 -0400
From: Asheesh Chowdhary <achowd01@cs.fiu.edu>
Subject: Perl for Win32
Message-Id: <357D5B87.625942DC@cs.fiu.edu>
Hi.
I'm trying to create some user management scripts for NT User Management
using Perl.
The following statement:
use Win32::UserAdmin;
causing the interpreter to return the following error:
Can't locate Win32/UserAdmin.pm in @INC at C:\Perl\lib\addtpgrp.pl line
1.
BEGIN failed--compilation aborted at C:\Perl\lib\addtogrp.pl line 1.
It's my understanding that you need to use the "use" statement so the
script will be
able to make the API calls. Any help will be appreciated.
Asheesh Chowdhary
------------------------------
Date: Tue, 9 Jun 1998 17:48:57 GMT
From: Thanh Hoang <thanh.d.hoang@boeing.com>
Subject: Re: print with <<
Message-Id: <357D7589.5E7@boeing.com>
Brian Lavender wrote:
>
> I remember seeing where you could do something like
>
> print << --theend--
> .....
>
> I can't get it to work and I can't find the answer in the Camel book.
> What am I missing?
>
"Here" documents - page 43 of the Camel book.
--
Thanh Hoang
thanh.d.hoang@boeing.com
------------------------------
Date: Tue, 09 Jun 1998 16:05:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Reading a file from the bottom up
Message-Id: <Pine.GSO.3.96.980609090414.29617o-100000@user2.teleport.com>
On 9 Jun 1998, Tim Cooper wrote:
> : foreach (reverse <F>) {
> Yup this works fine but I suspect it still reads
> the whole file in first.
That's right; foreach has to have the entire list before it starts,
whether you use reverse in there or not. Oh, well! :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Jun 1998 12:27:29 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Reading Directories
Message-Id: <357D6271.C810BAC3@matrox.com>
dukeboy77@my-dejanews.com wrote:
> I need a script that will search a directory read the name of every file
> and put it into an array called @files. I've tried and tried with no success
> and had no idea where else to turn. If someone could help me I would be very
> greatful. Thank you.
>
> Curtis Howard
Have you read any documentation? Check out the FAQs. Better yet, buy the Llama
book.
Hint: Check out readdir() and opendir() functions.
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Tue, 9 Jun 1998 17:32:17 GMT
From: "Dave" <hannum@oak.cat.ohiou.edu>
Subject: Return cell contents to HTML dropdown menu
Message-Id: <EuALup.DxK@boss.cs.ohiou.edu>
I am looking for a snippet that reads the contents of a cell in a database
and returns those contents to a dropdown box in HTML. Anybody got anything?
Thanks,
Dave H
------------------------------
Date: 9 Jun 1998 16:05:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Return characters from a string
Message-Id: <6ljmgk$rkg$1@client3.news.psi.net>
Mike Baroukh (f024101@fr.ibm.com) wrote on MDCCXLIII September MCMXCIII
in <URL: news:6ljir8$o96$1@nnrp1.dejanews.com>:
++ Hi.
++
++ I'd like to return char 1 to 22 of q string. Is there a way to do it without
++ using functions like cut ?
Yes, there would be, although it would be a lot easier to use a function
like cut. Perl has such a function, specially designed to return
substrings of a string.
Did you read perlfunc? It is explained there.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: Tue, 09 Jun 1998 16:13:34 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Return characters from a string
Message-Id: <Pine.GSO.3.96.980609091247.29617q-100000@user2.teleport.com>
On Tue, 9 Jun 1998, Mike Baroukh wrote:
> I'd like to return char 1 to 22 of q string. Is there a way to do it
> without using functions like cut ?
cut? What's cut? It's not listed in perlfunc! :-)
But there's a function listed in the perlfunc manpage which should help
you. Look for 'substr'. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 09 Jun 1998 17:14:59 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Return characters from a string
Message-Id: <357D5F82.2D19EE62@nortel.co.uk>
Mike Baroukh wrote:
> Hi.
>
> I'd like to return char 1 to 22 of q string. Is there a way to do it without
> using functions like cut ?
Can't find any cut function in The Camel book, hmmm...what about $stringpart =
substr($string, 0, 21);
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Tue, 09 Jun 1998 16:48:28 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Return characters from a string
Message-Id: <6ljp0r$29q$1@nnrp1.dejanews.com>
In article <6ljir8$o96$1@nnrp1.dejanews.com>,
Mike Baroukh <f024101@fr.ibm.com> wrote:
>
> Hi.
>
> I'd like to return char 1 to 22 of q string. Is there a way to do it without
> using functions like cut ?
>
> Thanks
>
> Mike Baroukh
Where $string is the string in question, how about:
print substr($string, 0, 22), "\n";
Hope that helps.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 09 Jun 1998 16:00:08 GMT
From: donbay@gte.net (Don Bayless)
Subject: sendmail on NT IIS4
Message-Id: <6ljm68$9c5$1@gte2.gte.net>
Just what would one put in place of this on an NT box running IIS4??
#!/usr/local/bin/perl
$mail_prog = '/usr/lib/sendmail' ;
------------------------------
Date: Tue, 09 Jun 1998 10:53:56 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: donbay@gte.net
Subject: Re: sendmail on NT IIS4
Message-Id: <357D76B4.B37820E6@sirius.com>
Don Bayless wrote:
>
> Just what would one put in place of this on an NT box running IIS4??
>
> #!/usr/local/bin/perl
> $mail_prog = '/usr/lib/sendmail' ;
There is no plug-in replacement for this (as far as I know). I use the Net::SMTP
module for sending email. This module works with on NT and Unix.
-- Jim Bowlin
------------------------------
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 2822
**************************************