[7988] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1613 Volume: 8

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

Date: Sat, 10 Jan 98 07:00:29 -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: 1613

Today's topics:
     Re: [Help] Capturing STDOUT under DOS ? <wtansill@erols.com>
     Can Perl talk smtp protocol under NT4? <yamasaki@mars.dti.ne.jp>
     Re: Capturing STDERR on NT nospam@domain.com
     Capturing STDOUT under DOS <wtansill@erols.com>
     Re: Convert .bmp to .jpg via Perl <*@qz.to>
     Re: CRYPT() (Jim Britain)
     Re: Does range operator work with file handles? <zenin@best.com>
     Re: Finding the TITLE to a HTML page <*@qz.to>
     Getopt::Long caveat? (Jeeves)
     Re: Getopt::Long caveat? (Hans-Georg Rist)
     How can i create a file in perl? <dimino@worldnet.fr>
     How to know intranet user identity yet connected ? <dimino@worldnet.fr>
     LWP problem in a loop (Gilles Maire)
     Re: Mailing binary file <jamesr@aethos.co.uk.nospam>
     Re: Newbie question <rjk@coos.dartmouth.edu>
     Re: Parsing a log file with / / <*@qz.to>
     password input module needed <lanting@ica.net>
     Re: Perl CGI script's own directory (Martin Vorlaender)
     Re: Perl to EXE nospam@domain.com
     Re: Q: search matching "(" and ")" (Dean Inada)
     Re: req: A) Perl/Tk B) Permanter Perl-Interpreter unter <jhi@alpha.hut.fi>
     Search engine? Do u? <adline@pc.jaring.my>
     Re: Sorting Data File <rjk@coos.dartmouth.edu>
     Re: weird problem! <*@qz.to>
     WWW-pages generated by Perl-scripts <paulweingarten@hotmail.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 09 Jan 1998 23:24:53 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Re: [Help] Capturing STDOUT under DOS ?
Message-Id: <34B6F815.46DA@erols.com>

Jan Krynicky wrote:
> 
> Augusto Cardoso wrote:
> >
> > What can I do to capture the output of Perl programs to a disk file
> > insted of screen ? I tried all "redirection" and other "piping" I
> > could think of, no results!
> > Ex.
> > POD2TEXT C:\PERL\README.POD
> >
> > ... I would like to catch the output for later printing ...
> > Thanks for suggestions.
> 
> 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
Under DOS/Windows STDOUT may be redirected at will regardless of the
source.  STDERR can't be redirected from the command prompt (unlike
UNIX).
-- 

How do I set my laser printer to "stun"?


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

Date: Sat, 10 Jan 1998 23:38:11 +0900
From: Cool Yam <yamasaki@mars.dti.ne.jp>
Subject: Can Perl talk smtp protocol under NT4?
Message-Id: <34B787D3.5344@mars.dti.ne.jp>

Hello,

I need to make Form2Mail.pl under WindowsNT4.
But,I can't use any sendmail aplication.

I hear Perl can talk smtp protocol,but I don't know
how to make it.

Anybody know how to make that script??

Please teach me.

Thanks,

----
Cool Yam
yamasaki@mars.dti.ne.jp


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

Date: Sat, 10 Jan 1998 04:31:05 GMT
From: nospam@domain.com
Subject: Re: Capturing STDERR on NT
Message-Id: <dQCt.85$Dy5.1315720@news3.voicenet.com>

Gurusamy Sarathy (gsar@engin.umich.edu) wrote:
: In article <34B1EE1A.7A492AC7@sirius.com>,
: Jim Bowlin  <bowlin@sirius.com> wrote:
: >to the best of my knowledge there is no solution to this problem.

: perlwin32.pod in the standard distribution describes ample empirical
: evidence to the contrary:


Thanks for posting these examples.  :) 

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.  

This outputs everything to file "b"

  perl -e "print STDERR 'foo';print 'bar'" >b 2>&1

But this does not:

  gzip -h >b 2>&1

I've never understood why...  :( 

