[10277] in Perl-Users-Digest
Perl-Users Digest, Issue: 3870 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 2 01:07:27 1998
Date: Thu, 1 Oct 98 22:00:25 -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 Thu, 1 Oct 1998 Volume: 8 Number: 3870
Today's topics:
Re: ****Can you show me a simple perl script to run the (Martien Verbruggen)
Academic Assistance in Programming Languages <tutoraid@mailexcite.com>
Re: Alternate colors in tables with perl command? stevenjm@olywa.net
Re: Alternate colors in tables with perl command? (Ronald J Kimball)
Re: Append to users file with .htaccess (brian d foy)
Bug or Proprietary Internet Take-Over? <afs@sadera.com>
Finding Consecutive lines jimbob4334@my-dejanews.com
Re: Finding Consecutive lines (Tad McClellan)
Re: forwarding web-based email to mail server? (Martien Verbruggen)
Re: how to pass FORM variable to second cgi? <howel88@cyberway.com.sg>
How to swapp each key with its record in Hash Table? <jian@cisco.com>
Re: How to swapp each key with its record in Hash Table (Larry Rosler)
Re: How to swapp each key with its record in Hash Table <jian@cisco.com>
Re: IDE for Perl <tchrist@mox.perl.com>
Re: mod_perl file closing problem schwern@starmedia.net
Re: new term for illogical <eashton@bbnplanet.com>
Re: Porting Unix perl script to winNT servers (Martin Vorlaender)
Re: Q: Is there any Win32-compilabe perl? (Martin Vorlaender)
Re: send geroge reese (was Re: Call for Participation: <jon@floorboard.com>
sendmail.pl francesx@my-dejanews.com
Re: sendmail.pl <eashton@bbnplanet.com>
Re: SSI call (Martien Verbruggen)
Statically linking a module in NT: possible? <standfast@mindspring.com>
string from array (Jerrad Pierce)
Re: string from array (Jerrad Pierce)
Re: string from array (Craig Berry)
Re: string from array (Brand Hilton)
Re: system() and `` on Win32 (Martin Vorlaender)
Re: Trimming Long Scalar Variables (Larry Rosler)
Re: Trimming Long Scalar Variables (Tad McClellan)
Re: URL not working in Eudora via perl script (Martien Verbruggen)
Web project help <jbracamo@ucsd.edu>
Re: Web project help <eashton@bbnplanet.com>
Re: what's wrong with win32 perl ? <metcher@spider.herston.uq.edu.au>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 02 Oct 1998 02:55:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ****Can you show me a simple perl script to run the POST method?
Message-Id: <0hXQ1.5$fd1.6677@nsw.nnrp.telstra.net>
In article <3614aec3.54731510@news.au.ac.th>,
burningboy@hotmail.com (James Bond 098) writes:
> Plz show me a simple script to POST method(Don't USE any module)
Hello burningboy Mr James '007' Bond 098,
I will do that for you, if you can write a web server for me (DON'T
use any programming language)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd. | great height, over water.
NSW, Australia |
------------------------------
Date: 01 Oct 98 23:36:08 -0400
From: Academic Assistance Access <tutoraid@mailexcite.com>
Subject: Academic Assistance in Programming Languages
Message-Id: <8ce5.14be8.244@AAA>
Academic Assistance Access is a free tutoring service on the Web
designed to offer assistance in Programming Languages for post
secondary students. If you are looking for answers to your Programming
Languages questions, our team of professionals can help you make the
grade!!!
Please, do not ask questions by replying to this message. For assistance
you should first subscribe to the following address:
http://www.tutoraid.org/
George Richards
Academic Assistance Access
------------------------------
Date: Fri, 02 Oct 1998 00:42:47 GMT
From: stevenjm@olywa.net
Subject: Re: Alternate colors in tables with perl command?
Message-Id: <6v17i7$bcl$1@nnrp1.dejanews.com>
In article <36138185.D34F7C66@lmco.com>,
Mike Elness <mike.elness@lmco.com> wrote:
> Daniel Pray wrote:
> >
> > I've seen some professional web site that have a perl script list a
> > database request. The table is alternated rows of color. Does anyone know
> > how to do this?
>
<Snip>
Or if you're simple minded like me...
my(@colors) = ('Silver','White');
my($toggle) = 0;
my(@whatever) = ('Fred','Wilma','Barney');
foreach(@whatever){
print qq~
<tr bgcolor="$colors[$toggle]">
<td>Name</td>
<td>$_</td>
</tr>
~;
## Simple logic that toggles the color
(!$toggle and $toggle = 1) or $toggle = 0;
}
TMTOWTDI
Steve
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 1 Oct 1998 23:47:28 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Alternate colors in tables with perl command?
Message-Id: <1dg8ua4.10qzvnq1itvzagN@bay1-322.quincy.ziplink.net>
<stevenjm@olywa.net> wrote:
> ## Simple logic that toggles the color
> (!$toggle and $toggle = 1) or $toggle = 0;
## Simpler logic that toggles the color
$toggle = !$toggle;
## Simplest logic that toggles the color
$toggle ^= 1;
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 01 Oct 1998 21:49:57 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Append to users file with .htaccess
Message-Id: <comdog-ya02408000R0110982149570001@news.panix.com>
Keywords: from just another new york perl hacker
In article <6v0t1j$8fa@nnrp2.farm.idt.net>, "Roberto Cerini" <rob@ccsn.com> posted:
>I really no VERY VERY little about perl. I am trying to come up wit a way
>that a user can enter a userid and a password into an html form and those
>are taken and added to the user file that is created by htpasswd. I know
>the password has to be encrypted and the userid and password have to be
>appended to the user file. I am completely clueless.
see the HTTPD::UserAdmin module. it does everything except slice
bread it seems :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Thu, 01 Oct 1998 21:08:21 -0400
From: Anthony Sadera <afs@sadera.com>
Subject: Bug or Proprietary Internet Take-Over?
Message-Id: <36142785.11074BF@sadera.com>
I need to know why MSIE4 chokes on certain CGI-based
form submissions. (Can't access errors, etc.)
I need to know what to do about it (aside from recommending
Netscape to everyone that uses our CGI forms).
It may be an SSL problem, it may be a STDIN problem,
it may be MSIE's stupid file associations (why does MS hide
the damn things by default if they're so friggin' important?).
I guess what I'm asking is there some depository of information
about things I need to know to update about 40-50 Perl
Scripts running under an Apache server on four linux boxes.
--
Anthony Sadera
mailto:afs@sadera.com
------------------------------
Date: Fri, 02 Oct 1998 02:50:00 GMT
From: jimbob4334@my-dejanews.com
Subject: Finding Consecutive lines
Message-Id: <6v1f0o$mie$1@nnrp1.dejanews.com>
I have a file that contains info succh as the following lines - I want to
capture just the two lines with PR: and Status:, I thought I meight be able
to accomplish this using regexp and an or- could not figure out how to do
that - any ideas. Want to perform a global search.
###########################################################################
CAPTURED IN : Test
PR: 106129 Urg/Svr: U2/P1 Orignation Date(age): 06 Jan 1998 (0)
Status: tested Orignator: xxxxxx
Title: Testing of yyyyy
tried variations of
perl -pi -e 's/^(Status)||^(PR)/$1$2/g' filename
TIA,
Jim
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 1 Oct 1998 22:18:24 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Finding Consecutive lines
Message-Id: <0mg1v6.rnd.ln@flash.net>
jimbob4334@my-dejanews.com wrote:
: I have a file that contains info succh as the following lines - I want to
: capture just the two lines with PR: and Status:, I thought I meight be able
: to accomplish this using regexp and an or- could not figure out how to do
: that - any ideas. Want to perform a global search.
: ###########################################################################
: CAPTURED IN : Test
: PR: 106129 Urg/Svr: U2/P1 Orignation Date(age): 06 Jan 1998 (0)
: Status: tested Orignator: xxxxxx
: Title: Testing of yyyyy
: tried variations of
: perl -pi -e 's/^(Status)||^(PR)/$1$2/g' filename
Whew!
There is just too much there that is wrong to even try
and straighten it out.
-p prints every line, you only want to print some lines...
|| is logical 'or', but a regex is not a logical expression...
| is 'or' in regexen.
I can't figure out what the s/// is for at all.
It _always_ uses an uninitialized variable. Not Good.
If it matched the "left side", ignoring the || problem,
then $2 will be uninitialized. If it matched the "right side"
then $1 will be uninitialized.
???
perl -ne 'print if /^(?:PR|Status):/' filename
egrep '^(PR|Status):' filename
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 02 Oct 1998 02:59:06 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: forwarding web-based email to mail server?
Message-Id: <_jXQ1.7$fd1.6677@nsw.nnrp.telstra.net>
In article <coh90j09r7i.fsf@omni.c-cube.com>,
Kin Cho <kin@omni.c-cube.com> writes:
> 1) automatically login to the freemail web site,
[snip]
> To me, the "hard" part appears to be 1), cause I don't
> know what the browser sends back to the site when I type in
> username and password and click on the login button.
There really isn't a question in here. The task you set yourself can
most likely neatly be performed by the libwww and HTTP::Parser stuff.
get them from CPAN. If you don't know how the login procedure works,
check the HTML code. If it's standard HTTP authentication, libwww
supports that.
Next time, if you ask a question here, please show us some code. We're
not here to solve all your problems.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Fri, 02 Oct 1998 10:51:07 +0730
From: Hongwei <howel88@cyberway.com.sg>
Subject: Re: how to pass FORM variable to second cgi?
Message-Id: <361446A2.144C0C1F@cyberway.com.sg>
Shambo Pfaff wrote:
> I want an HTML form to send two variables, one which is a generic text
> string, another which dictates which second cgi script gets this text
> string. I've gotten to the point where I can get my cgi script to reead
> the input from the form, but I can't figure out how to trigger the second
> cgi script based on the variable from the first script.
>
> In other words,
>
> $string = $FORM{'string'};
> $cgitorun = $FORM{'cgittorun'};
>
> This is what I'm using to grepare the variables from the form to go to,
> and execute, the second cgi script.
>
> The $cgitorun variable triggers the cgi selected by the user
> (cgi-bin/mycgi.cgi, for example), and $string sends that value to the
> second cgi.
>
> I've been messing around with
> system(perl $cgitorun);
>
> but can't figure out how to pass it the $string variable from the form.
>
> Any help would be greatly appreciated.
>
> Feel free to e-mail direct.
>
> Thanks,
> Shambo Pfaff
Did you try HTML hidden attribute ?
------------------------------
Date: Thu, 01 Oct 1998 18:03:19 -0700
From: Jian Zhang <jian@cisco.com>
Subject: How to swapp each key with its record in Hash Table?
Message-Id: <36142657.8456E7@cisco.com>
Hi,
I have a Hash table with one-to-one key/record mapping. Is there a
clean way to swapp the key and its record?
Thanks in advance.
Jian Zhang
------------------------------
Date: Thu, 1 Oct 1998 19:11:34 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to swapp each key with its record in Hash Table?
Message-Id: <MPG.107dd634b1c05de2989892@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <36142657.8456E7@cisco.com> on Thu, 01 Oct 1998 18:03:19 -
0700, Jian Zhang <jian@cisco.com> says...
> I have a Hash table with one-to-one key/record mapping. Is there a
> clean way to swapp the key and its record?
Squeaky clean.
%h2 = reverse %h1;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 01 Oct 1998 19:46:50 -0700
From: Jian Zhang <jian@cisco.com>
Subject: Re: How to swapp each key with its record in Hash Table?
Message-Id: <36143E9A.F72D12A6@cisco.com>
Larry Rosler wrote:
> [Posted to comp.lang.perl.misc and copy mailed.]
>
> In article <36142657.8456E7@cisco.com> on Thu, 01 Oct 1998 18:03:19 -
> 0700, Jian Zhang <jian@cisco.com> says...
> > I have a Hash table with one-to-one key/record mapping. Is there a
> > clean way to swapp the key and its record?
>
> Squeaky clean.
>
> %h2 = reverse %h1;
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
Thanks, Larry. You've solved my problem!!!
Jian Zhang
San Jose, CA
------------------------------
Date: 2 Oct 1998 02:34:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: IDE for Perl
Message-Id: <6v1e4a$jqk$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, ijliao@csie.nctu.edu.tw writes:
:is there any IDE for un*x users ?
Unix *is* Perl's IDE!
--tom
--
"Umm, square root of two? Ouch!"
--The guy who blew a hole in the Pythagoreans' assertion that all numbers can
be represented as a ratio of two integers, so they killed him
------------------------------
Date: Fri, 02 Oct 1998 01:41:12 GMT
From: schwern@starmedia.net
Subject: Re: mod_perl file closing problem
Message-Id: <6v1avo$hak$1@nnrp1.dejanews.com>
In article <1XoQ1.304$Fl6.6169565@news.abs.net>,
ryan@mail.ramresearch.com (Ryan McGuigan) wrote:
> you can't use exit; when using mod_perl
<snicker-snatch>
Yes, you can under the Apache::Registry handler:
from Apache::Registry man page:
ENVIRONMENT
The Apache function `exit' overrides the Perl core built-
in function.
--
Michael G Schwern Applications Engineer
(212)548-9643 Starmedia Networks Unix Bigot
schwern@starmedia.net Certified Stupid Person
@h{@a[grep{!$_%2}0..$#a]}=@a[grep{$_%2}0..$#a];
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 03:52:51 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: new term for illogical
Message-Id: <36144B9E.9C283F4D@bbnplanet.com>
Scratchie wrote:
> : poor abby couldn't handle some acerbic comments back at he/r!
>
> She's the sensitive type, you know.
The more abrasive you are the more insecure and sensitive you are...as a
general rule of thumb.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 05:36:03 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Porting Unix perl script to winNT servers
Message-Id: <36144a23.524144494f47414741@radiogaga.harz.de>
Ethan H. Poole (ehp@gte.net) wrote:
: bjorn.w.nilsson@edt.ericsson.se says...
: >What can be a problem is if anything is encrypted with the UNIX crypt
: >command. That is not supported on NT.
:
: The ActiveState Perl port has supported the crypt() function since at least
: 5.001 (the earliest version I've used).
The Standard 5.005 distribution's ReadMe.Win32 contains directions on how
to get a DES library and integrate it into the building process.
Needless to say, my Win32 Standard Perl 5.005_02 binary can crypt().
Thanks a lot to Gurusamy Sarathy for that (and everything else). Now the
last big obstacle in porting Unix scripts to Win32 (and any other OS) is
fork()...
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
VMS is today what | work: mv@pdv-systeme.de
Microsoft wants | http://www.pdv-systeme.de/users/martinv/
Windows NT 8.0 to be! | home: martin@radiogaga.harz.de
------------------------------
Date: Fri, 02 Oct 1998 06:29:22 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Q: Is there any Win32-compilabe perl?
Message-Id: <361456a2.524144494f47414741@radiogaga.harz.de>
[posted & mailed]
Hermann Flacke (hermann.flacke@t-online.de) wrote:
: I would like to use the the perl functionality within the C/C++ and
: the Java language. I know that there is the "embedded" perl way. Is
: there any resource and documentation out there to get perl run within
: _one_ programm, _not_ from a running interpreter outside my *.exe
: file?
If you have a standard Perl installation, there should be a perlembed
POD file describing wxactly what you are looking for.
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
VMS is today what | work: mv@pdv-systeme.de
Microsoft wants | http://www.pdv-systeme.de/users/martinv/
Windows NT 8.0 to be! | home: martin@radiogaga.harz.de
------------------------------
Date: Thu, 01 Oct 1998 19:09:58 -0700
From: Jonathan Biggar <jon@floorboard.com>
To: Zenin <zenin@bawdycaste.org>
Subject: Re: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <361435F6.702C6EDD@floorboard.com>
Zenin wrote:
> Of course they could, after all, where do you think Perl came
> up with its original object design? None other then Python.
Actually, not, or at least mostly not. I was sitting back to back with
Larry in the same office while he was designing Perl 5, and he borrowed
liberally from many languages, including C++ and Ada, although Python
was part of the mix.
Not to brag :-), but I am partly to blame for Perl 5, by pushing Larry
to add the OO stuff.
--
Jon Biggar
Floorboard Software
jon@floorboard.com
jon@biggar.org
------------------------------
Date: Fri, 02 Oct 1998 00:43:20 GMT
From: francesx@my-dejanews.com
Subject: sendmail.pl
Message-Id: <6v17j8$bcn$1@nnrp1.dejanews.com>
I want to call up the sendmail.pl program from a perl script on NT. To send
input of a form via email.
I have called it up on Unix by using the line:
open(MAIL,"|/usr/sbin/sendmail -t");
Can I call this up from my cgi-bin on NT or do I need an NT version of the
sendmail program?
I can call up my perl scripts by the following:
http://www.myserver.com.au/cgi-bin/perlscript.pl
So I was wondering if I can call up sendmail by using a similar line, such as:
open(MAIL,"http://www.myserver.com.au/sbin/sendmail -t");
Thankyou
Frances
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 02 Oct 1998 03:49:38 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: sendmail.pl
Message-Id: <36144ADD.41F45717@bbnplanet.com>
francesx@my-dejanews.com wrote:
> I want to call up the sendmail.pl program from a perl script on NT. To send
> input of a form via email.
Uh, the last time I checked (though things change and I could be wrong)
Sendmail doesn't run on NT. UNIX isn't NT so you might need to see what
MUA will send mail on NT.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 03:02:20 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: SSI call
Message-Id: <0nXQ1.89$fd1.6677@nsw.nnrp.telstra.net>
In article <6v0po2$m6m$1@nnrp1.dejanews.com>,
darrensw@netscape.net writes:
> Hi
>
> I have a URL which I can call from the URL line, no problem, but when i try to
> call from SSI I get an error processing directive massage.
SSI being Server Side Includes? So... What exactly was your perl
question again? It's a SSI problem, not a perl one. Ask in one of the
comp.infosystems.www.* groups. They're there to talk about web stuff.
We're here to talk about perl and lately also about George Reese, if I
recall the name correctly.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I think there is a world market for
Commercial Dynamics Pty. Ltd. | maybe five computers. --Thomas Watson,
NSW, Australia | chairman IBM, 1943
------------------------------
Date: Thu, 1 Oct 1998 18:48:02 -0700
From: "David Watson" <standfast@mindspring.com>
Subject: Statically linking a module in NT: possible?
Message-Id: <361430cf$0$26080@nntp1.ba.best.com>
I can't seem to find any way to 'make perl' successfully in order to
statically link Filter::decrypt into a perl binary on NT (it's no problem on
Linux). I'm using MSVC and nmake -- I've tried both "native" perl and
ActivePerl build 502.
Has anyone done this successfully? Any tips?
Thanks,
-David.
------------------------------
Date: Fri, 02 Oct 1998 04:16:30 GMT
From: belg4mit@mit.edu (Jerrad Pierce)
Subject: string from array
Message-Id: <6v1k31$6f3$1@news.tdl.com>
Is there a way to dump the contents of an array of unknown length into a
string?
Other than iterating over each element? eg;
for($i = 0; $i < $#ary+`; $i++){
$string .= $ary[$i];
}
Reason is I'm going to be doing this operation a lot,
with some fairly large arrays.
Please (b)cc me, think!
------------------------------
Date: Fri, 02 Oct 1998 04:43:45 GMT
From: belg4mit@mit.edu (Jerrad Pierce)
Subject: Re: string from array
Message-Id: <6v1lm3$6f3$2@news.tdl.com>
In article <6v1k31$6f3$1@news.tdl.com>, belg4mit@mit.edu (Jerrad Pierce) wrote:
it's join
Doh!
------------------------------
Date: 2 Oct 1998 04:45:54 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: string from array
Message-Id: <6v1lq2$erf$1@marina.cinenet.net>
Jerrad Pierce (belg4mit@mit.edu) wrote:
: Is there a way to dump the contents of an array of unknown length into a
: string?
Yes. perldoc -f join
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 2 Oct 1998 04:45:17 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: string from array
Message-Id: <6v1lot$7p11@mercury.adc.com>
In article <6v1k31$6f3$1@news.tdl.com>, Jerrad Pierce <belg4mit@mit.edu> wrote:
>Is there a way to dump the contents of an array of unknown length into a
>string?
>Other than iterating over each element? eg;
>
>for($i = 0; $i < $#ary+`; $i++){
> $string .= $ary[$i];
>}
Hmm... recent convert from C, right?
$string = join('', @ary);
A couple of critiques, if I might. First, if you're using a for loop
to iterate over a list, then you probably want a foreach loop (man
perlsyn). Second, if I really, really wanted a for loop like that
one, I'd make the condition '$i < @ary' since, in scalar context,
@ary == $#ary+1.
HTH
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: Fri, 02 Oct 1998 06:36:09 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: system() and `` on Win32
Message-Id: <36145839.524144494f47414741@radiogaga.harz.de>
scott@softbase.com wrote:
: Chris Day (chrisday@cs.utexas.edu) wrote:
: > Hello, I've recently installed Perl 5.004_02 on my Win95 web server and
: > have hit a rather odd bug when using system() or `` to execute any shell
: > commands.
:
: I've tried using system() some too with PWS, and have found it
: not to work well. Usually the Perl program either does nothing
: at all, or hangs forever.
See my response on the thread "Help with system() on NT", and remember that
PWS really is IIS2 (3?).
cu,
Martin
--
| Martin Vorlaender | VMS & WNT programmer
VMS is today what | work: mv@pdv-systeme.de
Microsoft wants | http://www.pdv-systeme.de/users/martinv/
Windows NT 8.0 to be! | home: martin@radiogaga.harz.de
------------------------------
Date: Thu, 1 Oct 1998 17:56:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Trimming Long Scalar Variables
Message-Id: <MPG.107dc4a8be1b0077989890@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <36142059.8904AF28@savalas.com> on Fri, 02 Oct 1998 00:37:43
GMT, Jesse Rosenberger <jesse@savalas.com> says...
> How would you get Perl to trim a long variable value down to a
> certain specified length?
`perldoc -f substr`
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 1 Oct 1998 22:02:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Trimming Long Scalar Variables
Message-Id: <vnf1v6.5id.ln@flash.net>
Jesse Rosenberger (jesse@savalas.com) wrote:
: How would you get Perl to trim a long variable value down to a
: certain specified length?
perldoc -f substr
: $variable = "supercalafragalisticexpealidocious";
: I want to have the option to take the first, let's say, 20 characters,
: and have the variable become:
: $variable = "supercalafragalistic"; and drop the rest....
$variable = substr($variable, 0, 20);
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 02 Oct 1998 03:06:12 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: URL not working in Eudora via perl script
Message-Id: <EqXQ1.168$fd1.6677@nsw.nnrp.telstra.net>
In article <6v0rvu$p7n$1@nnrp1.dejanews.com>,
webmaster@vaticanart.com writes:
> Is there anyway to prevent the outgoing HTML in
> perl from wrapping at 80 characters ?
perl does not wrap anything for you. perl has no idea about HTML. If
there is wrapping going on, it's somewhere else. Maybe your sendmail
does some magic, although that would be increcibly undesirable.
Why don't you just test it by printing that HTML crap to a file, and
seeing what gets in the file? At least then you'll be convinced it's
not perl. You could have thought of that yourslef, I guess..
> <HTML>
> <HEAD>
> <TITLE>Test</TITLE>
> </HEAD>
> <BODY>
>
> .... and the two hyperlinks go here which are 112 characters long.
That would be invalid HTML.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd. | great height, over water.
NSW, Australia |
------------------------------
Date: Fri, 02 Oct 1998 01:01:54 GMT
From: "John B" <jbracamo@ucsd.edu>
Subject: Web project help
Message-Id: <6CVQ1.446$VN.1887017@news.san.rr.com>
I am new to any type of web authoring and have a project that I'm going to
need to learn more than my limited HTML experience. I need am designing a
web site for a new law-based company. On the site there will be sort of a
search engine. The users selects their options in 3 different combo boxes
then the site should bring up the corresponding document. There are 150
megs of about 80-90 different documents and they are all sorted by the
possible selections of the combo boxes. Also access to this page will be
only with the use of a user name and password.
I was hoping someone could point me in the right direction on this project.
What the requirements would be, what skills I would need to learn to to it
and possibly the amount of time you think it would take.
Thanks for any info.
John
jbracamo@ucsd.edu
------------------------------
Date: Fri, 02 Oct 1998 03:45:59 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Web project help
Message-Id: <36144A02.642E2A59@bbnplanet.com>
John B wrote:
> I was hoping someone could point me in the right direction on this project.
> What the requirements would be, what skills I would need to learn to to it
> and possibly the amount of time you think it would take.
http://www.ora.com
There you will find a book on "Learning Perl" and a book on learning
CGI. Maybe have them send you to a class or something.
e.
Would I live my life over again?
Make the same unforgivable mistakes?
Yes, given half a chance. Yes -R. Carver-
------------------------------
Date: Fri, 02 Oct 1998 13:34:40 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: what's wrong with win32 perl ?
Message-Id: <361449D0.21C66DAD@spider.herston.uq.edu.au>
Windows 95, perhaps? From Sarathy's README.win32 (perl source
distribution):
"These are instructions for building Perl under Windows NT (versions
3.51 or 4.0). Currently, this port is reported to build
under Windows95 using the 4DOS shell--the default shell that infests
Windows95 will not work (see below). Note this caveat is only about
B<building> perl. Once built, you should be able to B<use> it on
either Win32 platform (modulo the problems arising from the inferior
command shell)."
--
Jaime Metcher
John Smith wrote:
>
> I still couldn't compile modules under win32.
> So far, I have tried four different versions of perl5,
> include ActiveState perl. They all complained about
> xsubpp. Is it my windows setting or the unsolved problem of win32 perl ?
> Please help.
> If anybody have a binary version of HTML::Embperl
> module, could you please email me ?
> Thanks,
> dc@fcc.gov
------------------------------
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 3870
**************************************