[15922] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3335 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 12 21:05:37 2000

Date: Mon, 12 Jun 2000 18:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960858312-v9-i3335@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 12 Jun 2000     Volume: 9 Number: 3335

Today's topics:
    Re: ANSI Perl: No Way !!! <elaine@chaos.wustl.edu>
    Re: Automating stuff through Perl (Tad McClellan)
        Benchmark Perl build options on Linux <scott@industrial-linux.org>
        Content-type: text/html with ActivePerl braccobaldo.xyz@hotmail.com
    Re: Create dateformat yyyymmdd <eyalb@aks.com>
    Re: Creating new folder and file and can't use mkdir() <lr@hpl.hp.com>
    Re: Creating new folder and file and can't use mkdir() <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Diff. between putting & before a subroutine call (Tad McClellan)
    Re: exec (cal) and split result into an array <lara@lodestone-sw.com>
    Re: exec (cal) and split result into an array (Tad McClellan)
    Re: exec (cal) and split result into an array <lr@hpl.hp.com>
    Re: exec (cal) and split result into an array (Randal L. Schwartz)
    Re: Help! (Perl) How to retrieve from delimited ASCII f (Malcolm Dew-Jones)
    Re: HTTPS with LWP <jrbrown@cts.com>
    Re: Larry Rosler interview on perl.com! (David H. Adler)
        Length of an Array <crazycoder@my-deja.com>
        Mail via perl <elynt@exchange.ml.com>
    Re: Mail via perl <lauren_smith13@hotmail.com>
    Re: Mystery Regex [long] (Tad McClellan)
    Re: Not shifting what I want from an array <tina@streetmail.com>
    Re: perl CGI on an Linux based apache webserver <Michael.Siemens@nospamhome.com>
    Re: Perl is FAST!!! <y-o-y@home.com>
        Perldebug - jump command? steveeq1@earthlink.net
        PGP::GPG::MessageProcessor + IO::Handle woes... (Mathew A. Hennessy)
    Re: Place to run programs <abe@ztreet.demon.nl>
    Re: Place to run programs (Tad McClellan)
    Re: Place to run programs (Steve Leibel)
    Re: Removing Whitespace <monty@primenet.com>
        Strange permission problems with ActivePerl 613 <james@WebEvent.com>
    Re: Strange permission problems with ActivePerl 613 <lauren_smith13@hotmail.com>
    Re: Summer Computer Jobs <uri@sysarch.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 13 Jun 2000 00:45:00 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: ANSI Perl: No Way !!!
Message-Id: <B56AFC4E.6061%elaine@chaos.wustl.edu>

in article xP715.111471$hT2.435944@news1.rdc1.ct.home.com, Dan Sugalski at
dan@tuatha.sidhe.org quoth:
>> My personal viewpoint is, Perl 5 has been developed to
>> counter a market share being grabbed by other languages,
>> such as Java and Microsoft's Active Server Programming.
> 
> Perl 5 predates both ASP and Java, Gojira.

18.Oct.94 - Perl 5.000 released
23.May.95 - JAVA Announced by Sun Microsystems

I couldn't find a date for ASP but considering how late in the game MS
'discovered' the Internet, I'd guess it would have debuted ~96.

And the language really isn't the issue in the web serving/hosting market as
far as I can tell rather it is the tools that come with the language that
make it a popular choice or not. Perl's strength for allowing people to make
their own tools is also its weakness in this particular market. JAVA and ASP
are growing in popularity as they have IDEs and ready-made code for rapid
development. In a world that fought a Perl IDE and plenty of people to
criticise yet not fix Matt Wrights and Selena Sols code one can hardly blame
companies looking to Sun and MS for a language that comes with tools and
support. I don't have hard statistics, but by what I've seen Perl has lost
ground it will never regain in this arena.

e.



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

Date: Mon, 12 Jun 2000 18:02:40 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Automating stuff through Perl
Message-Id: <slrn8kang0.1gi.tadmc@magna.metronet.com>

On Mon, 12 Jun 2000 21:35:11 +0200, john69 <john69@raketnet.nl> wrote:

>Looking for other possibiliets I found that I can run Perl scripts... Have
>seen that all the elements seem to be there... but I just havn't been able
>to put things together.
>It seems that I should use the <img src=""> tag to load a GIF or so... and
>that this should automatically redirect me ba means of code in rest of the
>script.
>As I'am not an experienced Perl user.. maybe someone can help me on my way.


You do not have a Perl question.

CGI questions should be asked in the CGI newsgroup:

      comp.infosystems.www.authoring.cgi

Perl is not CGI.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Jun 2000 18:26:25 -0600
From: "scott thomason" <scott@industrial-linux.org>
Subject: Benchmark Perl build options on Linux
Message-Id: <Dke15.2083$gZ4.874774@feed.centuryinter.net>

For what it's worth, I spent last evening overheating my trusty AMD K6-2/300 
with various builds of Perl to see how the "usethreads" and "usemymalloc" settings
affected performance. Here are the results, where "t" = threaded and "m" = use Perl's
malloc routines (instead of the ones that come with Linux):

T+M: 24 secs elapsed / 4.73 CPU
T: 25 secs elapsed / 5.07 CPU
M: 18 secs elapsed / 3.5 CPU
neither: 20 secs elapsed / 3.95 CPU

This wasn't a rigorously controlled test, I just ran it when my system was otherwise idle.
Here's the build script, the benchmark controller, and the benchmark:

=== build script: only T+M version shown ===
sh Configure -des \
  -Dprefix=/usr/local/perl-tm \
  -Dusethreads \
  -Dusemymalloc \
  -Doptimize='-O6 -march=pentium -mcpu=pentium -fomit-frame-pointer -ffast-math -funroll-loops' \
  -Dusedl \
  -Uuseshrplib \
  -Uinstallusrbinperl \
  -Ubincompat5005

=== benchmark controller script ===
#!/usr/bin/perl -w