This becomes a rather tricky problem.  If I use a line
such as:

  system ("gzip myfile") || die "Problem gzipping.\n";

And my script as a whole has both STDERR and STDOUT redirected
to a log file, the STDERR of the gzip operation does not go to the
file, it goes to the real STDERR.  And I can't say this:

  system ("gzip myfile 1> file.log 2>&1") || die "Problem gzipping.\n";

Because "file.log" is already open for writing by another process,
and it's not available.  So far I haven't figured a way around this. 
I have to use separate logs.  Maybe I should just stop using 
this old gzip.  :)


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

: Now, before Randal gives me a 'useless use of cat' award for that last one:

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

--
##--------------------------------
##  John Nolan  
##  jpn acm org
##--------------------------------


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

Date: Fri, 09 Jan 1998 23:22:30 -0500
From: "William B. Tansill, III" <wtansill@erols.com>
Subject: Capturing STDOUT under DOS
Message-Id: <34B6F786.7102@erols.com>

The syntax:

perl pod2text ..\lib\perl5\pod\perlsub.pod > e:\ps.txt

works for me, producing an output file 39,805 bytes in size.

This is a DOS box unde Win '95.
-- 

How do I set my laser printer to "stun"?


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

Date: 10 Jan 1998 06:07:29 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Convert .bmp to .jpg via Perl
Message-Id: <qz$9801100057@qz.little-neck.ny.us>

John Porter  <jdporter@min.net> wrote:
> Eric Hilding wrote:
> > Does anyone know if a .bmp graphics file can be
> > converted to a .jpg format via a perl script?

Can be? Yes. Good idea? No. Without an external program or XS stuff
that would be really ineffiecent.

> Alternatively, consider Jef Poskanzer's PBM Plus package,

The PBM stuff is wonderful for most scriptable image modifications.
You could use perl as the glue for those scripts.

> which can do just about anything you would want to do to an
> image, all via pipelineable commands.

MPEG -> 'cat' ascii art movie is still somewhat hairy.

Elijah
------
thinks about making a general image to ascii art tool for lynx someday


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

Date: Sat, 10 Jan 1998 10:29:23 GMT
From: jbritain@home.com (Jim Britain)
Subject: Re: CRYPT()
Message-Id: <34b74cc1.12749413@news>

I emailed him a reply, but that obviously isn't going to work and I'm
not going to post the whole damn thing again.

do a Subject search on: Subject: Re: username:password crypt module
                        From: gbacon@adtran.com (Greg Bacon)
it's all there.

On 9 Jan 1998 18:57:03 GMT, nvp@shore.net (Nathan V. Patwardhan)
wrote:

>Shawn M. Nelson (anonymous@whatever.com) wrote:
>
>: No, I am not.  What group would you post to if you were trying to update an
>: .htpasswd file by first creating the file in VFP and the FTPing the file to
>: an NCSA server?
>
>Well, I'd probably post to a FoxPro group, or even a webserver group
>where users were discussing htpasswd stuff.  Unless, of course, you
>were really trying to ask about crypting passwords like the htpasswd
>program and how you'd do it in Perl.  
>
>But I didn't parse that question from your question.  Is that the
>question you were trying to ask?
>
>--
>Nathan V. Patwardhan
>



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

Date: 10 Jan 1998 11:50:00 GMT
From: Zenin <zenin@best.com>
Subject: Re: Does range operator work with file handles?
Message-Id: <884433254.553931@thrush.omix.com>

