[17938] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 98 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 19 11:05:27 2001

Date: Fri, 19 Jan 2001 08:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979920308-v10-i98@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 19 Jan 2001     Volume: 10 Number: 98

Today's topics:
        Another newbie mattfenn@my-deja.com
    Re: Another newbie (Bernard El-Hagin)
    Re: Another newbie (Chris Fedde)
        Cache control: no Cache ?? for parts of a html file ? <comctl@yahoo.com>
    Re: Hello.  I'm back. (Tad McClellan)
    Re: Hello.  I'm back. jdf@pobox.com
    Re: Hello.  I'm back. <nospam@nospam.com>
        How to number of directories and dates on NT <sumera.shaozab@lmco.com>
    Re: How to number of directories and dates on NT <josef.moellers@fujitsu-siemens.com>
        HTML::TokeParser - Help please! badass101@my-deja.com
    Re: Mailing attachments? jdf@pobox.com
        Newbie question <kkirwan@emory.edu>
    Re: Newbie question (Bernard El-Hagin)
    Re: Newbie question <kkirwan@emory.edu>
        Newbie questions: variable scope <lxq79@hotmail.com>
    Re: Newbie questions: variable scope (Bernard El-Hagin)
    Re: Newbie questions: variable scope (Bernard El-Hagin)
    Re: Newbie questions: variable scope <lxq79@hotmail.com>
    Re: opening file into filter (Tad McClellan)
    Re: overhead on filehandle opening/closing jdf@pobox.com
    Re: passing a variable... what am i doing wrong??? <nospam@nospam.com>
        Perl Style Guide - uncuddled elses birgitt@my-deja.com
    Re: Perl Style Guide - uncuddled elses <nospam@nospam.com>
        Question about domain users/groups <hexorhaxor@vaxor.com>
    Re: Syntax -  Still need HELP <nospam@nospam.com>
        XML::Parser <kdinh@commerce-tv.com>
    Re: XML::Parser (Bernard El-Hagin)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Jan 2001 15:08:23 GMT
From: mattfenn@my-deja.com
Subject: Another newbie
Message-Id: <949l90$fus$1@nnrp1.deja.com>

Hi, I've picked up PERL again after a 4 year hiatus. The last time I
used PERL was on the UNIX platform, I'm now using ActiveState Perl on
Windows, in particular Win95. I'm glad to be back.
Since at this time I don't have any business need for PERL, I'm just
fooling around for now. At work we try to solve a monthly puzzle posted
on our Intranet site. Part of this weeks puzzle: We are given a paragrah
which we need to find words that have an even number of charaters and
only one vowel. One of these words is the solution to the puzzle. I was
able to split the paragrah and extract each word and then determine if
the word has an even number of characters. I have pasted what I've done
so far. I'm having trouble matching each word for only one vowel. Any
ideas?