system('./benchmark >b1 &');
system('./benchmark >b2 &');
system('./benchmark >b3 &');
system('./benchmark >b4 &');
system('./benchmark >b5 &');

print "Benchmarks submitted, waiting for completion...\n";

while (`ps` =~ /benchmark/m) {
  print "  ...waiting ten seconds...\n";
  sleep 10;
}

print "Done!\n", `cat b1 b2 b3 b4 b5`;

exit 0;

=== benchmark script: only T+M version shown ===
#!/usr/local/perl-tm/bin/perl -w

use Benchmark qw/timethis/;

my $bench   = timethis(50, 'a()');
exit 0;

sub a {
  my $x; my $y;
  my @a;
  my %l;

  open(O, ">/dev/null") or die "Can't open /dev/null!";

  for ($x=0; $x<1000; $x++) {
    print O "$x ";
    push(@a, $x);
    $l{$x} = $x;
  }

  print O "\n\n==========\n\n";

  for ($x=0; $x<1000; $x++) {
    my $f = int(rand(1) * 1000);
    my $t = int(rand(1) * 1000);

    my $h  = $a[$f];
    $a[$f] = $a[$t];
    $a[$t] = $h;
  }

  print O join(' ', @a), "\n";

  @a = sort(@a);

  close(O);
}




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

Date: Tue, 13 Jun 2000 02:25:31 +0200
From: braccobaldo.xyz@hotmail.com
Subject: Content-type: text/html with ActivePerl
Message-Id: <akvaks0mhmhha1scds6qlqk100oh93f1fm@4ax.com>

Hi,
I'm very new to Perl, and I don't need to do very big things with it,
but I need to know how to do a few things.
I'm configuring a Perl counter (gcount.pl - Author:  Yutung Liu - web
site: http://www.cgi-factory.com). It works fine in my web site
(http://baravalle.co.uk). I'm using it by a a few months.
Today I decided to install ActivePerl in my home computer, to test
some scripts in local, without having all times to connect to internet
($$$).
I have a win2000 sistem. Il looks more or less fine, but in front of
the digits I have the words "Content-type: text/html".
Why? In internet I don't have them.
The code the script uses to display immages is:

print "Content-type: text/html\n\n";
for ($i; $i < $length; ++$i) {
print "<img src=\"$images/@gcount[$i].$ending\" width=\"$width\"
height=\"$height\">";
}

I have solved it deleteing the line 

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

in the script I have in my computer and leaving as it was in my web
page.
What was the meaning of that line? Why in internet I have only my
counter and in local I have the  words "Content-type: text/html"+the
counter?
Any help will be very apreciated.
Thanks in advance,
		Andres
________

remove .xyz to reply
________

http://baravalle.co.uk


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

Date: 13 Jun 2000 03:44:53 +0300
From: Eyal Ben-David <eyalb@aks.com>
Subject: Re: Create dateformat yyyymmdd
Message-Id: <m2ln0acsu2.fsf@localhost.localdomain>

"Hans Kamp" <hkamp1@hotmail.com> writes:

> For an application I need a dateformat yyyymmdd in a textbox. How can I
> realize that with perl: something like:
> 
> $dateparameter = date(yyyymmdd),  but this doesn't work. I hope there is a
> simple solution possible ;)
> 
> E-mail: h_kamp@yahoo.com
> Much thanks when you can help me!

Hello,
Read documentation about localtime: "perldoc -f localtime"
Here's a possible implementation:


sub date_yyyymmdd {
   my ($d, $m, $y) = (localtime)[3,4,5]; 
   $y += 1900; 
   $m++; 
   return sprintf("%4d%02d%02d", $y, $m, $d);
}

# Test it
#
my $yyyymmdd = date_yyyymmdd();
print "$yyyymmdd\n";


Eyal.


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

Date: Mon, 12 Jun 2000 16:15:21 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <MPG.13af0edf5dd5b87098ab62@nntp.hpl.hp.com>

In article <8i3ft8$3tmj6$7@fu-berlin.de> on 12 Jun 2000 20:07:04 GMT, 
Tina Mueller <tina@streetmail.com> says...

 ...

> try mkdir($directory,0766) instead of
> mkdir($directory)
> because mkdir needs two arguments.
> you could have known that by reading the perl documentation on
> mkdir:
> perldoc -f mkdir

The second argument is optional.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 12 Jun 2000 17:18:09 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Creating new folder and file and can't use mkdir()
Message-Id: <39457DC1.58752612@jpl.nasa.gov>

Larry Rosler wrote:
> 
> In article <8i3ft8$3tmj6$7@fu-berlin.de> on 12 Jun 2000 20:07:04 GMT,
> Tina Mueller <tina@streetmail.com> says...
> 
> ...
> 
> > try mkdir($directory,0766) instead of
> > mkdir($directory)
> > because mkdir needs two arguments.
> > you could have known that by reading the perl documentation on
> > mkdir:
> > perldoc -f mkdir
> 
> The second argument is optional.

This appears to be new in 5.6.0 (but I can't find the change listed in
perldelta).  I'm glad to know that Perl is becoming a higher level
language.

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Mon, 12 Jun 2000 17:04:31 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Diff. between putting & before a subroutine call
Message-Id: <slrn8kak2v.1gi.tadmc@magna.metronet.com>

On Mon, 12 Jun 2000 12:42:08 -0500, Paul R. Andersen <andersen+@rchland.ibm.com> wrote:
>EnderW wrote:
>> 
>>  I am newbie to Perl. I use it from time to time. I was looking at
>> subroutines. I have seen that they guy calls it like &my_sub instead of
>> my_sub(). Is there a diff. between those two forms ? Thanks
>> 
>I am not aware of any difference in function.  The &my_sub is, in my
>opinion, not as nice to read as my_sub().  The & notation is old but
>still works.  If there is a difference, I've not run into it.


And there we have a perfect example of why it is better to
use the docs than to post to Usenet.

