[8443] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2060 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 9 22:08:01 1998

Date: Mon, 9 Mar 98 19:00:30 -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           Mon, 9 Mar 1998     Volume: 8 Number: 2060

Today's topics:
    Re: $0: which OSes? (Arthur Darren Dunham)
    Re: Another RegExp Question <jstern@world.northgrum.com>
    Re: Are There Any Snazzy Perl Editors for Windows? <mknutson@websolution.com>
    Re: Are There Any Snazzy Perl Editors for Windows? <charles.engelke@ibm.net>
        Automating Visual C++ Builds with Perl (Daniel R. Kegel)
    Re: c.l.p.mod and TPI (John Stanley)
    Re: c.l.p.mod and TPI <friedman@uci.edu>
    Re: c.l.p.mod and TPI <dformosa@st.nepean.uws.edu.au>
        Form submission christine.a.nicholson@ac.com
        How do I translate PST to EST time? <fuzzy@tampabay.rr.com>
        HTML Form "Input" sorting problem. <lyman@pacbell.net>
    Re: HTML::Element/Parser/Tree help <jdporter@min.net>
    Re: HTML::Element/Parser/Tree help (Bart Lateur)
        Informix conectivity w/perl bpszenny@baynetworks.com
    Re: Informix conectivity w/perl (Raj Goel)
    Re: lowercase $lower = lc("aBcDe"); Blows UP!! <webmaster@fccjmail.fccj.cc.fl.us>
        Northern Cal. Perl evangelist needed April 4 (Cameron Spitzer)
    Re: Perl and the mSQL Interpreter greg@directnet.net
    Re: Problem with "goto" in Perl (Andrew M. Langmead)
        pty terminal control and IPC via pseudo-terminal device (Mike Rollins)
    Re: pty terminal control and IPC via pseudo-terminal de <webmaster@fccjmail.fccj.cc.fl.us>
        RegEx for HTML... (KUNAL KAPUR)
    Re: Relational arrays <dboorstein@shopcfn.com>
    Re: Tom, grow up [Re: The -w switch (was Re: better way (Nicholas Carey)
    Re: Tom, grow up [Re: The -w switch (was Re: better way (Abigail)
    Re: use Module vs. no Module ??? <jstern@world.northgrum.com>
        using a scalar in an expression (Paul Farber)
    Re: Using named array to populate radio group via cgi.p (Craig Keefner)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 9 Mar 1998 23:14:27 GMT
From: add@netcom.com (Arthur Darren Dunham)
Subject: Re: $0: which OSes?
Message-Id: <addEpKr83.Bup@netcom.com>

In article <Moz_YMS00YUq1ooVA0@andrew.cmu.edu>,
Gautam Srikanth  <morpheus+@andrew.cmu.edu> wrote:
>Found in perlfaq8:
> 
>>>>
>To actually alter the visible command line, you can assign to the
>variable $0 as documented in the perlvar manpage. This won't work on all
>operating systems, though. Daemon programs like sendmail place their
>state there, as in: 
> 
>    $0 = "orcus [accepting connections]";
>>>>
> 
>And the question... under which OSes will ps reflect the changed command
>line?  In my testing
> 
>  - Linux 2.0.33 does
>  - Solaris 2.5.1 and HP/UX 9.05 do not.
> 
> 
>Anyone know why this happens?  Better yet, is there a workaround for
>systems where modifying $0 fails?

There are *two* different places where the program name is kept.
PROCTITLE only affects one of them.

Under Solaris 2.5, you could get both sometimes....

# perl
$0 = 'Foobar!!!!!!!';
sleep(500);
^D

# ps -ef | grep perl
    root 12501  1324  0 15:05:34 pts/8    0:00 grep perl
    root 12499   585  0 15:05:08 pts/6    0:00 perl

AND

# /usr/ucb/ps -aguxw | grep 12499
root     12499  0.0  1.3 2032 1576 pts/6    S 15:05:08  0:00 perl

But...

# /usr/ucb/ps -aguxww | grep 12499
root     12499  0.0  1.3 2032 1576 pts/6    S 15:05:08  0:00 Foobar!!!!!!!

Yes, that's right, the ww on the end affects the output.  Now, last I
checked, this didn't seem to work any longer under 2.6.  You'd
probably have to rewrite ps or something.

>thanks in advance --
> 
>Gautam 


-- 
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                                  Taos Mountain
Got some Dr. Pepper?                                     Santa Clara, CA 
      < Please move on, ...nothing to see here,  please disperse >


------------------------------

Date: Tue, 10 Mar 1998 02:19:34 GMT
From: Jim Stern <jstern@world.northgrum.com>
Subject: Re: Another RegExp Question
Message-Id: <3504A336.349B6673@world.northgrum.com>

Mike Stok wrote:
> 
> In article <35041A02.F445CB21@world.northgrum.com>,
> Jim Stern  <jstern@world.northgrum.com> wrote:
> 
> >> >        while (@data)   {
> >
> >Your problem isn't with the regex.  It's with the 'while' condition.
> >'while (@data)' does _not_ set $_ to each element of @data successively.
> >'while (defined($_ = shift @data))' does that (destroying @data as
> >it goes).  Or use 'while(<>)' to read and parse the data in one go.
> 
> Beware of while (defined($_ = shift @data)) 'cos you can have undef as an
> element of an array.  One way to do it if you want to see everything in
> the while's condition might be shown below:

Good point.  But I think the original questioner was talking about an
array
that held the contents of a file.  My answer was tailored for that.

> [...] 
> but I'd lean towards using foreach or, if you really want to use while,
> putting the assignment outside the while condition usually (although a
> destructive assignment like $_ = shift @copy in the loop may be a trap for
> someone using redo later...)

Ok.  'foreach' probably beats my patch to the original poster's 'while'.

-- 
Jim Stern -- Views here are my own, not my employer's.   (Hawthorne, CA)


------------------------------

Date: Mon, 09 Mar 1998 14:21:01 -0800
From: Mick Knutson <mknutson@websolution.com>
To: Keith Turner <rkturner@us.ibm.com>
Subject: Re: Are There Any Snazzy Perl Editors for Windows?
Message-Id: <35046B4C.B8DDA2BE@websolution.com>

I use CodeWright by Premia.  It has a Perl Extension that is really good.

Keith Turner wrote:

> Are there any text editors for windows  that can recognize perl syntax and
> color code and such?





------------------------------

Date: Mon, 09 Mar 1998 18:47:40 -0500
From: Charles Engelke <charles.engelke@ibm.net>
Subject: Re: Are There Any Snazzy Perl Editors for Windows?
Message-Id: <35047F9C.7402@ibm.net>

Keith Turner wrote:
> 
> Are there any text editors for windows  that can recognize perl syntax and
> color code and such?

I've just got to give a plug to the GWD Text Editor by Vedran Gaco,
available at http://www.iridis.com/gwd .  I've never found an editor
that could replace Brief for me until this one.

The editor is Windows-32 specific, lightning fast, supports regular
expressions, syntax coloring, and macros.  The newest 2.0 version (still
in beta and not generally available, unfortunately) uses C as its macro
language, and can easily spawn Perl programs for customization.

The free version doesn't color Perl syntax by default, but you can
download a patch that adds it.

Finally, it's very inexpensive to register, just $20 for one user, $60
for a five user site license.

I am _not_ affiliated with the programmer in any way, other than being
extremely impressed by what he has produced.


------------------------------

Date: 9 Mar 1998 23:14:31 GMT
From: dank@alumnae.caltech.edu (Daniel R. Kegel)
Subject: Automating Visual C++ Builds with Perl
Message-Id: <6e1t4n$shl@gap.cco.caltech.edu>

I'm trying to figure out how to script my Visual C 5.0 biulds.
I used to use Makefiles, but Visual C 5.0 has made that nearly impossible.
According to Steve Hardy 
( http://search.dejanews.com/getdoc.xp?AN=321715463 ), 
Perl is the way to go.

Well, it's a bit hard to figure out from scratch.  Here's 
my first try at doing anything in msdev with Perl.
I can't ever figure out how to open a workspace, much less
build a project.

Can anyone point out where I'm going wrong, or post some example Perl script
to do this kind of thing?

Thanks!

- Dan

# Perl script to test scripting of MSDEV / Visual C++ 5.0
# Use Perl-Win32 from http://www.activestate.com/software/Perl_for_Win32.htm 
# to run this script.
# dank@alumni.caltech.edu

use OLE;
print "Creating MSDEV object\n";
$msdev = CreateObject OLE 'MSDEV.Application'
	or die "Couldn't create new instance of MSDEV App!!";

# Show the app (otherwise, it's hard to believe it really invoked msdev!)
$msdev->{'Visible'} = 1;

# Print the app's name.  This works.
print "App name: ". $msdev->Name . "\n";

# This doesn't work - you can't get count this way.
#print "There are ". scalar($msdev->Projects)." projects.\n";

# This does work.
@projects = $msdev->Projects;
print "There are ". scalar(@projects)." projects.\n";

# This iterates, but ...
foreach ($msdev->Projects) {
	# Broken. Prints out a blank name.
	print "Project name is ". $_->Name . "\n";
	# Broken. Prints out a blank type.
	print "Project type is ". $_->Type . "\n";
}

# I can't figure out how to build a project.
# ???

print "Hit ENTER\n";
$x = <>;

# Quit the app.  This works.
print "Calling Quit method\n";
$msdev->Quit();
print "Done\n";


------------------------------

Date: 9 Mar 1998 22:07:42 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: c.l.p.mod and TPI
Message-Id: <6e1p7e$rqf$1@news.orst.edu>

In article <6e1m2r$565$1@cyprus.atlantic.net>,
Chip Salzenberg <chip@pobox.com> wrote:
>Perhaps you imagine that just because things are vetted by TPI that
>therefore non-TPI ads will automatically be excluded.  Nothing could
>be further from the truth.  But of course you'll have to see that to
>believe it, unless my (and Tom's and Randal's and ...) word is enough.

Quoting from the proposed charter:

]In addition, the moderators will reject any article:
]
]+ which contains an advertisement or commercial solicitation
]  of any sort; (EXCEPTION: The Perl Insitute may post
]  commercials that its board deems to be of general interest
]  to the Perl community, such as announcements of upcoming
]  Perl-oriented conferences.)

