[8328] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1945 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 21 02:12:43 1998

Date: Fri, 20 Feb 98 23:00:24 -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           Fri, 20 Feb 1998     Volume: 8 Number: 1945

Today's topics:
    Re:  Mailing List Perl Program? (Earl Hood)
        "Learning Perl" questions and frustrations (David Pinkerton)
    Re: "Learning Perl" questions and frustrations (brian moore)
    Re: "Learning Perl" questions and frustrations (Mike Heins)
    Re: 5.004 bug? invisible object dereferencing (Ilya Zakharevich)
    Re: 5.004 bug? invisible object dereferencing <zenin@best.com>
    Re: A Few Questions about Form Handling <rrjackso@tddcae99.tddeng00.fnts.com>
    Re: Avoiding $` <joegottman@nospam.worldnet.att.net>
        CGI.pm error - Modification of Read-Only Value <mroeser@removethis.gte.net>
    Re: differences perl 4.0.1.8 -> 4.0.3.6 <bf8$s03c92f97$a93d2@kf8nh.apk.net>
    Re: Getting GET/POST requests (Nathan V. Patwardhan)
    Re: HELP!  exec doesn't work properly! <lsj@bnl.gov>
    Re: HELP! exec doesn't work properly! <sfarrell+usenet@farrell.org>
    Re: HUMOR: Userspeak vs Hackerspeak <bf8$s03c92f97$a93d2@kf8nh.apk.net>
    Re: if (-d $filename) in Win32 <cdkaiser@delete.these.four.words.concentric.net>
    Re: Mailing List Perl Program? <bgrosman@healey.com.au>
        Multicast perl <nrd@mcg.net>
    Re: on reading FAQs and gurus answering questions (John Stanley)
    Re: on reading FAQs and gurus answering questions (John Stanley)
        Please help <dphan@hal-pc.org>
    Re: Prisoners of the evil empire <bf8$s03c92f97$a93d2@kf8nh.apk.net>
    Re: RFC about ``Matt's Script Archive'' (Craig Berry)
        SQL, Perl and Access databases (running on NT4) (Ed Egan)
    Re: SQL, Perl and Access databases (running on NT4) (Steve Linberg)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl <bf8$s03c92f97$a93d2@kf8nh.apk.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 21 Feb 1998 01:09:15 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re:  Mailing List Perl Program?
Message-Id: <6cl9fr$pes@news.service.uci.edu>

	[mail and posted]
In article <6cka52$8m9@bgtnsc01.worldnet.att.net>,
Kate Smalley <Kate-Smalley@worldnet.att.net> wrote:
>
>I was wondering what was involved in setting up a mailing list perl
>program?  Is there a perl program available, with simple functions, not too
>complicated?  In your opinions is it too much trouble to bother with?

Have you looked at Majordomo?

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Sat, 21 Feb 1998 02:14:21 GMT
From: dep2@csrlink.net (David Pinkerton)
Subject: "Learning Perl" questions and frustrations
Message-Id: <34ee3454.50494916@news.csrlink.net>

I've been starting to work my way through this book recently and have
come across several operators (?) that have not worked.  The first is
the "chomp" command.  This is the example:

$name = <STDIN>;
chomp ($name);

and here is the error I receive:

syntax error in file hello.sh at line 5, next 2 tokens "chomp ("
Execution of hello.sh aborted due to compilation errors.

*Luckily* I happened to read (somewhere else) that "chop" can be
substitued for "chomp."  So far this has worked but can anyone tell me
why "chomp" will not work?  This is SunOS Unix if that makes a
difference.  I'm not sure what version of Perl this is and I have no
idea how to find out.  
	Secondly, when trying to use the "qw" command I get an error
every time.  Here is an example from page 10 of the book:

%words = qw(
     fred     camel
     barney   llama
     betty    alpaca
     wilma    alpaca
);

the error I get is this:

Illegal expression (MODULO) as lvalue in file sw3.sh at line 3, next 2
tokens "qw("
syntax error in file sw3.sh at line 3, next 2 tokens "qw("
Execution of sw3.sh aborted due to compilation errors.

I was able to get around something like this:  %words = qw(camel llama
alpaca); by doing this:  %words = ("camel", "llama", "alpaca") but
doesn't that defeat the purpose of "qw" in the first place?
	Can anyone give me any help on this.  If I can't get "qw" to
work I'm sort of finished by page 10.  How frustrating.

David
dep2@csrlink.net




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

Date: 21 Feb 1998 02:43:18 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: "Learning Perl" questions and frustrations
Message-Id: <slrn6esfr1.ujg.bem@thorin.cmc.net>

On Sat, 21 Feb 1998 02:14:21 GMT, 
David Pinkerton <dep2@csrlink.net> wrote:
>*Luckily* I happened to read (somewhere else) that "chop" can be
>substitued for "chomp."  So far this has worked but can anyone tell me
>why "chomp" will not work?  This is SunOS Unix if that makes a
>difference.  I'm not sure what version of Perl this is and I have no
>idea how to find out.  

how about perl -v?  Bet it's Perl4, not Perl5 and you're using the new
book which is Perl5.

Hit your admin on the head and tell him to install Perl5: chomp works
with Perl5.

>	Secondly, when trying to use the "qw" command I get an error
>every time.  Here is an example from page 10 of the book:

<snip>

>I was able to get around something like this:  %words = qw(camel llama
>alpaca); by doing this:  %words = ("camel", "llama", "alpaca") but
>doesn't that defeat the purpose of "qw" in the first place?
>	Can anyone give me any help on this.  If I can't get "qw" to
>work I'm sort of finished by page 10.  How frustrating.

Another sign of Perl4: get your admin to install Perl5.



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

Date: 21 Feb 98 03:04:19 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: "Learning Perl" questions and frustrations
Message-Id: <34ee4433.0@news.one.net>

David Pinkerton <dep2@csrlink.net> wrote:
> I've been starting to work my way through this book recently and have
> come across several operators (?) that have not worked.  The first is
> the "chomp" command.  This is the example:

> $name = <STDIN>;
> chomp ($name);

> and here is the error I receive:

> syntax error in file hello.sh at line 5, next 2 tokens "chomp ("
> Execution of hello.sh aborted due to compilation errors.

I am guessting that if you did a 'perl -v' you would
find that you are running Perl 4.036, which is a 5-year-old
dinosaur (yes, 5 years is a couple of eaons in this business).

The chomp() function and qw// operators you mention are 
in the one true Perl, but not in that old version.

Sometimes you will find a real perl by typing 'perl5'. If not,
you can download and build your own pretty easily.

Good luck!

Regards,
Mike Heins                          
                               
The Net is a dangerous place to send naive students.  You may as well
send them to the nearest laundromat to learn about quantum mechanics.
They might get lucky, but they're more likely to return as members of
a new church.     -- Vernon Schryver



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

Date: 21 Feb 1998 02:00:33 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: 5.004 bug? invisible object dereferencing
Message-Id: <6clcg1$49n$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Zenin 
<zenin@best.com>],
who wrote in article <888021723.709634@thrush.omix.com>:
> 	I think you don't fully understand what bless() does to references,
> 	and you also seem to be making the incorrect assumption that a Perl
> 	reference is the same as a C pointer, which it isn't.  Unlike a
> 	pointer, a Perl reference holds much more then just the memory
> 	location.  It is not the same as an int, nore is it stored as such.
> 	Yes, they are stored in scalar values, however scalar values hold
> 	far more then just an "int" or "string" themselfs.  See man perlguts
> 	if you really want to know the gorry details, but it isn't needed to
> 	use or build objects and classes.

Sorry to disturb you, but a Perl reference is *exactly* what you say
it is not.  It keeps just the address of the referenced object,
nothing more (except probably a refcount - which is most often 1,
unless something else references *this reference*).

Ilya


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

Date: 21 Feb 1998 03:17:41 GMT
From: Zenin <zenin@best.com>
Subject: Re: 5.004 bug? invisible object dereferencing
Message-Id: <888031305.516107@thrush.omix.com>

[ posted & mailed ]

Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
	>snip<
: Sorry to disturb you, but a Perl reference is *exactly* what you say
: it is not.  It keeps just the address of the referenced object,
: nothing more (except probably a refcount - which is most often 1,
: unless something else references *this reference*).

	Hmm, now we're talking semantics, but I should know better then to
	give a correct "usability" answer that doesn't fly if you get out
	of Perl code and into it's source with this group.  At least, not
	without redundant explanation about what I'm talking about. :-)

	From the perldsc manpage, in the third paragraph of the "REFERENCES"
	subsection we find:
		"Briefly, references are rather like pointers that know
		 what they point to."

	From the perlref manpage, item 5 under the "References can be
	constructed in several ways" header we find:
		"References are often returned by special subroutines
		 called constructors.  Perl objects are just references
		 to a special kind of object that happens to know which
		 package it's associated with."

	From the perlobj manpage, under the "An Object is Simply a
	Reference" section we find in paragraph 2:
		 "This is for convenience, because the referenced object
		  itself knows that it has been blessed, and the reference
		  to it could have been returned directly, like this:"

	"Know what they point to", "happens to know which package it's
	associated with.", "the referenced object itself knows that it has
	been blessed"...  It sure sounds to me like a reference holds far
	more then a pointer which, indirectly, it kinda does.  True, it
	doesn't actually store this itself, it must look up the thingy type
	it references and check sv_flags for type info, but this is just
	semantics when looked at from the Perl user end.  And as far as I
	can tell from the sv.c/sv.h files, the SV holding the reference
	does infact hold both the bless flag and the object type (class).

	Please correct me if I'm wrong (I'm sure you will:-), but I don't
	see where else the object type would be stored except in the
	SV holding the reference?  That's where the blessed flag is kept,
	so it just makes sense that is where the object type would be
	stored as well, no?  Either way it's still just semantics from the
	Perl code end, which I assume (danger) is why the man pages are
	writen with this overtone.

-- 
-Zenin
 zenin@best.com


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

Date: Fri, 20 Feb 1998 18:22:24 -0600
From: Robert Jackson <rrjackso@tddcae99.tddeng00.fnts.com>
Subject: Re: A Few Questions about Form Handling
Message-Id: <34EE1E3F.F6F964AA@tddcae99.tddeng00.fnts.com>

Katy,

First, I want to say you have a great last name.

1) Associative arrays (%array types) don't store keys in any given
order. You can select key-value pairs in a specific order in several
ways:

a. foreach $key (sort keys(%form)) gives you the keys sorted 
b. is you know the key names (i.e. values for the HTML form elements)
foreach $key ('name1', 'name2', etc)
{
	$form{$key} ....
}

b would be my preference

c. as you create %FORM create a separate array to handle the order

>$value =~ s/~!/ ~!/g;
> $FORM{$name} = $value;
$order[$count++] = $name;
 .
 .
 .
for($index = 0; $index <= $#order; $index++)
{
	$key = $order[$index]
	$form{$key} ....
}


Good Luck!!
-- 
Robert R. Jackson         "We must use time creatively...and forever
972-479-4131              realize that the time is always right to do
right.
robert.jackson@fnc.fujitsu.com              Dr. Martin Luther King JR.
http://www.self-image.com/people/robert


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

Date: Fri, 20 Feb 1998 19:54:48 -0500
From: Joe Gottman <joegottman@nospam.worldnet.att.net>
Subject: Re: Avoiding $`
Message-Id: <6cl8ni$4k4@bgtnsc02.worldnet.att.net>



