[6738] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 363 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 24 12:56:13 1997

Date: Thu, 24 Apr 97 09:00:23 -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, 24 Apr 1997     Volume: 8 Number: 363

Today's topics:
     Re: check command line options? <minaret@sprynet.com>
     Re: Clearing the browser screen <minaret@sprynet.com>
     Re: Day of the week (Nathan V. Patwardhan)
     Re: HELP! Matching a multi line pattern and replacing i (Kyzer)
     Latest GD.pm for NT <sgilliar@cmp.com>
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <erik@naggum.no>
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (Samuel L. Bayer)
     Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <erik@naggum.no>
     Newbie Q: Slow script (Ashley Roach)
     Re: Ousterhout and Tcl lost the plot with latest paper (Niels Mvller)
     Re: Perl and EBCDIC (Will Morse)
     PERL and X25 Communications <rcm@mtt.ca>
     Re: Perl as its own metalanguage? (Ronald L. Parker)
     Re: Perl as its own metalanguage? (Paul Prescod)
     Re: Perl ODBC and IE 3.0x <...petri.backstrom@icl.fi>
     Re: Printing to Files. <dorman@s3i.com.ANTI-SPAM>
     Re: Puzzle: Count Actual Days from MM,DD,YYY to localti (rga)
     Re: recursive directtory tree walk (Lars Gregersen)
     Re: recursive directtory tree walk (Nathan V. Patwardhan)
     Re: recursive directtory tree walk <tchrist@mox.perl.com>
     Re: Regular Expression Help Newbie (Bart Lateur)
     Strange behaviour under Windows NT (Yuri Shtil)
     Re: sysopen object method in perl 5.001? <tchrist@mox.perl.com>
     Re: What does "UNIX" stand for.. <vkannan@singnet.com.sg>
     Re: What's the equivalant to sendmail with NT? <...petri.backstrom@icl.fi>
     Re: Why perl/TK hardly mentioned in Camel Book? lvirden@cas.org
     Re: wretched C++ (Was: Ousterhout and Tcl lost the plot <thant@nospam.acm.org>
     Re: www-based e-mail (Clay Irving)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 24 Apr 1997 13:57:35 GMT
From: "Geoff Mottram" <minaret@sprynet.com>
Subject: Re: check command line options?
Message-Id: <01bc5014$c2c52800$eccbaec7@cactus>

> How does one trap command-line-option typos ?

Use Perl's @ARGV variable and process the arguments yourself.

-- 
Geoff Mottram
minaret@sprynet.com


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

Date: 24 Apr 1997 14:11:55 GMT
From: "Geoff Mottram" <minaret@sprynet.com>
Subject: Re: Clearing the browser screen
Message-Id: <01bc50b9$4d995ec0$3f81aec7@cactus>

> With Perl, I want to be able to print some HTML in the user's browser
> window, clear their browser window, and then type in some more text.
> An example is MetaCrawler (http://www.metacrawler.com).  Do a search
> there and you'll notice that once you submit your query, it shows you
> the amount of references returned from certain other search engines.
> Once it has "culled" all references, it clears the screen and prints
> the links.  How can I do this in Perl?

The results came back so fast I couln't confirm your results.  However,
there is a thing called "server push" that would probably give you the
results you want.  Try the netscape home page and dig through their on-line
documentation.  They have something on it there.

-- 
Geoff Mottram
minaret@sprynet.com


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

Date: 24 Apr 1997 13:45:32 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Day of the week
Message-Id: <5jno5s$h2@fridge-nf0.shore.net>


Mark Guz (markguz@sol.co.uk) wrote:
: I have a text file with a field in there which shows the month and
: date(MAR1 or APR2) 

You could use localtime() and roll-yer-own variable => month name 
converter, but why?  You might find the Date modules useful for your
needs, available at a CPAN near you!

http://www.perl.com/CPAN/modules/by-module/Date/

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 24 Apr 1997 13:08:29 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: HELP! Matching a multi line pattern and replacing it
Message-Id: <5jnm0d$ib4@info.abdn.ac.uk>

David Millier of i_dont@have.one wrote in comp.lang.perl.misc:
: I need to match somthing that looks like this:
: New files in F:\ozzy_data\buckeye
: Need to remove the "New files in ........." followed by two blank lines.
$list=`cat <list`;
$list =~ s/^New files.+\n\n//;
print $list;

--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac   |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com  |University or AUCC, thankfully.***** |always!
StudentCode(v1.0) BSc A Y-- C++ E L W- G+ X? P-- T++ F M H++


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

Date: Thu, 24 Apr 1997 09:14:50 -0400
From: Steve Gilliard <sgilliar@cmp.com>
Subject: Latest GD.pm for NT
Message-Id: <335F5CCA.B008BF4F@cmp.com>

I just got the latest GD.pm update file from

ftp://www.roth.net/pub/ntperl/GD_build_306.zip

and I placed the gd.pll file in the /perl/lib/auto/gd directory.  The
date on the GD.pm file in my perl/lib directory is :  5/27/96 2:25pm

When i run the following sample from my cgi-bin directory :

  use GD;

        print "Content-type: image/gif\n\n";

        # create a new image
        $im = new GD::Image(100,100);
        # allocate some colors
        $white = $im->colorAllocate(255,255,255);
        $black = $im->colorAllocate(0,0,0);
        $red = $im->colorAllocate(255,0,0);
        $blue = $im->colorAllocate(0,0,255);
        # make the background transparent and interlaced
        $im->transparent($white);
        $im->interlaced('true');
        # Put a black frame around the picture
        $im->rectangle(0,0,99,99,$black);
        # Draw a blue oval
        $im->arc(50,50,95,75,0,360,$blue);
        # And fill it with red
        $im->fill(50,50,$red);
        # Convert the image to GIF and print it on standard output
        print $im->gif;

I get a broken gif.  If i run this same example above from the dos
prompt using perl test.pl I see that the image portion of the program
does not have the GIF header information in the output.  I assume this
is why I have a broken gif when I execute the above example from my
cgi-bin directory.  Does anyone have any information on what I'm doing
wrong ?  Thanks in advance for any help.

Steve Gilliard



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

Date: 24 Apr 1997 14:25:58 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <3070880758138585@naggum.no>

* Donal K. Fellows
| In particular, your "facts" often seem to be either inaccurate, wrong or

no, Donal, my facts are not inaccurate.  what I write is very seldom wrong.
when I am uncertain or know that I lack information to be certain, I don't
post.  (this does make the errors I make important, but it's easy to fix
big mistakes.  it is much harder to correct minor mistakes, so I have set a
goal not to make minor mistakes.)  I may have strong opinions on certain
issues, but that's not where you see me most irate.  the only thing I truly
hate is unmethodical people, because it is impossible to trust anything
they say.  if you have no consistent methodology for separating wish from
opinion from uncertainty from certainty, you _will_ post drivel and confuse
issues and make a hell of a lot of _easily avoidable_ mistakes.  _that_ is
what I object to in many articles.  (and no, even if your job is advocacy,
that doesn't make everybody else's job advocacy.  to correct misinformation
is more than enough work.  somebody else can do the advocacy.)

#\Erik
-- 
if we work really hard, will obsolescence be farther ahead or closer?


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

Date: 24 Apr 1997 15:10:33 GMT
From: sam@linus.mitre.org (Samuel L. Bayer)
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <5jnt59$bvh@top.mitre.org>

Look, I don't know what newsgroups the clowns responsible for posting this
thread all over creation actually live, but speaking for comp.lang.python,
I frankly couldn't care less whether Erik and M. Prasad shoot each other
in a duel, but I DO care whether my newsgroup continues to be flamed by
this ad hominem, irrelevant debate. I'm going to start a trend: I'm not 
posting this back to comp.lang.python. 

Take it outside, guys.



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

Date: 24 Apr 1997 15:18:43 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <3070883923129869@naggum.no>

* M. Prasad
| You obviously have a following on the Usenet from those who enjoy seeing
| the personal attacks.

you know, that tar brush you're wielding is awfully broad -- you must be
the biggest fan ever of personal attacks, so if there were _only_ personal
attacks in my messages (such as in yours), I'd fully expect you to enjoy
them and even request advance tickets to the live show.  but no, you and
all others who seem to enjoy (or hate) my articles, do so because I make
technically valid points, contradict hype, demonstrate ignorance, and
destroy "marketing arguments" aimed solely at the ignorant masses.  people
are certainly allowed to be ignorant, lying, mass-market propagandists, but
if they try to claim they are something else, they must be exposed.  I do
that.  some find it very entertaining.  this would not be possible with the
kind of personal attacks that you work so hard to find in my articles to
the exclusion of everything else they contain, but it's hard to show that
somebody is a pathological liar _in_ his arguments without at least someone
confusing the issue and thinking that his (in their opinion valid) argument
is dismissed _because_ he is called a pathological liar (which would have
been an argumentum ad hominem).

I don't think _I_ have a following.  I think people would like to see the
arguments I'm making more often, and are happy that I make them.  if _I_
had a following, it would be immaterial what I wrote, and the idiocy you
attribut to them would be possible.  fortunately, I have never met anyone
who has suggested that they like my articles because of the harsh treatment
I give the incompetent fools I don't suffer -- that's just the spice.  for
many it's actually too hot.  but very few are unable to taste the real meat
only because they are too sensitive to the spice.  curiously, those who are
seem to be candidates for world championship in personal attacks without
any form of substantiation, giving like M. Prasad serious competition.

it is typical of such lame-brained idiots to associate something they don't
think they like with something they already hate, to justify things to
themselves, I guess.  M. Prasad thinks of Lisp.  the other day, I got a
very nasty letter from some environMENTAList who accused me of being in
favor of multiple death sentences on anti-whaler Paul Watson since I'm from
Norway.  events like these remind me of a joke about Stevie Wonder, who was
asked "have you never been discriminated against because you're blind?"
where he shall have answered "no, but I'm glad I'm not black -- I hear
that's rough."

(this article was sponsored by the Lisp Defamation League.)

#\Erik
-- 
if we work really hard, will obsolescence be farther ahead or closer?


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

Date: 24 Apr 1997 14:48:23 GMT
From: aroach@mail2.sas.upenn.edu (Ashley Roach)
Subject: Newbie Q: Slow script
Message-Id: <5jnrrn$qnt@netnews.upenn.edu>

Hello all,

well, I've been working on this small script in MacPerl to extract the 
first and last filename in a subdirectory on a CD, and then print those 
filenames out to a file.  I have probably done this in a very clunky way, 
because I'm new to perl and programming also.  The code is listed below.  

Now, the arrays that I create have anywhere from 125 to 250 items in them 
because of the number of files in the subdirectories.  I wonder if the 
script runs slowly (like 10mins) because the split function is operating 
on all of these itesm?  Though, as far as I can tell, only on the first
 and last one of these are "operated" on. Anyway, here's the code, and 
any help would be appreciated...sorry if it's too long or whatever, just 
tell me for future reference.

#!perl

print "Database Builder for MacPerl by Ashley v1.0.1\n";


$file1 = 'directory.tmp';
open(DIRECTORY, ">$file1") || die "Sorry, couldn't create $file1";

$volume = MacPerl::Ask("What volume do you want to open?");
print "Volume = $volume \n";

$dirs = MacPerl::Ask("How many subdirectories are there?");

# this section lists the directory structure into a file

@list = <$volume:*>;
local ($,,$/) = ("\n","\n");
print DIRECTORY @list;

# here I need to peek into each subdirectory and find the first
# and last files therein.

$file2 = 'subdir1.tmp';
chop($volume); #truncates the volume for use later in the path statement
open(SUBDIRECTORY, ">$file2") || die "Sorry, couldn't create $file2";
for ($i=0; $i < $dirs; $i++) {
	@subdir = <$list[$i]:*>;

	$last = $#subdir; #puts the final index in the array into $last
	print "last $last\n";
	@first = split(/:/,$subdir[0]); #assigns first value in the 
subdirectory to an array while taking out the :
	print "first @first\n";
	@last = split(/:/,$subdir[$last]); #assigns last value in the 
subdirectory to an array while taking out the :
	print "last @last\n";
	print SUBDIRECTORY "$first[$#first]\t";
	open(SUBDIRECTORY, ">>$file2");
	print SUBDIRECTORY "$last[$#last]\t";
	print SUBDIRECTORY "g:\\$volume\\$first[1]\\\n";
	print ".";
}

print "Done!\n";

--

Ciao-
Ashley

aroach@sas.upenn.edu
http://www.sas.upenn.edu/~aroach/
If my email bounces, and you're not a spammer, try jaroach@mnsinc.com.


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

Date: 24 Apr 1997 16:07:01 +0200
From: nisse@lysator.liu.se (Niels Mvller)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <nn3esgpla1.fsf@tinner.lysator.liu.se>

will@peanut.jpl.nasa.gov (Will Duquette) writes:

> Here's what Tcl/Tk buys *me*.
> 
> I have no interest in writing large programs solely in Tcl to Tcl/Tk.
> There are indeed better languages out there for that purpose.
> However, in my work we have a developed a number of APIs for a variety
> of obscure tasks.  These are generally coded as C libraries.  By
> writing Tcl extensions for these libraries, I get the following
> practical advantages:

Currently, I'm developing under a similar paradigm: Write most of the
code in an interactive, interpreted language. Extend with C-code when
interfacing to other libraries, or when doing performance critical
stuff.

As I see it, this is quite different from "gluing *applications*
together"; instead I extend my interpreter environment to include
C-libraries or other features from the rest of the system that I need.
(Yes, I do have threads as well).

However, I have not used tcl for this, I've been using Python, and
more recently Pike (http://pike.infovav.se). From what I have read and
heard about tcl, I can't see tcl having any advantage over the
languages I have been using (I haven't been doing much
GUI-programming, though). In particular, I find OO-techniques quite
powerful.

/Niels




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

Date: 24 Apr 1997 10:07:36 -0500
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Perl and EBCDIC
Message-Id: <5jnsvo$t16@Starbase.NeoSoft.COM>

In article <5jh07a$mml$1@byatt.alaska.net>,
Chris Brown <cbrown@alaska.net> wrote:
>
>	Looking for anything in Perl to help in converting 
>EBCDIC to ASCII.  Any ideas?
>
>	Or better yet a Perl <-> DB2 interface.
>
>Anyone?
>
>Thanks
>

Assuming something like dd conv=ascii won't work,

I have done this in a specific case using a translation table like:

# --------------------- set up table -------------
for $i (0..255)
{
    $ebcdic{$i} = "_";
}

$ebcdic{  0} = "~";
$ebcdic{ 64} = " ";

$ebcdic{ 74} = "$";
$ebcdic{ 75} = ".";
$ebcdic{ 76} = "<";
$ebcdic{ 77} = "(";
$ebcdic{ 78} = "+";
$ebcdic{ 79} = "|";
$ebcdic{ 80} = "&";
$ebcdic{ 90} = "!";
$ebcdic{ 91} = "$";
$ebcdic{ 92} = "*";
$ebcdic{ 93} = ")";
$ebcdic{ 94} = ";";
$ebcdic{ 95} = "^";
$ebcdic{ 96} = "-";
$ebcdic{ 97} = "/";
$ebcdic{107} = ",";
$ebcdic{108} = "%";
$ebcdic{109} = "_";
$ebcdic{110} = ">";
$ebcdic{111} = "?";
$ebcdic{122} = ":";
$ebcdic{123} = "#";
$ebcdic{124} = "@";
$ebcdic{125} = "'";
$ebcdic{126} = "=";
$ebcdic{127} = "\"";

$ebcdic{129} = "a";
$ebcdic{130} = "b";
$ebcdic{131} = "c";
$ebcdic{132} = "d";
$ebcdic{133} = "e";
$ebcdic{134} = "f";
$ebcdic{135} = "g";
$ebcdic{136} = "h";
$ebcdic{137} = "i";
$ebcdic{145} = "j";
$ebcdic{146} = "k";
$ebcdic{147} = "l";
$ebcdic{148} = "m";
$ebcdic{149} = "n";
$ebcdic{150} = "o";
$ebcdic{151} = "p";
$ebcdic{152} = "q";
$ebcdic{153} = "r";
$ebcdic{162} = "s";
$ebcdic{163} = "t";
$ebcdic{164} = "u";
$ebcdic{165} = "v";
$ebcdic{166} = "w";
$ebcdic{167} = "x";
$ebcdic{168} = "y";
$ebcdic{169} = "z";

$ebcdic{193} = "A";
$ebcdic{194} = "B";
$ebcdic{195} = "C";
$ebcdic{196} = "D";
$ebcdic{197} = "E";
$ebcdic{198} = "F";
$ebcdic{199} = "G";
$ebcdic{200} = "H";
$ebcdic{201} = "I";
$ebcdic{209} = "J";
$ebcdic{210} = "K";
$ebcdic{211} = "L";
$ebcdic{212} = "M";
$ebcdic{213} = "N";
$ebcdic{214} = "O";
$ebcdic{215} = "P";
$ebcdic{216} = "Q";
$ebcdic{217} = "R";
$ebcdic{226} = "S";
$ebcdic{227} = "T";
$ebcdic{228} = "U";
$ebcdic{229} = "V";
$ebcdic{230} = "W";
$ebcdic{231} = "X";
$ebcdic{232} = "Y";
$ebcdic{233} = "Z";

$ebcdic{240} = "0";
$ebcdic{241} = "1";
$ebcdic{242} = "2";
$ebcdic{243} = "3";
$ebcdic{244} = "4";
$ebcdic{245} = "5";
$ebcdic{246} = "6";
$ebcdic{247} = "7";
$ebcdic{248} = "8";
$ebcdic{249} = "9";

# ------------------- translate 40 * 80 column EBCDIC to ASCII -----
for $i (0..39)
{
    $offset = $i * 80;
    $line = substr($asciiHeader,$offset,80);
    print STDOUT "$line\n";
}

Hope this helps.

Will

-- 
# Copyright 1997 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
# 
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas
#              it's the law.       #    will@starbase.neosoft.com
#
#   These are my views and do not necessarly reflect anyone else/


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

Date: 24 Apr 1997 12:58:02 GMT
From: "Rick Moffatt" <rcm@mtt.ca>
Subject: PERL and X25 Communications
Message-Id: <01bc50af$185d5540$0f19448e@pc1607.mtt.ca>

I'm looking for help in retrieving data from off site equipment using the
X25 protocol. The equipment will not allow a pad emulator connections.
I was hoping I would be able to use a PERL script to connect me to the
equipment, ask what files are available (in Hex), and request those files.
 I cannot find a way to activate the x25 with a Datapac address without
using padem. I using a HP D210 server with 10.20 HP-UX
-- 
***//////////////////////////////////////////////////////***
***   Rick Moffatt                                  ***
***   Applications System Accociate      ***
***   Maritime Tel & Tel                         ***
***   (902)487-5846                             ***
***   rcm@mtt.ca                                 ***
***//////////////////////////////////////////////////////***


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

Date: Thu, 24 Apr 1997 14:13:30 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: Perl as its own metalanguage?
Message-Id: <3362619b.2561191@10.0.2.33>

On 23 Apr 1997 17:05:41 -0700, brannon@bufo.usc.edu (Terrence M.
Brannon) wrote:

>Tom Christiansen <tchrist@mox.perl.com> writes:
>
>>     int i = (1,2);
>is this C syntax? what does it mean?

It's a slightly obfuscated way of saying "int i = 2;"

The comma operator executes its operands in order, then takes its
value from the value of the second operator.

--
Ron Parker
Software Engineer
Farm Works Software       Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt


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

Date: Thu, 24 Apr 1997 12:39:57 GMT
From: papresco@csclub.uwaterloo.ca (Paul Prescod)
Subject: Re: Perl as its own metalanguage?
Message-Id: <E9576L.Jto@undergrad.math.uwaterloo.ca>

In article <ysizpvvlwai8.fsf@bufo.usc.edu>,
Terrence M. Brannon <brannon@bufo.usc.edu> wrote:
>>     int i = (1,2);
>is this C syntax? what does it mean?

Nothing useful. It means "evaluate 1", "evaluate 2" "set i to the second".

This is a really bad attempt to try to ascribe a property to C which it 
does not have. This is a simple overloaded operator (",") which is 
competely resolved at compile time. Perl's "array context" is in fact a
runtime feature of much greater complexity.

 Paul Prescod



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

Date: Thu, 24 Apr 1997 16:08:30 +0200
From: Petri Backstrom <...petri.backstrom@icl.fi>
Subject: Re: Perl ODBC and IE 3.0x
Message-Id: <335F695E.533D@icl.fi>

Dave Roth wrote:
> 
> Paul Hanssen <paulh@sanford.com.au> wrote in article
> <335db840.25945197@news.per.aone.net.au>...
> > Hi there,
> >
> > I am accessing an ODBC database (Microsoft SQL Server 6.5) through
> > Perl  5 (using the Win32::ODBC module). IIS 3 is our WWW server.
> >
> > It all works fine on Netscape 3+ but I keep getting an error
> > containing the following message using Internet explorer 3.0x
> >
> >   Could not Connect to DSN:
> >   Error: [18450] [] "[Microsoft][ODBC SQL Server Driver][SQL
> >   Server]Login failed- User: _ Reason: Not defined as a valid user of
> >
> >   a trusted SQL Server connection. "
> >
> > Has anyone encountered this problem before ? If so, any suggestions ?
> > Is it because IE 3 integrates too heavily with other Microsoft
> > products ?
> >
> > BTW - We are NOT running a trusted connection to SQL Server.
> 
> In your DSN are you specifying a userid and password? If not I am wondering
> if the IIS is using your userid from IExplorer (that just sounds like
> something MS would do).
> dave
> --

That is exactly what Microsoft's IIS (Internet Information Server)
does, if in the "Internet Service Manager" (or its HTML equivalent)
you have for "WWW Service Properties" -> "Service" the "Windows NT
Challenge/Response" box for "Password Authentication" checked; i.e., 
if you've logged on to an NT workstation/server/domain, and use
InternetExplorer, then IE will automatically try to authenticate 
you as the logged in user.

Unchecking that box, and checking "Basic (Clear Text)" (which, if
my memory serves me right, is not checked by default) and "Allow
Anonymous".

Unless, of course, one wishes to take advantage of this IE/IIS 
feature. Benefits are that authentication is "automatic" (or
should I say transparent), with no passwords transmitted for
WWW authentication on the wire.

The disadvantage is that it works only with IE, and that IIS puts
the Windows NT (LAN Manager) domain name with $ENV{REMOTE_USER}, 
which one has to take that into account in one's own (Perl) code;
i.e., "domain/username" vs. just "username".

And in any case, with IIS, authentication (if done), is done
through the Windows NT user database, UAS (User Accounts Subsystem),
and anonymous access is by default through the account named
"IUSR_computername".

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: 24 Apr 1997 10:02:55 -0400
From: Clark Dorman <dorman@s3i.com.ANTI-SPAM>
Subject: Re: Printing to Files.
Message-Id: <dafmozfg0.fsf@s3i.com>


Mitchell Verter <mcv@ikos.com> writes:
> Comrades in perl,
> 
> 	I thought I knew my perl, but I've been stuck on this problem for too
> long.  i have been trying to simply write to a file, but it seems that
> some intermediate buffering is getting in my way.
> 	
> 	!.  I open up the file handle: 
> 		open (OFILE, ">$outfile");
> 	2.  I try to print to the file
> 		print OFILE "$statement";
> 	
> 	
> 	I've noticed that the file remains empty until maybe the 20th print
> call.  At that point, some of the text is dumped out into the file, but
n> some of it still remains in limbo.  Therefore, I can not generate a full
> file of text because some of it still seems to remain in a buffer
> somewhere.
> 	
> 	Does anyone have any idea what might be happening here and how I might
> be able to fix it?  Are there any buffers to flush?  Can anyone help? 
> Please write me personally and/or post to this group if you can.  Thanks
> a heap.
> 	
> 			-- Mitchell Verter
> 			   mcv@ikos.com

Printing to files is expensive, so the system waits till the buffer is
full before it dumps it to the output file (that's my lay-person's
memory of the way a system guy explained it once).  That's a pain
sometimes, so you need to tell perl to do put it in the file every
time something gets written.  From perlvar:

$|
     If set to nonzero, forces a flush after every write or print on the
     currently selected output channel.  Default is 0.  Note that STDOUT
     will typically be line buffered if output is to the terminal and
     block buffered otherwise.  Setting this variable is useful primarily
     when you are outputting to a pipe, such as when you are running a
     Perl script under rsh and want to see the output as it's happening.
     This has no effect on input buffering.  (Mnemonic: when you want your
     pipes to be piping hot.)


Note that it says that $| refers to to the selected output channel.  How do
you select the output channel?  "select()". 

I usually do a open, select, and then

$|++; 

right after opening to make sure to flush it (if I need to).

And, yes, you could have done a search on "buffer" or "flush" to
figure this all out.

-- 
Clark Dorman				"Evolution is cleverer than you are."
http://cns-web.bu.edu/pub/dorman/D.html                -Francis Crick


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

Date: Thu, 24 Apr 1997 14:37:56 GMT
From: rga@io.com (rga)
Subject: Re: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <335f6fe4.8272265@news.io.com>


rga@io.com (rga) wrote:

>
>No laughing out loud, please.


Thanks for everyone's help with this.

I've got it all working, now, but I'm not sure admin on my ISP
is really gonna appreciate what I've done <grin>

Next Time !  I'll get the modules.

Sincerely, RGA



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

Date: Thu, 24 Apr 1997 13:59:29 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: recursive directtory tree walk
Message-Id: <335f65bb.14905527@130.228.3.8>

On 24 Apr 1997 12:29:13 GMT, kevin@dvstsol.demon.co.uk (Kevin
Mulholland) wrote:

>I am quite new to perl, and I am playing about with it at the moment,
>before I have to use it in anger (as it were) however I am getting just a 
>bit confused at the moment. I am trying to write a subroutine that will
>recurse through a directory tree adding file names to a passed in array.
>So the subroutine starts
>
>	dir_walk( @allfiles, "start directory") ;
>
>I want all the directory filelists to go into @allfiles.

Don't reinvent the wheel. Check out if there is an existing module
that does what you want. In this case the module File::Find does it
all for you.

The code below saved the full path of every file in and below
'c:\\files\\perl' in the array @allfiles.


use File::Find;

find(\&wanted, 'c:\\files\\perl');

sub wanted
{
  push @allfiles, $File::Find::name;
}


I hope this helps.

  Lars

Lars Gregersen
Technical University of Denmark
Department of Chemical Engineering
E-mail  : lg@kt.dtu.dk
Homepage: http://www.gbar.dtu.dk/~matlg/


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

Date: 24 Apr 1997 13:58:07 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: recursive directtory tree walk
Message-Id: <5jnotf$h2@fridge-nf0.shore.net>


Kevin Mulholland (kevin@dvstsol.demon.co.uk) wrote:
: I am quite new to perl, and I am playing about with it at the moment,
: before I have to use it in anger (as it were) however I am getting just a 
: bit confused at the moment. 

Aw, don't be angry at Perl.  :-)  You might look into find2perl, or
File::Find which will do the work for you!

Example: find2perl /path/dir -type f -print (outputs files)

which generates:

#!/usr/local/bin/perl

eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
        if $running_under_some_shell;

require "find.pl";

# Traverse desired filesystems

&find('your_directory_here');

exit;

sub wanted {
    (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
    -f _ &&
    print("$name\n");
}

OR

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

use File::Find;

# Traverse desired filesystems
find(\&wanted, 'your_directory_here');
print @all_entries,"\n"; # output all - or do something with the entries
exit;

sub wanted {
    (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
    -f _ &&
    push(@all_entries, $File::Find::name);
}

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 24 Apr 1997 15:31:33 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: recursive directtory tree walk
Message-Id: <5jnucl$jns$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    lg@kt.dtu.dk (Lars Gregersen) writes:
:The code below saved the full path of every file in and below
:'c:\\files\\perl' in the array @allfiles.

Don't use backslashes for path separators.  You just feed Microsoft
Brain Damage, and screw over programmers trying to get work done or write
things moderately portably.  Use normal slashes the way POSIX requires.
See the FAQ for why.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    stab_val(stab)->str_nok = 1;    /* what a wonderful hack! */
        --Larry Wall in stab.c from the perl source code


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

Date: Thu, 24 Apr 1997 11:55:41 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Regular Expression Help Newbie
Message-Id: <335f2ce2.5625967@news.tornado.be>

Deepak Thadani <deepak@pcsltd.com> wrote:

>	I have a perl script in which
>$_ = "881     /usr/spool/mmdf/lock/home"
>
>What I want to do is get the number (in this case 881) into a variable
>called $VALUE.  This is what I've got, which only seems to return
>the 1.

>$VALUE = /[0-9]*\S\//;

>What I believe the above is doing is getting all the numbers until
>I get to a white space or / right?  Apparently wrong since $VALUE
>after running that line, is simply 1.

You don't get *the* one, you get a "True" (= "success").

You need:
	1) parentheses around $VALUE to make this an array
	2) parenthese around your match, to notify Perl that you want to
keep the match
	3) Get your pattern right.
		\S will match *non*-space. Use \s to match the space
		Use [\s\/] or (\s|\/) to match *either* space or slash.
Your pattern matches both in a row. Actually, you don't need it:

	($VALUE) = /([0-9]+)/;


Alternative, why not simply convert $_ into a number?

	$VALUE = $_ + 0 ;

Gent (Ghent, Gand),
Belgium, 
Europe,
3rd planet from the sun.


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

Date: Thu, 24 Apr 1997 15:06:14 GMT
From: shtil@netcom.com (Yuri Shtil)
Subject: Strange behaviour under Windows NT
Message-Id: <shtilE95DyE.Bzz@netcom.com>


I'm observing a very strange behaviour of perl 4 something under Windows NT 4.0.

The perl I am talking about is from Atria shipped with their distribution
of clearcase. It was working OK until something happened to my NT workstation.
I cannot describe what actually happened, but one never knows with NT :-).