Use the docs: get the correct answer.

Ask on Usenet: get the *wrong* answer and many pointers to the docs.


Please don't "guess" when following up, it makes things worse,
not better.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Jun 2000 16:08:05 -0700
From: Lara Fabans <lara@lodestone-sw.com>
Subject: Re: exec (cal) and split result into an array
Message-Id: <39456D4F.3B73427C@lodestone-sw.com>

I love|hate it when I post because I always find the answer 
two minutes later.

Here's the code that works in case anyone else runs into problems:

$| = 1;
my @data;
open(CAL, "cal |");
while(<CAL>) {
  @data = map {split} <CAL>;
}

  print "Month: $data[0]\n";
  print "Day 16: $data[12]\n";
1;

Thanks to all who thought about it.
Lara


Lara Fabans wrote:
> 
> Hi,
> 
> I'm trying to create a very simple calendar (I've been trying to get
> HTML::CalendarMonth to work, but it's taking more time then I
> have at the moment...I'm trying to put together something quickly,
> and would then go back and debug HTML::CalendarMonth) by
> open(CAL, "cal |");
> then I am trying to split.
> 
> The output of cal looks like this:
>       June 2000
> Su Mo Tu We Th Fr Sa
>              1  2  3
>  4  5  6  7  8  9 10
> 11 12 13 14 15 16 17
> 18 19 20 21 22 23 24
> 25 26 27 28 29 30
> 
> So I thought @data = [split];
> would work, but it's not.
> 
> I tried to get a localized version by putting the data at the
> __END__
> and reading it in.  It only read in 7 chunks (line by line instead
> of splitting it up) (And it read in uninitialized data).
> 
> So, do I need to do 2 splits?  Do I need to split on a different
> regex?
> 
> I searched the archives & can find nothing about this.  You'd
> think it was so simple :-)
> 
> Thanks,
> Lara
> --
> Lara J. Fabans          lara@lodestone-sw.com
> Software Consultant     http://www.lodestone-sw.com
> Lodestone Software, Inc.

-- 
Lara J. Fabans          lara@lodestone-sw.com
Software Consultant     http://www.lodestone-sw.com
Lodestone Software, Inc.


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

Date: Mon, 12 Jun 2000 17:55:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: exec (cal) and split result into an array
Message-Id: <slrn8kan38.1gi.tadmc@magna.metronet.com>

On Mon, 12 Jun 2000 14:13:06 -0700, Lara Fabans <lara@lodestone-sw.com> wrote:

>I'm trying to create a very simple calendar (I've been trying to get
>HTML::CalendarMonth to work, but it's taking more time then I
>have at the moment...I'm trying to put together something quickly,
>and would then go back and debug HTML::CalendarMonth) by
>open(CAL, "cal |");


There are 3 ways of running external programs.

You have chosen one inappropriate for your application.

Choose a different one (backticks):

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

$_ = qx/cal/;

foreach ( split ) {
   print "'$_'\n";
}
-------------


>then I am trying to split.


Into a linear list, I guess.

Seems like a 2-D array (List Of Lists) would be better,
but you didn't say that, so I won't show that  :-)

   perldoc perllol

If that is what you want to do.


>So I thought @data = [split];
>would work, but it's not.


That does what it is supposed to do, but it is not supposed to
do what you want to do  :-)  :-)

I don't know why you want an anonymous array there. Maybe you
_do_ want a 2-D array. If so, you should have said so.


>I tried to get a localized version by putting the data at the 
>__END__
>and reading it in.  It only read in 7 chunks (line by line instead
>of splitting it up) 


Reading line by line is the default behavior. You need to change
it if you do not want the default.


>(And it read in uninitialized data).


It is impossible to read uninitialized data.

When perl says "uninitialized value" it is talking about undef.

You cannot read an undef, but the input operator will give you
one when it gets to EOF.


>So, do I need to do 2 splits?  Do I need to split on a different
>regex?


The problem has nothing to do with the splitting.

The problem has to do with reading in more than a line at a time.

The $/ variable can help with that (see perlvar.pod), but you
don't need that now that you are going to use backticks.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Jun 2000 16:49:54 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: exec (cal) and split result into an array
Message-Id: <MPG.13af1700f8043d8998ab65@nntp.hpl.hp.com>

In article <39456D4F.3B73427C@lodestone-sw.com> on Mon, 12 Jun 2000 
16:08:05 -0700, Lara Fabans <lara@lodestone-sw.com> says...
> I love|hate it when I post because I always find the answer 
> two minutes later.

Perhaps, but what you posted isn't 'the answer'.

> Here's the code that works in case anyone else runs into problems:

For what definition of 'works'?

> $| = 1;
> my @data;
> open(CAL, "cal |");

You should ALWAYS check for success of an open() request.

> while(<CAL>) {

The above reads the first line of the file into $_, from which it is 
never seen again.

>   @data = map {split} <CAL>;

Then this reads the rest of the file and splits the 'words' into @data.  
But the month is gone.

> }
> 
>   print "Month: $data[0]\n";

So this prints 'Su'.

>   print "Day 16: $data[12]\n";

And this prints '6'.

> 1;

And that is irrelevant.
 
> Thanks to all who thought about it.
> Lara

You're welcome, I guess.  I don't know what you had in mind for "Day 16" 
or $data[12] either, but life's mysteries go on.  :-)


<SNIP of complete quote of the article, after the response instead of 
ahead of it.  Please don't do that.>

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Jun 2000 17:50:41 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: exec (cal) and split result into an array
Message-Id: <m1itve9zfi.fsf@halfdome.holdit.com>

>>>>> "Lara" == Lara Fabans <lara@lodestone-sw.com> writes:

Lara> I'm trying to create a very simple calendar (I've been trying to get
Lara> HTML::CalendarMonth to work, but it's taking more time then I
Lara> have at the moment...I'm trying to put together something quickly,
Lara> and would then go back and debug HTML::CalendarMonth) by
Lara> open(CAL, "cal |");
Lara> then I am trying to split.

