[9844] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3437 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 13 11:07:28 1998

Date: Thu, 13 Aug 98 08:00:31 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 13 Aug 1998     Volume: 8 Number: 3437

Today's topics:
    Re: ActivePerl 5.005: Dynamically Generated @INC? derzayg@gsao.med.ge.com
    Re: Calculate Date in Perl (Mike Stok)
    Re: Free Web Stuff (Scott Willsey)
        Help: Installing Modules? (Mike)
    Re: Help: NT User ID, Full Name + Perl 5? <hugh@hiwaay.net>
    Re: How to handle food properly (Scott Willsey)
    Re: IMPORTANT: Proper Netiquette (Scott Erickson)
        INLINES.PL?WHEELS=PLASTIC <cristo@consotech.se>
    Re: long story - fork & multiprocessing problem dzuy@my-dejanews.com
    Re: Net::FTP problem. <jdf@pobox.com>
        NT redirect to file <jdwyer@verio.com>
        performance analysis <dgl@offis.lu>
    Re: performance analysis (Maurice Aubrey)
    Re: performance analysis <jdf@pobox.com>
    Re: Perl Style (Scott Erickson)
    Re: Perl Style (Scott Erickson)
        Q: How to read all the file name in a directory (Ollie Cook)
        Q: Using XS module with PerlScript (ActiveState) <jemmerli@cscmail.csc.com>
    Re: Read directory and not files <jdf@pobox.com>
    Re: Remove lines from output <tonylabb@infonline.net>
        retrieving hash name (Mark C. Wilhelm)
        Setting DOS environment variables in a perl script vdielman@debis.com
        test post. <helpdesk@wan.omnes.net>
    Re: Test your Javascript and HTML knowledge (Scott Willsey)
    Re: Test your Javascript and HTML knowledge (Scott Willsey)
    Re: The Four P's: Perl, Paging, and Palm Pilots...... (Andrew M. Langmead)
    Re: unlink files in directories with spaces (win95) (Andrew M. Langmead)
    Re: Win NT Formmail and opening temporary files (Bill Mezian)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 13 Aug 1998 13:14:20 GMT
From: derzayg@gsao.med.ge.com
Subject: Re: ActivePerl 5.005: Dynamically Generated @INC?
Message-Id: <6quorc$lql$1@nnrp1.dejanews.com>

I'm running 5.005_01 on Solaris and IRIX and have to build it in a
different directory than where it ultimately sits....and the @INC is still
hardcoded.  So the change to a dynamically created @INC was not a part of
the upgrade to 5.005 from what I can tell.

Greg


> I haven't been able to try this on a Unix version of 5.005 so I suppose it's
> possible that this is a 5.005 change rather than an ActivePerl one.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 13 Aug 1998 13:02:02 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Calculate Date in Perl
Message-Id: <6quo4a$rk2@news-central.tiac.net>

In article <6qu5dl$5g6$1@nnrp1.dejanews.com>,  <ngong@my-dejanews.com> wrote:
>I wanna know how I can calculate a new date, given an initial date and an
>offset which may be positive or negative in days, in order to answer
>questions like "today plus 90 days -- what date gives that ?, by using CGI.pm
>and POSIX like your suggestion following :

You might cinsider using the Date::Calc module available on CPAN, visit
http://www.perl.com and follow the CPAN links if you don't know where CPAN
archives are.  CPAN is the comprehensive perl archive network.

  use Date::Calc ':all';

  print Date_to_Text (Add_Delta_Days Today, 90), "\n";

is one way to discover today + 90 days.

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Thu, 13 Aug 1998 12:36:49 GMT
From: hangtown_nospam@thelostweb.com (Scott Willsey)
Subject: Re: Free Web Stuff
Message-Id: <35e5dcb1.26861314@news.calweb.com>

On Wed, 12 Aug 1998 15:48:22 GMT, veronica@iminet.com wrote:

>
>You are able to offer a "virtual community" to your web visitors, where YOU
>are the mayor and YOU control the community.  Your visitors will keep coming
>back to your website again and again and again.
>

As Mayor, I hereby pledge to have all spammers shot on sight and then
ground up and shoved into tiny rectangular cans and sold in grocery
stores for a buck ninety-nine.