It would seem that this section of the charter needs to be reworded. It
does say that non-TPI ads will be rejected.  Well, not in so many words,
but it does say any article which contains an ad will be, except TPI may
post ads...



------------------------------

Date: 9 Mar 1998 21:54:13 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: c.l.p.mod and TPI
Message-Id: <6e1oe5$lki@news.service.uci.edu>

[mailed, posted]

In article <6e1m2r$565$1@cyprus.atlantic.net>,
Chip Salzenberg <chip@pobox.com> wrote:

<Perhaps you imagine that just because things are vetted by TPI that
<therefore non-TPI ads will automatically be excluded.  Nothing could
<be further from the truth.  But of course you'll have to see that to
<believe it, unless my (and Tom's and Randal's and ...) word is enough.

Immediately before the TPI exception, the RFD says

[a posting will be excluded...]

"+ which contains an advertisement or commercial solicitation
   of any sort;"
   ^^^^^^^^^^^^

But you say that I'm "imagining" that non-TPI ads will automatically
be excluded.  Did Mark-Jason circulate a draft that was different
from the one you signed off on?

Look, I'm all for moderating this group, but if you're going to
outlaw advertisements, then outlaw it.  Period.  TPI stuff will be plenty
visible at www.perl.org, www.perl.com, and on comp.lang.perl.announce

