[10498] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4090 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 28 08:06:54 1998

Date: Wed, 28 Oct 98 05:00:41 -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           Wed, 28 Oct 1998     Volume: 8 Number: 4090

Today's topics:
    Re: ActiveState Perl: problem with PerlPacketManager: p massimobalestra@my-dejanews.com
    Re: ActiveState Perl: problem with PerlPacketManager: p dave@mag-sol.com
    Re: changing file timestamp in Win32 (Larry Rosler)
    Re: Date 2 Num (Craig Pickles)
    Re: Dynamic Function Calls???? karl.dyson@in-linea.com
    Re: Dynamic Function Calls???? karl.dyson@in-linea.com
    Re: File locations <perlguy@technologist.com>
    Re: File Permissions on NT 4 using Perl 5.004 <perlguy@technologist.com>
        Help: Unknown error message <aidan@salvador.blackstar.co.uk>
    Re: Help: Unknown error message <perlguy@technologist.com>
        I need Source code for Spider??? (Chris Williams)
        Integer to hex conversion problem. <jouke@impact.nl.com>
    Re: Not to start a language war but.. <perlguy@technologist.com>
    Re: Off the beaten path <perlguy@technologist.com>
    Re: Perl & Y2K - booby trap code <uri@sysarch.com>
    Re: Perl & Y2K - booby trap code finsol@ts.co.nz
    Re: Perl / DNS Module (M.)
        Perl CGI on various OS c960901@student.dtu.dk
        Perl Question kottelo@iname.com
        picturing a directory tree <aravind@genome.wi.mit.edu>
    Re: picturing a directory tree <jhi@alpha.hut.fi>
        Reg. expr. question <kjetil@balder.no>
    Re: RFC - Signature (Abigail)
    Re: Sending mail using perl (M.)
    Re: Sending mail using perl (M.)
        Subroutine question <mferg@hal.ddntl.didata.co.za>
        system() function on PERL for Win32 (Mike Price)
    Re: system() function on PERL for Win32 scott@softbase.com
    Re: system() function on PERL for Win32 haakon.alstadheim@sds.no
    Re: Win32 Registry.pm incosistent for nonexistent tople (Bob N.)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 28 Oct 1998 08:40:04 GMT
From: massimobalestra@my-dejanews.com
Subject: Re: ActiveState Perl: problem with PerlPacketManager: ppm.pl (proxy/internet)
Message-Id: <716l94$f4m$1@nnrp1.dejanews.com>

I have the same identical problem shown by rk.

I tried Install Tk
PPM> install Tk
Install package 'Tk?' (y/N): y
Error installing package 'Tk': Could not locate a PPD file for package Tk

I also tried through a internet connection without proxy and it works. Looks a
bug in the http module for proxy.

Thank you in advance for any other help.

In article <363d3bc1.49765418@news3.ibm.net>,
  jan.dubois@ibm.net (Jan Dubois) wrote:
> [mailed & posted]
>
> rk <rkoch@sbs.de> wrote:
>
> >I need to install the tk package for Active State Perl.
> >Has anybody an idea, how this could work (or where else I could download
> >the packages)  ???
>
> [snip]
>
> >PPM> search
> >Packages available from http://www.ActiveState.com/packages:
> >
> >   <== No packages / no error displayed
> >PPM>
> >
> >So, how can I get the packages?
>
> Did you try just "install Tk". The "search" command may be broken. Also the
> ActiveState server is rather temperamental; sometimes it works and sometimes
> it doesn't. You might just try again later/next day etc.
>
> -Jan
>


--
 Massimo Balestra
 System Engineer
 Torino Italy

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Oct 1998 11:39:59 GMT
From: dave@mag-sol.com
Subject: Re: ActiveState Perl: problem with PerlPacketManager: ppm.pl (proxy/internet)
Message-Id: <716vqg$r91$1@nnrp1.dejanews.com>

In article <716l94$f4m$1@nnrp1.dejanews.com>,
  massimobalestra@my-dejanews.com wrote:
> I have the same identical problem shown by rk.
>
> I tried Install Tk
> PPM> install Tk
> Install package 'Tk?' (y/N): y
> Error installing package 'Tk': Could not locate a PPD file for package Tk
>
> I also tried through a internet connection without proxy and it works. Looks a
> bug in the http module for proxy.
>
> Thank you in advance for any other help.
>
> In article <363d3bc1.49765418@news3.ibm.net>,
>   jan.dubois@ibm.net (Jan Dubois) wrote:
> > [mailed & posted]
> >
> > rk <rkoch@sbs.de> wrote:
> >
> > >I need to install the tk package for Active State Perl.
> > >Has anybody an idea, how this could work (or where else I could download
> > >the packages)  ???
> >
> > [snip]
> >
> > >PPM> search
> > >Packages available from http://www.ActiveState.com/packages:
> > >
> > >   <== No packages / no error displayed
> > >PPM>
> > >
> > >So, how can I get the packages?
> >
> > Did you try just "install Tk". The "search" command may be broken. Also the
> > ActiveState server is rather temperamental; sometimes it works and sometimes
> > it doesn't. You might just try again later/next day etc.
> >

If your connection is thru an HTTP Proxy, then you need to have a environment
variable set to tell ppm.pl where the proxy is.

The env variable is called %HTTP_Proxy%.

hth,

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://london.pm.org/>
[Note Changed URL]

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 27 Oct 1998 23:58:01 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: changing file timestamp in Win32
Message-Id: <MPG.10a06e66ffbc52bc9898e3@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <7166tn$pqd$1@nnrp1.dejanews.com> on Wed, 28 Oct 1998 
04:35:03 GMT, stevenfitz@my-dejanews.com <stevenfitz@my-dejanews.com> 
says...
 ...
> utime ($newTime, $newTime, $dest_path);
 ...
> It doesn't seem to matter what I set $newTime to, utime always seems to set it
> to the current time. Any thoughts on what I'm doing wrong or how I could do
> this better?

I don't have any thoughts on what you're doing wrong, but perhaps the 
'utime' function has some.  You should test its return value (just as 
you should for any system call, such as 'open').  If 'utime' fails, the 
value of $! might tell you why.

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


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

Date: Wed, 28 Oct 1998 09:44:24 GMT
From: pickles_c@hotmail.com (Craig Pickles)
Subject: Re: Date 2 Num
Message-Id: <363ae142.166952751@news.demon.co.uk>


>I think you missed Craig's point...  From the INSTALL file for the
>DateCalc package:
>
>
>    Prerequisites:
>    --------------
>
>    Perl version 5.000 or higher,
>    a C compiler capable of the ANSI C standard (!)
>    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>[original emphasis]
>
>
>So, you do need access to C to compile the Date::Calc module.

Thank anyway guys..... I gave in and wrote the subroutines myself :)

It is a shame though I feel that there arent more routine archives out
there (yes I know there are loads of module archives) but sometimes
just a few lines of clever code would suffice, like in the early days
of my career programming BASIC.

I wonder if there is any call for this type of resource? I might even
think about setting one up..

Craig


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

Date: Wed, 28 Oct 1998 09:41:21 GMT
From: karl.dyson@in-linea.com
Subject: Re: Dynamic Function Calls????
Message-Id: <716os5$ipf$1@nnrp1.dejanews.com>


> >But is there a way to run a Perl function via a string? So, you might loadthe
> >string with the name of a room function (e.g. North32) and call it like that.
> >But the next time, you might have loaded the string with the name North35 and
> >want to run that function instead.
> As with almost any
> large programming task, figuring out what the data structures should
> be will be half the battle.

True enough. I have an advantage in that I'm also designing a MUD before I
start the engine - that way I know exactly what I want it to be able to do,
and the limitations I can live with.

> Expect to invest a few hours in reading
> in order to learn what you need to know to do this.
Fine by me, nothing else to do right now. :)