[Hi Lara!]

I did something very similar to the output of "cal" for a UR column,
at

        http://www.stonehenge.com/merlyn/UnixReview/col25.html

Check that out.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 12 Jun 2000 17:19:59 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Help! (Perl) How to retrieve from delimited ASCII file
Message-Id: <39457e2f@news.victoria.tc.ca>

Larry Rosler (lr@hpl.hp.com) wrote:
: [Followups set.]

: In article <394560c3@news.victoria.tc.ca> on 12 Jun 2000 15:14:27 -0800, 

: Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> says...
: + Ant (towsar@ihug.co.nz) wrote:
: + : Can some one help me please?  I know how to open and append to a txt
: + : file but I need fairly simple code to read and write a line of
: + : dlimited text to a file and to change a string between two
: + : deliminations.

: ...

: + An example that adds the area code (123) to each phone number in a
: + simple flat file database, consisting of 
: + 
: + 	name:phone number: address 
: + 
: + The delimiter in my example is a colon (:) just for the sake of
: + argument, and MYFILE and NEW_FILE are file handle to files (they need
: + to be open already, I don't show that).
: + 
: + an example datafile might look like
: + 
: + 	Frank:123-5789:18 first street, pleasantville
: + 	Sally:456-5243:#1 7th ave, uglywhere
: + 
: + 
: + 	# this is untested perl code
: + 
: + 	# the names of the fields
: + 	my @field_names = qw{ NAME NUMBER ADDRESS };
: + 
: + 	# read each line of input into $_
: + 	while(<MYFILE>)
: + 	{	# some variables we will use within this loop
: + 		my (%field_data,$new_line);
: + 
: + 		# remove a line ending (assume it was a line feed) 
: + 		chomp;

: Why bother?  You put it back on again later.

Because if you modify this code to do things with the last field then
you'll catch a nasty little bug.   Imagine blithely adding
	$field_data{'ADDRESS'} .= ' USA'; # (append the country)

Also, it ties nicely into forcing the data to always have a line feed at
the end of the last row, which I consider useful in the kind of file I
showed, as it protects against unforeseen bugs when you do something like
	cat more_data >> original_data
(which can be an issue if you manually edit the data along the way.)

: + 		# split into fields accessible by name
: + 		@field_data{ @field_names } = split /:/ ;
: + 
: + 		# modify the one field we want to modify.
: + 		# Concatenate the new area code (123) with the current
: + 		# value, and save in the same variable.
: + 
: + 		$field_data{'NUMBER'} = '(123) '.$field_data{'NUMBER'};
: + 
: + 		# join line back together, and add the line delimiter
: + 		$line = join(':',@field_data{ @field_names } ) . "\n";
: + 
: + 		# save line in a new file
: + 		print NEW_FILE , $line ;
: + 	}

: TIMTOWTDI.

:     perl -pe "s/:/:(123) /" infile >outfile

(malcolm bonks himself on the head) Yes, much better.

(Of course if Ant wants to use a more complicated alteration then it may
be harder to fit that into the command line pipe.) 



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

Date: Mon, 12 Jun 2000 17:18:49 -0700
From: Jason Brown <jrbrown@cts.com>
To: john <johnNOjoSPAM@appmagic.com.invalid>
Subject: Re: HTTPS with LWP
Message-Id: <Pine.BSF.4.21.0006121715150.39206-100000@king.cts.com>


I think I may know the problem. According to the
Crypt:SSLeay on-line documentation, the following
OpenSSL versions are compatible:


 PLATFORM       CPU     SSL             PERL     DATE           WHO
 --------       ---     ---             ----     ----           ---
 WinNT SP4      x86     OpenSSL 0.9.4   5.00404  1999-10-03     Joshua Chamas
 FreeBSD 3.2    ?x86    OpenSSL 0.9.2b  5.00503  1999-09-29     Rip Toren
 Solaris 2.6    ?Sparc  OpenSSL 0.9.4   5.00404  1999-08-24     Patrick Killelea
 FreeBSD 2.2.5  x86     OpenSSL 0.9.3   5.00404  1999-08-19     Andy Lee
 Solaris 2.5.1  USparc  OpenSSL 0.9.4   5.00503  1999-08-18     Marek Rouchal
 Solaris 2.6    x86     OpenSSL 0.9.4   5.00501  1999-08-12     Joshua Chamas   
 Solaris 2.6    x86     SSLeay 0.8.0    5.00501  1999-08-12     Joshua Chamas   
 Linux 2.2.10   x86     OpenSSL 0.9.4   5.00503  1999-08-11     John Barrett
 WinNT SP4      x86     SSLeay 0.9.2    5.00404  1999-08-10     Joshua Chamas

Looks like in both of our cases, we need to download and install
OpenSSl 0.9.4. This also means we need to recompile Crypt:SSLeay.

I have not tried it yet, but will let you know the results of my
test.




On Thu, 8 Jun 2000, john wrote:

> In article
> <Pine.BSF.4.21.0006071012350.79067-100000@king.cts.com>, Jason
> Brown <jrbrown@cts.com> wrote:
> >
> >I am writing a PERL script to fetch a web page encrypted by SSL.
> >
> >I installed:
> >
> >>I got the following error:
> >
> >Failed: 500 Can't connect to www.helsinki.fi:443 (Bad file
> number)
> >
> >
> >What am I doing wrong?????
> 
> I'm doing the same thing on Windows NT (using the same versions
> of modules Cryp-Leay, libwww, and openssl) and get the same
> error. With debugging turned on I see:
> 
> LWP::UserAgent::new: ()
> retrieving
> https://trading.etrade.com/cgi-bin/gx.cgi/AppLogic+Loginpage
> LWP::UserAgent::request: ()
> LWP::UserAgent::simple_request: GET
> https://trading.etrade.com/cgi-bin/gx.cgi/AppLogic+Loginpage
> LWP::UserAgent::_need_proxy: Not proxied
> LWP::Protocol::http::request: ()
> LWP::UserAgent::request: Simple response: Internal Server Error
> Error: 500 Can't connect to trading.etrade.com:443 (Bad file
> descriptor)
> 
> So far, I've tracked it down to the connect in openssl returning
> a -1 for all favors of SSL. Let me know if you figure it out.
> 
> John Anderson
> 
> 
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
> 
> 