Randal says that TPI is the embodiment of Larry Wall's Perl
philosophy.  Great!  But does anyone seriously believe that postings
by (or inspired by) Larry won't make it through moderation?

Anyway, my greater concern is with the part of the RFD that excludes
any posting

+ which is, in the opinion of the moderation panel,
  otherwise unsuitable for posting;

what's the purpose of enumerating specific criteria if arbitrary
"opinion" can always trump the published rules?

-- 
Eric D. Friedman
friedman@uci.edu


------------------------------

Date: 10 Mar 1998 01:53:30 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: c.l.p.mod and TPI
Message-Id: <889494809.204981@cabal>

In <6e1m2r$565$1@cyprus.atlantic.net> chip@mail.atlantic.net (Chip Salzenberg) writes:

[...]

>But the idea is for the
>moderation panel to have authority to leave out "hi hire me I know how
>to spel PERL" postings while leaving things like the conferences that
>are of interest to all Perlers

Then can not you allow the moderation panel to have the authority and not
placing TCI in a higher place then anyone else who wishes to orginise a
conference.

[...]

>Perhaps you imagine that just because things are vetted by TPI that
>therefore non-TPI ads will automatically be excluded.

Then there is no need for TPI it be mentioned in the charter.

--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


------------------------------

Date: Mon, 09 Mar 1998 16:27:16 -0600
From: christine.a.nicholson@ac.com
Subject: Form submission
Message-Id: <6e1q9u$8vn$1@nnrp1.dejanews.com>