Tom Grydeland wrote:

> On 20 Feb 1998 13:40:14 -0500,
> uri@sysarch.com <uri@sysarch.com> wrote:
> > > > /^(.+?)(a+)(.+?)$/
> > > surely you mean
> > > /^(.*?)(a+)(.*?)$/s
> > >
> > > //Tom Grydeland <Tom.Grydeland@phys.uit.no>
> >
> > he never showed the data string. i assumed a single line for
> > simplicity. your addition may be more correct but doesn't address the
> > original problem (unless it is multiline).
>
> Note that I changed the original +es to *s.
>
> No, you're wrong.  Unless you've specified -l to perl, your trailing
> newline (or whatever your record separator is) will be in $', but not in
> $3 unless you've included /s.  Dot won't match newline.  Behold:
>
> % perl -ne '/^(.*?)(a+)(.*)/ && print "<$1:$2:$3>\n"'
> asdf
> <:a:sdf>
> % perl -ne '/^(.*?)(a+)(.*)/s && print "<$1:$2:$3>\n"'
> asdf
> <:a:sdf
> >
> %
>
> (Apart from that, the other responder is of course correct in that the
> last ? is superfluous and should be removed.)
>
> So my final suggestion is:
>
>     /^(.*?)(a+)(.*)$/s
>             ^^ insert your regex here

   Another problem with the regular expression you use is that it consumes the