open (WORDLIST, "C:\\PERL\\MattsExamples\\Puzzle.txt");
$_ = <WORDLIST>;
close(WORDLIST);
chop($_);
#Eliminate punctuation marks and whitespace. Not sure if this is the
best approach?
@words = split(/[,.!]|\s+/,$_); #??????
foreach $word (@words) {
        #For each word determine how many characters. I'm not sure if
this is the best appraoch
        @size = split(//,$word); #??????
        $size = @size;
        #I also need to match for only one vowel and print the result
        #I'm not sure why but I was picking up spaces and hence the need
for the: $size gt 0
        if ($size gt 0 && $size % 2 eq 0)  {
                print "The word is $word, and its size is $size\n";
                }
       }

Thanks for any help.

Matt


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 19 Jan 2001 15:28:21 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Another newbie
Message-Id: <slrn96gn8h.2q0.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 19 Jan 2001 15:08:23 GMT, mattfenn@my-deja.com
<mattfenn@my-deja.com> wrote:

[snip]

>I'm having trouble matching each word for only one vowel. Any
>ideas?

A rather simple, but ugly way of counting the number of vowels:

------------------
my $vowels;
$_ = "abba";
foreach(split//){
	$vowels++ if /[aeiouy]/;
}
print "Too many vowels" if $vowels > 1;
------------------

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Fri, 19 Jan 2001 15:59:15 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Another newbie
Message-Id: <nvZ96.1109$B9.193396224@news.frii.net>

In article <949l90$fus$1@nnrp1.deja.com>,  <mattfenn@my-deja.com> wrote:
>Part of this weeks puzzle: We are given a paragrah
>which we need to find words that have an even number of charaters and
>only one vowel. One of these words is the solution to the puzzle. I was
>able to split the paragrah and extract each word and then determine if
>the word has an even number of characters. I have pasted what I've done
>so far. I'm having trouble matching each word for only one vowel. Any
>ideas?
>

This comes close:

man perlop |
perl -lne '
   $t{$_}++ for grep(/\w+/, split(/\s+/, $_));
    END {
        print map {join " ", $_, tr/aeiouAEIOU/aeiouAEIOU/, length($_)%2,"\n"}
            keys(%t);
    }
'

I'm sure one of the pros could do it in fewer strokes though.

chris
-- 
    This space intentionally left blank


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

Date: Fri, 19 Jan 2001 14:52:28 GMT
From: Seansan <comctl@yahoo.com>
Subject: Cache control: no Cache ?? for parts of a html file ?
Message-Id: <949kb8$f5u$1@nnrp1.deja.com>

I have a page and when it loads. The contents of the page is not
supposed to be cached at all. SO i use cache control and pragma is no
cache
But in the html page gif images are used. I DO want these to be cached,
because the page is refreshed quite foten and this only makes the page
slower.

Any idea on how to solve this??


-----+++++-----+++++-----+++++
When give, always get.
Mr. Miyagi


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 19 Jan 2001 14:09:51 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Hello.  I'm back.
Message-Id: <slrn96gbgj.6rf.tadmc@tadmc26.august.net>

jdf@pobox.com <jdf@pobox.com> wrote:
>Hello.  My name is Jonathan Feinberg.  I used to be a frequent poster
>to this group and to c.l.p.moderated.  I gave up in exhaustion some
>time ago--perhaps a year or so--but I'm back.  


Welcome back.


>I've begun teaching a
>Perl class at a local corporate technical cubical farm, and I'm having
>a good time, so I thought I'd share the love.


There is a mailing list for Perl trainers:

   http://www.deja.com/[ST_rn=ap]/getdoc.xp?AN=540846325&fmt=text

---------------
From: skud+usenet@netizen.com.au (Kirrily 'Skud' Robert)
Subject: ANNOUNCE: Mailing list for Perl trainers
Date: 26 Oct 1999 00:00:00 GMT
Newsgroups: comp.lang.perl.moderated,comp.lang.perl.announce
---------------


>Sadly, I've lost my old killfile.  Any of you old-timers have a
>gnus-compatible scorefile for c.l.p.m that you'd care to email to me?
>I think you know what I'm talking about.


Oh golly! I wish you had put the subject of your post in the
Subject of your post.

I collect perl-related scorefiles (several have been posted here
in the past, some I requested in email), I wouldn't have thought
to look in an article with this Subject though...


>Hello Randal, hello rootbeer, hello Larry Rosler, hello Andrew
>Langmead, and are you out there gellyfish?  


Those regulars are regulars no more (I've only seen Randal
here from time to time recently).


>Hello MJD, hello brian d
>foy, 


Here much less frequently than you are likely to remember.


>no point saying hello to tchrist, 


Paying him back in kind is a Good Thing?

You could have graciously left that part out.

But I think he's gone again too.


Many have abandoned the newsgroup, there are of course, a few
new regulars as well.


>and hello to everyone in
>general.


Yo dude!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 19 Jan 2001 09:59:56 -0500
From: jdf@pobox.com
Subject: Re: Hello.  I'm back.
Message-Id: <66jbeger.fsf@pobox.com>

tadmc@augustmail.com (Tad McClellan) writes:

> There is a mailing list for Perl trainers:
> 
>    http://www.deja.com/[ST_rn=ap]/getdoc.xp?AN=540846325&fmt=text

Thank you so much.  I have subscribed.

> >no point saying hello to tchrist, 
> 
> Paying him back in kind is a Good Thing?

I didn't say that to imply "because he wouldn't say hello back to me";
I said it to imply "because he doesn't hang out here."  No offense
meant.  I actually like the guy.  He's cute when he's grumpy.

> Yo dude!

Yo!  And thanks for the reply.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 19 Jan 2001 15:02:17 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Hello.  I'm back.
Message-Id: <949ktp$6sk$0@216.155.33.20>

In article <lms8dtk5.fsf@pobox.com>, jdf@pobox.com wrote:

 | Hello.  My name is Jonathan Feinberg.  I used to be a frequent poster
 | to this group and to c.l.p.moderated.  I gave up in exhaustion some
 | time ago--perhaps a year or so--but I'm back.  I've begun teaching a
 | Perl class at a local corporate technical cubical farm, and I'm having
 | a good time, so I thought I'd share the love.

Welcome back! Glad to see another old-time frequent poster return. What 
with some of the other regular denizens you mentioned being more absent 
than usual lately, an 'old hand' is a welcome sight indeed. 

re-Greets, and felicitations ! :) 

 ... and a fellow br00klynite I see, as well (although I've relocated to 
Delaware myself, Brooklyn's still in da heart :D

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Fri, 19 Jan 2001 15:36:22 GMT
From: smax <sumera.shaozab@lmco.com>
Subject: How to number of directories and dates on NT
Message-Id: <949mtl$hme$1@nnrp1.deja.com>

Hi,

I am tring to write a "C" program to run on an NT server.  It has to go
through each directory and check its subdirectories.  If there are 100
subdirectories then move the entire directory to another location.  If
there are less than 100 then check the directory's modification date.
If the date is greater than 2 days then move it to another location.
Otherwise leave that directory where it is.

How can I capture the number of each subdirectories and modification
date of the parent directory using C programming?

Any help is appreciated

Thanks!

SAS


Sent via Deja.com
http://www.deja.com/


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

Date: Fri, 19 Jan 2001 16:58:02 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How to number of directories and dates on NT
Message-Id: <3A68640A.73514846@fujitsu-siemens.com>

smax wrote:
> =

> Hi,
> =

> I am tring to write a "C" program to run on an NT server.  It has to go=

> through each directory and check its subdirectories.  If there are 100
> subdirectories then move the entire directory to another location.  If
> there are less than 100 then check the directory's modification date.
> If the date is greater than 2 days then move it to another location.
> Otherwise leave that directory where it is.
> =

> How can I capture the number of each subdirectories and modification
> date of the parent directory using C programming?
> =

> Any help is appreciated

Although there are two "C"s in comp.lang.perl.misc, your question has
nothing to do with this very fine language.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)


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