> Have fun!
>
>         Brand
Thanks for your advice Brand, it's appreciated.

--
Karl Dyson (karl.dyson@in-linea.com)
No Signature... ever.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Oct 1998 09:43:43 GMT
From: karl.dyson@in-linea.com
Subject: Re: Dynamic Function Calls????
Message-Id: <716p0e$iq0$1@nnrp1.dejanews.com>


> > Is is not possible to have a Perl file for each location, with a load of
> > functions that can be called when certain things happen? Erm.. can I have a
> > variable/pointer that can be loaded with a function name dynamically and
> > then executed. So in one loop it might be loaded with "North32()" but on
> >the second "North50()"???

> Not to worry.
> If you have a string that contains some perl code -- even just a simple
> function call, like "North32()" -- then you can cause it to be executed
> by passing the string to the eval() function.  E.g.

[Snip]

> Hope this helps.
That is exactly what I needed.

Thank you.

--
Karl Dyson (karl.dyson@in-linea.com)
No Signature... ever!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Oct 1998 12:28:19 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: File locations
Message-Id: <36370DE3.280CCF60@technologist.com>

Basile Laderchi wrote:
> 
> i am trying' to built a perl script that accesses a file but the script
> insists on needing' the file in the C:\
> any ideas on how to convince the .pl or the server to make it look for
> the file in the cgi-bin directory or in the webserver root?
> 
> i am using ActivePerl 505 with Alibaba server in Win95
> 
> Thanx in advance

Change your C:\ to C:/

The backslash escapes the character following it.

HTH,
Brent

-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Wed, 28 Oct 1998 12:15:44 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: File Permissions on NT 4 using Perl 5.004
Message-Id: <36370AF0.65160F57@technologist.com>

I use XCACLS.exe and call it from Perl.  It isn't elegant, but is Perl
on an NT box really elegant anyway?  XCACLS is part of the resource kit.