entire string. This could be a major difference if you are matching using
/regex/g.  This is why in my original post I used
/(a+)(?=(.*))/ . It is ugly, but it leaves $pos after the match at the same
position as the original regex would have.  I do agree that the way to get the
prematch is with /(^.*?)/, so I think the best way to
get all three is
   /^(.*?)(a+)(?=(.*\n?))/g

The \n? should pick up the the trailing newline at the end of the string if there
is one.

--
Joe Gottman
joegottman@nospam.worldnet.att.net

[Remove nospam to reply]




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

Date: Fri, 20 Feb 1998 17:09:02 -0800
From: Michael Roeser <mroeser@removethis.gte.net>
Subject: CGI.pm error - Modification of Read-Only Value
Message-Id: <6cl98i$fu6$1@gte2.gte.net>

<Running Perl 5.00404 and CGI.pm v2.36 on IRIX 6.2>

I'm running into an error which doesn't occur when I run my script from
the command line (feeding it values), but fails when I launch it from a
web browser.  I'm using the import_names method in my script:

   $query = new CGI;
   $query->import_names('QUERY');

Here's the fragment from my program that calls import_names:

   if ($query->param('qty1')) {
      print "<TR><TD>" . $hstyle{$QUERY::style1} . "</TD>\n";
      print "<TD>" . $color{$QUERY::color1} . "</TD>\n";
      print "<TD>" . $shape{$QUERY::shape1} . "</TD>\n";
      print "<TD>" . $size{$QUERY::size1} . "</TD>\n";
      print "<TD>" . $QUERY::qty1 . "</TD>\n";
      print "</TR>\n";
   }
   
   if ($query->param('qty2')) {
      print "<TR><TD>" . $hstyle{$QUERY::style2} . "</TD>\n";
      print "<TD>" . $color{$QUERY::color2} . "</TD>\n";
      print "<TD>" . $shape{$QUERY::shape2} . "</TD>\n";
      print "<TD>" . $size{$QUERY::size2} . "</TD>\n";
      print "<TD>" . $QUERY::qty2 . "</TD>\n";
      print "</TR>\n";
   }
 