Jason Brown
UNIX System Admin.




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

Date: 12 Jun 2000 22:09:47 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <slrn8kantb.fvk.dha@panix6.panix.com>

On Mon, 12 Jun 2000 04:20:46 +0930, Henry <htp@mac.com> wrote:
>In article <8hvv49$o6s$1@orpheus.gellyfish.com>, Jonathan Stowe 
><gellyfish@gellyfish.com> wrote:
>> and by what objective standards have you determined that these
>> people of yours arent 'doing pretty well' ? 
>
>By the number and flavour of support questions that come my way.  
>Specifically, the frequency of painful questions such as "What's a 
>POD?", "Where do I type 'perldoc xxx'?" and "Where the $#@! is the 
>manual for this thing?"

I'm sorry, but I cannot in any way find the last two of those even
vaguely a problem with perl.  That's a problem with users being so
unfamiliar with their operating system and the tools thereof that they
will not be able to do very much in attempting to program under it.
Quite frankly, if the line about the perlpod manpage would have a
"(POD)" following it, I'd even say that about the first.

And keep in mind, I'm one of the more forgiving 'round these
parts. :-)

I certainly have no problem with someone coming up with *clear*
documentation, but if we're talking about people who can't (or, more
likely, *won't*) even try to tie their own shoes, as it were, I don't
think we need to do that sort of incredibly low-level hand-holding.

all, IMO, of course...

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Riding around on a horse while wearing a loincloth with one's gut
flapping in the breeze for a rock & roll video may lead viewers to
believe said rider to be, if not Indian, merely insane. That confusion
is understandable too.	- Rip Thrillby


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

Date: Tue, 13 Jun 2000 00:47:09 GMT
From: crazyCoder <crazycoder@my-deja.com>
Subject: Length of an Array
Message-Id: <8i40aa$vhi$1@nnrp1.deja.com>

I'm trying to get the length of an array stored in a hash, is there a
short-cut for this?

I know that $#array will give the length of @array, I have something
like this:
%my_hash = (1  => ["elem1","elem2","elem3"],
            2  => ["elem1","elem2","elem3","elem4","elem5"]
           );

since I am creating %my_hash on the fly, I need to know the lengths of
the array elements contained in it.

Thanks,


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 12 Jun 2000 18:06:42 -0400
From: Eli Mansour <elynt@exchange.ml.com>
Subject: Mail via perl
Message-Id: <39455EF2.53FA77D9@exchange.ml.com>

Does anybody have an example of sending attachments via Perl.

I don't mind using any mail package from CPAN. Just don't
see any code to just attach files and send them via email.

Thanks,

Eli



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

Date: Mon, 12 Jun 2000 15:40:48 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Mail via perl
Message-Id: <8i3ort$r35$1@brokaw.wa.com>


Eli Mansour <elynt@exchange.ml.com> wrote in message
news:39455EF2.53FA77D9@exchange.ml.com...
> Does anybody have an example of sending attachments via Perl.
>
> I don't mind using any mail package from CPAN. Just don't
> see any code to just attach files and send them via email.

Hi Eli,

Do you know about 'perldoc'?  It's Perl's documentation grepper,
essentially.  You tell it what you are looking for and it tries its best to
find relevant information.

Try typing this into your prompt:

perldoc perldoc

Now you have a list of valid flags that you can pass to perldoc.  The one
you may be interested in right off the bat is the '-q' flag.  That is the
FAQ grepper.  Let's try it out, you wanted to find out how to send mail,
right?

perldoc -q mail

Read the output.  Somewhere in there will be the FAQ "How do I send mail?".
Immediately following it will be the answer.  Pretty cool, huh?

Good luck, and happy grepping!

Lauren





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

Date: Mon, 12 Jun 2000 17:17:56 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Mystery Regex [long]
Message-Id: <slrn8kaks4.1gi.tadmc@magna.metronet.com>

On Mon, 12 Jun 2000 14:50:41 -0400, MC <mc@backwoods.org> wrote:
>Tad McClellan wrote:
>>
>> Looks like a bug to me.
>> 
>> Match fails with 5.6.
>> 
>> Match succeeds with 5.005_03.
>>
>
>Thanks, thats the first post that addresses the actual problem.
>
>The structures in evidence in the original post, as well as the code, is
>necessary to simulate the conditions in the real program and to show several
>variations in testing.


But none of that is "necessary" to illustrate the bug:

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

$_ = 'custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2';

my $pattern = "^(?:[^,]*,){6,6}(shipname,shipaddr1,shipa)";
#                                                      ^
print "pattern '$pattern'\n";

if ( /$pattern/ )
   { print "matched\n" }
else
   { print "No match\n" }
----------------------


Match fails under 5.6. Passes in 5.6 if you remove the "a" marked above.

Matches in both cases under 5.005_03.



>Several asked about the @order{@order} = @order. This creates a hash %order with
>keys from @orders and values from the same. This is there as a quick way to make
>a hash from a single data set.


Yes, but we are all wondering is: what good is it?

Why does it need to be in a hash?

Why is the array not Good Enough for your purposes?


>Would appreciate any ideas on this bug. 


It is a bug. Please report it using the 'perlbug' program that
shipped with the perl distribution.



>And help on how to report this bug. 


   perldoc perlbug


>I
>think the code below is the minimum to properly demonstrate this bug.


I think you are right that you have found a bug.

I think you are wrong that you need that much code to show the bug.

:-)