I have a utility (that I'm hoping to share someday soon), that sets all
of the rights in a particular subdirectory tree based on the values in a
configuration file.  

I wrote this utility because it is too easy to screw up the rights on
NT.  This way, I can see exactly what the rights are going to be based
on the config file and then just run the program.  I am able to set the
rights on just under 500 subdirectories in about a minute!

HTH,
Brent

-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Wed, 28 Oct 1998 09:44:37 GMT
From: Aidan Rogers <aidan@salvador.blackstar.co.uk>
Subject: Help: Unknown error message
Message-Id: <909567833.927494@sparc.tibus.net>

I'm getting an error message that isn't documented in the
Camel Book:

Can't locate loadable object for module Date::DataCalc in
@INC (@INC includes ....)

The module in question is definitely in one of @INC's paths,
and this program is only doing the following:

use Date::DateCalc;
1;

Does anyone have any ideas as to why this might be happening?

Thanks in advance,

Aidan



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

Date: Wed, 28 Oct 1998 12:11:30 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Help: Unknown error message
Message-Id: <363709F2.71FDFC6E@technologist.com>

Aidan Rogers wrote:
> 
> I'm getting an error message that isn't documented in the
> Camel Book:
> 
> Can't locate loadable object for module Date::DataCalc in
> @INC (@INC includes ....)
> 
> The module in question is definitely in one of @INC's paths,
> and this program is only doing the following:
> 
> use Date::DateCalc;
> 1;
> 
> Does anyone have any ideas as to why this might be happening?
> 
> Thanks in advance,
> 
> Aidan

Aidan,

You say that the *module* is definitely in the path BUT is the
__DateCalc__ module where IT belongs?

Look in your "lib" directory.  There should be a Date subdirectory.  In
THAT subdirectory, the DateCalc module should be located.

This is probably why you are getting the error.  Also, I can't guarantee
you system is setup the same way.. but this is how it is on my system.

Good luck!
Brent
-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Tue, 27 Oct 1998 20:18:00 GMT
From: webboss@FreeNet.co.uk (Chris Williams)
Subject: I need Source code for Spider???
Message-Id: <36362cd9.0@news.globalpac.com>

Hi....


Im hoping to build a dynamically updated  resource and linking site
and am looking for a suitable (simple!) search spider prog to start
gathering site and link information from our linux based server...

Rather than re-inventing the wheel, Im hoping someone has written a
simple spider prog that I can adapt to be called from the cron to
gather data during the slack evening times on our system...


suggestions??

Cheers - ChrisW

webboss@tcat.ac.uk       [work]
webboss@freenet.co.uk  [home]



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

Date: Wed, 28 Oct 1998 12:59:56 +0100
From: "Jouke Dijkstra" <jouke@impact.nl.com>
Subject: Integer to hex conversion problem.
Message-Id: <717115$fff$1@freyja.bart.nl>

Hail, O Mighty Perl Hackers!

I need a (big) integer to hex conversion sub. I've been trying the
printf("%X", $i); method, but that seems only able to convert 32-bit
integers. I need to convert 48 bit unsigned ints, and I fail constantly.

Anyone has a little example at hand?

Regards,

Jouke Dijkstra






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

Date: Wed, 28 Oct 1998 12:22:54 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Not to start a language war but..
Message-Id: <36370C9E.63EA1280@technologist.com>

Klaus Schilling wrote:
> 
> John Call <johnc@interactive.ibm.com> writes:
> >
> > Speaking of wars, remember the "Burger-wars"? Where's the beef?
> >
 ..snip..
> 
> Is there a version that vegetarians can understand?
> 
>         Klaus Schilling

Klaus,

I just don't think "Where's the broccoli?" sounds as good...

Brent
-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Wed, 28 Oct 1998 12:20:43 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Off the beaten path
Message-Id: <36370C1B.19E505B8@technologist.com>

I have seen this problem solved using JavaScript and disabling the
button once it has been pressed.

This type of solution, however, does not take into consideration those
who have JavaScript turned off or those who have old browsers.

A cookie is another possibility, assuming that the user has them turned
on...

I think that a temporary file that stores some information about the
user may be the best approach.  Now you just need to determine what
information to store so that you prevent duplicate orders, but don't
prevent *real* orders...

Good luck!
Brent
-- 
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: 28 Oct 1998 02:02:21 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <x790i1f9tu.fsf@sysarch.com>

>>>>> "CB" == Craig Berry <cberry@cinenet.net> writes:

  CB> [cc'd to cited author] On Tue, 27 Oct 1998, Jim Davis wrote:

  >> In article <712vnc$6o$2@marina.cinenet.net> you wrote: : existence,
  >> is mere coincidence.  In 1908 it would have returned 1 digit, : in
  >> 2000 it will return 3 digits.
  >> 
  >> ...and in 1900, it would've returned "false" :)

  CB> Hrm...perhaps the tm_year field should be renamed to
  CB> tm_year_not_1900? :)


what version of perl would that have been? perl -49.0045? (assuming a
major release on a 2 year cycle as for the last 10 years or so).

:-)

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 28 Oct 1998 10:19:08 GMT
From: finsol@ts.co.nz
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <716r2r$lqn$1@nnrp1.dejanews.com>

In article <slrn73cpcp.nfg.sholden@pgrad.cs.usyd.edu.au>,
  sholden@cs.usyd.edu.au wrote:

> Short answer: No, Perl does not have a Year 2000 problem.  Yes,
> Perl is Y2K compliant.  The programmers you're hired to use it,
> however, probably are not.
>
> Long answer: Perl is just as Y2K compliant as your pencil--no more,
> and no less.  The date and time functions supplied with perl (gmtime
> and localtime) supply adequate information to determine the year well
> beyond 2000 (2038 is when trouble strikes for 32-bit machines).  The
> year returned by these functions when used in an array context is the
> year minus 1900.  For years between 1910 and 1999 this I<happens> to
> be a 2-digit decimal number. To avoid the year 2000 problem simply do
> not treat the year as a 2-digit number.  It isn't.
>