Anyway, it seems that perl cannot spawn a subprocess anymore via
open(PIPE, 'program|'). The call never returns and the task manager does not
show the program running. What is very strange is that the newest version
of perl (5.003 I believe) runs OK as well as the perl from Atria on other NT's.

It may well be an NT question.

Please reply via e-mail if you have any clues.


    Yuri Shtil


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

Date: 24 Apr 1997 15:23:46 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: sysopen object method in perl 5.001?
Message-Id: <5jntu2$jns$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    a.aitken@unl.ac.uk writes:
:the bsd compatible libraries are in /usr/ucb and have been seriously
:unreliable from solaris 2.2 - 2.5.
:
:Not recommended to even go near them.

It's an evil plot from Sun.   But really, if you put them *last*, after
libc even, you should be ok.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    When in doubt, parenthesize.  At the very least it will let some
    poor schmuck bounce on the % key in vi.
            --Larry Wall in the perl man page 


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

Date: Thu, 24 Apr 1997 22:40:14 +0800
From: KANNAN <vkannan@singnet.com.sg>
Subject: Re: What does "UNIX" stand for..
Message-Id: <335F70CE.272E@singnet.com.sg>

what does  Glisix stand for ?


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

Date: Thu, 24 Apr 1997 16:27:01 +0200
From: Petri Backstrom <...petri.backstrom@icl.fi>
Subject: Re: What's the equivalant to sendmail with NT?
Message-Id: <335F6DB5.10A1@icl.fi>