Scott

 .................................................
Please edit the email address to reply



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

Date: 13 Aug 1998 13:55:08 GMT
From: schutzmd@SPAMFREEjmu.edu (Mike)
Subject: Help: Installing Modules?
Message-Id: <6qur7s$3q8$1@lark.jmu.edu>

I'm new to the concept of installing new modules, which seems simple
enough.  I follow the following steps:

perl Makefile.PL
make
make install

Everything runs smoothly until 'make install' which give me the following
error message:
/bin/sh:
/var/tmp/perl-root/usr/lib/perl5/i386-linux/5.00401/perllocal.pod: No such
file or directory
make: *** [doc_site_install] Error 1

This has happened with all of the modules I have tried to install.  I have
searched my system for a perllocal.pod, but the closest I can find is
/usr/lib/perl5/i386-linux/5.00401/perllocale.pod  --  any ideas?

As always, thanks for the help.

- mike -


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

Date: Thu, 13 Aug 1998 09:21:40 -0500
From: "Hugh Messenger" <hugh@hiwaay.net>
Subject: Re: Help: NT User ID, Full Name + Perl 5?
Message-Id: <2#l9qHsx9GA.195@newstoo.hiwaay.net>


Jeffrey D. Hoffman wrote in message <35D2E00D.6AD5@teldta.com>...

>Is there an alternative to Win32::NetAdmin that returns the users ID and
>the user's real name?

Get AdminMisc, from www.roth.net.  That'll give you the Full Name, at least,
using AdminMisc::GetUserAttributes.

   -- hugh





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

Date: Thu, 13 Aug 1998 12:25:55 GMT
From: hangtown_nospam@thelostweb.com (Scott Willsey)
Subject: Re: How to handle food properly
Message-Id: <35e4db34.26480857@news.calweb.com>

On 12 Aug 1998 02:53:51 GMT, mgjv@comdyn.com.au (Martien Verbruggen)
wrote:

>In article <998222410380.8059590448@earthlink.net>,
>	dgo4th@earthlink.net writes:
>
>> Any opinions?
>
>Yes. Go away, and I am struggling not to use a more expletive way of
>expressing that opinion. What a totally transparent attempt at hiding
>a silly spam.
>
>Martien

Well, if I had a silly spam, I'd hide it too...

Scott

 .................................................
Please edit the email address to reply



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

Date: Thu, 13 Aug 1998 13:58:20 GMT
From: Scott.L.Erickson@HealthPartners.com (Scott Erickson)
Subject: Re: IMPORTANT: Proper Netiquette
Message-Id: <35d2f0a0.2507510980@news.mr.net>

Previously, gburnore@databasix.com (Gary L. Burnore) wrote:

>On 11 Aug 1998 02:50:13 GMT, in article <6qobh5$nc7$2@csnews.cs.colorado.edu>,
>Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>>Those who have never read this document, should.
>>
>>              A Primer on How to Work With the Usenet Community
>>                             Chuq Von Rospach 
>
>
>From reading some of your posts in .moderated, looks like you didn't read it
>before either.

Hmm, you echoed my thoughts.

Scott.


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

Date: Thu, 13 Aug 1998 17:05:47 +0100
From: Cristsbal Hormazabal <cristo@consotech.se>
Subject: INLINES.PL?WHEELS=PLASTIC
Message-Id: <35D30EDB.783C@consotech.se>

Hi there!

When I put a link like this:
<A HREF="INLINES.PL?wheels=plastic ">Plastic wheels</A>

How do I read the line with my Perls script? I know I can't 
use:
		local(*queryString) = @_ if @_;
		local($contentLength);
		$contentLength = $ENV{"CONTENT_LENGTH"};
		read(STDIN,$queryString,$contentLength);
		return 1;


How do I do it when I use the "?"-sign after the script?

Please email your tip to:
cristo@consotech.se

/Best Regards Cristobal


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

Date: Thu, 13 Aug 1998 14:26:00 GMT
From: dzuy@my-dejanews.com
Subject: Re: long story - fork & multiprocessing problem
Message-Id: <6qut1o$ps0$1@nnrp1.dejanews.com>