Of course Perl is Y2K compliant - so is just about any other language,
including COBOL!  But the applications developed in Perl can have Y2K issues
associated with them - as does every other language.  That is the issue - not
how good or bad programmers may or may not be, not how clever you personally
may be in shaving off nano-seconds in runtime or cramming the Encyclopedia
Britannica into a single bit.

For a supposedly logical profession (!?) a lot of programmers display very
little of that skill when confronted with some of the realities of
programming and their language of choice.  Logic would say that with such an
ambiguous year handling method, there has to be a lot of mistakes out there. 
So lets check it out and fix what we need to fix.

By the way, did anyone learn something new from this debate? Has anyone
checked the code at their site & have they found any problems? If you want to
remain anonymous, I can post your findings to this newsgroup on your behalf,
if you forward them to me personally.  A description of the consequences of
leaving any errors found uncorrected would be very interesting as well - and
perhaps it will motivate some of the contributors to this debate to stop
theorising and start doing something about it.

Anyone can get it wrong - and none of the 'experts', who have been so scathing
of others' abilities in this debate, could honestly state that they have never
put a bug into production, unless they live in an ivory tower and have never
produced code for the real world.  We're only human, after all.


--
Financial Solutions Limited
http://www.ts.co.nz/~finsol/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Oct 1998 12:25:28 GMT
From: pub @ alma . ch (M.)
Subject: Re: Perl / DNS Module
Message-Id: <363a0cd5.20394070@news.urbanet.ch>

>I'm look for a simple way to take the log file on an NT web server and
>extract the domain name from the addresses.  Has anyone already written
>a module to do this?

gethostbyaddr();




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

Date: Wed, 28 Oct 1998 12:28:55 GMT
From: c960901@student.dtu.dk
Subject: Perl CGI on various OS
Message-Id: <7172m7$uls$1@nnrp1.dejanews.com>

Hi

I've made a script which recieves information from an applet and then
writes it to a server. It works nicely at home on my win PC, but when
I put it on the server (Novell) it doesn't look like the script gets
called at all. Can anyone tell me why this might be? The script is below,
thanks.

Morten

#!/opt/internet/bin/perl

use CGI qw(:standard);

$dir = param("directory");
$fil = param("filename");
$str = param("string");

$write_base="sys:/novonyx/suitespot/docs/capec/docs/capecnews/structure/";
$log_file="sys:/novonyx/suitespot/docs/capec/docs/capecnews/logs/wr_err.log";

#Check that the file is properly named
if($fil =~ /\b\d{14}\b/)
{
  $out_file = $write_base.$dir.$fil.".html";
}
else
{
  #Append to the log file
  $out_file = ">".$log_file;
  $str = "Write aborted. File: ".$fil." Dir: ".$dir." Message: ".$str."\n";
}

open(OUT,">$out_file") || die "Error: $out_file $1";
print OUT $str;
close OUT;

exit 0;

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Oct 1998 09:05:08 GMT
From: kottelo@iname.com
Subject: Perl Question
Message-Id: <716mo3$glc$1@nnrp1.dejanews.com>



Hi!

I'm new in Perl-World... Where are a good manual of perl? (best in Spanish)

Please... send me a copy to my mail (is very dificul read all messagess
in DejaNews of a group)
--
Nos vemos...

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 27 Oct 1998 15:38:07 -0500
From: Aravind Subramanian <aravind@genome.wi.mit.edu>
Subject: picturing a directory tree
Message-Id: <36362F2F.ABA78877@genome.wi.mit.edu>

Hi,

I'm looking for a script that takes a (top-level) directory as an
argument, drills down under that directory and produces a (tree) gif of
the directory structure found.


Has anyone attempted this before / have suggestions as to how this might
be scripted

Thanks,

aravind



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

Date: 28 Oct 1998 14:16:35 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: picturing a directory tree
Message-Id: <oeepvbc7ufw.fsf@alpha.hut.fi>


> I'm looking for a script that takes a (top-level) directory as an
> argument, drills down under that directory and produces a (tree) gif of
> the directory structure found.