Date: Fri, 19 Jan 2001 15:49:01 GMT
From: badass101@my-deja.com
Subject: HTML::TokeParser - Help please!
Message-Id: <949nl8$iau$1@nnrp1.deja.com>

Hi,
I'm playing around with html::tokeparser, and I
am trying to do something that returns all of the
text in an html page, but without any whitespace.

i.e. I get a list of words all seperated by a
single space!

I am currently doing this:

  my $parser = HTML::TokeParser->new(\$c);
  while (my $token = $parser->get_token) {
    next unless $token->[0] eq 'T';
    if (($token->[1] ne "")&&($token->[1] ne "\n")
&&($token->[1] ne "&nbsp;")){

	print $token->[1];
	}
  }

but it returns very spaced out text.

Help please!!

Craig Atkins


Sent via Deja.com
http://www.deja.com/


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

Date: 19 Jan 2001 10:07:29 -0500
From: jdf@pobox.com
Subject: Re: Mailing attachments?
Message-Id: <zognd1hq.fsf@pobox.com>

abigail@foad.org (Abigail) writes:

> If you can install programs, you can install modules as well. It isn't
> that you need to sacrifice a goat and a virgin while burning black
> candles.

Oh my Goddess.  All of that time in the Dark Cubicle has been wasted?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Fri, 19 Jan 2001 09:11:39 -0500
From: "Kevin Kirwan" <kkirwan@emory.edu>
Subject: Newbie question
Message-Id: <949hq3$2lb$1@lendl.cc.emory.edu>