In article <35D1B0E7.BCA59540@rocketmail.com>,
  Debbie Whitten <usenet-replies@rocketmail.com> wrote:
> Hello,
>
> I am fairly new to using fork() in Perl, although I'm fairly familiar
> with Unix...It's kind of a long problem, so here goes:
>
> I am writing a script that will process all files in a directory. The
> files are going to be ftp'd there by another machine, and may be coming
> in in chunks of 100 or so (not sure yet).
>
> All I need to do for each file is to:
> 1) check if the destination dir exists (based on the filename). If not,
> create it
>
> 2) mv the file to the destination (checking for duplicates and renaming
> as necessary)
>
> 3) gzip the file
>
	I detect the gzip part probably takes up half of your script execution
	time.  Since gzip is an entirely separate function, why not make it a
	separate process?  have one process to process the checking and moving
	of the files.  Have another process just gzip the list of files passed
	in.  You can use some mean of IPC to pass the list of files to be
	gzip'ed.  This concept is like employing a cashier and a packer at the
	supermarket's checkout.  It moves the line faster.

	Also, most of your system commands can be done using perl functions.
	Try to avoid system as much as you can as what system does is fork,
	execute the command via the shell, wait, get back status, etc.  This
	should save some time.

> The problem is that we're going to be processing about 2.2 million small
> files, and I calculated that my script is going to take anywhere from 15
> - 22 days to run. I've been told this is too slow.
>
> I tested the script with just sequential processing of 150 files and
> using the time command and got this result:
>
>      34.0u 56.0s 1:52 79% 0+0k 0+0io 0pf+0w
>
> I wrote a 2nd script using fork() and ran into the zombie process
> problem. I added the $SIG{CHLD} = sub { wait; } statement and it still
> didn't solve the problem. I had to add a handler sub that would reset
> the $SIG{CHLD} every time (WHY!?)
>
> sub handler {
>         local ($sig) = @_;
>         wait;
>         $forks_returned++;
>         $SIG{CHLD} = 'handler';
> }
>
> and then it worked fine with no zombies. The timing for that one was:
>
>      33.0u 56.0s 1:42 86% 0+0k 0+0io 0pf+0w,
>
> But the system load went up to 18! And besides, this isn't much faster
> than the sequential script.
>
> I also tried writing this in C, which was slower than the sequential
> Perl script. Then I tried Perl but using a system ("cmd &"); call
> instead of fork. I calculated this one would take 22 days.
>
> What should I do? The Perl script with the fork() function is the
> fastest, but not by much. Is there any way to speed this up? The problem
> is that after the files are transferred, a 2nd script needs to be called
> to format the data, and judging from what I have so far, we're looking
> at a month to process!
>
> I'm concerned about creating too many child processes and slowing the
> system down. I also thought that the parent Perl script would be much
> quicker - waiting for the child processes to finish seems to be a waste
> of time.
>
> Here's the script:
>
> #!/usr/bin/perl
>
> $secs = 120;
>
> $SIG{CHLD} = 'handler';
> $SIG{KILL} = 'exit_gracefully';
> $SIG{QUIT} = 'exit_gracefully';
>
> ##
> ## Use a variable to control where the files will be read from.
> ##
>
> $from = "./test";
>
> ##
> ## Use a variable to control where the files will be written.
> ##
>
> $dest_root = "./dest/";
>
> ##
> ## Will be writing to a log file so turn on auto-flushing.
> ##
>
> $| = 1;
>
> ##
> ## Keep track of all files processed. This list will be used later.
> ##
>
> open LOG, ">> mv_files.log";
> $timestamp = `date`;
> ## print LOG "# $timestamp"; In parallel this doesn't work the way I
> ## expected. EVERY process writes to the log file. I don't want that.
>
> ## while (1) { ## will need this for the real run.
>
>     ## Order files by time, that way the newest file can be skipped.
>
>     @files = `ls -t $from`;
>     $xxx = $#files;
>     print "Num files: $xxx\n";
>
>     if ($xxx == -1) {
>         print "$$: No files ready. Sleep $secs\n";
>         sleep $secs;
>     } elsif ($xxx == 0) {
>         print "$$: Only 1 file -- in progress. Sleep $secs\n";
>         sleep $secs;
>     }
>     else {
>         print "$$: Starting. \n";
>         ##sleep 5;
>
>     ##
>     ## get rid of the newest file since it is most likely still being
>     ## transferred. Note - this program will need to be run once more
>     ## to ensure that the last file gets processed, or maybe set up so
>     ## that ^C does this...Or the last file can be processed manually.
>     ##
>     $lastfile = shift @files;
>
>     ##
>     ## Remove the newline.
>     ##
>
>     chomp ($lastfile);
> ##      print "$lastfile is still being transferred.\n";
>
>     $forked = 0;
>     $forks_returned = 0;
>     foreach $file (@files) {
>
>         chomp ($file);
>
>         ## what I was trying to do here was to ensure not too many
>         ## child processes were created at once. It didn't improve
>         ## run time although it helped the system load average.
>
>         if ($forked - $forks_returned > 10) {
>             print "forks returned: $forks_returned\n";
>             print "forked: $forked\n";
>             sleep 60;
>         }
>         $pid = fork();
>         ## print "pid: $pid, file: $file\n";
>
>         if (defined ($pid)) {
>            $forked++;
>         }
>         if ($pid == 0) { ## supposedly, this is all the child process
>                          ## will be doing...
>
>             ##
>             ## Break up the filename into the directory names.
>             ##
>
>             ($dir1, $dir2, $dir3) = ($file =~ m/^(..)(..)(..)/);
>
>             ##
>             ## Append the destination directory root name
>             ## (./dest/ in this case).
>             ##
>
>             $dir1_name = $dest_root . $dir1;
>             $dir2_name = $dir1_name . "\/" . $dir2;
>             $dir3_name = $dir2_name . "\/" . $dir3;
>
>             ##
>             ## Reduce the following to 1 system call instead of
>             ## potentially 3 by using mkdir -p to create all
>             ## parent directories.
>             ##
>
>             if (! -e $dir3_name) {
>                system "mkdir -p $dir3_name";
>             }
>
>             ##
>             ## $filename is of the format:
>             ##      /dest/ak/11/22/ak11223.listing
>             ##
>
>             $filename = $dir3_name . "\/" . $file;
>
>             ##
>             ## $dest_file is of the format:
>             ##      /dest/ak/11/22/ak11223.listing.gz
>
>             $dest_file = $filename . ".gz";
>
>             ##
>             ## Check for existence of $dest_file, keep trying new
>             ## filenames by incrementing a counter. (Assumption is
>             ## that if file.gz doesn't exist, neither does file,
>             ## or if it does it's ok to be overwritten).
>             ##
>
>             $counter = 0;
>             while (-e $dest_file) {
>                $counter++;
>                ## print "$dest_file exists!\n";
>                $dest_file = $filename . ".gz";
>                $dest_file =~ s/(\w+)(\.\w+)(\.gz)$/$1$counter$2$3/ ;
>             }
>             $dest_file =~ s/\.gz// ;
>
>             ##
>             ## First, mv the file to it's final destination.
>             ##
>
>             $err = system "mv $from\/$file $dest_file 2>/dev/null";
>
>             ##print "Error from mv = $err\n";
>             ## print "Err: $err\n";
>             ## print "cp $from\/$file $dest_file\n";
>
>             ##
>             ## For the mv command:
>             ## 0 = success
>             ## > 0 = failure
>             ##
>
>             ##if ($err <= 0) {
>             ## Sometimes get -1 returned - maybe
>             ## from system() instead of mv??
>             ##
>             ## Then finally, gzip the file.
>             ##
>
>                    system "gzip -qf1 $dest_file 2>/dev/null";
>                    ## print "gzip $dest_file\n";
>
>                    print LOG "$dest_file.gz\n";
>             ##}
>
>             exit(0);
>
>         } ## end of child process.
>     } ## foreach file
> } ## else
> ## } ## while (1)
> close LOG;
> ##close MSG;
> exit(0);
>
> sub handler {
>     local ($sig) = @_;
>     wait;
>     $forks_returned++;
>     $SIG{CHLD} = 'handler';
> }
>
> sub exit_gracefully {
>     local ($sig) = @_;
>     close LOG;
>     $SIG{CHLD} = 'handler';
>     ##close MSG;
>     exit(0);
> }
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 13 Aug 1998 10:06:29 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: k-sato@res.otaru-uc.ac.jp (Kou Sato)
Subject: Re: Net::FTP problem.
Message-Id: <lnos9b0q.fsf@mailhost.panix.com>