Here's a shell script.  Conversion to Perl and GD left as an exercise :-)

#!/bin/sh
# @(#) dtree - prints a directory tree

dir=${1:-.}
(cd $dir ; pwd)
find $dir -type d -print | sort -f |
sed -e "s,^$1,," -e "/^$/d" -e \
"s,[^/]*/\([^/]*\)$,\`-----\1," -e "s,[^/]*/, |     ,g"

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Wed, 28 Oct 1998 13:22:15 +0100
From: Kjetil Svendsberget <kjetil@balder.no>
Subject: Reg. expr. question
Message-Id: <36370C77.EAA7D8AA@balder.no>

I want to convert:

f.eksample:

f:\temp\test\

unto:

f:/temp/test/


I do this with:

while ($dest_dir =~ /\\/ ){
	$dest_dir =~ s/\\/\//;
}

How can i do this in 1 operation?
E.g: how do i remove n instances of x pattern in the string z??


-- 
Kjetil Svendsberget, systemengineer
Balder Dialog AS
Olaf Helsetsvei 6
N-0694 Oslo, Norway


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

Date: 28 Oct 1998 07:26:16 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: RFC - Signature
Message-Id: <716guo$3lj$1@client3.news.psi.net>

Bill Jones (bill@fccj.org) wrote on MDCCCLXXXIII September MCMXCIII in
<URL:news:36363368.9F080687@fccj.org>:
++ Dan Boorstein wrote:
++ > 
++ > Bill Jones, FCCJ Webmaster wrote:
++ > >
++ > > Anybody have ideas about shortening this a bit?
++ > 
++ > [snip]
++ > 
++ > > $perlRulez = "FCCJ Webmaster";
++ > > if ($perlRulez =~ /(F)(C)(C)(J)( )(W)(e)(b)(m)(a)(s)(t)(e)(r)/) {
++ > >     print "$4", chr(ord($12)+1), "$11$12$5", uc($10), chr(ord($9)+1),
++ > >         chr(ord($14)-3), "$12", lc(chr(ord($1)+2)), reverse($14,$13),
++ > >         "$5", uc(chr(ord($14)-2)), "$13$14", chr(ord($9)-1), "$5",
++ > >         uc(chr(ord($7)+3)), "$10", chr(ord($10)+2),chr(ord($9)-2),
++ > >         reverse($14,$13), "\n"; }

Three lines:

$_="FCCJ Webmaster";print$4,chr(1+ord$12),$11,$12,$5,uc$10,chr(1+ord$9),chr(-3
+ord$14),$12,chr(34+ord$1),$13,$14,$5,chr(-34+ord$14),$13,$14,chr(-1+ord$9),$5
,chr(-29+ord$7),$10,chr(2+ord$10),chr(-2+ord$9),$13,$14,"\n"if/${\('(.)'x14)}/


And you can save some more characters.


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Wed, 28 Oct 1998 12:16:56 GMT
From: pub @ alma . ch (M.)
Subject: Re: Sending mail using perl
Message-Id: <363709ae.19586737@news.urbanet.ch>

>: use Net::SMTP;
>
>What do you do when you can't connect to the recipient host?

No mailer (whether command-line or Perl module) connects to the
recipient host! They connect to your local or your ISP's SMTP server
(which may be sendmail itself on Unix), which forwards to the
recipients SMTP server. 




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

Date: Wed, 28 Oct 1998 12:21:48 GMT
From: pub @ alma . ch (M.)
Subject: Re: Sending mail using perl
Message-Id: <36390b89.20061748@news.urbanet.ch>

>> You can use sendmail, but it's probably safer (and more portable) to
>
>Tell me why is it safer to use SMPT over sendmail when sendmail is available?
>

"Safer" is probably disputable (how do you define "safer"?). But a
sockets Perl script is definitely more portable: 90% machines don't
have sendmail.
And obviously more customizable (MIME encoding, custom headers,
attachments, ...).



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

