[7989] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1614 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 10 14:07:19 1998

Date: Sat, 10 Jan 98 11: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           Sat, 10 Jan 1998     Volume: 8 Number: 1614

Today's topics:
     Re: [Help] Capturing STDOUT under DOS ? (Augusto Cardoso)
     Re: ActiveState PerlScript on Win95 <duncan.cameron@btinternet.com>
     Alphabetical Order <gnew@southernvirginia.edu>
     Re: Alphabetical Order (Honza Pazdziora)
     Re: Capturing STDERR on NT (Gurusamy Sarathy)
     dbmopen from two different linux distributions beryte@leb.net
     Help with "target=" anyone? <lelyea@freeway.net>
     Re: How can i create a file in perl? (Honza Pazdziora)
     Re: How do I configure Perl scripts under IIS4.0? <bigape@grungyape.com>
     Re: How to know intranet user identity yet connected ? (Honza Pazdziora)
     how to put % in replace text of s///??? <rparr@temporal.com>
     Re: how to put % in replace text of s///??? (Honza Pazdziora)
     Re: how to put % in replace text of s///??? <neil@nsedley.dircon.co.uk-antispam>
     Re: How to Use Perl to Summarize a Bit of Text Output (Honza Pazdziora)
     Re: LWP problem in a loop (J. Bacon)
     Re: LWP problem in a loop (Honza Pazdziora)
     Re: password input module needed (Honza Pazdziora)
     PERL & IIS 4 (final) hanging - help!! nospam@XX.co.uk
     Perl oddity... <bigape@grungyape.com>
     Re: Perl programming with NT4.0: sendmail problem (David Bigwood)
     Re: Perl to Binary? (J. Bacon)
     Re: Recursing Directories in Search of Files, maybe? (Honza Pazdziora)
     Re: Recursing Directories in Search of Files, maybe? <merlyn@stonehenge.com>
     Re: serious post about gmtime and year-1900 (was Re: Pe <Russell_Schulz@locutus.ofB.ORG>
     Re: sorting problem <jefpin@bergen.org>
     What does qw mean? (Mark666769)
     Re: What does qw mean? (Honza Pazdziora)
     Re: Win32 module with Perl 5.004_2 (Gurusamy Sarathy)
     Re: Win32--Add to program to system tray or Hide while  (David Bigwood)
     Re: WWW-pages generated by Perl-scripts (Honza Pazdziora)
     Re: WWW-pages generated by Perl-scripts (Mike Heins)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 10 Jan 1998 16:37:18 GMT
From: cardoso.a@mail.telepac.pt (Augusto Cardoso)
Subject: Re: [Help] Capturing STDOUT under DOS ?
Message-Id: <34b79f44.1056482@news>

Jan Krynicky <Jan@ChipNET.cz> wrote:


thank you very much
it WORKS!


>use 
>c:\> perl.exe pod2text c:\perl\readme.pod
>
>DOS/Windows are able to redirect only exe and com files
>(+ .bat & .cmd in WinNT).
>
>Jenda



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

Date: 10 Jan 1998 16:49:18 GMT
From: "Duncan Cameron" <duncan.cameron@btinternet.com>
Subject: Re: ActiveState PerlScript on Win95
Message-Id: <01bd1de7$addaf220$263763c3@dns.btinternet.com>

I installed Perlscript last week and it works OK.  There were (at least)
two things which I had to do which weren't clearly documented,
1) look at the Security tab under |View|Options in IE, and check some of
the boxes.  Then go into the Safety... window and enable medium or low. 
Until I did this I got a message saying that IE would not execute the Perl
script.
2) The installation of Perlscript puts several keys in the registry.  There
is a key which applies to IE4 which limits the execution of scripts based
on where they originate (local intranet or the internet).  Look at registry
key 
HKEY_LOCAL_MACHINE\SOFTWARE\ActiveWare\PerlSE\EnabledZones and set the
value to be 1.  I think the default installed value is 16.  This then
allows local and internet-originated Perl scripts to be executed.

Hope this helps

Duncan Cameron

Rainer Keuchel <r_keuchel@smaug.netwave.de> wrote in article
<wkg1n0jllv.fsf@smaug.netwave.de>...
> I cannot run the IE3.0 examples on a Win95 machine.  What can be
> wrong? I installed build 315. There does not seem to exist much
> information on perlscript. Can it only run on NT?
> -- 
> Rainer Keuchel
> 


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

Date: Sat, 10 Jan 1998 12:25:06 -0500
From: "Gary C. New" <gnew@southernvirginia.edu>
Subject: Alphabetical Order
Message-Id: <34B7AEF2.4FB3@southernvirginia.edu>