When I run this script from the command line, and feed it values for
style1, color1, qty1, etc., it prints out the correct html (inluding the
header).  However, when I run the script using its corresponding web
page, I get a Server Error.

Here's the error from the FastTrack 3.0 error log:

   "...got line "modification of a read-only value attempted at
    /usr/freeware/lib/perl5/cgi.pm line 308"

Here's that section of CGI.pm:

   292 #### Method: import_names
   293 # Import all parameters into the given namespace.
   294 # Assumes namespace 'Q' if not specified
   295 ####
   296 sub import_names {
   297     my($self,$namespace) = self_or_default(@_);
   298     $namespace = 'Q' unless defined($namespace);
   299     die "Can't import names into 'main'\n"
   300      if $namespace eq 'main';
   301     my($param,@value,$var);
   302     foreach $param ($self->param) {
   303      # protect against silly names
   304      ($var = $param)=~tr/a-zA-Z0-9_/_/c;
   305      $var = "${namespace}::$var";
   306      @value = $self->param($param);
   307      @{$var} = @value;
   308      ${$var} = $value[0];
   309     }
   310 }

I'm still somewhat of a novice with Perl 5 and modules, so maybe I'm not
seeing something obvious, but I'd appreciate any help you folks could
provide.

Thanks,

Mike Roeser


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