Date: Wed, 28 Oct 1998 11:27:27 -0200
From: Mark Fergusson <mferg@hal.ddntl.didata.co.za>
Subject: Subroutine question
Message-Id: <36371BBF.76001D4F@hal.ddntl.didata.co.za>

Hello,

I have some code which needs to be external to a main program. Only on
rare occasions will this code need to be run as if it was part of the
main program. What is the best way to do this, so that I avoid it being
loaded, every time the program is run ?

If the routine is used, only then must it fetch the code, and run it, as
if it was tagged on to the program in the first place, with access to
all the programs variables.

Please can someone point me in the right direction.

Thanks.



--
_____________________________________________
Mark Fergusson: mferg@hal.ddntl.didata.co.za
Dimension Data:
PO Box 236, Pavillion, 3611, South Africa
(+27)-31-568-2032 (Work)
(+27)-31-204-8590 (Fax)
082-771-8519 (Cell)




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

Date: Wed, 28 Oct 98 04:29:56 GMT
From: mprice@netconexinc.com (Mike Price)
Subject: system() function on PERL for Win32
Message-Id: <36369e46.0@news.redrose.net>

I am trying to use perl's system() function to copy files on a Windows NT 
server but the command is not working.  It appears as if parameters are not 
processed when the program being called is an internal to the operating 
system.  For example, when I execute the command

system("copy");

I get an error message back stating the number of parameters is invalid.  This 
is what I would expect from this call.  However, the following command does 
nothing

system("copy","d:\\temp\\*.*","c:\\temp\\*.*");

ahtough files do exist in the d:\temp directory.  Ironically, commands that 
are not internal to the operating system work just fine.  In the same script, 
I use the following command to send email:

system("d:\\temp\\batmail.exe","d:\\temp\\config.txt","d:\\temp\\messages.
txt");

The only fix to the problem I've found is to use back ticks for all internal 
operating system calls.  Although I have a fix, I would like to know if I am 
doing something wrong with the system() function or if this is a known issue.  
Thanks.

Mike.


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

Date: 28 Oct 1998 12:54:16 GMT
From: scott@softbase.com
Subject: Re: system() function on PERL for Win32
Message-Id: <363713f8.0@news.new-era.net>

Mike Price (mprice@netconexinc.com) wrote:

> system("copy","d:\\temp\\*.*","c:\\temp\\*.*");

System takes a single parameter, not a list.

Scott


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

Date: 28 Oct 1998 12:49:35 +0100
From: haakon.alstadheim@sds.no
Subject: Re: system() function on PERL for Win32
Message-Id: <u90i0hpo0.fsf@SDSA0561.i-did-not-set--mail-host-address--so-shoot-me>

mprice@netconexinc.com (Mike Price) writes:
> I get an error message back stating the number of parameters is invalid.  This 
> is what I would expect from this call.  However, the following command does 
> nothing
> 
> system("copy","d:\\temp\\*.*","c:\\temp\\*.*");

The "copy" command is internal to the cmd.exe/command.com shells.
You need to use the form of the 'system' call with only one arg,
to make perl spawn an instance of %COMSPEC% and run your command there.

Like so:
system("copy d:\\temp\\*.* c:\\temp\\*.*");

This of course brings up quoting issues, you might need to use this:

system("copy \"d:\\temp\\*.*\" \"c:\\temp\\*.*\"");




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

Date: 28 Oct 1998 08:10:37 GMT
From: bobn@interaccess.com (Bob N.)
Subject: Re: Win32 Registry.pm incosistent for nonexistent toplevel keys
Message-Id: <716jht$loj$1@supernews.com>

In a different forum someone suggested that I ... check the return code.
Doh!.

- Bob N.

In Article <71058e$2bd$1@supernews.com> , Bob N. (bobn@interaccess.com) said:
: Registry.pm exports toplevel keynames which may not exist on all systems.
: The returned object from Open is sometimes undefined and sometimes
: defined, based on the sate of the variable (that is to hold the object)
: prior to the call.


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

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

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