What is the simplest way to alphabatize data using Perl other than the
"sort" command?

Example:

        Alex
        Brenda
        Carl
        .
        .
        .
        Xena


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

Date: Sat, 10 Jan 1998 17:46:09 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Alphabetical Order
Message-Id: <adelton.884454369@aisa.fi.muni.cz>

"Gary C. New" <gnew@southernvirginia.edu> writes:

> What is the simplest way to alphabatize data using Perl other than the
> "sort" command?

[...]

What don't you like about the sort? I do not think there is simpler
way than using something that is built-in. You can of course write
your own quick sort, but ...

Hope thie helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 10 Jan 1998 18:21:17 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Capturing STDERR on NT
Message-Id: <698e6t$50r@srvr1.engin.umich.edu>

In article <dQCt.85$Dy5.1315720@news3.voicenet.com>,
 <nospam@domain.com> wrote:
>These examples are with the Perl executable,
>but can you always do this with all commands?  
>
>On NT I often use an old gzip program originally written 
>for DOS (yes, I call it from Perl) and I have hard
>time redirecting both STDERR and STDOUT from that utility
>into a log file.  

The usual reason for this is that the utility writes directly to
the console (which is not a nice thing to do, obviously).

>This outputs everything to file "b"
>
>  perl -e "print STDERR 'foo';print 'bar'" >b 2>&1

Ahh, so redirection of both stderr/stdout to file works (I was
missing the left-to-right sh-like parse of redirection), hence
wrote it this way:

>: C:\> perl -e "print STDERR 'foo';print 'bar'" 2>&1 | perl -e "print<>" >b
>: C:\> perl -e "print<>" < b
>: foobar

Does piping to 'cat' as above work for your gzip?

 - Sarathy.
   gsar@umich.edu



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

Date: Sat, 10 Jan 1998 09:51:38 -0600
From: beryte@leb.net
Subject: dbmopen from two different linux distributions
Message-Id: <884447016.890961926@dejanews.com>

Hi,

 I was using dbmopen (perl) under RedHat 4.2. The extension of the files
were *.db  I then upgraded to RedHat 5.0 and now I cannot open and use my
*.db files  Perl creates instead two files with *.dir and *.pag
extensions.

 I had to go back to RH 4.2 because of this.

 Do you know why is that? because of perl? because of the filesystem and C
libraries? Will I have to stay in RH 4.2 or is there a solution?

 thank you,

 nag

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Sat, 10 Jan 1998 12:15:09 -0500
From: L Elyea <lelyea@freeway.net>
Subject: Help with "target=" anyone?
Message-Id: <34B7AC9D.D290EB5A@freeway.net>

My script works great but I want to add a link to reload the current
frame.  Here is my current line:

print "<a href = \"http://shareware2001.com/cgi-bin/winner.pl\">Try
Again</A><BR>\n";

I want this line to cause a reload of my frame - however anytime I add
anything to do with "target=" I get a
perl error.

Help would be appreciated.

L Elyea
(New to CGI/perl)





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

Date: Sat, 10 Jan 1998 16:52:29 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How can i create a file in perl?
Message-Id: <adelton.884451149@aisa.fi.muni.cz>

"Anthony DIMINO" <dimino@worldnet.fr> writes:

> Hello,
> 
> I would want to write into  files,but in perl you can't write into a not
> existing  file?

Who told you that? He was a ... liar!

> may i use a touch unix command?

Yeah, you can -- system "touch $filename";

But you are definitely better off just creating the file using Perl:

open NEW, "> $filename" or die "Error writing $filename: $!\n";

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Fri, 9 Jan 1998 21:23:29 -0500
From: "Big Ape" <bigape@grungyape.com>
Subject: Re: How do I configure Perl scripts under IIS4.0?
Message-Id: <696m33$a98$1@cletus.bright.net>

Not to sound stupid, but did you turn on execute permissions in the required
directories you put the .pl files into?

Do you have the most recent Win32 release of Perl for NT?

F


Sridhar Madduluri wrote in message <34B69AA7.6BE64AEF@internetMCI.com>...
>Please let me know how to make Perl scripts to work unser IIS4.0
>I have added .pl to App settings under HomeDirectory Application
>Settings,
>but it still did not work.
>Thanks for your suggestions
>Sridhar
>sridharm@bellatlantic.net
>




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

Date: Sat, 10 Jan 1998 16:54:50 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How to know intranet user identity yet connected ?
Message-Id: <adelton.884451290@aisa.fi.muni.cz>

"Anthony DIMINO" <dimino@worldnet.fr> writes:

> Hello ,
> 
> I work on an intranet based on Solaris and Apache server,
> Users log first to connect LAN.
> After using a netscape browser they use the intranet.
> In my perl scripts,i would want to know the user name of the client
> how can I do that?
> I don't to want to ask them their login/password another time

You have to unless you somehow hack the Apache to get the login (and
believe it) from the remote (client) side.

Anyway, you should check the CGI FAQ about that.

And when you learn how to do authenticated pages on Apache, check man
page of CGI.pm, which you are using to write the cgi scripts in Perl,
how to get the remote_user name in the script.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sat, 10 Jan 1998 11:14:26 -0600
From: "Randall J. Parr" <rparr@temporal.com>
Subject: how to put % in replace text of s///???
Message-Id: <34B7AC72.85BF50BB@temporal.com>

How can I include a "%" (percent sign) in the replacement text of the
s/// command.

The following line

s~\\begin{DBTable}~<TABLE BORDER WIDTH=100%>\n<TR><TH>Name</TH></TR>~g

produces

<TABLE BORDER WIDTH=10
<TR><TH>Name</TH></TR>


s~\\begin{DBTable}~<TABLE BORDER WIDTH=100\%>\n<TR><TH>Name</TH></TR>~g

produces

<TABLE BORDER WIDTH=10
<TR><TH>Name</TH></TR>

s~\\begin{DBTable}~<TABLE BORDER WIDTH=100\\%>\n<TR><TH>Name</TH></TR>~g

produces

<TABLE BORDER WIDTH=100\%>
<TR><TH>Name</TH></TR>





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

Date: Sat, 10 Jan 1998 17:49:30 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: how to put % in replace text of s///???
Message-Id: <adelton.884454570@aisa.fi.muni.cz>

"Randall J. Parr" <rparr@temporal.com> writes:

> How can I include a "%" (percent sign) in the replacement text of the
> s/// command.
> 
> The following line
> 
> s~\\begin{DBTable}~<TABLE BORDER WIDTH=100%>\n<TR><TH>Name</TH></TR>~g
> 
> produces
> 
> <TABLE BORDER WIDTH=10
> <TR><TH>Name</TH></TR>

If this is what you get, then you have a problem with your perl binary
and you should either upgrade or (if you have 5.004_04) use perlbug
and send bug report. Well, my perl does:

$ perl
$_ = "\\begin{DBTable}\n";
s~\\begin{DBTable}~<TABLE BORDER WIDTH=100%>\n<TR><TH>Name</TH></TR>~g;
print;
__END__
<TABLE BORDER WIDTH=100%>
<TR><TH>Name</TH></TR>

and this is what I would expect -- % is no special.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sat, 10 Jan 1998 18:05:35 -0000
From: "Neil Sedley" <neil@nsedley.dircon.co.uk-antispam>
Subject: Re: how to put % in replace text of s///???
Message-Id: <34b7b872.0@newsread1.dircon.co.uk>

Randall J. Parr wrote in message <34B7AC72.85BF50BB@temporal.com>...
>How can I include a "%" (percent sign) in the replacement text of the
>s/// command.
>
>The following line
>
>s~\\begin{DBTable}~<TABLE BORDER WIDTH=100%>\n<TR><TH>Name</TH></TR>~g
>
>produces
>
><TABLE BORDER WIDTH=10
><TR><TH>Name</TH></TR>
>
<snip>


Which version of Perl are you using? I have tried the latest builds for both
Unix and NT and neither produces the results you describe.

Neil Sedley




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

Date: Sat, 10 Jan 1998 17:10:33 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How to Use Perl to Summarize a Bit of Text Output
Message-Id: <adelton.884452233@aisa.fi.muni.cz>
Keywords: text process summarize

simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson) writes:

[...]

>      I need to check to make sure that these lines occur in pairs.  If I

Let's analyse what you need. You need to read the input, line by line
-- check man page perlsyn for loop definitions and perlop for
input-reading operator <> and probably also perldata for description
of how to store data in Perl. Then, you will need a way to decide if
the line you've just read is that you are looking for. Check man page
perlop for pattern matching operators and man page perlre for regular
expressions -- powerful way to define pattern.

Then you will only print results, using print function described in
perlfunc man page. But I'm pretty sure you teacher has already shown
you many of these thinks to you.

There is also perlfaq man page answering many questions you might come
across and also www.perl.com with other references.

But I think that the standard man pages will be just fine to get you
started.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 10 Jan 1998 16:45:42 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: LWP problem in a loop
Message-Id: <6988jm$gao@dfw-ixnews3.ix.netcom.com>