I'm in the process of learning PERL.  I have a question regarding assignment
of output from a system("cmd") to a variable.  Syntax I've used is:
1.
system("/usr/lpp/ssp/bin/splstdata -A|wc -l");
$num = $_;
2.
$num = system("/usr/lpp/ssp/bin/splstdata -A|wc -l");

I've noticed that option 2 assigns the return code value to $num.

How do I get the output from this system call assigned to $num?

Thanks,
Kevin




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

Date: Fri, 19 Jan 2001 14:22:08 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Newbie question
Message-Id: <slrn96gjce.2q0.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 19 Jan 2001 09:11:39 -0500, Kevin Kirwan <kkirwan@emory.edu>
wrote:
>I'm in the process of learning PERL.

No you're not. You're in the process of learning Perl.

>I have a question regarding assignment
>of output from a system("cmd") to a variable.  Syntax I've used is:
>1.
>system("/usr/lpp/ssp/bin/splstdata -A|wc -l");
>$num = $_;
>2.
>$num = system("/usr/lpp/ssp/bin/splstdata -A|wc -l");
>
>I've noticed that option 2 assigns the return code value to $num.
>
>How do I get the output from this system call assigned to $num?

You need to use qx// or the equivalent `` (backticks). For example:

my $num = qx /ls/;

or

my $num = `ls`;

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Fri, 19 Jan 2001 10:40:12 -0500
From: "Kevin Kirwan" <kkirwan@emory.edu>
Subject: Re: Newbie question
Message-Id: <949n04$39b$1@lendl.cc.emory.edu>

Bernard,
Thanks so much for the help.  I changed my perl (pls note the corrected use
of case) script to use local variable and the qx operator.  Worked like a
champ.

Kevin

"Bernard El-Hagin" <bernard.el-hagin@lido-tech.net> wrote in message
news:slrn96gjce.2q0.bernard.el-hagin@gdndev25.lido-tech...
> On Fri, 19 Jan 2001 09:11:39 -0500, Kevin Kirwan <kkirwan@emory.edu>
> wrote:
> >I'm in the process of learning PERL.
>
> No you're not. You're in the process of learning Perl.
>
> >I have a question regarding assignment
> >of output from a system("cmd") to a variable.  Syntax I've used is:
> >1.
> >system("/usr/lpp/ssp/bin/splstdata -A|wc -l");
> >$num = $_;
> >2.
> >$num = system("/usr/lpp/ssp/bin/splstdata -A|wc -l");
> >
> >I've noticed that option 2 assigns the return code value to $num.
> >
> >How do I get the output from this system call assigned to $num?
>
> You need to use qx// or the equivalent `` (backticks). For example:
>
> my $num = qx /ls/;
>
> or
>
> my $num = `ls`;
>
> Cheers,
> Bernard
> --
> #requires 5.6.0
> perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$
?] }'




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

Date: Sat, 20 Jan 2001 00:12:05 +0900
From: L-X-Q <lxq79@hotmail.com>
Subject: Newbie questions: variable scope
Message-Id: <20010120001205.4623bb41.lxq79@hotmail.com>

Hi all,

I tried to make a script like this:

---
#!/usr/bin/perl -w

use strict;

my $value = 30;

sub testFunc {
    print("$value");
}

testFunc();
---

My questions are:
1. Why can the subroutine testFunc get the $value even I have set 'my' to $value? Is that not how 'my' works (to make variable on accessible in specific block)?
2. I don't get the idea about 'our' and 'local'. Can somebody please write a simple script demostrating the difference between 'my', 'our' and 'local'?

Thank you so much.
LXQ




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