Austin Hastings <hastinga@tarim.dialogic.com> wrote:
	>snip<

	I hate the binary range op, it's just too damn confusing and
	when ever I used it I get 20 people asking me what the hell
	my code does.  Normally, it's also trivial to do without so
	I've got no reason to use it:

	use IO::File;
	my $changes    = new IO::File ($ch_file)
	    or die qq(Could not open "$ch_file":  $!, stopped);

	my $oldaliases = new IO::File ("< /etc/aliases")
	    or die qq(Could not open "/etc/aliases":  $!, stopped);

	my $newaliases = new IO::File ("> /tmp/aliases.new")
	    or die qq(Could not open "/tmp/aliases.new":  $!, stopped);

	my $replace	= 0;     

	while (<$oldaliases>) {
	    if (/^$top_delim$/) {
	        ## BTW, try never to explicitly add a trailing newline because then
	        ## perl won't tell you what line, file, and package the error happened.
		print $newaliases while (<$changes>)
	            or die qq(I don't trust I have the disk space available: $!, stopped);
	        $replace = 1;
	    } elsif (/^$bot_delim$/) {
	        $replace = 0;
	    }
	    next if $replace;
	    print $newaliases  $oldaliases;
	}

	__END__

	No, this doesn't explain the range op, but then like I said I hate having
	to explain it so much I just don't. :-)

-- 
-Zenin
 zenin@best.com


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

Date: 10 Jan 1998 04:21:45 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <qz$9801092309@qz.little-neck.ny.us>

Mark Hazen  <mhazen@franklin.uga.edu> wrote:
> Tushar Samant wrote:
> > Unless you are telling me not to *compose* HTML with comments
> > in titles -- in which case I will point out that you have the
> > bullying power of neither Netscape nor Microsoft.
> Well, if he won't tell you not to do it, the standard will. From the W3

"The nice thing about standards is there are so many to choose from."
-- Tanenbaum (?)

> Consortium HTML 4.0 Spec document (this section in
> {http://www.w3.org/TR/REC-html40/struct/global.html#edef-TITLE} )"
> Titles may contain character entities (for accented characters, special
> characters, etc.), but may not  contain other markup."
> 
> Just a thought.... :)

Chances are very good for the foreeable future that if you download a
web page under my control you are going to get an HTML 2.0 webpage.
Comments are perfectly legal inside of titles for 2.0. (Similarly
markup is perfectly legal and should be ignored in HTML 2.0.) I can't
be the only person with 2.0 web pages left.

Moral: you should uee a module to parse html rather than doing it by
hand so that idiosyncracies like these can by handled properly by
someone else.

Elijah
------
purist who thinks HTML started going wrong with the poorly designed IMG tag



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

Date: 10 Jan 1998 06:10:30 GMT
From: darlenem@PAS.DE.SPAM.flash.net (Jeeves)
Subject: Getopt::Long caveat?
Message-Id: <slrn6be539.32b.darlenem@jeeves.flash.net>

Am I missing something? GetOpt::Long lets you specify that options have
an optional integer argument. But, what happens if that option is specified,
but no integer supplied?

use GetOpt::Long;
%optctl = ( 'n' => \$num,);
&GetOptions(%optctl);
# lots_of_code

Suppose the above snippet was run with '-n 10'. That's nice, $num is now 10.
But if no number is given? I cannot find an example of this *anywhere* in the
Camel book! I can only assume that it would set $num to 1. But what if the
script was run with 'n=1'? Am I missing something? If not, how do I deal with
that?

TIA,

Jeeves (darlenem@spamless.flash.net)

-- 
---------------------------------------------------------------------
     J |  Copyright (c) 1997 Jeeves Industries Limited.
     J |  All rights reserved. Void where prohibited.
     J |  Some restrictions may apply. Limit 1 per customer.
 J   J |  Offer not valid in conjunction with any other offer.
  JJJ  |  Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\?  You must mean kill -9.; kill -9 \!*'
=====================================================================


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

Date: Sat, 10 Jan 1998 13:16:46 GMT
From: hans-georg.rist@zkrd.de (Hans-Georg Rist)
Subject: Re: Getopt::Long caveat?
Message-Id: <34b7733a.1463147@news.uni-ulm.de>

darlenem@PAS.DE.SPAM.flash.net (Jeeves) wrote:

>Am I missing something? GetOpt::Long lets you specify that options have
>an optional integer argument. But, what happens if that option is specified,
>but no integer supplied?
>
>use GetOpt::Long;
        ^
>%optctl = ( 'n' => \$num,);
              ^
>&GetOptions(%optctl);

first correct your code to:

use Getopt::Long;
%optctl = ( 'n:i' => \$num,);
&GetOptions(%optctl);
# test with:
printf "option -n is %s\n", 
       defined $num ? "set, value=$num" : "not set";

>
>Suppose the above snippet was run with '-n 10'. That's nice, $num is now 10.
>But if no number is given? I cannot find an example of this *anywhere* in the
>Camel book! I can only assume that it would set $num to 1. But what if the
>script was run with 'n=1'? Am I missing something? If not, how do I deal with
>that?

?? --> Camel 2nd Edition, p. 447: If the optional argument is omitted,
the value 0 will be assigned to the option variable.
(OK, it's no example  ;-) )

HG
| Hans-Georg Rist     ZKRD, Zentrales Knochenmarkspender-Register
| Helmholtzstr. 10    Deutschland, gGmbH
| P.O.B. 4244         German National Registry of Bone Marrow Donors
| D-89032 Ulm         http://www.zkrd.uni-ulm.de
| Phone: +49 731 95430-46, Fax: -50, email: hans-georg.rist@zkrd.de


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

Date: Sat, 10 Jan 1998 11:02:10 +0100
From: "Anthony DIMINO" <dimino@worldnet.fr>
Subject: How can i create a file in perl?
Message-Id: <697ghg$5rt$1@news2.isdnet.net>

Hello,

I would want to write into  files,but in perl you can't write into a not
existing  file?
may i use a touch unix command?
Please help me thanks

Dimino Anthony
Elhve inginieur ECE
dimino@worldnet.fr




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

Date: Sat, 10 Jan 1998 11:11:20 +0100
From: "Anthony DIMINO" <dimino@worldnet.fr>
Subject: How to know intranet user identity yet connected ?
Message-Id: <697h8p$63q$1@news2.isdnet.net>

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
Please help me thanks !

Elhve inginieur ECE
dimino@worldnet.fr




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

Date: Sat, 10 Jan 1998 12:39:49 GMT
From: Gilles.Maire@ungi.com (Gilles Maire)
Subject: LWP problem in a loop
Message-Id: <34ba6b66.3282719@news.imaginet.fr>

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


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

Date: 10 Jan 98 07:36:24 GMT
From: "James Richardson" <jamesr@aethos.co.uk.nospam>
Subject: Re: Mailing binary file
Message-Id: <01bd03c5$1d320560$26c0a4c1@kitkat.aethos.co.uk>

Tom Phoenix <rootbeer@teleport.com> wrote in article
<Pine.GSO.3.96.971205122718.29415I-100000@usertest.teleport.com>...
> On Thu, 4 Dec 1997, Mikel Cook wrote:
> 
> > The open for mail looks like this:
> > 
> > open (MAIL, "|/usr/bin/sendmail -B 8BITMIME");
> > 
> > I am not getting an error on the open statement even with the -w
> > parameter, so it seems that flag is OK. 
> 
> That doesn't necessarily follow.
> 
> > I read in the sendmail man page that the -B flag is for a binary
message
> > body. 
> 
> If you're having trouble getting sendmail to do what you want, you should
> check the docs, FAQs, and books about sendmail. If you still can't get it
> working, you should ask your local sendmail expert. When even that fails,
> you should try a sendmail newsgroup. Of course, there's nothing
> Perl-specific about getting sendmail to work. Good luck!
> 

Agreed, but only about 1 1/2 weeks ago I answered a similar question.
(Mikel: Check dejanews. Hint: Try MIME attachments).

James



 


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

Date: Sat, 10 Jan 1998 01:31:39 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: jcotton@erols.com
Subject: Re: Newbie question
Message-Id: <34B715CB.9A49E965@coos.dartmouth.edu>

Joseph Cotton wrote:
> 
> I'm new to perl, too, and I retch at the sight of such code.  Can any
> one of you nice perl nerds create a series of functions to format
> strings and numbers, so I can format things like I am able to in some
> more civilized languages, that is, with out the use of a tilde and
> slashes =~s/u/c/k/s;  I am not judgemental, this is just my own humble
> opinion.  I believe in "each to his own", and I could be much more
> productive without tildes.

This is the stupidest complaint I've ever heard about perl.  Nonetheless...

You can avoid using tildes by only doing pattern matches on the $_ variable.

i.e.:

$foo = "hiya";
$_ = $foo;
if (/hiya/) {
  print "Hiya!\n";
}

You can avoid using slashes by using the m and s operators explicitly.

i.e.:

$foo = "hiya";
if ($foo =~ m{hiya}) {
  print "Hiya!\n";
}



Now, let's see you do something like handling pointers in C without
using * and &.

Chipmunk


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

Date: 10 Jan 1998 04:44:17 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Parsing a log file with / /
Message-Id: <qz$9801092323@qz.little-neck.ny.us>

Mark Thompson <mwt@webstylists.com> wrote:
> My main problem is that I'm not sure exactly what "($host, $rfc931,
> $authuser, $timestamp, $request, $status, $bytes) = /^(\S+) (\S+)
> (\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;" is actually doing.  

Let's rewrite it slightly (for the same funtionality):

( $host,  $rfc931, $authuser, $timestamp, $request,  $status, $bytes ) =
/^(\S+)\s (\S+)\s  (\S+)\s    \[(.+)\]\s  \"(.+)\"\s (\S+)\s  (\S+)\s/x;

Each parened group will be assigned to the variable in the line above it.

> =========This is the code========
> ($host, $rfc931, $authuser, $timestamp, $request, $status, $bytes) =
>         /^(\S+) (\S+) (\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;
> =======This is two lines of the log file, note that the only
 ...
> tc3-la33.linkline.com - - [09/Jan/1998:17:06:22 -0800] "GET /
> HTTP/1.0" 200 297 "-" "Mozilla/4.04 [en] (Win95; I)" GET / -
> "HTTP/1.0"

Without even reading your text to see what you think the problem is,
I have a lot of confidence that you are seeing .* being greedier than
the author intended. Rewriting your RE to not use .* will almost certainly
fix this:

#!/usr/bin/perl -w

$_='tc3-la33.linkline.com - - [09/Jan/1998:17:06:22 -0800] "GET /' .
   'HTTP/1.0" 200 297 "-" "Mozilla/4.04 [en] (Win95; I)" GET / -' .
   '"HTTP/1.0"';

( $host,  $rfc931, $authuser, $timestamp,   $request,     $status, $bytes ) =
/^(\S+)\s (\S+)\s  (\S+)\s    \[([^]]+)\]\s \"([^"]+)\"\s (\S+)\s  (\S+)\s/x;

print 
    "$host\n$rfc931\n$authuser\n$timestamp\n$request\n$status\n$bytes\n\n";

__END__

:r! perl -x %
tc3-la33.linkline.com
-
-
09/Jan/1998:17:06:22 -0800
GET /HTTP/1.0
200
297


Elijah
------
#!/usr/bin/perl -- -*- my ny.pm sig -*-
$_=$^ ;s;s;sss;;s^.^ju^&&s&P+&\n&&&(s(_..)(ers)||s|^|^^|)&&s(T)(q(st%eg))eg;
s<.(o).><$& new 1$$>i+s+\dst.+$a--||reverse(q(rep k))+ge;s*%.+u* so+*i;s=\++
="me"=mex&&s%ege%l$"hke%;$a||s/^\S+ /\/\//;s;\d+;yor;;s[KE]<ac$&>i;print $_;


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

Date: 10 Jan 98 05:08:06 GMT
From: "Peter Lanting" <lanting@ica.net>
Subject: password input module needed
Message-Id: <01bd1d85$dd5a9940$65d7f5cf@jedidiah>

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.

Can anyone tell me what this module is called and where to get it?
Does it work on Win32 as well?

Thanx
	- Pete


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

Date: Sat, 10 Jan 1998 04:45:00 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Perl CGI script's own directory
Message-Id: <34b6eebc.524144494f47414741@radiogaga.harz.de>

brian d foy (comdog@computerdog.com) wrote:
>MARTIN@RADIOGAGA.HARZ.DE posted:
>> There are a couple of related Perl CGI scripts that pull in other files
>> (e.g. for configuration) via require. 

> require()-ing files for configuration?  there are much better ways
> to do that.

Hmmm... apart from putting the path to the scripts into an environment
variable (which would break the self-sufficiency of the scripts), I
can't think of any.

What I meant by 'configuration' is that there are lots of values and subs
shared between scripts.

What did you have in mind?

>> Is there a (portable) way for a Perl CGI script to get the directory it's
>> situated in, in order to push it into @INC before attempting to require?

> there is the Cwd module.  see the documentation of the details.

I'm sorry to insist, but that's not what I asked for... What I'm looking
for is a way to get to the directory that the file of the currently
executed script resides in, not the current working directory.

The problem is that some web servers don't cd to the script's directory
before executing it (most prominently Mirco$oft's IIS, which's cwd is
always the cgi-bin directory, regardless of where the script resides).

Aaahhh... I just found FindBin! And it even is part of the standard
distribution!

Never mind.

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Sat, 10 Jan 1998 04:54:43 GMT
From: nospam@domain.com
Subject: Re: Perl to EXE
Message-Id: <naDt.86$Dy5.1315720@news3.voicenet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote:

: In comp.lang.perl.misc, 
: :WWW: http://www.demobuilder.com
: :This is where you can find it.

: Yes, but it doesn't do what you think it does.  What good 
: is a tar file with the a.out and script bundled together,
: or at least the moral equivalent of the same?


It's good because you can run a Perl script 
without first installing the Perl distribution. 
In some cases this might be worth doing. 

Maybe we don't care about speed of execution --
maybe we just have a short script that we need to run 
on an arbitrary machine, which does not have Perl.
In this case, a faux "compiler" might be handy. 

I'm assuming this "compiler" actually works... I haven't tried it. ;)
But it's a reasonable idea.  