Date: Fri, 20 Feb 98 19:43:37 -0500
From: "Brandon S. Allbery KF8NH" <bf8$s03c92f97$a93d2@kf8nh.apk.net>
Subject: Re: differences perl 4.0.1.8 -> 4.0.3.6
Message-Id: <34ee26ff$3$ofn$mr2ice@speaker>

[p&e]

In <6cht4s$1tca$1@ausnews.austin.ibm.com>, on 02/19/98 at 06:20 PM,
   rhaig@austin.ibm.com (Haig) said:
+-----
| I'm looking for historical information about updates to perl4
| (ver 4.0.1.8 -> 4.0.3.6) and the security & other implications
| thereof.
+--->8

You should be able to find stuff like this on CPAN, with the unsupported Perl4
distributions.

BTW, it's Perl 4.0 patchlevel 18 and patchlevel 36 (or 4.018 / 4.036 in the
vernacular), not 4.0.1.8 / 4.0.3.6.  The only thing magic about those numbers
is that enough changes had accumulated to make a new full Perl release a good
idea at those times.  (pl35 had a full release as well.)

| Also, I'd be interested in what would have to be done to any arbitrary
| perl4.0.1.8 script to make it run on perl5.  
+--->8

The only thing I've ever run in to is that Perl 4 would allow you to use an
unquoted @ in a double-quoted string as long as it wasn't followed by the name
of a list variable that had already been "seen" by Perl at that point; Perl 5
requires you to backslash all @'s in double-quoted strings, because they can
be more than just variables (consider the idiom for embedding a random
expression in a string:  "... @{[ some_expression ]} ...") and because the
Perl 4 behavior could lead to programs "inexplicably" breaking if a new list
variable were added to the program later.

This is assuming good Perl coding style as has been recommended since Perl3 at
least, such as using all-uppercase filehandle names to avoid possible
collisions with new keywords (i.e. if someone does ``open(bless,
"/usr/pub/blessings")'' --- legal in Perl 4, but not recommended --- they're
in for a surprise in Perl 5).

Of course, if you modify a Perl4 script to use Perl5 modules, you may have to
watch out for filehandles with the same name as classes.  This isn't generally
a problem because (a) it's usually easier to rewrite such scripts from scratch
as Perl5 scripts, including using FileHandle / IO::File objects instead of
filehandles, and (b) most class names are mixed case, specifically to avoid
such collisions.

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



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

Date: 21 Feb 1998 02:57:27 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Getting GET/POST requests
Message-Id: <6clfqn$a85@fridge.shore.net>

Roger Liu (rwliu@romulus.rutgers.edu) wrote:

: I'm writing a mini-server for class, (right now with no network connectivity)
: But I'm having trouble understanding some things...basically I have a form
: set up to send in a POST request and then write the form info to a file.

Get kirves; it comes with source.  Or read the HTTP::Daemon stuff that
comes along with libwww (LWP).

--
Nathan V. Patwardhan



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

Date: Fri, 20 Feb 1998 21:50:40 -0500
From: "Lance" <lsj@bnl.gov>
Subject: Re: HELP!  exec doesn't work properly!
Message-Id: <6clf7m$t0i$1@sun20.ccd.bnl.gov>

After using close(jj), everything works properly.  Thank you all+ACE-  ...
Lance




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

Date: Sat, 21 Feb 1998 00:46:20 GMT
From: stephen farrell <sfarrell+usenet@farrell.org>
Subject: Re: HELP! exec doesn't work properly!
Message-Id: <87k9apokdf.fsf@phaedrus.uchicago.edu>

"Lance" <lsj@bnl.gov> writes:

> Hi,
> 
>     I have the following lines in a perl script on a HP-UX:
> 
>     open(jj,">junk") || die "Couldn't open junk: $!\n";
>     print jj <<EOF;                # line A
> 1
> 1
> 0
> 4
> 0
> 5
> 0
> 0
> EOF
> exec "trans.x < junk";        # line B
> 
> Note: "trans.x" is a Fortran executable file which uses "junk" as a
> redirected input file
> But it just doesn't work! line A does generate the file "junk", but line B
> not only doesn't recognize "junk" but also makes it null.
> 
> If I comment line B and run the rest.  It generates  "junk". And then I
> uncomment line B and comment the rest of it. (so "junk" already exits)  and
> run it.   Line B works!  I don't understand why they can't work together.
> 
> Since I'm new in Perl Programming, this could be a dumb question.
> Any advice will be greatly appreciated!

try close(jj)

--sf


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

Date: Fri, 20 Feb 98 20:00:37 -0500
From: "Brandon S. Allbery KF8NH" <bf8$s03c92f97$a93d2@kf8nh.apk.net>
Subject: Re: HUMOR: Userspeak vs Hackerspeak
Message-Id: <34ee28eb$4$ofn$mr2ice@speaker>

In <6c8dlr$8gv$1@pithy.mincom.oz.au>, on 02/16/98 at 04:00 AM,
   ianc@mincom.com (Ian Clatworthy) said:
+-----
| Perhaps a tip could be popped-up every time a newbie
| started their newsreader? Of course, we'd probably need to
| be unethical and exploit some security hole to make the
| tip pop up, but that shouldn't be hard, right? :-) :-) :-)
+--->8

If you assume that most of them run HTML-"enhanced" newsreaders, this is not
particularly difficult.  Stick the tips pages on CPAN, then Tom could embed
some JavaScript/JScript in his headers.

<SCRIPT LANGUAGE="JavaScript">
<!-- alert("Just a small example of what could be done....") -->
</SCRIPT>

(Not to mention a small example of why I refuse to use an
HTML-<bigger><bold><blink>"enhanced"</blink></bold></bigger> mailer or
newsreader.)

:-)

P.S.  For those of you who saw the fireworks, the above was:

&lt;SCRIPT LANGUAGE="JavaScript"&gt;
&lt;!-- alert("Just a small example of what could be done...."); --&gt;
&lt;/SCRIPT&gt;

(Not to mention a small example of why I refuse to use an
HTML-&lt;bigger&gt;&lt;bold&gt;&lt;blink&gt;"enhanced"&lt;/blink&gt;&lt;/bold&gt;&lt;/bigger&gt;
mailer or newsreader.)

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



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

Date: 21 Feb 1998 02:58:33 GMT
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: if (-d $filename) in Win32
Message-Id: <6clfsp$qla@examiner.concentric.net>

perl.user@sndk.se writes:

>Why isn't the following ok in Win32? Is -d only working in unix perl?
>I want to scan the whole of d:\ for perl-files (extension "pl").

Let's clean this up a bit ...

>@dirs = 
>(
>  'd:\\'
>);

Try 'd:/', since WinPerl understands / as equal to \.