Date: Fri, 19 Jan 2001 15:20:43 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Newbie questions: variable scope
Message-Id: <slrn96gmqa.2q0.bernard.el-hagin@gdndev25.lido-tech>

On Sat, 20 Jan 2001 00:12:05 +0900, L-X-Q <lxq79@hotmail.com> wrote:
>Hi all,
>
>I tried to make a script like this:
>
>---
>#!/usr/bin/perl -w
>
>use strict;
>
>my $value = 30;
>
>sub testFunc {
>    print("$value");
>}
>
>testFunc();
>---
>
>My questions are:
>1. Why can the subroutine testFunc get the $value even I have set 'my'
>to $value? Is that not how 'my' works (to make variable on accessible in
>specific block)?

But think about what the block is in this case. $value is effectively
global since it's outside of any block.

>2. I don't get the idea about 'our' and 'local'. Can somebody please
>write a simple script demostrating the difference between 'my', 'our'
>and 'local'?

Check out this great article on the subject:

http://perl.plover.com/FAQs/Namespaces.html

It doesn't say anything about 'our', because that's new, but once you've
read the article and:

perldoc -f our

you'll understand what it does.

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Fri, 19 Jan 2001 15:31:16 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Newbie questions: variable scope
Message-Id: <slrn96gne4.2q0.bernard.el-hagin@gdndev25.lido-tech>

I wrote:

>Check out this great article on the subject:
>
>http://perl.plover.com/FAQs/Namespaces.html
>
>It doesn't say anything about 'our' [...]

Actually, it does. Silly me.

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Sat, 20 Jan 2001 00:41:39 +0900
From: L-X-Q <lxq79@hotmail.com>
Subject: Re: Newbie questions: variable scope
Message-Id: <20010120004139.69105d75.lxq79@hotmail.com>

Thanks :)