--
##--------------------------------
##  John Nolan  
##  jpn acm org
##--------------------------------


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

Date: 10 Jan 1998 06:36:07 GMT
From: dmi@delta1.deltanet.com (Dean Inada)
Subject: Re: Q: search matching "(" and ")"
Message-Id: <6974sn$1tm$1@news01.deltanet.com>

In article <690ijf$65s$2@marina.cinenet.net>, Craig Berry <cberry@cinenet.net> wrote:
>Wow...this rather blows my mind.  I'd always thought that "balanced pair
>matching"  like this was beyond the scope of regexes by definition.  Can
>you provide an example regex, useable under 5.004, which will match a
>sequence of characters starting with '(' and ending with the balancing
>')', for arbitrarily nested parens? 
Here's an example useable under 4.036:

	($re=$_)=~s/(\()|(\))|./$1.$2/g;
	print ((/$re/)[0]);



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

Date: 10 Jan 1998 13:10:24 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: req: A) Perl/Tk B) Permanter Perl-Interpreter unter oSolaris
Message-Id: <oeed8i0fuu7.fsf@alpha.hut.fi>


the.tom@usa.net (TheTom) writes:
> Hi Alle,
> 
> ich suche 2 Sachen:

Aber wof|r spracht du Deutsch in diese Gruppe, comp.lang.perl.misc?