k-sato@res.otaru-uc.ac.jp (Kou Sato) writes:

>   Can't locate object method "new" via package 
>  "Net::FTP::A" at /usr/local/lib/perl5/5.00501/i386-freebsd/IO/Socket.pm
>   line 253.

Could you please post a brief but complete example program that
exhibits this behavior?  It would be best if you'd use an anonymous
account on a publicly accessible ftp server.

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


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

Date: 13 Aug 1998 14:51:13 GMT
From: John Dwyer <jdwyer@verio.com>
Subject: NT redirect to file
Message-Id: <6quuh1$p5q$1@news.ncal.verio.com>

Hi,

I'm using PerlWin32 on NT workstation 4.0 and am having a bit of a
problem redirecting output to a file.

I've got a perl script (processor.pl) that basically processes a detail
file and spits out summary stats. At the command line, I run:

processor.pl detail.txt > summary.txt

I know the Perl piece appears to be working correctly, because when I just
run the program without redirection, the data scrolls across the screen.

Under Win95, all the output ends up in "summary.txt", which is what I
want. On WinNT, I end up with an empty file.

Any ideas?

thanks,
john dwyer
jdwyer@wco.com



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

Date: Thu, 13 Aug 1998 15:06:33 +0200
From: David Gallone <dgl@offis.lu>
Subject: performance analysis
Message-Id: <35D2E4D8.2EF1E24@offis.lu>