[ snip 80 lines of code ]


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 13 Jun 2000 00:40:23 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Not shifting what I want from an array
Message-Id: <8i3vtn$43jeu$1@fu-berlin.de>

hi,

nobull@mail.com wrote:
> Tina Mueller <tina@streetmail.com> writes:

>> i made a little mistake; maybe you recognized:
>> >>
>> >>while(<@a>) {
>> 
>> this should be:
>> while(<@lines>) {

> No, it should be:

> for(@lines) {

> If you do:

> while(<@lines>) {

> This is like doing:

> for (split /s+/ => pipeopen("echo @lines")) {

i *do* know that it would be better to use
for(@lines) in general.
but have you acutally read the original
posting?
try out the code with
for(@lines)
it won't give you the right result because you
shift inside: shift @lines.
then the for loop will be executed n/2
instead of n (n as the number of elements in @lines)

so 'while' creates another array which won't
be touched in the loop.


clear?

tina

-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception


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

Date: Mon, 12 Jun 2000 22:26:07 GMT
From: "Michael.Siemens" <Michael.Siemens@nospamhome.com>
Subject: Re: perl CGI on an Linux based apache webserver
Message-Id: <3sd15.109$El3.3718@news1.rdc1.ab.home.com>

thank you for your feed back! you are correct, I did type the wrong file
name in this example... however, the problem is real
here is a partial screen capture that has me trying to execute the correct
filename  =)

root@csg:/usr/local/httpd/cgi-bin > ls -l
total 963
-rw-r--r--   1 root     root         1167 Nov 17  1998 CdbCli.pm
-rw-r--r--   1 root     root         5786 Nov 17  1998 CdbHtml.pm
-rwxr-xr-x   1 root     root         9275 Nov 18  1998 cdb.cgi
-rwxr-xr-x   1 root     root        22588 Dec 13  1998 cdbsimple.cgi
-rwxr-xr-x   1 root     root         4842 Jun 11 15:51 contact.cgi
-rwxr-xr-x   1 root     root         4559 Nov 18  1998 detail.cgi
-rwxr-xr-x   1 root     root       851892 Apr 14  1999 htsearch
-rwxr-xr-x   1 root     root        20584 Apr 14  1999 info2html
-rw-r--r--   1 root     root         1529 Apr 14  1999 info2html.conf
-rwxr-xr-x   1 root     root          199 Feb 28 21:15 mail-form.cgi
-rwxr-xr-x   1 root     root          196 Jun 11 20:27 mail-form.pl
-rwxr-xr-x   1 root     root         4277 Jun 12 01:18 mailer
-rwxr-xr-x   1 root     root         4277 Jun 12 01:25 mailer.pl
-rwxr-xr-x   1 root     root          598 Jun 12 01:47 mailme.cgi
-rwxr-xr-x   1 root     root          598 Jun 12 01:50 mailme.pl
-rwxr-xr-x   1 root     root         1937 Jun 11 15:51 myversion.cgi
-rwxr-xr-x   1 root     root          120 Apr 14  1999 printenv
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_en
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_es
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_faq
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_fr
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_it
drwxr-xr-x   2 root     root         1024 Nov 30  1999 sdbtxt
-rwxr-xr-x   1 root     root          757 Apr 14  1999 test-cgi
-rwxr-xr-x   1 root     root          400 Apr 14  1999 test.pl
root@csg:/usr/local/httpd/cgi-bin > ./mail-form.pl
bash: ./mail-form.pl: No such file or directory
root@csg:/usr/local/httpd/cgi-bin >


got any ideas?



"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:394abc38.5354473@news.skynet.be...
Michael.Siemens wrote:

>-rwxr-xr-x   1 root     root          201 Feb 28 20:28 mail-form.pl

>root@csg:/usr/local/httpd/cgi-bin > ./mailform.pl
>bash: ./mailform.pl: No such file or directory
>root@csg:/usr/local/httpd/cgi-bin >

It doesn't look to me like it's the same filename.

--
Bart.




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

Date: Mon, 12 Jun 2000 23:57:46 GMT
From: Andy <y-o-y@home.com>
Subject: Re: Perl is FAST!!!
Message-Id: <_Ne15.268$fE2.5931@news1.rdc2.pa.home.com>

In article <x7vgze8wh8.fsf@home.sysarch.com>, Uri Guttman 
<uri@sysarch.com> wrote:

> >>>>> "A" == Andy  <y-o-y@home.com> writes:
> 
> 
>   A>     $_ =~ s/ +\|/\|/g;
>                       ^
> 
> no need to backwhack | in the replacement string. it has no special
> meanint there.
> 
> and lose all the $_ =~. that is very ugly. if you are using $_ then
> s/// will use it by default.
> 
>   A>     $_ =~ s/\| +/\|/g;
>                       ^
> 
>   A>     $_ =~ s/\|/\t/g;
> 
> if you want speed, use tr/// for char translations
> 
> 	tr/|/\t/ ;
> 
>   A>     $_ =~ s/Jan +(\d+) (\d\d\d\d) +\d+(?:\:\d\d+)+[AP]M/01\/\1\/\2/g;
>                                               ^
> no need to escape a : there.
> 
>   A>     $_ =~ s/Feb +(\d+) (\d\d\d\d) +\d+(?:\:\d\d+)+[AP]M/02\/\1\/\2/g;
>                                                                ^   ^
> if you need / in the regex, use alternative delimiters
> 
>   A>     $_ =~ s/Mar +(\d+) (\d\d\d\d) +\d+(?:\:\d\d+)+[AP]M/03\/\1\/\2/g;
>                                                                  ^^  ^^
> \1 and \2 are NOT the way to get backreferences in the replacement
> string. use $1 and $2.
> 
> 
> 
>   A>     $_ =~ s/Nov +(\d+) (\d\d\d\d) +\d+(?:\:\d\d+)+[AP]M/11\/\1\/\2/g;
>                                                       ^
> 
> do you really want a modifier on an subexpression with a modifier? since
> you ar not grabbing it, why not skip even matching it? you don't use any
> of the text after the (i assume) 4 digit year. you can just match the
> AM/PM and should be fine.
> 
> 
>   A>     $_ =~ s/Dec +(\d+) (\d\d\d\d) +\d+(?:\:\d\d+)+[AP]M/12\/\1\/\2/g;
> 
> that is slower than one regex which matches the months and substitutes
> with a hash for the month number.
> 
> this should be a bit faster and is much cleaner:
> 
> 	@months = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ) ;
> 	@month2num{ @months } = '01' .. '12' ;
> 
> 	s{([a-zA-Z]{3}) +(\d+) (\d{4}).+[AP]M}{$month2num{$1}/$2/$3}g ;
> 
> see how much faster that is.
> 
> uri


Uri,

Let me get back to you. Thanks for the pointers. I did test using your 
suggestions and the only thing that failed is the .+ modifier. I used 
the .+? and it worked. No greed. Otherwise it wiped out many fields.

Standby... (stay tuned).

Thanks,

Andy
I finally graduated! Now I've got no class.


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

Date: Mon, 12 Jun 2000 21:56:22 GMT
From: steveeq1@earthlink.net
Subject: Perldebug - jump command?
Message-Id: <8i3m9v$oog$1@nnrp1.deja.com>

I am using the Perl Debugger. I checked the man pages for this, but
haven't been able to come up with much. Anyway, if I am at say, line 6,
is there a way to jump up the execution to line 3?

- Steve


--
--------------------------------------
If you want to send me an email, send it to:
steve{at_sign}tripperjones{dot_com}


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 12 Jun 2000 22:57:20 GMT
From: hennessy@earl-grey.cloud9.net (Mathew A. Hennessy)
Subject: PGP::GPG::MessageProcessor + IO::Handle woes...
Message-Id: <skaqmg21h51126@corp.supernews.com>

Hi,
	Not having much fun trying to write a wrapper around a central 
password repository using P::G::M..  Code below:

-----8<-----8<-----8<-----8<-----8<-----8<-----
# decrypt pbook into hash

	# $switch->{'b'} = "/path/to/cryptext"
	# $pbook_tmp_file = tmp local storage

        #open(STDIN, $switch->{'b'});
        #open(STDOUT, ">$pbook_tmp_file");

        open(IN, $switch->{'b'}); open(OUT, ">$pbook_tmp_file");

        $in=new IO::Handle; $out=new IO::Handle;

        $in->fdopen(fileno(IN), "r"); 
        $out->fdopen(fileno(OUT), "w");

        my $pid=$gpg->decipher($in, $out)||
                die "$0: couldn't decipher!\n";
        waitpid ($pid, 0);

        close(OUT); close(IN);

-----8<-----8<-----8<-----8<-----8<-----8<-----

I leave the STDIN/STDOUT in because I've found that it works, but it clobbers
STDIN/STDOUT thereafter.  Duping STDIN/STDOUT gives me the same problem as 
using IO::Handles, and the PGP::GPG::MessageProcessor perldoc is not terribly
informative about actually using (as in, working examples?) the code..

running the full script with the DEBUG flag on, I get:
-----8<-----8<-----8<-----8<-----8<-----8<-----
begin decipher()
begin call_with_common_interface()
begin attach_pipes()
forking
closing unused status handle
fork: executing gpg --decrypt --status-fd 8
gpg: Warning: using insecure memory!

<ctrl-c>

gpg
: Interrupt caught ... exiting
-----8<-----8<-----8<-----8<-----8<-----8<-----

perl -v: This is perl, v5.6.0 built for i686-linux-thread
PGP::GPG::MessageProcessor v0.4.5

What am I missing?

Cheers,
- Matt
-- 
If it sounds too good to be true, it's probably Linux.
"Fool! There is nothing Perl cannot do! NOTHING!" -Bastich
"You can never entirely stop being what you once were. That's why it's important
to be the right person today, and not put it off till tomorrow." - Larry Wall


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

Date: Tue, 13 Jun 2000 00:16:45 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Place to run programs
Message-Id: <q9oaks06mn8bshehrkosib44ukq0p441q6@4ax.com>

On Mon, 12 Jun 2000 21:38:02 +0100, "James" <fromnews@pagepool.co.uk>
wrote:

> I am completely new to perl - I got my first book this evening.  Can anyone
> tell me where I can run the programs on a Windows 98 PC?

at home?

-- 
Good luck,
Abe


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

Date: Mon, 12 Jun 2000 17:58:54 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Place to run programs
Message-Id: <slrn8kan8u.1gi.tadmc@magna.metronet.com>

On Mon, 12 Jun 2000 21:38:02 +0100, James <fromnews@pagepool.co.uk> wrote:

>Can anyone
>tell me where I can run the programs on a Windows 98 PC?


Perl runs on your Central Processing Unit (CPU).

:-)



You must first have perl installed on your computer.

Go download it from activestate.com.

Install it.

Then read the docs that come with it.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 12 Jun 2000 16:27:18 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: Place to run programs
Message-Id: <stevel-1206001627180001@192.168.100.2>

In article <q9oaks06mn8bshehrkosib44ukq0p441q6@4ax.com>, Abe Timmerman
<abe@ztreet.demon.nl> wrote:

> On Mon, 12 Jun 2000 21:38:02 +0100, "James" <fromnews@pagepool.co.uk>
> wrote:
> 
> > I am completely new to perl - I got my first book this evening.  Can anyone
> > tell me where I can run the programs on a Windows 98 PC?
> 
> at home?


Hell no that cuts into valuable TV time.  I'd do it at work.


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

Date: 12 Jun 2000 22:40:00 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: Removing Whitespace
Message-Id: <8i3os0$42b$1@nnrp02.primenet.com>

Bob Walton <bwalton@rochester.rr.com> wrote:
> deno wrote:
> > Here the task - The script reads from a csv file and writes to
> > another csv file.
> >
> > Here the problem- I'm looking for a method to ensure that all
> > fields are written to the second csv file without leading or
> > trailing whitespace. What's the bestway to accomplish this. Yes
> > I'm new to perl but I have tryed.
> >
> > s/^\s+//; s/\s+$//; - how do I incorporate these so each field
> > is modified?
> >
> > while (<USRL>)
> >
> >          {
> >
> >   ($loginn,$lastn,$firstn,$dept,$title,$tel) = split (',');
> > 
> >    die "\n\nFatal Error !! - Required field missing in $ui_file
> > at Line $user_count\n\n"
> >    if (grep {!$_ or $_ =~ /\"/} ($loginn,$lastn,$firstn));
> > 
> > print IMPORTDATA
> > "$firstn,$lastn,$firstn,$dept,$title,$tel\n";
> > 
> >     }
> ...
>
> The easiest way is to use map:
>
> while(<DATA>){
>     chomp;
>     ($loginn,$lastn,$firstn,$dept,$title,$tel) = 
>         map {s/^\s+//;s/\s+$//;$_} split(',');
>     die "\n\nFatal Error !! - Required field missing in $ui_file at Line
> $user_count\n\n"
>         if (grep {!$_ or $_ =~ /\"/} ($loginn,$lastn,$firstn));
>     print 
>         "$firstn,$lastn,$firstn,$dept,$title,$tel\n";
> }
> __END__
> a,b,c,d,e,f
>    aa  ,  bb  ,  cc  ,  dd  , ee , ff         

Unless you must do something with the values in the comma-separated
fields, this simple script will suffice:

#!/usr/bin/perl -w

while (<DATA>) {
    s/^\s+//;
    s/\s+$//;
    s/\s*,\s*/,/g;
    print;
}

__END__
montyj,Monty,Jim,Processing,Senior Consultant,714-799-6540
  montyj  , Monty  ,  Jim,  Processing ,Senior Consultant   , 714-799-6540  

Otherwise, you can trim leading and trailing spaces from the record
(i.e., the line), then split the record using the regular expression
pattern /\s*,\s*/, thus:

#!/usr/bin/perl -w

use strict;

$, = ",";
$\ = "\n";

while (<DATA>) {
    s/^\s+//;
    s/\s+$//;
    my ($loginn, $lastn, $firstn, $dept, $title, $tel) = split /\s*,\s*/;
    # operate on the parsed values here
    print $loginn, $lastn, $firstn, $dept, $title, $tel;
}

__END__
montyj,Monty,Jim,Processing,Senior Consultant,714-799-6540
  montyj  , Monty  ,  Jim,  Processing ,Senior Consultant   , 714-799-6540  

This problem changes significantly if your data might contain quoted
strings with embedded commas.

-- 
Jim Monty
monty@primenet.com
Tempe, Arizona USA


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

Date: 12 Jun 2000 18:47:20 -0400
From: James Cameron <james@WebEvent.com>
Subject: Strange permission problems with ActivePerl 613
Message-Id: <x7hfay34av.fsf@server.matadordesign.com>


OS: Windows NT 4.0 SP 4 or lower

Summary: Receiving permission denied error messages when using 'rmdir'
         after 'opendir' with the latest release.

Code: This code fails with permission denied in version 613 but works
      fine in 522 and every version of Perl I've tried on Unix
      machines. 

######################
$dir = "mytest";
$ret = mkdir($dir,"511");

if (!opendir(DIR1, $dir)) {
    print "Could not get contents of $dir: $!";
}
$return = rmdir($dir);

if ($return ne "1") {
    print "Could not remove $dir. Reason: $!";
}
####################

Note: This is very similar to a bug we reported a long time ago with
      the DLL/ISAPI version but which is now resolved (at least in 522).

If you remove the opendir call, it works just fine.  However, the
opendir call should not be affecting the permissions at all.  We
noticed this bug when customers of our perl software complained that
they could not delete calendars.

-James Cameron
President, WebEvent, Inc.
http://www.WebEvent.com/


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

Date: Mon, 12 Jun 2000 16:09:21 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Strange permission problems with ActivePerl 613
Message-Id: <8i3qhe$23v$1@brokaw.wa.com>


James Cameron <james@WebEvent.com> wrote in message
news:x7hfay34av.fsf@server.matadordesign.com...
>
> ######################
> $dir = "mytest";
> $ret = mkdir($dir,"511");
>
> if (!opendir(DIR1, $dir)) {
>     print "Could not get contents of $dir: $!";
> }
> $return = rmdir($dir);
>
> if ($return ne "1") {
>     print "Could not remove $dir. Reason: $!";
> }
> ####################

This isn't an answer to your problem, I don't have 613 installed so I
wouldn't be able to reproduce your problem.  This is more of a stylistic
issue, hope you don't mind.  :-)

Perl is not C.  Your checking of system interaction return values is
laudable, but you are going about them in an ack-bassword way.  Write your
checks to emphasize the correct action, and de-emphasize the exceptions.

$dir = "mytest";
mkdir ($dir, "511") or die "Couldn't create $dir: $!";
opendir (DIR1, $dir) or print "Could not get contents of $dir: $!\n";  #
warn() and die() send the string to STDERR

rmdir ($dir) or print "Could not remove $dir: $!\n";

Lauren





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

Date: Mon, 12 Jun 2000 23:19:25 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Summer Computer Jobs
Message-Id: <x7r9a28p37.fsf@home.sysarch.com>

>>>>> "C" == Cybercamps2000  <summer2000@cybercamps.com> writes:

  C> We are still hiring for our camps in:

  C> Bellevue, WA

i wonder what kind of spoiled brat will be going to that camp? :-)

"mommy, why do i have to use linux? i want my winblows!! WAAAHHHHH!!"

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

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 V9 Issue 3335
**************************************


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