> A) Wo kann ich Perl/Tk fuer Win311 und WinNT kriegen/saugen?

	http://www.perl.com/CPAN/doc/FAQs/win32/

> B) Gibt es eine Moeglichkeit unter oSolaris (das is das SUN
> Unix OS) Perl als permanenten Prozess zu starten, soda_ der

Nat|rlich.  Du meinst eine Server, ja?

> Overhead des Ladeprozesses beim Starten eines Perl-Scripts
> entfaellt? Hierbei bin ich an ALLEN Infos interessiert...
> selbst wenn ich das Perl-Script dann via Socket-Connection
> an den Interpeter schicken muss.

Du ha_t Sicherheitsprobleme: wie kann du trauen das Perl-script?

> tia
> TheTom
> ---
> sig censored in physical layer --- The Stack


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


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

Date: 10 Jan 1998 06:11:58 GMT
From: "Leslie Chan" <adline@pc.jaring.my>
Subject: Search engine? Do u?
Message-Id: <01bd1d8e$87380940$21658ea1@jaring>

Any one have a really cool and fast search engine scripts? I'm looking for
one. Kindly give me a little bit of information if you have any...

Thank you.




Leslie
Please contact me at: adline@pc.jaring.my


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

Date: Sat, 10 Jan 1998 01:53:22 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Sorting Data File
Message-Id: <34B71AE1.9A842DCA@coos.dartmouth.edu>