Hi There,

Does someone know about  a performance analysis tool (not the Benchmark
module) that could be used to trace the execution time of Perl
instructions ?

Thanks in advance
T.Conrad



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

Date: Thu, 13 Aug 1998 13:56:47 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: performance analysis
Message-Id: <slrn6t5s50.58b.maurice@we-24-130-48-83.we.mediaone.net>

On Thu, 13 Aug 1998 15:06:33 +0200, David Gallone <dgl@offis.lu> wrote:

>Does someone know about  a performance analysis tool (not the Benchmark
>module) that could be used to trace the execution time of Perl
>instructions ?

See the Devel::DProf module.

-- 
Maurice Aubrey <maurice@hevanet.com>

The goal of Computer Science is to build something that will last
at least until we've finished building it. 


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

Date: 13 Aug 1998 10:27:26 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: David Gallone <dgl@offis.lu>
Subject: Re: performance analysis
Message-Id: <g1f09a1t.fsf@mailhost.panix.com>

David Gallone <dgl@offis.lu> writes:

> Does someone know about  a performance analysis tool (not the Benchmark
> module) that could be used to trace the execution time of Perl
> instructions ?

Ummm...  When you say "Perl instructions," what exactly do you mean?
Do you mean to profile your own code?

  $ perl -d:DProf yourscript
  $ dprofpp

DProf is available at the CPAN.

Do you mean to time the execution of various builtins like "print" or
"shift"?  You'll have to use Benchmark to take *relative* measures of
these operators.

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


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

Date: Thu, 13 Aug 1998 13:35:12 GMT
From: Scott.L.Erickson@HealthPartners.com (Scott Erickson)
Subject: Re: Perl Style
Message-Id: <35d2e9d2.2505769175@news.mr.net>

Previously, Tom Christiansen <tchrist@mox.perl.com> wrote:

>In comp.lang.perl.misc, Scott.L.Erickson@HealthPartners.com (Scott Erickson) writes:
>:I, for one, believe
>:that using 'or' is much more readable than ||, 
>
>Do you also believe that `plus' is more readable than `+' comma
>or that `BEGIN' is more readable than `{' question mark

Finally, I get the pleasure of receiving a stupid comment from Tom.
Joy!!!

In answer to your question, it depends on the situation. With regards
to Perl, no, because, as far as I know, I can not use 'plus' for '+',
nor can I use 'BEGIN' for '{'. However, I can use 'or' for '||' in
some situations, and I still believe 'or' to be more readable than
'||'.  If I remember correctly, somewhere in the Camel book it says
that Perl provides 'or', 'and', and 'not' as more readable
alternatives to '||', '&&', and '!'. Plus, by using those I usually do
not need to use parentheses.

However, regarding your use of 'comma' for ',' and 'question mark' for
'?', I do consider such usage to be more readable, nor have I ever
seen anyone, other than you, use such notation. Yet, I have seen
others use 'or' for '||' in their Perl code and I had no difficulty
understanding their use of such.

Scott.




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

Date: Thu, 13 Aug 1998 13:37:13 GMT
From: Scott.L.Erickson@HealthPartners.com (Scott Erickson)
Subject: Re: Perl Style
Message-Id: <35d2eb97.2506222377@news.mr.net>

Previously, Tom Christiansen <tchrist@mox.perl.com> wrote:

> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, Scratchie <upsetter@ziplink.net> writes:
>:Sorry, Tom. He must have forgotten that There's Only One Way To Do It!
>
>That doesn't mean all ways are equally desirable. And exchanging
>all symbolic notation for namby-pamby wordies isn't one of the
>desirable ways.

Who mentioned exchanging all symbolic notation for namby-pamby
wordies? Oh, that was you that suggested it.

>Why don't you just kill file me instead of continuing your whining?

Why don't you just kill file me instead of continuing your whining?

Scott.



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

Date: Thu, 13 Aug 1998 13:59:36 GMT
From: oliver.REMOVE.cook@bigfoot.DELETE.com (Ollie Cook)
Subject: Q: How to read all the file name in a directory
Message-Id: <35d2ede8.1849542@news.ukonline.co.uk>

I have written a counter script that is run off an SSI that stores the
number of accesses of a file in a directory under that filename. e.g.
if links.shtml was accessed 26 times then a file links.shtml in
another directory would have 26 stored in it. What I would like to do
is to complete the next step: to create another script that tells the
webmaster how many times each page has been accessed. So I suppose
what I need to do is to read in the names of all the files in that
directory into an array, but I have no idea how to do this. you help
would be greatly appreciated!

Regards,
Ollie
----
Oliver COOK, Web Site Designer for
Premiere Web Designs - Http://Www.Premiere.Uk.Com/
+
Webmaster of The Audio-Visual Archive 
 * over 900 images and 700 sounds, free
 * Http://Www.Premiere.Uk.Com/ava/ 


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

Date: 13 Aug 1998 13:10:26 GMT
From: "John Emmerling" <jemmerli@cscmail.csc.com>
Subject: Q: Using XS module with PerlScript (ActiveState)
Message-Id: <01bdc6bd$2a6850c0$7d1456c0@c-104638>


Hi:

Does anyone know, if you use PerlScript from ActiveState in an ASP, can the
PerlScript use modules that incorporate C-code that was integrated using
the Perl XS API?

TIA,
--
John Emmerling


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

Date: 13 Aug 1998 10:22:05 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: perlguy@technologist.com
Subject: Re: Read directory and not files
Message-Id: <iujw9aaq.fsf@mailhost.panix.com>

Brent Michalski <perlguy@inlink.com> writes:

> I use the below code to read my subdirectory structure.  Although it
> still reads the filenames with readdir, I only store the directory names
> in the array @dirs.

You might consider using the File::Find module instead, which makes
things a bit pithier, and allows for tracking symlinks (to avoid
infinite recursion), etc.

   #!perl -w
   use strict;
   use File::Find;

   my @dirlist = get_dirs('c:/perl');

   sub get_dirs {
     my $start = shift;
     my @dirs = ();
     my $wanted = 
       sub { -d && !/^\.\.?$/ && push @dirs, $File::Find::name };
     find($wanted, $start);
     return @dirs;
   }

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


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

Date: Thu, 13 Aug 1998 09:44:34 -0400
From: Tony Labbiento <tonylabb@infonline.net>
Subject: Re: Remove lines from output
Message-Id: <35D2EDC2.15FAA5AE@infonline.net>

You can use this:
print "$port $timeon $pid\n" if $port !~ /ttyE6/;

which should print as long as $port doesn't have ttyE6 in it.

Craig Nuttall wrote:
> 
> This does what I want.
> 
> for (keys %ppp) {
>     my ($port, $timeon, $pid) = split /\s+/, $ppp{$_};
> if ($port ne "ttyE60,") {
>     print "$port $timeon $pid\n";
>     }
> }
> 
> how do I remove more than just ttyE60, from the report
> eg ttyE60 and ttyE61 and etc etc
> 
> Any help appreciated
> Craig
> admin@kewl.com.au
> The effort of learning provides the gift of teaching :-)