Gregory Reddin wrote:
> 
> I've moved from a Unix based web server to Windows NT. Now,  my perl
> scripts that use sendmail don't work anymore.  What can I use on NT
> that's the equivalant to sendmail?
> 
> Also, each of these scripts used to create a log file but this doesn't
> work either.
> 
> Any help would be greatly appreciated.

One approach that works for me is BLAT for sending SMTP mail.

Se

    http://gepasi.dbs.aber.ac.uk/softw/Blat.html

for more.

As to creating log files, you would have to provide more information
(code) to show, exactly, what's happening & how, exactly, it fails.

Isolate the relevant code and work on it on the command line until
you know what's going on (use 'use strict;' and '-w' and 'CGI.pm')
and you get it to work right.

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: 24 Apr 1997 13:25:35 GMT
From: lvirden@cas.org
Subject: Re: Why perl/TK hardly mentioned in Camel Book?
Message-Id: <5jnn0f$da$1@cas.org>



According to Dave Ripberger <dlrip@one.net>:
:
:Nothing about TK in the index, though I haven't completed the book
:yet.  I also see very few posts and zero responses in
:comp.lang.perl.tk.  What gives?  Is tcl/tk still the "choice" of perl
:programmers?

I suspect that the main problems you are having are :
1. thinking that all Perl modules could be discussed in any book of
a reasonable (ie less than 3000 pages) size
2. not having access to a full usenet news server feed for comp.lang.perl.tk.
There have been over 3985 postings to comp.lang.perl.tk since it's creation.
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Thu, 24 Apr 1997 07:26:24 -0700
From: Thant Tessman <thant@nospam.acm.org>
Subject: Re: wretched C++ (Was: Ousterhout and Tcl lost the plot with latest paper)
Message-Id: <335F6D90.41C6@nospam.acm.org>