Btw, I got this message when tried to lookup for 'our':
[bk@mercury perl]$ perldoc -f our
No documentation for perl function `our' found

-bk-

On Fri, 19 Jan 2001 15:31:16 +0000 (UTC)
bernard.el-hagin@lido-tech.net (Bernard El-Hagin) wrote:

> I wrote:
> 
> >Check out this great article on the subject:
> >
> >http://perl.plover.com/FAQs/Namespaces.html
> >
> >It doesn't say anything about 'our' [...]
> 
> Actually, it does. Silly me.
> 
> Cheers,
> Bernard
> --
> #requires 5.6.0
> perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: Fri, 19 Jan 2001 14:09:53 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: opening file into filter
Message-Id: <slrn96gbok.6rf.tadmc@tadmc26.august.net>

bolero92@my-deja.com <bolero92@my-deja.com> wrote:
>how can I open a file to a filter
>so that the input to the filter contains
>no more than 2 newline?


You do not need a pipe. Just stop reading after 2 lines.


>> cat test.pl
>#!/usr/local/bin/perl

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


>open (FILE, "what should I put here |");

   open (FILE, 'readme.txt') || die "could not open 'readme.txt'  $!";


>while (<FILE>) {
>print $_;


   last if $. == 2;


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 19 Jan 2001 10:05:15 -0500
From: jdf@pobox.com
Subject: Re: overhead on filehandle opening/closing
Message-Id: <3defeg5w.fsf@pobox.com>

"Anson Parker" <ans@_nospam_x64.net> writes:

> For example, in a Perl daemon I'm building there's an built-in logging
> routine. Currently the daemon opens a filehandle to the log file on startup
> and closes it on shutdown. Given that the daemon could have uptimes
> into the years (hmmm don't think it's quite that robust yet) are there any
> issues with keeping a filehandle open indefinitely?

That depends on whether anyone else is supposed to be able to write to
the file.  If so, then, yes, that's a problem.  If, as I'd guess, your
process is the only one writing to the file, but you'd like others to
be able to read it, then, no, no problem.  Simply use flock() to issue
an advisory exclusive-write lock on the file in question, and hope
that everyone else is a good neighbor.

> If so, is it then better to open and close the filehandle for every logfile
> write (this could sometimes be a good number of lines/second)? Or
> would the overhead (if any) make this a bad idea.

IMHO, bad idea.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: 19 Jan 2001 15:42:45 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: passing a variable... what am i doing wrong???
Message-Id: <949n9l$f71$0@216.155.33.20>

In article <944p22$aql$1@nnrp1.deja.com>, pape_98@my-deja.com wrote:

I can say one thing.. if you're going to use CGI.pm, then USE it :) 

 |      print OUT1 ("
 | <td ALIGN=LEFT WIDTH=\"84\" BGCOLOR=\"#FFFFFF\" rowspan=\"4\">
 | <form method=\"POST\" style=\"float:
 | left\"action=\"http://zeus.nhlbi.nih.gov/cgi-bin/pape/save.pl\">
 | <p><input type=\"submit\" value=\"Save Changes\" name=\"$dir\"
 | style=\"border-style: solid; border-width: 1\"></p>
 | <input type=\"hidden\" name=\"$dir\" value=\"$dir\"></form>
 | <form method=\"POST\" style=\"float: left\"
 | action=\"http://zeus.nhlbi.nih.gov/cgi-bin/pape/delete.pl\">
 | <p><input type=\"submit\" value=\"Delete\" name=\"$dir\" style=\"border-
 | style: solid; border-width: 1\"></p>
 | <input type=\"hidden\" name=\"$dir\" value=\"$dir\"></form>
 | </td> \n
 | ");

should really look more like this (excuse the linewrapping.. I did the 
best I could):
 
#!perl -w
use strict;
use CGI qw/:standard -no_xhtml/;
my $dir = "/test/dir";
print table( Tr(
 td({ -align=>'left',  -width=>'84', -bgcolor=>'#FFFFFF', -rowspan=>'4'},
    start_form({-method=>'POST', -Style=>'float: left', 
-action=>'http://zeus.nhlbi.nih.gov/cgi-bin/pape/save.pl'}),
      p( 
        input({-type=>'submit', -value=>'Save Changes', -name=>"$dir", 
-Style=>'border-style: solid; border-width: 1'}) 
        ),
      input({-type=>'hidden', -name=>"$dir", -value=>"$dir"}),
    end_form(),
    start_form({-method=>'POST', -Style=>'float: left', 
-action=>'http://zeus.nhlbi.nih.gov/cgi-bin/pape/delete.pl'}), 
      p( 
        input({-type=>'submit', -value=>'Delete', -name=>"$dir", 
-Style=>'border- style: solid; border-width: 1'})
        ),
      input({-type=>'hidden', -name=>"$dir", -value=>"$dir"}),
    end_form(), 
  ), ), "\n" ); #</td></tr></table>

which results in correct output like this: 

<table><tr><td align="left" bgcolor="#FFFFFF" width="84" 
rowspan="4"><form method="post" 
action="http://zeus.nhlbi.nih.gov/cgi-bin/pape/save.pl" 
enctype="application/x-www-form-urlencoded" style="float: left">
 <p><input value="Save Changes" style="border-style: solid; 
border-width: 1" name="/test/dir" type="submit"></p> <input 
value="/test/dir" name="/test/dir" type="hidden"> </form> <form 
method="post" action="http://zeus.nhlbi.nih.gov/cgi-bin/pape/delete.pl" 
enctype="application/x-www-form-urlencoded" style="float: left">
 <p><input value="Delete" style="border- style: solid; border-width: 1" 
name="/test/dir" type="submit"></p> <input value="/test/dir" 
name="/test/dir" type="hidden"> </form></td></tr> 
</table>


HTH!

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Fri, 19 Jan 2001 14:02:45 GMT
From: birgitt@my-deja.com
Subject: Perl Style Guide - uncuddled elses
Message-Id: <949he0$cf5$1@nnrp1.deja.com>

I am reading the Perl Style Guide and don't understand what the meaning
of "uncuddled elses" is. What is meant by "uncuddled" ?

--
BF


Sent via Deja.com
http://www.deja.com/


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

Date: 19 Jan 2001 15:13:07 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Perl Style Guide - uncuddled elses
Message-Id: <949li3$6sk$1@216.155.33.20>

In article <949he0$cf5$1@nnrp1.deja.com>, birgitt@my-deja.com wrote:

 | I am reading the Perl Style Guide and don't understand what the meaning
 | of "uncuddled elses" is. What is meant by "uncuddled" ?


guessing is usually frowned upon, however my impression of that was 
'don't do this:'

}else{

depending on the complexity of your statements, some format like this 
may look more succinct and be easier to parse visually:

  if ( defined(param()) and ( param('short') eq 'rated' ) )
    { $displayselect = "SELECT gametype, coercename, filename, title 
                        FROM ncmapslist 
                        WHERE gametype = '$GameType' AND rating >= 0 " }

  elsif ( defined(param()) and ( param('short') eq 'unrated' ) ) 
    { $displayselect = "SELECT gametype, coercename, filename, title 
                        FROM ncmapslist 
                        WHERE gametype = '$GameType' AND rating < 0 " }
  else 
    { $displayselect = "SELECT gametype, coercename, filename, title
                        FROM ncmapslist 
                        WHERE gametype = '$GameType' " }


 ... at least that's what I took it to mean. If I'm on the wrong track, 
I'm open to suggestions. (: 

and yeah, I know "StudlyCaps" are deprecated, but in (very) rare 
instances they work visually for me. hehe :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Fri, 19 Jan 2001 15:53:44 +0100
From: "Arthuro" <hexorhaxor@vaxor.com>
Subject: Question about domain users/groups
Message-Id: <949kfb$62t$1@porthos.nl.uu.net>

Hello,

Is there a way to extract a list of users and the groups they're in from a
primary domain server
(Windows NT)?
I have found a way to export a list of users and a list of groups in comma
seperated files.
But they're seperate lists.

What i need to do is extract a list that's for example in this form:

UserName,UserGroup
UserName,UserGroup
 ...
etc.

I've not found a way in winnt to do that, and i was wondering if there's a
perl solution to this..

If anyone can tell me how to pull this trick off in perl, or perhaps in
windows nt itself i'd be very thankfull.

Regards,
Arthuro..




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

Date: 19 Jan 2001 15:54:56 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Syntax -  Still need HELP
Message-Id: <949o0g$f71$1@216.155.33.20>

In article <Rrt96.48$PN6.3102@news0.optus.net.au>, "Chris W" 
<chrisw.NOSPAM@dynamite.com.au> wrote:

 | 
 | What happens when you use the 'here' document to simpify the bul text
 | output?
 | 
 | print <<_EOPRINT;
 | <HR><H3>You did not fill in the required Survey Information fields
 | Please click the Back button at the top of your browser and answer
 | the two survey questions listed at the bottom of the page.</P>
 | _EOPRINT
 | 
 | 

not that this has ANYTHING to do with Perl (or the user's problem), but 
that last </P> should most likely be </H3> ...

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Fri, 19 Jan 2001 14:30:08 -0000
From: Khuong H. Dinh <kdinh@commerce-tv.com>
Subject: XML::Parser
Message-Id: <t6gjrgs3tosm47@corp.supernews.com>

Hi,
Does anybody have an example of code of how to extract element's "content" 
from an xml file?

I would appreciate your help very much.

Khuong.

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Fri, 19 Jan 2001 14:40:35 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: XML::Parser
Message-Id: <slrn96gkf1.2q0.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 19 Jan 2001 14:30:08 -0000, Khuong H. Dinh
<kdinh@commerce-tv.com> wrote:
>Hi,
>Does anybody have an example of code of how to extract element's "content" 
>from an xml file?

perldoc XML::Parser

It's all in there (grep for 'element').

Cheers,
Bernard
--
#requires 5.6.0
perl -le'* = =[[`JAPH`]=>[q[Just another Perl hacker,]]];print @ { @ = [$ ?] }'


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V10 Issue 98
*************************************


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