-- 
			****************************************
			*    Tony Labbiento                    *
			*    Infinity Online, Inc.             *
			****************************************


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

Date: 13 Aug 1998 13:29:34 GMT
From: mwilhelm@ccat.sas.upenn.edu (Mark C. Wilhelm)
Subject: retrieving hash name
Message-Id: <6qupnu$nmr$1@netnews.upenn.edu>

Suppose one "dynamically" names a hash during the course of a script, and
then creates a reference to the hash.  Is is it possible, using the
reference, to retrieve the _name_ of the hash as well as the key/value
pairs?  If so, how would one do this?

Thanks,
Mark

 -- 
===================================================================
Mark Wilhelm			|	(57)3-7418
Web Programmer			|	mwilhelm@ccat.sas.upenn.edu
Instructional Computing,	|	ccat.sas.upenn.edu/~mwilhelm
School of Arts And Sciences	|
University of Pennsylvania	|
===================================================================


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

Date: Thu, 13 Aug 1998 13:09:45 GMT
From: vdielman@debis.com
Subject: Setting DOS environment variables in a perl script
Message-Id: <6quoip$lfa$1@nnrp1.dejanews.com>

Hi there,

could anybody tell me how to set DOS environment variables in PERL? I want to
define an env-variable e.g. "SET LOCATION = jdvn" in a DOS batch-file and
want a PERL script to assign new values to these vars so i can use them as
command line parameters of the NT-command "net user...".

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 13 Aug 1998 09:10:18 -0500
From: omneswan <helpdesk@wan.omnes.net>
Subject: test post.
Message-Id: <35D2F3CA.6B86CD3F@wan.omnes.net>

This is a test post, I have users complaining that they can not post, so
I am going to test.  Please disregard this, and be assured that it will
not be a common thing.



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

Date: Thu, 13 Aug 1998 12:18:40 GMT
From: hangtown_nospam@thelostweb.com (Scott Willsey)
Subject: Re: Test your Javascript and HTML knowledge
Message-Id: <35e2d971.26029999@news.calweb.com>

On Tue, 11 Aug 1998 16:27:33 -0400, John Porter <jdporter@min.net>
wrote:

>Mike Russiello wrote:
>> 
>> We have developed separate HTML and JAVASCRIPT tests that will SOMEDAY
>> be used to screen job applicants and help employees get rewarded for
>> learning (perl is coming soon).  
>
>Evil so pure and unabashed, it defies description.

The description is ... spam ...

Yup.  Evil so pure and unabashed.

Scott
 .................................................
Please edit the email address to reply



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

Date: Thu, 13 Aug 1998 12:22:50 GMT
From: hangtown_nospam@thelostweb.com (Scott Willsey)
Subject: Re: Test your Javascript and HTML knowledge
Message-Id: <35e3d9c4.26112617@news.calweb.com>

On Tue, 11 Aug 1998 13:51:50 -0400, Mike Russiello
<mike.russiello@tekmetrics.com> wrote:

>We have developed separate HTML and JAVASCRIPT tests that will SOMEDAY
>be used to screen job applicants and help employees get rewarded for
>learning (perl is coming soon).

(snip)

>
>At completion, you will see scores between 1-5 (5 is highest).  We will
>also post a top ten list at 123apply.com.  Other than the top ten list,
>your info WILL NOT BE SHARED WITH ANYONE and YOU WILL NOT HEAR FROM US.
>
>Thanks for helping us out.
>
>Mike Russiello
>TekMetrics, Inc.


Rating myself in something on a scale of 1-5 is going to help me get
rewarded for learning?  "Gee, Willsey, you're a 4.  Not too bad.  Of
course, Smithers here is only 2 points behind you, but he's a dumbass.
Hmmm..."