I have ABSOLUTELY NO IDEA.  However, in the latest TPJ (The Perl Journal) 
there is an article on "Torture Testing Web Servers" which seems to address 
suspiciously similar subjects.  That would be "Issue #8(VOL. 2, NO. 4) Winter 
1997" which I just got last week.

If I'm not mistaken, you can retrieve the article text from their web site.  
If you are not a subscriber, I highly recommend the publication.


In article <34ba6b66.3282719@news.imaginet.fr>, Gilles.Maire@ungi.com says...
>
>Hello, 
>
>I use LWP and lauch requests on 200  Web pages. After 10 requests
>qorking fine  I have the message : Can-t resolve address xxxx ... 
>
>Any idea ? 
>
>My code is 
>
>
> require LWP::UserAgent;
> $ua = new LWP::UserAgent;
> $ua -> timeout(10);
> open ( F1, "<sniffer.in" ) ;
> @URL=<F1> ;
> close (F1) ;
>$request = new HTTP::Request('GET');
>foreach ( @URL ) 
> {
>  print "Recherche URL : $_" ;
>  $page=$_; 
>   chop($page);
>  $request->url($_);
> 
>  $response = $ua->request($request); 
>  if ($response->is_success)
>  {
>  @Fichier=split (/\n/,$response->content);
>...... 
>
>
>Amicalement
>
>          Gilles.Maire@ungi.com
>|||||||||||||||||||||||||||||| - UNGI - ||||||||||||||||||||||||||||||
>          http://www.ungi.com

-- 
***** Give me ambiguity or give me something else. *****
Jim Bacon
jwbacon@ix.netcom.com
303-666-9455 (H)  303-581-9635 ext. 329 (W)



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

Date: Sat, 10 Jan 1998 17:04:37 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: LWP problem in a loop
Message-Id: <adelton.884451877@aisa.fi.muni.cz>

Gilles.Maire@ungi.com (Gilles Maire) writes:

> Hello, 
> 
> I use LWP and lauch requests on 200  Web pages. After 10 requests
> qorking fine  I have the message : Can-t resolve address xxxx ... 
> 
> Any idea ? 

What can't you understand? You gave it bad URL, containing host that
couldn't be resolved and that's what the LWP tells you. The problem is
not with the script (or maybe is, some other strange things like
programming without use strict :-(, the problem is with the data that
contain wrong URL.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Sat, 10 Jan 1998 17:08:49 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: password input module needed
Message-Id: <adelton.884452129@aisa.fi.muni.cz>

"Peter Lanting" <lanting@ica.net> writes:

> Somewhere I heard of a Perl module that accepts a password
> and echoes '*****', just like logging in.  I haven't had any
> luck finding it on CPAN.

Check module Term::ReadKey for that.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Thu, 08 Jan 1998 17:26:23 GMT
From: nospam@XX.co.uk
Subject: PERL & IIS 4 (final) hanging - help!!
Message-Id: <884280387.6115.0.nnrp-05.9e980333@news.demon.co.uk>

We are running PERL (build 315) and IIS 4 (the final release).  When
we call a simple perl script, the browser shows server contacted,
waiting for reply, but just hangs forever.  When we look in the
process monitor a copy of perl.exe is open.  Even after we stop the
request this does not go away.  If you then request the perl script
again, it hangs again, and a new copy of perl.exe (along with the
original) is visible in process monitor.

We have setup the directory containing the PERL script with script
priveleges in the properties tab on Internet Service MMC.  We haev
mapped the file extension to the executeable perl.exe in the
properties sheet.   We have granted the annoymous web user execute
priveleges for both the directory containing the script, and the
perl.exe executable.  We have added the registery mapping recommended
by Microsoft Knowledge Base.

What is going wrong?!!

Please help with this - explain how it shold be done!

Many thanks in advance for your help.

Please e-mail answers to richard@the-web-works.co.uk

**************************************************************
www.the-web-works.co.uk
info@the-web-works.co.uk



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

Date: Fri, 9 Jan 1998 21:19:19 -0500
From: "Big Ape" <bigape@grungyape.com>
Subject: Perl oddity...
Message-Id: <696lra$a6e$1@cletus.bright.net>

I am having a script problem.

I wrote this in perl5 on HP-UX 10.xx and it works 100%
I put the exact same script on Linux 4.2 and works 100%
I put the exact same script on UNIX system V release 4 and works 100%
BUT, I put the exact same script on FreeBSD 2.1.7.1 and it causes some odd
results.

Now, the HP/linux/Unix are not secure directories, but the BSD is...however,
if I take it from the secure area and just drop it in a unsecure area, it
still causes the same results so I "assume" it's not a result of the secure
directory.

The script is on-line(and source viewable) at:
http://www.grungyape.com/perl/perl_order.html
when testing use values:

Part#s 100-110 Quantity (anything)

The script not working correct is on a user's site at:
https://ssl5.pair.com/carbide/

when testing use values:
EDP# 216, 420,232,248,420b,240b,224b Quantity (anything)

Here is the normal, expected output:

----start----
Thank you for your order.
Here is the information you selected:
Part#: 100 Quantity: 1 Total: 6.92
Design(option):
Part#: 109 Quantity: 34 Total: 161.5
Design(option):
Part#: 110 Quantity: 4 Total: 4.6
Design(option):

Sub Total: 173.02
Standard UPS Shipping($5.50): 178.52

-----stop----

Here is the same stuff on the BSD:

----start----
Thank you for your order.
Here is the information you selected:
EDP#: 216 Quantity: 4 Total: 24.839999999999999858
Coating(option):
EDP#: 420b Quantity: 15 Total: 138.75
Coating(option):
EDP#: 232 Quantity: 1 Total: 17.379999999999999005
Coating(option):
EDP#: 224b Quantity: 100 Total: 1143
Coating(option):

Sub Total: 1323.9700000000000273
Standard UPS Shipping($5.50): 1329.4700000000000273

----stop----

Can anyone help on this?

To answer questions before they are asked:

Yes, I copied the BSD site script back to my HP box and it ran fine.
Yes, I put my on-line demo (with fake part numbers 100-110) on the BSD site
and it suddenly did the same strange stuff.

Please e-mail help/suggestions to me as well as post if you do.

Thanks,
Frank
orangutan@grungyape.com






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

Date: Sat, 10 Jan 1998 15:24:51 GMT
From: dbigwood@presp.demon.co.uk (David Bigwood)
Subject: Re: Perl programming with NT4.0: sendmail problem
Message-Id: <34b790ca.867764@news.demon.co.uk>

On Thu, 8 Jan 1998 09:51:01 +0100, "John Goor" <splyc2@klm.nl> wrote:

Try using an OLE MAPI session, I think the following example worked
last time I tried:

print "HTTP/1.0 200 OK\n"; 
print "Content-Type: text/html\n\n"; 

print "<HTML>\n"; 
print "<HEAD>\n"; 
print "<TITLE>Perl Examples</TITLE>\n"; 
print "</HEAD>\n"; 
print "<BODY bgcolor=\"#ffffff\">\n";
print "<FONT face=\"Courier New,Courier,Arial\">\n"; 

print "<h1>Mail Creation using OLE</h1>\n";
use OLE;
$LogonName = "Prime Network";	# send message to me
$LogonPasswd = undef;		# use stored password
$ActiveSession = CreateObject OLE "MAPI.Session" || die "CreateObject:
$!";
	# create session
die "Logon: $!" if $ActiveSession->Logon($LogonName,$LogonPasswd);
	# logon (returns 0 on success)
$Message = $ActiveSession->Outbox->Messages->Add();
$Recipient = $Message->Recipients->Add();
$Recipient->{Name} = "dbigwood\@prime-response.com";	# to address
$Recipient->{Type} = 1;
$Recipient->Resolve();		# resolve name
$Message->{Subject} = "Message from Perl";
$Message->{Text} = "Test message line 1\nTest message line 2!";
$Message->Update();		# save it
$Message->Send(1, 0, 0);	# send it - don't show UI
$ActiveSession->Logoff();	# end session

print "</BODY>\n"; 
print "</HTML>\n"; 

>Hello,
>
>Hopefully you may know the answer to my problem I'm really stuck with:
>I am programming some Perl scripts for an Intranet site, which runs on a
>Windows NT 4.0 platform.
>Now I want to invoke a 'feedback' option, however: In Unix I use 'sendmail',
>being invoked from a Perl script.
>Ofcourse NT hasn't such a tool, but is there another way to accomplish what
>I want: 'sendmail for NT'?
>Please help. I'm waiting anxiously for an answer...
>
>Thanks in advance.
>Regards,
>
>John Goor
>(John.Goor@Turnkiek.nl)
>
>



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

Date: 10 Jan 1998 17:05:16 GMT
From: jwbacon@ix.netcom.com (J. Bacon)
Subject: Re: Perl to Binary?
Message-Id: <6989oc$gao@dfw-ixnews3.ix.netcom.com>

There is a shareware Perl compiler available (cost is $35, it works on the 
ActiveState port build 3.13+ and has at least one 'bug').  From what I think I 
saw going on during the "compile" process, it grabs your script, all 'use' or 
'require' modules, and the Perl binary and adds them all together to make an 
exe file.

DARN NICE except it created a 750kb+ file on my 27kb (including comments) 
script.  You can get the evaluation version from http://www.demobuilder.com.  
They have a very prompt response to 'problems' and are quite honest about the 
limitations or bugs, and in my case provided a workaround via e-mail.

Which probably makes the product worth $35.00

In article <34b96d00.77471888@news.gate.net>, mkelly99@NOSPAMgate.net says...
>
>On Fri, 9 Jan 1998 14:57:07 +1100, "Imo" <imo@vision.net.au> wrote:
>
>>Hello All,
>>
>>I was wondering if it was possible to compile perl?  Can it be done like C,
>>gcc file.c -o file  or something like that?
>>
>>Thanks,
>>John
>>
>
>According to the Larry Wall interview in Feb. 1998 Doctor Dobb's Journal,
>a feature of the next Perl release will be compilation to C source code.
>
>
>
>Mike
>
>"Genius gives birth, talent delivers."
>
>                - Jack Kerouac
>
>(remove NOSPAM from address, if present, to reply)

-- 
***** Give me ambiguity or give me something else. *****
Jim Bacon
jwbacon@ix.netcom.com
303-666-9455 (H)  303-581-9635 ext. 329 (W)



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

Date: Sat, 10 Jan 1998 17:54:01 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Recursing Directories in Search of Files, maybe?
Message-Id: <adelton.884454841@aisa.fi.muni.cz>

defike@spam.ilstu.edu.not (Don) writes:

> I wrote this little script to recurse directories in search of files
> but when it gets to the call to the subroutine it never finishes the
> rest of the @dirs_files from before the call.  It would appear that
> their values are written over by each call to the subroutine.
> I would appreciate any suggestions on how to approach this.
> Thanks,
> defike@ilstu.edu.spam.not 
> 
> $startdir = "f:\\main";
> &Recurse ($startdir);
> sub Recurse
>  {
>   local ($startdir) = @_;
>   opendir DIR, $startdir;
>   @dirs_files = sort grep !/^\.\.?$/, readdir DIR;
>   foreach (@dirs_files)
>   {
>   $newdirfile = join "\\", $startdir, $_;
>   if (-d $newdirfile)
>    {
>      print "DIR: $_ \n";
>      &Recurse ($newdirfile);
>    }
>   else
>    {
>      print "FILE: $_\n";
>    }
>   }
> }

I'd say that there are two or three problems:

- you use global variables (@dirs_files, $newdirfile) where you
  probably want to have local ones, using my;

- you do not use use strict that would warn you about such things;

- you do not use use File::Find (see man File::Find) that would do it
  for you and probably better -- note that "\\" doesn't have in
  operating systems the same meaning as it has on Windoze.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 10 Jan 1998 11:29:05 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: defike@ilstu.edu
Subject: Re: Recursing Directories in Search of Files, maybe?
Message-Id: <8cvhvs5gjy.fsf@gadget.cscaper.com>

>>>>> "Don" == Don  <defike@spam.ilstu.edu.not> writes:

Don> I wrote this little script to recurse directories [..]

Please don't.  There are many things to worry about when you do this.
And it's already done for you...

"perldoc File::Find" =>

    NAME
	 find - traverse a file tree

	 finddepth - traverse a directory structure depth-first

    SYNOPSIS
	     use File::Find;
	     find(\&wanted, '/foo','/bar');
	     sub wanted { ... }

	     use File::Find;
	     finddepth(\&wanted, '/foo','/bar');
	     sub wanted { ... }

    DESCRIPTION
	 The wanted() function does whatever verifications you want.
	 $File::Find::dir contains the current directory name, and $_
	 the current filename within that directory.
	 $File::Find::name contains "$File::Find::dir/$_".  You are
	 chdir()'d to $File::Find::dir when the function is called.
	 The function may set $File::Find::prune to prune the tree.

And so on.  I have examples of using this module in my Unix Review
columns at:

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

and my Web Techniques columns at:

	http://www.stonehenge.com/merlyn/WebTechniques/

Joe Bob says Check it Out!

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 233 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sat, 10 Jan 1998 14:52:33 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: serious post about gmtime and year-1900 (was Re: Perl not Y2K compliant)
Message-Id: <19980110.145233.9t7.rnr.w164w@locutus.ofB.ORG>

phenix@interpath.com (John Moreno) writes:

> Perl does the right thing (trust us),

:-)

> but what your local C library does is beyond anybody except the people
> using it.

such as the people using perl, if you compiled it locally.

which doesn't address the people who don't compile perl locally, and
want to have emprical reassurance that it works as documented.

> Putting code in the documentation to test your local runtime is beyond
> the scope of the documentation.

you're right.  we should leave it as is, because it's obviously clear
enough to the people who keep posting asking if it's going to work.

sorry, the subject says `serious'.  let me rephrase that:

I think that any decision as bad as returning 98 for 1998 and 101 for
2001 should be documented, with examples past the border case, so the
implementors know how to get it right, and users know what to expect.

of course, the main goal of such documentation is to make the person
deciding on such a bad representation to realize it should just be
done less obscurely in the first place, but that opportunity for C
(and thus Perl) was gone almost 20 years before Perl was born.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Sat, 10 Jan 1998 10:52:01 -0500
From: TechMaster Pinyan <jefpin@bergen.org>
To: Tomas <tomas@iimagers.com>
Subject: Re: sorting problem
Message-Id: <Pine.SGI.3.95.980110104824.25972A-100000@vangogh.bergen.org>

>I was wondering if someone could help me out here...I am trying to
>find a way to sort @menu alphabetically by last names. @menu typically
>looks like this:

To sort alphabetically, you can just do sort (@array);

>@menu[0] = "Smith, John [73301]";
>@menu[1] = "Doe, John [06102]";
>@menu[2] = "Smith, Lisa [02133]";
>@menu[3] = "Lee, Jane [34504]";
>@menu[4] = "Lewis, Joe [07135]";

sort (@menu);
Incidentally, when defining SINGLE elements of arrays, it is better to use
$menu[0] rather than @menu[0].

----------------
| "WYSIWYG?  More like WUSSIWYG... Text Editors Rule!!!"
| 	- Jeff Pinyan
----------------
Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
techmaster@mindless.com | jpinyan@sdf.lonestar.org
techie@continuum.eu.org | too many addresses!!!
** I can be found on #perl on irc.ais.net as jpinyan **

- geek code -
GCS/IT d- s>+: a--- C+>++ UAIS+>$ P+++$>++++ L E--->---- W++$
N++ !o K--? w>+ !O M>- V-- PS PE+ !Y !PGP t+ !5 X+ R tv+ b>+
DI+++ D+>++ G>++ e- h- r y? 



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

Date: 10 Jan 1998 17:02:57 GMT
From: mark666769@aol.com (Mark666769)
Subject: What does qw mean?
Message-Id: <19980110170201.MAA07634@ladder01.news.aol.com>

Hi,

Could someone please explain what "qw" means and does in the 
following statement:

use CGI qw(:standard);

I understand the USE part, and even the (:standard) part, and
I'm vaguely familiar with the concept of namespace. 

It's just the syntax - what exactly does "qw" mean in the syntax
of Perl? "Learning Perl" doesn't cover it, and I couldn't find
it in the faq.

Thanks very much...



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

Date: Sat, 10 Jan 1998 17:43:34 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: What does qw mean?
Message-Id: <adelton.884454214@aisa.fi.muni.cz>

mark666769@aol.com (Mark666769) writes:

> Hi,
> 
> Could someone please explain what "qw" means and does in the 
> following statement:
> 
> use CGI qw(:standard);
> 
> I understand the USE part, and even the (:standard) part, and
> I'm vaguely familiar with the concept of namespace. 
> 
> It's just the syntax - what exactly does "qw" mean in the syntax

Yes, it's syntax thing.

> of Perl? "Learning Perl" doesn't cover it, and I couldn't find
> it in the faq.

You've skipped the essential source, man page ;-) It's hidden in perlop
man page but it's there:

	qw/STRING/
		Returns a list of the words extracted out of STRING,
		using embedded whitespace as the word delimiters.

		[...]

Hope thie helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 10 Jan 1998 18:40:17 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Win32 module with Perl 5.004_2
Message-Id: <698fah$61f@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <34B53D11.15875A43@sirius.com>,
Jim Bowlin  <bowlin@sirius.com> wrote:
>
>Win32::NetAdmin::UserCreate($server, $self->{user}, $self->{password},
>    0, $temp->{priv}, '', '', $temp->{flags}, $self->{script})
>or
>
>Win32::AdminMisc::UserSetAttributes($server, $self->{user}, 
>$self->{fullname}, $self->{password}, '', '', '', '', '', '')
>
>to work.  I've tried many variations.  They return false but
>I can not find any error messages.

Try calling the functions with simple scalars (not hash values),
and let me know if that works.

The interface for output args changed in 5.004 and is (in retrospect)
a serious source-level incompatibility for those XSUBs that must
handle output arguments. (cc-ed to perl5-porters for comment.)

>Also the masks in the Win32::FileSecurity seem messed up.
>For example: when Windoze says that a user has read(RX) permission,
>the mask is set to 001200A9 while the full complement of masks is
>reported to be:
>
>0000ffff  SPECIFIC_RIGHTS_ALL
>00010000  DELETE
>00020000  READ_CONTROL STANDARD_RIGHTS_EXECUTE
>STANDARD_RIGHTS_READ                     STANDARD_RIGHTS_WRITE
>00040000  WRITE_DAC
>00080000  WRITE_OWNER
>000f0000  STANDARD_RIGHTS_REQUIRED
>00100000  SYNCHRONIZE
>00120000  R READ
>00130000  C CHANGE
>001f0000  STANDARD_RIGHTS_ALL
>001f01ff  F FULL
>01000000  ACCESS_SYSTEM_SECURITY
>02000000  MAXIMUM_ALLOWED
>10000000  GENERIC_ALL
>20000000  GENERIC_EXECUTE
>40000000  GENERIC_WRITE
>80000000  GENERIC_READ
>
>What boat did I miss?

I'm not sure about the 'problem' that you're describing.  Can you
give an example (with 'expected' output)?

 - Sarathy.
   gsar@umich.edu



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

Date: Sat, 10 Jan 1998 15:14:08 GMT
From: dbigwood@presp.demon.co.uk (David Bigwood)
Subject: Re: Win32--Add to program to system tray or Hide while running/minimized
Message-Id: <34b78fee.648469@news.demon.co.uk>

On Tue, 06 Jan 1998 14:50:20 -0500, Deflores <deflores@bigfoot.com>
wrote:

Try the following script which was included with the Win32 Perl
examples (process.pl). The process runs in the background:

use strict;
use Win32;
use Win32::Process;

#Create the process object.
Win32::Process::Create($Win32::Process::Create::ProcessObj, 
    "C:\\PERL\\BIN\\PERL.EXE",          # Whereabouts of Perl
    "perl test",                        #
    0,                                  # Don't inherit.
    DETACHED_PROCESS,                   #
    ".") ||                             # current dir.
    die &print_error;

sub print_error {
    print Win32::FormatMessage( Win32::GetLastError() );
}



>How can I hide a running perl program from the Windows NT taskbar or
>alternatively minimize it into the system tray?
>
>Thanks in advance,
>
>deflores



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

Date: Sat, 10 Jan 1998 16:58:40 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: WWW-pages generated by Perl-scripts
Message-Id: <adelton.884451520@aisa.fi.muni.cz>

"Paul Weingarten" <paulweingarten@hotmail.com> writes:

[...]

> Please take a look at this Perl-script:
> #!/usr/bin/perl

No -w.

> $filename = "data.txt";

No use strict and no my.

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

No use CGI; That's bad, really bad.

[...]

Start by checking CGI orinted modules on CPAN. That will save you
a lot of troubles wince it already think about many cases for you. So
your modules will be easier to develop and maintain and will be safer.

> One problem with many pages generated by scripts is
> the big amount of data files. In this case as many as
> the amount of product categories.
> I wonder how to get data for only one category from a data
> file containing many others. Probebly you have to add
> one more "field" in the data file as in the example further down.
> But what would the Perl code look like then?

Split and decide on field number 3.

> Category1|Sampo 17"|Big and nice|4400|sampo17.jpg
> Category1|Sampo 15"|Good|4332|sampo15.jpg
> Category1|Acer 15"|Nice price|2344|acer15.jpg
> Category2|D-link Combo|10 Mbps Network card|320|d-link.jpg
> 
> Another problem is signs that needs to be formatted, like
> i to &eacute;. How is this done automaticly?

By using modules, to be found on CPAN.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 10 Jan 1998 17:20:42 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: WWW-pages generated by Perl-scripts
Message-Id: <698ala$t97$1@vixen.cso.uiuc.edu>

Paul Weingarten (paulweingarten@hotmail.com) wrote:
: > [snip]

 X-Newsreader: Microsoft Outlook Express 4.71.1712.3

What is it with these Windows newsreaders that people post
separately to three groups?  Are not only the users but the
DEVELOPERS clueless?

It is disgusting to reply to the first post and then see
the same question posted separately in another group. As a
result, I am as of this moment killing on X-Newsreader: .*microsoft.*.

I encourage everyone encountering these separate posts to ignore
them all.

- 
Regards,
Mike Heins

This post reflects the
opinion of my employer.


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

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

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