Laurel Shimer wrote:
> 
> You can use the Unix sort command.

No, he can't.

> In article <34AB2DAC.1F4AB2FA@cybernex.net>, hudson@cybernex.net wrote:
> 
> > I don't have access to a sort utility on my platform...

Chipmunk


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

Date: 10 Jan 1998 04:07:51 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: weird problem!
Message-Id: <qz$9801092258@qz.little-neck.ny.us>

Ricky  <ric@megsinet.net> wrote:
> this is weird.  sometimes, my scripts don't work when they absolutely
> should.  does anyone know why this happens?  i mean an extremely simple,

Could be lots of things. 

> child's play script won't work like this one:
> 
> #!usr/local/bin/perl

I'd bet that works if the current directory is / (HINT).
You should have a '-w' on that, BTW.

> yet, this script on the same server in the same directory works.
> 
> #!/usr/local/bin/perl

This one should have a '-w' too.

> does anyone know why this happens.  i can't tell you how frustrating it
> is to look for a bug when none exists.  please help. . . anyone?

'perl -wc' is good for finding syntax errors. It would not have found
anything wrong with your script, which would have directed you to look
for non-perl related problems with it.

Elijah
------
perl -e 's Y Yreverse q N ny pm srekcah lrep kroy wen emosNYex and s Pmp ynP
P and s MsMjust sMx and print and s NYPM MPYN Nis or reverse and print q qq'


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