Not to mention that you'll have a top 10 list where the maximum
difference in scores is 4 points.

Wow.  Did your boss give you a 5 for this project?  Or was he really
impressed and stamped a gold star on your forehead?

Scott
 .................................................
Please edit the email address to reply



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

Date: Thu, 13 Aug 1998 14:19:56 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: The Four P's: Perl, Paging, and Palm Pilots......
Message-Id: <ExMt59.2Fu@world.std.com>

mail83870@pop.net writes:

>I am not eager to dive into arcana like IXO/TAP
>without asking first....)

Oh c'mon, IXO is fun to fight with. The spec itself isn't so bad, but
the variations taken on by each paging companies switch is the
killer. (And then what makes it worse is that revisions of the spec
declare the actions of these broken implementations complient.)

Actually, you might want to take advantage of perl's ability as a glue
language and call something like sendpage

<URL:ftp://ftp.net.ohio-state.edu/pub/pagers/sendpage5a.tar.gz>

For more paging info, you might want to look at the IXO FAQ
<URL:ftp://ftp.netcontech.com/pub/paging_info/ixo_faq.txt>

And for finding errors reported by your system, you might want to
"tail -f" relevant syslog files.
-- 
Andrew Langmead


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

Date: Thu, 13 Aug 1998 14:28:07 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: unlink files in directories with spaces (win95)
Message-Id: <ExMtIv.8ME@world.std.com>

sfe@iname.com writes:

>I've a problem to unlink files in directories with spaces (Win95)

>ex:
>         unlink <c:\tmp\hello world\*.*>

The first problem is that glob patterns interpolate backslash
sequences. The second problem is that glob patterns inherit the unix
glob semantics that spaces separate multiple patterns.

In perl's glob "<*.c *.h>" will return all the files that end in ".c"
and ".h", not all files that contain a ".c" and a ".h".

I've always thought that the best thing to do is to avoid globbing and
use opendir/readdir/closedir instead.

opendir DIR 'c:/tmp/hello world' or die;
unlink readdir DIR;
closedir DIR;

-- 
Andrew Langmead


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

Date: Thu, 13 Aug 1998 14:14:06 GMT
From: bill@sky-comm.net (Bill Mezian)
Subject: Re: Win NT Formmail and opening temporary files
Message-Id: <35d2f30d.4744996@sky2.sky-comm.net>

On 12 Aug 1998 22:51:05 GMT, peaceml@erols.nospam.com wrote:

>Hello,
>
>I sent this to the perl-win32-users@lyris.activestate.com, but got no
>response so I thought I'd see if I can get any help on this newsgroup.
>
>I'm kind of new at this so forgive me if I'm asking for something that
>has been rehashed to death.  I'm using Matt Wright's formmail.pl file with
>some modifications to make it work with softmail instead of Windmail.  I
>can run this once with success.  However if I do not unlink the temporary
>file nor manually delete the temporary file, I can not run again.  It just
>hangs.  I have eliminated execution of softmail.exe so all the send_mail
>portion of formmail.pl file does is create $tempfile and it still fails. 
>I have limited the problem to the following line:
>
Why would you want the tempfile hanging around anyway?  One problem in
doing it this way is if you have multiple users using the script at
one time there can be a problem with the tempfile.  I use the
following rand routine to generate a unique tempfile, and then unlink
it after the mail is sent.

# Create Tempfile name

 srand;

$tempfile='temp'.int(rand(9)).int(rand(9)).int(rand(9)).int(rand(9)).'.txt';

# Output a temporary file

open(MAIL,">$tempfile") || die("Cannot open tempfile -- Check
Directory Permissions : $!"); 



>Open(MAIL,">$tempfile") || die ("Cannot open $tempfile - Check Directory
>Permissions : $!");  
>
>If the file already exists, the open appears to hang.  If I test for
>existance of $tempfile and attempt to unlink it before the open, that also
>hangs. The NT system I am using is using NTFS.  I've tried chmod, and
>SetAttributes to no avail.  Do I have to set the file permissions in the
>formmail.pl file using Win32::FileSecurity?  Any
>answers/help/explainations/directions/etc. would be appreciated.
>
>Thanks,
>
>John

I hope this helps.
Bill


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 3437
**************************************

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