>foreach $dir (@dirs)
>{ # for each directory on d:\
>  opendir(HOMEDIR, $dir);
>  while (defined($filename = readdir(HOMEDIR)))

while($filename = readdir(HOMEDIR)) {

>  { # for each file in this directory...
>    if ((-d $filename) and !($filename eq '.' or $filename eq '..'))
>    { # this is a directory, let's scan it's files as well
>      push(@dirs, "$dir\\$filename");
>    }
>    elsif (-1 != index($filename, ".pl"))
>    { # this is a perl file since it has ".pl" in it's name

Try elsif ($filename =~ /\.pl$/) {

>      print "Perlfile named \"$dir\\$filename\"\n";
>    }
>  }
>  closedir(HOMEDIR);
>}

Hmm. You could probably do a little better if you made a recursive routine
 ... ?

--
Cameron Kaiser
cdkaiser at concentric dot net (it hasn't helped the spam yet though)
*** visit the Spectre Server at www.sserv.com
*** C64 software lives! www.computerworkshops.home.ml.org


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

Date: Sat, 21 Feb 1998 14:53:54 +1100
From: Benjamin Grosman <bgrosman@healey.com.au>
To: Kate Smalley <Kate-Smalley@worldnet.att.net>
Subject: Re: Mailing List Perl Program?
Message-Id: <34EE4FD1.39F07F72@healey.com.au>

> I was wondering what was involved in setting up a mailing list perl
> program?  Is there a perl program available, with simple functions, not too
> complicated?  In your opinions is it too much trouble to bother with?
>
> I would think the participants would number around 125 or so.

Check out majordomo ... it is written in Perl. You are probably already the
member of a list or two that which is serviced via majordomo. It is quite
powerful and extensible, and popular too.

As for being "not too complicated" ... I can't help you there sorry. Really
depends on your own definition. You'll have to have a look at it and decide for
yourself.

Ben

---
"Mr. Churchill, if you were my husband, I'd poison your tea!" And if you were
my
wife, I would drink it! -- Winston Churchill




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

Date: Fri, 20 Feb 1998 19:10:28 -0600
From: Neal Dalton <nrd@mcg.net>
To: nrd@xox.com
Subject: Multicast perl
Message-Id: <34EE2984.25B0@mcg.net>

Can perl be used to write a multicast app?

I need to transfer files via mutlicasting UDP over a very slow satelite
network.

Thanks

Neal


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

Date: 21 Feb 1998 01:19:57 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6cla3t$p6c$1@news.orst.edu>

In article <6cl0t7$b4o$1@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>Give it a rest, man!  Look at all the smart (and probab^H^H^H^Hperhaps
>lazy) people who don't munge their address in clpm alone!

I will "give it a rest" when it goes away. So what if many people don't
munge their addresses? What does that prove?

>It is the slow witted PoBs who have no clue what the Internet or even
>Usenet is all about who would break what has always worked and avoid
>a clearly better forum for the false sense of security that their
>selfishness gives them.

Give it a rest, man. It is not selfish to munge an address. It does not
break anything except your strange notion that you must somehow always
be able to send mail to someone who posts an article. That's what is
selfish. You feel the need to be able to send mail to everyone who
posts, even if by having that ability it will cost them real money
having to deal with spam. You want an ability that you almost never use
(and don't really need to use even when you do) which will cost other
people time and money.

>If the terms of the charter of the new group would keep the mungers
>and other ne'er-do-wells out, then I would call that a feature. :-)

One problem with that statement: people who mung their address aren't
necessarily "ne'er-do-wells", they are people trying to deal with spam
in a way that works. Surely, keep out ne'er-do-wells, but don't toss
the baby with the bathwater.



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

Date: 21 Feb 1998 01:21:19 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: on reading FAQs and gurus answering questions
Message-Id: <6cla6f$q1o$1@news.orst.edu>

In article <6cl12m$b4o$2@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>But it's much more entertaining and satisfying to watch an annoying
>or trouble making person be publicly removed from the forum and
>furthering  the Greater Good.

So the goal is not a noise free place to discuss perl, it is a forum
where you can watch public floggings.  I suggest you read alt.flame to
get that out of your system and then come back to the perl groups.



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

Date: Fri, 20 Feb 1998 19:13:48 -0600
From: Dao Phan <dphan@hal-pc.org>
Subject: Please help
Message-Id: <34EE2A4C.1C67@hal-pc.org>

I am new to Perl and Perl 5.0 was installed on SCO5.02. I don't how to
fix this problem.
>  The crypt() function is unimplemented due to excessive paranoia. at
>  /usr/local/e 

The Discus program uses the crypt function to encrypt user and 
moderator passwords.  Because your Perl interpreter does not 
implement the crypt function, you will not be able to use Discus.  
Sorry... :(
 Thanks in advance for any help.
Regards


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

Date: Fri, 20 Feb 98 20:08:39 -0500
From: "Brandon S. Allbery KF8NH" <bf8$s03c92f97$a93d2@kf8nh.apk.net>
Subject: Re: Prisoners of the evil empire
Message-Id: <34ee29b4$5$ofn$mr2ice@speaker>

In <6ci8ma$ouc$2@news.bayarea.net>, on 02/19/98 at 09:37 PM,
   donut@bayarea.net (Plastic Nuclear Ferret) said:
+-----
| : Or those who don't understand an application without a gui or a window
| : manager without a Start button.  :-)
| what about fvwm95?
+--->8

# /bin/rm /usr/X11R6/bin/fvwm95    ;  : it will not be missed...

:-)

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



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

Date: 17 Feb 1998 19:53:55 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <6ccpsj$hv$1@marina.cinenet.net>

ssmieja@execpc.com wrote:
: Probably taking this in a direction that I will regret but here goes.
: 
: I feel that there is an underlying current of hatred at old Perl 4 code by
: those who believe only in the OO model of Perl 5.  Everyone screams rewrite
: but moving from a process orientation to an OO one ain't easy.

I don't think OO is the issue.  Rather, it's the other vast improvements 
in Perl 5 -- things like references (allowing complex hierarchical data 
structures) and the improved module model.  Most Perl 5 code (including 
my own) seems to be 'process oriented'.

: I use Perl 5 but code in Perl 4.  Guess what, many of those wonderful CPAN
: modules don't build on a Windoze platform because the code isn't perl it is
: Un*x flavored C.

That's a non sequitur.  You can use Perl 5 without the CPAN modules.  A 
good deal of my own private-use coding is for a DOS/Win31 environment, 
where hardly any of CPAN works.  I still use Perl 5 just fine.

: Stuff like MSA stay viable because they run, on any platform, with any version
: of perl. Something to think about that the next time you find yourself coding
: "require 5.004;"

MSA FormMail (for example) requires significant tweaking to move from 
Unix/sendmail to WinNT/blat.  So "on any platform" must be qualified with 
"...if you're willing to muck around in the source."

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Sat, 21 Feb 1998 02:06:13 GMT
From: ed@vtrad.com (Ed Egan)
Subject: SQL, Perl and Access databases (running on NT4)
Message-Id: <34ef3563.2619336@news.poptel.org.uk>

Can any one help me?

I have been landed with the job of running a Perl driven web-ste off
data obtained from an access database. I can get Access to generate
SQL for me but I haven't a clue how I am going to feed that SQL to
Access from my Perl srcipt.

I would really appreciate a small script extract from someone who has
been here before!

Many thanks,

Ed.


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

Date: Fri, 20 Feb 1998 22:53:35 -0500
From: see-below@crocker.com (Steve Linberg)
Subject: Re: SQL, Perl and Access databases (running on NT4)
Message-Id: <see-below-2002982253350001@pri03-033.oldcity.dca.net>

In article <34ef3563.2619336@news.poptel.org.uk>, ed@vtrad.com (Ed Egan) wrote:

> Can any one help me?
> 
> I have been landed with the job of running a Perl driven web-ste off
> data obtained from an access database. I can get Access to generate
> SQL for me but I haven't a clue how I am going to feed that SQL to
> Access from my Perl srcipt.
> 
> I would really appreciate a small script extract from someone who has
> been here before!

Do a deja news search on Win32::ODBC sample code.  I posted some here
about two weeks ago.


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

Date: Fri, 20 Feb 98 20:13:41 -0500
From: "Brandon S. Allbery KF8NH" <bf8$s03c92f97$a93d2@kf8nh.apk.net>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34ee2b72$7$ofn$mr2ice@speaker>

In <6cl0t5$sm6$1@brie.direct.ca>, on 02/20/98 at 10:42 PM,
   bill@cafe.net (Kaz Kylheku) said:
+-----
| >In a billion years the Sun will explode and you won't need to
| >worry about it any more. This suggests that a 64 bit time_t
| >ought to be enough...
| That assumes that by then we will not have figured out a way to survive the
| death of the Sun.
+--->8

By then we'll hopefully have moved to a timekeeping system not quite so
dependent on Earth-based values.  (Can you imagine the newbie-questions
otherwise?  "How come years / days / hours / etc. are such screwball values
that don't match something useful like the rotational period of my
homeworld?")

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)



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

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

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