Date: Sat, 10 Jan 1998 15:28:49 +0100
From: "Paul Weingarten" <paulweingarten@hotmail.com>
Subject: WWW-pages generated by Perl-scripts
Message-Id: <884442496.688264@nn1>

It is very comforable to use a script that gets
data from a text file and writes it out as a HTML-page.
The updating procedure will be very easy, when
it is possible to get the data directly from a product
database etc.
Please take a look at this Perl-script:
#!/usr/bin/perl
$filename = "data.txt";
print "Content-type:text/html\n\n";
print <<HTMLHead;
<html>
<head>
<title>Monitors</title>
</head>
<body>
HTMLHead
;
open(INF,$filename);
@indata = <INF>;
close(INF);
print "<center>";
print "<table>";
print qq!<tr><td><FONT face="geneva,helvetica,arial">We are very good at
monitors.</FONT></td>\n!;
print "    <td><IMG src=\"monitors.jpg\"><p>&nbsp;</td>\n";
foreach $i (@indata) {
    chop($i);
   ($name,$description,$price,$picture) = split(/\|/,$i);
print <<HTMLProd;
<tr>
<td><FONT face=\"geneva,helvetica,arial\"
size=\"\+1\">$name<br>$price\:\-</font><P>
<FONT face=\"geneva,helvetica,arial\" size=\"\-1\">$description</font></td>
<td><IMG src=\"$picture\"></td>
</tr>
HTMLProd
;
}
print "</table></center>";
print "</body></html>";

The data file to get the datas from would have this format:
Sampo 17"|Big and nice|4400|sampo17.jpg
Sampo 15"|Good|4332|sampo15.jpg
Acer 15"|Nice price|2344|acer15.jpg

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?
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?

I would be very grateful for answers, please include the full
Perl-code since I am a beginner on Perl.
      // Paul





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

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

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