David Thornley wrote:

> OK, looks like templates and RTTI.  These aren't exactly the latest
> features in the draft standard, but I don't expect them to be
> completely stable yet.

According to section 5.2.7 of the proposed C++ standard, in order for 
dynamic_cast<T> to work, T must be a "complete" class--hence
the need for an explicit instantiation of T if it is a template.
This is an aspect of the language, not the compiler.

The section doesn't make clear whether the compiler has an obligation
to warn if T is an incomplete class.  But even if it did, I'm writing
a toolkit and I resent the fact that its users (who aren't going to
be as familiar with C++'s quirks as I am) are going to have to know 
and remember to use mysterious incantations in order for stuff to work.


> OK, so your compiler doesn't support the draft ANSI standard,
> and doesn't provide warnings or clues.  This looks like an
> implementation problem to me.  In particular, I don't think
> it's actually Stroustrup's fault you spent hours figuring this
> out.  [...]

I admit haven't used many C++ compilers, (I don't program for PCs,
just SGIs and (rarely) Macs) but I have yet to use a C++ compiler 
that worked as advertised, let alone supported the draft ANSI standard.  
I've said before that the only thing I can imagine being worse than 
programming in C++ is trying to implement C++.  And this *is* 
Stroustrup's fault.

I'll let someone else address the comparison to Lisp.

-thant

[...followups trimmed...]


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

Date: 24 Apr 1997 09:08:53 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: www-based e-mail
Message-Id: <5jnm15$sft@panix.com>

In <335E73B9.412B@skokie.com> Greg <greg@skokie.com> writes:

>did you guys see the www.usa.net page or hotmail.com?

Nope.

>i want to put that www-based e-mail on my server... i did couple of
>pages all non-profit, and i would like my visitors to communicate with
>me somehow, but some of them don't have e-mail accounts (well, yes, they
>can send me e-mail but i can't reply to it ;-) )

>do you know of any location on the web, or do you have a script that
>does that? if not, do you have any suggestions on how to write one? i'm
>sort of a beginner in perl ;-)

You may want to poke around in the CGI section of Perl Reference:
http://www.panix.com/~clay/perl/query.cgi?cgi+index 

-- 
Clay Irving                                        See the happy moron,
clay@panix.com                                     He doesn't give a damn,
http://www.panix.com/~clay                         I wish I were a moron,
                                                   My God! Perhaps I am!


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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