I am getting user info from a file and putting it into a form where users can
correct any personal info (like phone#, address, etc)  I can re-submit the
form though netscape using form method=POST action="perl.pl" but IE doesn't
seem to recognize this and just starts to use the GET method.
Is there a known problem between the browsers?

Thanks,
Christine

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Mon, 9 Mar 1998 21:22:09 -0500
From: "Jeff Tomich" <fuzzy@tampabay.rr.com>
Subject: How do I translate PST to EST time?
Message-Id: <6e286t$gio$1@newse2.tampabay.rr.com>

Wanting to write a script to take the PST time and translate or equate it to
EST time. How is this done?

Thanks, Jeff





------------------------------

Date: Mon, 09 Mar 1998 14:28:14 -0800
From: "Terry S. Lyman" <lyman@pacbell.net>
Subject: HTML Form "Input" sorting problem.
Message-Id: <35046CFD.E3FA1833@pacbell.net>

Recently I moved my Domain Name to another Host Provider that uses Perl.

I am having a problem with the HTML Form "input name=" string line. When
the form is submitted to me, the input text is there but it all mixed up
and not in the same order as the Form itself.
Question (1) What is needed in the html file to correct this problem?
Question (2) What is also needed in the html file to create an automatic
response back to the sender e-mail address? I was using:  input
name="Cc" , but that not working.

Thank for your time;
Terry



------------------------------

Date: Mon, 09 Mar 1998 17:05:05 -0500
From: John Porter <jdporter@min.net>
Subject: Re: HTML::Element/Parser/Tree help
Message-Id: <35046791.7C0E@min.net>

Don wrote:
> 
> Hello John,
> 
> Thanks for your reply!
> 
>  > What was your understanding of the
>    $h->content() description?
> 
> Pretty much the same as yours, which results in the same kind of list
> address, ie. "ARRAY(0x25ac5c)" being displayed instead of the actual text
> and I've not been able to figure out how to convert the list address into
> the actual text stored AT that address.  I'm sure it's simple, but it
> elludes me <frown>.

$h->content() returns an array ref, which you are apparently printing.
The array contains strings, and Element refs.  If there is only text in
content of the 'a', then the array will have length=1, and the item will
be a string.  It should be gettable as ${$h->content}[0]. (Sorry, I got
that a little wrong in my modification to your code, below, now
corrected.)


> Yes the assumption of "plain text" is a good one for starters, but I have
> seen people use tags within this text to make it bold, italic, etc., so
> that would be my second quest <smile>.

Then I would recomment performing a $h->traverse() of your tree.


> As an aside, over the weekend I figured out how to define a global RegExp
> that extracts all HREF's with text, from a document, but am wondering how
> it would compare in speed to the HTML:: modules.  Do you have any idea?
> For example, assuming the document is contained within $html...

Bad idea.

>   while ($html =~ m{<A\sHREF=(.*)</A>}ig) {

This regex is a sure loser.  Don't bother, just use HTML::Parser.

hth,
John Porter


#!/usr/local/bin/perl

use LWP::Simple;
use HTML::Parse;
use HTML::Element;
use URI::URL;

print "Content-type:text/html\n\n";

$html        = get $ENV{'QUERY_STRING'};
$parsed_html = HTML::Parse::parse_html($html);

for ( @{ $parsed_html->extract_links(a) } ) {
  my( $link, $node ) = @{$_};
  my $text     = ${$node->content}[0];
  my $url      = new URI::URL $link;
  my $full_url = $url->abs($ENV{'QUERY_STRING'});
  print "$full_url: $text<BR>";
}

$parsed_html->delete();


------------------------------

Date: Mon, 09 Mar 1998 22:11:25 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: HTML::Element/Parser/Tree help
Message-Id: <3509680d.2480852@news.tornado.be>

"Don" <dgoyette@NoMoreSPAMpcisys.net> wrote:

>... which results in the same kind of list
>address, ie. "ARRAY(0x25ac5c)" being displayed instead of the actual text
>and I've not been able to figure out how to convert the list address into
>the actual text stored AT that address.  I'm sure it's simple, but it
>elludes me <frown>.

Have you tried using @{$ref}?

HTH,
Bart.


------------------------------

Date: Mon, 09 Mar 1998 18:31:07 -0600
From: bpszenny@baynetworks.com
Subject: Informix conectivity w/perl
Message-Id: <6e21io$ejg$1@nnrp1.dejanews.com>

Hello,

Could anyone let me know what I need, and where to get it, to connect to an
Informix database using perl?

Idealy I want a WWW page to allow useres to dynamicly send queries to teh dB.

Thanks for any assistance!

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: 10 Mar 1998 01:55:25 GMT
From: frostbit@brainlink.com (Raj Goel)
Subject: Re: Informix conectivity w/perl
Message-Id: <slrn6g977q.dt2.frostbit@kali.brainlink.com>

In article <6e21io$ejg$1@nnrp1.dejanews.com>, bpszenny@baynetworks.com wrote:
>Hello,
>
>Could anyone let me know what I need, and where to get it, to connect to an
>Informix database using perl?
>
>Idealy I want a WWW page to allow useres to dynamicly send queries to teh dB.
>
>Thanks for any assistance!

	You'll need DBD-Informix abd DBI modules.

	You'll also need the ESQL/C product from Informix to build 
the DBD-Informix module.

========= << raj >>  ==  http://www.brainlink.com/~frostbit/ ==============
 SYSADMIN: BrainLINK System (718) 805-6559 // http://www.brainlink.com 

	You want to be president? 				Yes.
	Put your hand on the book and say "I Do." 		I Do.
	Fine, done.  Let's eat.		- G'Kar & Sheridan
============================================================================


------------------------------

Date: Tue, 10 Mar 1998 02:03:51 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: lowercase $lower = lc("aBcDe"); Blows UP!!
Message-Id: <35049E42.49227057@fccjmail.fccj.cc.fl.us>

Try it like this -

my $mixCase = 'AbCdE';
if (lc($mixCase) eq 'abcde') { #do stuff... }

or something like -

my $lowerCase = lc($mixCase);
my $sub = substr (lc($string),0,3));

HTH,
Bill



Christian@Sur-Tech.com wrote:

> Hi All,
> Lost here.. i'm new to perl..  so far most all in the SAMS book on perl-5 has
> worked well.. i have version 5 running on freebsd.. 3.0 122597.. just before
> the vm changes.. well i have built a little cgi that puts together a web page,
> and it seems to work well, i had a line in there like so:
> $sub = substr ($string,0,3);
>
> but i also wanted to make sure a string was lower case
> before i ran some comparisons, so i tried $sub = lc (substr ($string,0,3));
> then the page did a crash/burn.. tried several different ways of putting
> in "" marks etc.. finally tried a basic line like
> $lower = lc("aBcDe");
> this line is directly out of the book!! and if i put it anyplace in my prog,
> it blows up!?.. error output just trying to run the prog looks like below..
>
> "lc" may clash with future reserved word at ././item line 35syntax error in
> file ././item at line 35
> , next 2 tokens "lc("
>
> this will happen anyplace!! i can put this line in after i setup variable some
> variable defaults at top of prog, before i really get into anything, and it will
> do the crash/burn.. my guess is that there is some typo in the book?? or that
> the syntax has changed??
>
> Can anybody send me the "Right" way to set a string to lower case??
>
> Thanks, Christian      Christian@Sur-Tech.com        1925 Grant St #4
> Sur-Tech / Ami-Tech    (408) 496-6348 Xt 247     Santa Clara CA 95050
>                           www.Sur-Tech.com





------------------------------

Date: 9 Mar 1998 22:18:04 GMT
From: cls@internetaddress.com (Cameron Spitzer)
Subject: Northern Cal. Perl evangelist needed April 4
Message-Id: <6e1pqs$eb8$1@samba.rahul.net>


I've been asked to talk about Perl, at the Gathering of the
Green Party of California next month in San Anselmo, Marin County.

The various counties' Registrars of Voters give us our voter lists
in weird and wacky formats, and I have been translating them
into useful data.  Folks are asking, how the hell did you do that,
and the answer is Perl.  And the Greens are starting to get interested
in the free software movement.

Trouble is, I'm just a hardware guy, not an expert in Perl by any means.
I'm also a unix bigot, and don't know the first thing about
installing and using Perl on MacOS or Microsoft.
It would be great to have someone who can answer basic questions about Perl
in general, and the non-unix platforms in particular.
Please mail me if you're interested, cls@greens.org.

Please visit http://www.greens.org/.


Cameron
-- 
I interpret unsolicited commercial email as an invitation to discuss the
Realtime Blackhole service (http://maps.vix.com/rbl), and the merits of
a strong Acceptable Use Policy, with the sender's internet service provider.


------------------------------

Date: Mon, 09 Mar 1998 16:11:04 -0600
From: greg@directnet.net
Subject: Re: Perl and the mSQL Interpreter
Message-Id: <6e1pbg$86s$1@nnrp1.dejanews.com>

DBI, DBD are perl modules..  Who said that an API had to be in C??
DBI and DBD::mSQL is what you are looking for.  Very easy to install and
configure.

-Greg



In article <34FA3E4A.DA34CD57@best.com>,
  Stephanie Ray <netnuevo@best.com> wrote:
>
> I didn't want to use the API because I wanted to use Perl, not C. :-)
>
> I guess I have to look into one of the packages, but weren't people using
> Perl/CGI/mSQL a long time before DBD came out?
>
> Nathan V. Patwardhan wrote:
>
> > Stephanie Ray (netnuevo@best.com) wrote:
> > : Can anyone please tell me how to implement the following statements into
> > : Perl?  My (unsuccesful) attempt follows... any help would be greatly
> > : appreciated.
> >
> > Don't do it this way.  Go to CPAN and get the DBD::mSQL module
> > instead.  Even if you choose not to use the DBD, I still don't
> > understand why you've chosen to work with a pipe of all things --
> > particularly since mSQL has an API that's clearly documented.
> >
> > Not trying to yell at you, but very, very puzzled with your approach.
> >
> > --
> > Nathan V. Patwardhan
>
>


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Mon, 9 Mar 1998 22:49:50 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Problem with "goto" in Perl
Message-Id: <EpKq32.EDy@world.std.com>

Zenin <zenin@best.com> writes:

>Andrew M. Langmead <aml@world.std.com> wrote:
>	>snip<
>: The statement "goto LABEL" has its uses (maybe less so than in other
>: languages, but there are uses.)

>	Show me one, please.  [stuff deleted]

>	My understanding is that goto is only kept at all to more easily
>	support the s2p/a2p converters and for reverse compatibility with
>	(blgh) bad perl3/4 code.

Can I use that one? (s2p and a2p?)

Since I can't think of any changes in control flow that were added by
perl 5. (except for "goto &$SUBROUTINE") I can't see how perl3/4
compatibility could be an issue. (Oh, but you said "bad perl3/4" code"
thats different. Bad perl3 or perl4 code may contain "goto"s, just as
bad perl5 code can.)

To be honest, though. I made the statement based on the following
opinions.

1. I believe in the language-blind statement that not all gotos are
evil and that they should be judged in context.

2. I believe the perl man pages when they say that perl's
sophisticated loop control operators can replace many of the uses of
goto.

3. I haven't found a situation where opinion #2 hasn't won over
opinion #1, but since #1 requires you to examine each and every
example, I won't be able to say for sure until I find an example where
#2 doesn't apply.

-- 
Andrew Langmead


------------------------------

Date: 10 Mar 1998 00:33:21 GMT
From: rollins@wfu.edu (Mike Rollins)
Subject: pty terminal control and IPC via pseudo-terminal devices
Message-Id: <6e21oh$oka@f1n1.spenet.wfu.edu>

I was reading the C code for poppassd:
ftp://ftp.qualcomm.com/eudora/servers/unix/password/pwserve-5-osf1

I am trying to write a similar program in Perl.

Does anyone know how to communicate with a child process via  
psuedo termianal devices in Perl?

If you try to run the passwd command from Perl, the passwd command
will expect input from the terminal you are using, not the program
from which it was executed.


The idea behind the poppassd code was to fork off a child 
process, change the pseudo-terminal devices around, implement 
the /bin/passwd command and allow the parent to pass the information 
to this child.  

Does anyone have example code of how this type of communication
can be done in Perl?


------------------------------

Date: Tue, 10 Mar 1998 02:12:59 GMT
From: Bill Jones <webmaster@fccjmail.fccj.cc.fl.us>
To: Mike Rollins <rollins@wfu.edu>
Subject: Re: pty terminal control and IPC via pseudo-terminal devices
Message-Id: <3504A067.FC502670@fccjmail.fccj.cc.fl.us>

At http://www.perl.com Search under Security,
see WebPass...  It will give you some ideas about what
you can and can't do - at least not without a headache or two :-)

Enjoy!,
Bill



Mike Rollins wrote:

> If you try to run the passwd command from Perl, the passwd command
> will expect input from the terminal you are using, not the program
> from which it was executed.

> Does anyone have example code of how this type of communication
> can be done in Perl?





------------------------------

Date: 8 Mar 98 22:59:28 MDT
From: slh6z@cc.usu.edu (KUNAL KAPUR)
Subject: RegEx for HTML...
Message-Id: <dZpqkDvyR5i2@cc.usu.edu>

I am trying to write a regular expression to extract bold and italic 
words from html files. 

	i.e. <b>    </b>
 	     <i>    </i>	

Sounds trivial, but I can't figure what I am doing wrong!

I have tried various combinations of REs but none work perfectly.

Here's what best I could manage:

#!/usr/local/bin/perl

$italic_bold = "(?i)<b|i>";

while(<>) {
  if(/$italic_bold([^<]+)/)
    {
       print $1, "\n ";
    }
}

Could somebody please help!


Thanks!

Kunal



------------------------------

Date: Mon, 09 Mar 1998 17:15:32 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: Relational arrays
Message-Id: <35046A04.ECEA7F75@shopcfn.com>

Baboulen wrote:
> 
> Hi,
> 
> I'm trying to 'connect' two lists.
> 
> DISK    PHYSICAL  SIZE  ....
> disk1   c0t0d0    4Go   ....
> 
> VOL     DISK    .....
> name1   disk3   .....

> I want to print a line like :
> 
>         VOL     DISK    PHYSICAL   .....
>         name1   disk3   c2t0d0     .....
>
> I want to join LIST1 and LIST2 on DISK name.

i would use two hashes. one for disks and one for volumes.
%volumes would contain identifiers which map into the keys of %disks:

#!/usr/bin/perl -w
use strict;

my %disks = (
  'disk1' => {                       # value from %volumes
    'physical' => 'c0t0d0',
    'size' => '4Go',
  },
);

my %volumes  = (
  'name1' => {
    'disk' => 'disk1',               # used for accessing %disks
    'foo' => 'bar',
  },
);

my $voi = 'name1';                   # volume of interest
my $doi = $volumes{$voi}{'disk'};    # disk of interest
my $poi = $disks{$doi}{'physical'};  # physical of interest

print "$voi $doi $poi\n";

hope this helps,

--
#!/usr/bin/perl -w -- 2 for 1    dan boorstien <dboorstein@shopcfn.com>
# my first Just another Perl hacker,
seek DATA,0,0;{$_=<DATA>,/!/&&redo}print join(' ',(split)[3..6])__END__
# my second Just another Perl hacker,


------------------------------

Date: Mon, 09 Mar 1998 22:58:24 GMT
From: a-bnc@microsoft.com (Nicholas Carey)
Subject: Re: Tom, grow up [Re: The -w switch (was Re: better way to do this?)]
Message-Id: <3504730b.16250859@newsvr>

Err...shouldn't all this discussion of the RFD be [at least]
cross-posted to news.groups?

To quote the RFD:

> All discussion of this proposal should be posted to news.groups.
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Follow-ups adjusted appropriately.

Cheers.

N.
-- 
Who has a hard time visualizing a secret, evil cabal at the Perl
Institute scheming to dominate the world of Perl.



------------------------------

Date: 9 Mar 1998 23:41:18 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Tom, grow up [Re: The -w switch (was Re: better way to do this?)]
Message-Id: <6e1umu$4v4$2@client2.news.psi.net>

Eric D. Friedman (friedman@uci.edu) wrote on 1651 September 1993 in
<URL: news:6e1j48$hmc@news.service.uci.edu>:
++ 
++ As to Tom's specific involvement: he, his two co-authors, and his
++ publisher (who *obviously* has a commercial stake in promoting
++ the "non-profit" TPI-endorsed Perl Conference & O'Reilly books)
++ form a majority of the TPI board.  I'd be very surprised if any of
++ these folks voted against posting something that would be in
++ their financial best interests.


Tom doesn't appear to me of someone who's driven by financial interests.



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


------------------------------

Date: Tue, 10 Mar 1998 02:25:40 GMT
From: Jim Stern <jstern@world.northgrum.com>
Subject: Re: use Module vs. no Module ???
Message-Id: <3504A4A4.DC2C0D0C@world.northgrum.com>

John Porter wrote:
> 
> I know that use Module LIST causes a require of Module,
> and calls Module::import( LIST );
> my question is, if I say "no Module", does it result in a
> call to a sub in Module?  If so, what's it called?
> 

perlfunc's "use" section says it calls 'unimport'.
-- 
Jim Stern -- Views here are my own, not my employer's.   (Hawthorne, CA)


------------------------------

Date: Tue, 10 Mar 1998 02:07:39 GMT
From: farber@f-tech.net (Paul Farber)
Subject: using a scalar in an expression
Message-Id: <35049fd6.30524954@news.f-tech.net>

I'm stumped, im trying to print out a line if it conatians the month,
the lines in question are:

if ($_ =~ /$month/ )
 { print $_;}

It works fine if I enter /Dec/, it prints out all lines with Dec in
it, but it willnot work using the scalar, camel book isn't down on my
level, as I am new to perl.

thanks 

Paul


------------------------------

Date: Mon, 09 Mar 1998 22:11:12 GMT
From: keefner@kinetic.com (Craig Keefner)
Subject: Re: Using named array to populate radio group via cgi.pm
Message-Id: <350463d8.345081651@news.visi.com>

On Mon, 09 Mar 1998 12:14:17 -0500, John Porter <jdporter@min.net> wrote:

>keefner wrote:
>> 
>> Now I have a variable file to read into the array
>> and am looking for advice on best to
>> split
>  ^^^^^^^ Ding Ding Ding!
>> that into 2 or 3 elements and populate the radio group.
>> There is a "|" delimiter that I can work with.

the split wasn't the part that was bothering
me to be honest, it was populating the VALUE
and labels. I did it like this;

@array=<MYFILE>;

if ( "@array" !~ /\|/ ) {
  &error('No parts found');
  }

foreach $i (@array) {
  chomp( $i );  # get rid of any trailing "\n"s
  ($desc,$partno,$more) = split( /\|/, $i, 3);
  if ($more) {
    $partno .= '|'.$more;  # add 3rd column if non-empty
  }
    # extend part number to be unique
    $ext = 0;
   do {
     ++$ext;
     $key = $partno . '_' . $ext;
   } while exists $label{$key}; 
  $partno = $key;

  push @values, $partno;    # populate VALUE array
  $label{$partno} = $desc;  # populate labels hash

}

question: If the array only contains one row
of data, how can I test/recognize that. 
That would mean that I've found one available part
and there would be no need to populate a radiogroup
(i could go straight to the sql).

Craig





------------------------------

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 2060
**************************************

home help back first fref pref prev next nref lref last post