[7260] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 885 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 18 13:17:23 1997

Date: Mon, 18 Aug 97 10:00:27 -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           Mon, 18 Aug 1997     Volume: 8 Number: 885

Today's topics:
     Re: Adding Modules for Distribution <rootbeer@teleport.com>
     Re: B-trees vs. hash tables? <pfeifer@ls6.informatik.uni-dortmund.de>
     Re: call other programms <tw36027@glaxowellcome.com>
     Re: call other programms <seay@absyss.fr>
     Can I return to a Perl program from a shell? <kerr_tung@sdt.com>
     Database <temp.ed.vanderbush@bentley.com>
     Don't understand error with hash prototypes (bug?) (Claudio Nieder)
     Re: Don't understand error with hash prototypes (bug?) <sfairey@adc.metrica.co.uk>
     Re: Getting a perl script to run with cron <tw36027@glaxowellcome.com>
     Re: Help compiling perl POSIX on Solaris (William Reardon)
     Re: Help: Dead Piped Processes <bargury@milcse.cig.mot.com>
     Re: how can I read compressed files in perl (Paul Marquess)
     Re: how to parse only the lines between <pre> and </pre <Harald.Joerg@mch.sni.de>
     Re: how to parse only the lines between <pre> and </pre <seay@absyss.fr>
     Re: HTML --> Perl conversion (Bart Lateur)
     Re: HTML --> Perl conversion <rootbeer@teleport.com>
     Re: Net::FTP documentation and examples <pfeifer@ls6.informatik.uni-dortmund.de>
     Re: perl -v seems to be lying <pfeifer@ls6.informatik.uni-dortmund.de>
     Slick way to return everything within matching parens (Jeffrey Horn)
     Re: Unix pwd <tw36027@glaxowellcome.com>
     Re: Unix pwd <rootbeer@teleport.com>
     window.location...........? <devli002@gold.tc.umn.edu>
     Re: window.location...........? <lilly@fedex.com>
     Re: window.location...........? <bsugars@sunpub.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 18 Aug 1997 08:44:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Clark Dorman <clark@s3i.com>
Subject: Re: Adding Modules for Distribution
Message-Id: <Pine.GSO.3.96.970818083903.25618R-100000@julie.teleport.com>

On 18 Aug 1997, Clark Dorman wrote:

> Installing perl itself is pretty easy, since I just tell them to do the
> ./configure, make, make install, and it works (at least in the one case
> I have tried). 

Don't forget to 'make test'! That only takes a moment, and it can save you
a lot of trouble in the long run. (In fact, you can save even more time by
simply replacing 'make' with 'make test' in your sequence above, rather
than doing the tests as a separate step.)

> However, as it stands, my code requires some of the non-standard
> modules.  What is the best way to bundle a non-standard module with
> the perl distibution to provide the least amount of work on the far
> end?  Let's say that I want Curses to be there.  How do I ensure that,
> along with the standard modules, that get's installed as well? 

Maybe you want to use CPAN.pm to make an automated installation utility. 
That could make it easy to download and install any needed modules. Hope
this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 17 Aug 1997 11:18:45 +0200
From: Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
Subject: Re: B-trees vs. hash tables?
Message-Id: <yfmvi15i2ve.ulp@gretchen.informatik.uni-dortmund.de>

>>>>> "Secret" == Secret Squirrel <nobody@secret.squirrel.owl.de> writes:

    Secret> Berkeley DB offers B-trees and hash tables as options.
    Secret> Why would one want to choose one over the other?

B-Trees are fine if you need to access the keys in sort order.

Ulrich Pfeifer
--
perl -e 'print map chr($_&=127), unpack "C*", pack "w", \
"28031325277245338375695089304165009203757780884355338"'


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

Date: Mon, 18 Aug 1997 11:36:54 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
To: Mathias Kuefner <kuefner@informatik.tu-muenchen.de>
Subject: Re: call other programms
Message-Id: <33F86C16.8608294@glaxowellcome.com>

If your on unix try

system 'otherProgram &';

The & should spawn a new process. Note, the perl process can end and the

spawned processes will not be automatically terminated, at least on Sun
OS 5.5.1.
I don't know if this is consistent behavior across all unix platforms.


Mathias Kuefner wrote:

> I tried to call other programms with perl,
> which just run in the background and dont give me anything back.
>
> The Problem is, that most/all commands that I have found,
> made the main program wait until the subprogram which was
> supposed to run in the background had been finished.
>
> Are there any common solutions for this?
> Do I have to  or  should I  use the fork command?
>
> Thanx!
>
> Mathias
>
> --
> --
> ------------------------------------------------------------------------
>
> Mathias Kuefner                     Munich University of Technology
> Elisabethstrasse 110                Department of  Computer Science
> D-85716 Unterschleissheim           Phone: +49 (089) 310 18 65
> Germany
> email: kuefner@informatik.tu-muenchen.de        IRC-Nickname: confusor
>
> URL:   http://www.informatik.tu-muenchen.de/~kuefner/





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

Date: Mon, 18 Aug 1997 18:33:27 +0200
From: Doug Seay <seay@absyss.fr>
To: Mathias Kuefner <kuefner@informatik.tu-muenchen.de>
Subject: Re: call other programms
Message-Id: <33F87957.B868DA5@absyss.fr>

[posted and mailed]

Mathias Kuefner wrote:
> 
> I tried to call other programms with perl,
> which just run in the background and dont give me anything back.
> 
> The Problem is, that most/all commands that I have found,
> made the main program wait until the subprogram which was
> supposed to run in the background had been finished.
> 
> Are there any common solutions for this?
> Do I have to  or  should I  use the fork command?

At a fundamental level, the system call fork is needed, but I doubt if
you need perl's fork().  The easiest way to have a child run in parallel
is open() or system(), depending on the level of interaction you need. 
If you use system(), don't forget the "&" at the end of the command.

- doug


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

Date: Mon, 18 Aug 1997 09:25:56 -0500
From: Kerr Tung <kerr_tung@sdt.com>
Subject: Can I return to a Perl program from a shell?
Message-Id: <33F85B74.43B0@sdt.com>

Hi all,

In my perl program, I have a system call to ClearCase setview command
which spawns a shell. How do I have it automatically exit the shell and
return back to my perl program to execute the commands followed?

Thanks,
Kerr


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

Date: Mon, 18 Aug 1997 12:05:24 -0400
From: Ed Vander Bush <temp.ed.vanderbush@bentley.com>
Subject: Database
Message-Id: <33F872C4.D9D@bentley.com>

I need to construct a database in perl that I can use to search one
column and then select a row from. Any resources I can go to or
examples???/


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

Date: 18 Aug 1997 14:54:48 GMT
From: claudio@srztm302.alcatel.ch (Claudio Nieder)
Subject: Don't understand error with hash prototypes (bug?)
Message-Id: <slrn5vgocc.209.claudio@srztm302.alcatel.ch>


Hi,

I don't understand, why the following perl script says 

Odd number of elements in hash list at ./x line 7.
a{1}=A
a{2}=B
a{3}=C

According to the prototype it requires two hash as parameter, which I
supply. As the prototype is \%% the first hash is passed as reference
while the second is not, so I should get 7 arguments, the reference
of the first hash and the 6 values from the 3 elements in the second
hash. In my($a,%b)=@_; the reference is assigned to $a so there should
be 6 arguments for %b. What did I miss in man perlsub?

				claudio

#!/opt/perl5/bin/perl -wT

use strict;

sub t(\%%)
{
 my ($a,%b)=@_;

 my $k;

 foreach $k (sort keys %$a) { print "a{$k}=$a->{$k}\n"; }
 foreach $k (sort keys %b) { print "b{$k}=$b{$k}\n"; }
}

my %x=(1=>'A',2=>'B',3=>'C');
my %y=(11=>'x',22=>'y',44=>'z');

t(%x,%y);


Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
  Platform:
    osname=hpux, osvers=9, archname=PA-RISC1.1
    uname='hp-ux tmnhp1 a.09.03 a 9000735 2014833415 two-user license '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=n useperlio= d_sfio=
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-D_HPUX_SOURCE -Aa -I/usr/local/include'
    ccflags ='-D_HPUX_SOURCE -Aa -I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='ld', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib
    libs=-lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.sl, so=sl
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=, ccdlflags='-Wl,-E -Wl,-B,deferred '
    cccdlflags='+z', lddlflags='-b -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under hpux
  Compiled at May 16 1997 18:00:20
  @INC:
    /opt/perl5.004/lib/PA-RISC1.1/5.004
    /opt/perl5.004/lib
    /opt/perl5.004/lib/site_perl/PA-RISC1.1
    /opt/perl5.004/lib/site_perl
    .
-- 
Claudio Nieder, Friesenbergstr. 75, CH-8055 Zuerich Tel: +41 1 465 3748
mailto:claudio.nieder@alcatel.ch http://tmnhp1.alcatel.ch/~claudio/


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

Date: Mon, 18 Aug 1997 16:12:51 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: claudio.nieder@alcatel.ch
Subject: Re: Don't understand error with hash prototypes (bug?)
Message-Id: <33F86673.41C6@adc.metrica.co.uk>

Claudio Nieder wrote:
> 
> Hi,
> 
> I don't understand, why the following perl script says
> 
> Odd number of elements in hash list at ./x line 7.
> a{1}=A
> a{2}=B
> a{3}=C
> 
> According to the prototype it requires two hash as parameter, which I
> supply. As the prototype is \%% the first hash is passed as reference
> while the second is not, so I should get 7 arguments, the reference
> of the first hash and the 6 values from the 3 elements in the second
> hash. In my($a,%b)=@_; the reference is assigned to $a so there should
> be 6 arguments for %b. What did I miss in man perlsub?
> 
>                                 claudio
> 
> #!/opt/perl5/bin/perl -wT
> 
> use strict;
> 
> sub t(\%%)
> {
>  my ($a,%b)=@_;
> 
>  my $k;
> 
>  foreach $k (sort keys %$a) { print "a{$k}=$a->{$k}\n"; }
>  foreach $k (sort keys %b) { print "b{$k}=$b{$k}\n"; }
> }
> 
> my %x=(1=>'A',2=>'B',3=>'C');
> my %y=(11=>'x',22=>'y',44=>'z');
> 
> t(%x,%y);
Without testing I would say this line is where your problem is. The
function is expecting a hash ref and a hash but you are supplying it
with 2 hashes. Try:

t( \%x, %y );

and see what happens.

Simon


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

Date: Mon, 18 Aug 1997 11:04:58 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
To: Mark Cantrell <Mark_Cantrell@fws.gov>
Subject: Re: Getting a perl script to run with cron
Message-Id: <33F8649A.AD96639C@glaxowellcome.com>

I don't know if this is going to help, but anyway,
a common mistake I always make with crontab, is not
executing my crontab command in the proper shell
environment.  I don't know what shell your using, but
if you are using the csh, for example try as an entry
in your crontab:

/bin/csh -c 'source ~/.cshrc; /absolutePerlPath/prog.pl'


Mark Cantrell wrote:

> To all,
>
> I am a novice UNIX type person, attempting to get a perl script to run
> on a
> DG running B1 Trusted DG/UX 5.4R3.10T OS.  I have entered the script
> using
> crontab -e and, while hacking through ED, it gets saved.  The job
> attempts
> to run as I can see by examining the /var/cron/log file however (and
> there
> is always a HOWEVER), the job doesn't run and the log file shows a
> rc=1
> code on the line.  I have even put a ls command instead of my perl
> script
> as the command in cron and it yields the same rc=1.
>
> I realize that this may be a broad question, but does anyone have a
> clue to
> what I might be doing wrong and what I need to do to fix it?  I have
> been
> many directions, and the one that I thought might be close was looking
> at
> the shell (when I saved the crontab job, it said at the bottom of the
> screen: WARNING:  Commands will be executed using /usr/bin/sh) but who
>
> knows if that has anything to do with it.  Have read the O'Reilly
> books -
> Armadillo, Camel and Llama, and can't find anything that might steer
> me in
> the right direction.
>
> e-Mail with any ideas would be appreciated.
> Mark_Cantrell@fws.gov
>
> Thank you all..





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

Date: Mon, 18 Aug 1997 16:03:00 GMT
From: wdr1@cs.uchicago.edu (William Reardon)
Subject: Re: Help compiling perl POSIX on Solaris
Message-Id: <EF49x0.IDt@midway.uchicago.edu>

In article <casper.871660736@uk-usenet.uk.sun.com>,
Casper H.S. Dik - Network Security Engineer <Casper.Dik@Holland.Sun.Com.No.SPAM.Or.Copies.By.Mail.Please> wrote:
>wdr1@cs.uchicago.edu (William Reardon) writes:
>>	Making POSIX (dynamic)
>>Note (probably harmless): No library found for -lposix
>>Note (probably harmless): No library found for -lcposix
>>Writing Makefile for POSIX
>>cc -c  -I/usr/local/include -O    -DVERSION=\"1.02\"
>
>It seems that /usr/local/include conflicts with /usr/include:
>
>>/usr/include/sys/termios.h:32: warning: `CTRL' redefined
>>/usr/local/include/sys/ttychars.h:65: warning: this is the location of
>>the previous definition
>
>
>It should include stuff like sys/ttychars.h from /usr/include.
>
>Try without -I/usr/local/include or use -I/usr/include -I/usr/local/include

	Hmmm, I tried doing both (with a "make realclean" & "rm
config.sh") before each, but with no luck.  When I set the cc flags to
use "-I/usr/include -I/usr/local/include" it no longer would
succesfully do a "make depends".  I didn't modify my lib path, but I
was wondering if I should do that.
	I compiled around POSIX using the -Uuseposix flag w/
Configure, and 97% of everything seemed to work.  I did get a few
other errors upon "./perl harness, though I'm not sure if they relate
to not having compiled POSIX or not:

b/db-btree........Can't load '../lib/auto/DB_File/DB_File.so' for
module DB_File: ld.so.1: ./perl: fatal: relocation error: symbol not
found: snprintf: referenced in ../lib/auto/DB_File/DB_File.so at
 ../lib/DynaLoader.pm line 155.

 at lib/db-btree.t line 12
BEGIN failed--compilation aborted at lib/db-btree.t line 12.
dubious
	Test returned status 2 (wstat 512)
lib/db-hash.........Can't load '../lib/auto/DB_File/DB_File.so' for
module DB_File: ld.so.1: ./perl: fatal: relocation error: symbol not
found: snprintf: referenced in ../lib/auto/DB_File/DB_File.so at
 ../lib/DynaLoader.pm line 155.

 at lib/db-hash.t line 12
BEGIN failed--compilation aborted at lib/db-hash.t line 12.
dubious
	Test returned status 2 (wstat 512)
lib/db-recno........Can't load '../lib/auto/DB_File/DB_File.so' for
module DB_File: ld.so.1: ./perl: fatal: relocation error: symbol not
found: snprintf: referenced in ../lib/auto/DB_File/DB_File.so at
 ../lib/DynaLoader.pm line 155.

 at lib/db-recno.t line 12
BEGIN failed--compilation aborted at lib/db-recno.t line 12.
dubious
	Test returned status 2 (wstat 512)


	After reading the hints file again, I noticed an older section
that mentioned I use try using /usr/ccs/bin/make instead of the GNU
version (which I had been), and that didn't seem to help either (in
fact, it didn't even get as far as the GNU version).  To my knowledge,
no libraries have been moved around or anything, and I'm pretty using
Solaris 2.5 w/ it's various default configurations.  Has anyone else
gotten perl5.004_01 running on Solaris 2.5?

Thanks,
-Bill

[myconfig included below incase that helps] 
Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
  Platform:
    osname=solaris, osvers=2.5, archname=sun4-solaris
    uname='sunos web 5.5 generic_103093-12 sun4m sparc
sunw,sparcstation-5 '
    hint=recommended, useposix=undef, d_sigaction=undef
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.7.2
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=7, d_casti32=undef, d_castneg=undef
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib -L/opt/gnu/lib'
    libpth=/usr/local/lib /opt/gnu/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib -L/opt/gnu/lib'
-- 
William Reardon							  wdr1@nhma.com
      Wedgies are unhealthy for children and other living things


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

Date: Mon, 18 Aug 1997 18:18:58 +0300
From: Yaniv Bargury <bargury@milcse.cig.mot.com>
Subject: Re: Help: Dead Piped Processes
Message-Id: <33F867E2.2B10D876@milcse.cig.mot.com>

First: You must never wait for input from a pipe.

If you read the pipe in line mode with <>, you need to make sure that
this read operation never blocks. It will block if it reads part of a
line. To avoid that you make sure that you write into the pipe a line at
a time. Assemble your lines ahead of time and then print them onto the
pipe with the "\n" in one instruction. Finally, make sure your lines are
small enough, so that they will not be broken into smaller chunks before
they travel the pipe. Just how small is small enough is machine
dependent.

Alternatively you can use non blocking  sysread().

Second: find out what happens on your architecture when a process at the
other end of the pipe dies. Most likely you will get a read event, but
when you attempt to read the pipe you get the empty string. This is the
indication that the the process at the other end died, or has put and
end of file indication onto the pipe. In any case the pipe should be
closed at that point.

Yaniv

David Tweedie wrote:

> Hi,
>
> I have a Perl/Tk program which creates a number of pipes to other
> process to read their output. These processes are continous, until
> explicitly closed. My problem is that occationaly one of the piped
> proceeses may fail, and this results in my main program freezing while
>
> waiting for output form the dead pipe.
>
> I'm wondering how I would go about avoiding this. I think that I would
>
> have to use the %SIG varaible, but I've been unsucccessful so far.
>
> Any help would be greatly appreciated.
>
> David





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

Date: 18 Aug 1997 15:38:13 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: how can I read compressed files in perl
Message-Id: <5t9q95$n37$1@pheidippides.axion.bt.co.uk>

[Posted & Mailed]

Bob Hannaford (bobh@metrica.co.uk) wrote:
: I am writting an application that needs to handle files compressed
: by the standard unix compress command and possible by 'gzip'.

: I have found the alpha version of a perl extension Compress::Zlib-0.50
: and successfully uncompressed 'gzip' files, does it also handle files
: compressed with the standard unix compress.  If so how do I do it?  I 
: have not been able to.

Nope. Compress::Zlib can only read gzip files.

: If Compress::Zlib-0.50 doesn't handle files compressed by the standard
: unix compress, what is a good way of doing the uncompress from perl?
: (Other than forking a process using the 'system' function which I will
: resort to, if all else fails.)

try

    open(F, "uncompress $file|") ;
    while (<F>) {
	...
    }
    close F ;

Paul


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

Date: Mon, 18 Aug 1997 17:14:09 +0200
From: Harald Joerg <Harald.Joerg@mch.sni.de>
To: Xu Chu <scip7075@leonis.nus.sg>
Subject: Re: how to parse only the lines between <pre> and </pre>
Message-Id: <33F866C1.67D@mch.sni.de>

Xu Chu wrote:
> 
> i wanna parse only the lines between a <pre> and </pre>. Look at the
> original files like this:
> <html>
> <head>head</head>
> <body>
> <map name="header">
> <AREA SHAPE=RECT COORDS="21,8,29,16" HREF="http://some.place.com/">
> </map>
> <pre>
> <a href="http://www.example.com/">example</a>
> </pre>
> 
> i am only interested in the url in the part between the <pre> and </pre>
> tags. but using the HTML::LinkExtor->new(\&callback) and set the tag
> comparing with 'a' will return both (http://some.place.com and
> http://www.example.com). how to solve the problem? pls help!! thanks.

First solution:
You can determine whether the link is in <PRE>...</PRE> with the 
is_inside method: The extract_links method passes a link value and 
a reference to the corresponding element to your callback routine.
  sub callback {
    my ($link,$linkelem)  =  @_;
    if ($linkelem->is_inside('pre')) { 
        # that's it!
    }

Second solution:
In a first traversal find the reference to the <PRE> element,
then traverse only this element:
use vars qw($pre);
$pre  =  0;
$html->traverse (sub {
    my ($node,$start)  =  @_;
    if (($start) && (ref $node) && ($node->tag eq 'pre')) {
        $pre  =  $node;
    }
    return 1;
   });
if ($pre) {
   $pre->traverse(\&callback);
}
Note that this method finds the last <PRE> block.
 
--
Oook,
--haj--


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

Date: Mon, 18 Aug 1997 18:05:29 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: how to parse only the lines between <pre> and </pre>
Message-Id: <33F872C9.3D29B8D2@absyss.fr>

Xu Chu wrote:
> 
> i wanna parse only the lines between a <pre> and </pre>. Look at the
> original files like this:
> <html>
> <head>head</head>
> <body>
> <map name="header">
> <AREA SHAPE=RECT COORDS="21,8,29,16" HREF="http://some.place.com/">
> </map>
> <pre>
> <a href="http://www.example.com/">example</a>
> </pre>
> 
> i am only interested in the url in the part between the <pre> and </pre>
> tags. but using the HTML::LinkExtor->new(\&callback) and set the tag
> comparing with 'a' will return both (http://some.place.com and
> http://www.example.com). how to solve the problem? pls help!! thanks.

$data =~ s/^.*<pre>//;
$data =~ s/</pre>$//;

what is left in $data is the stuff between the two tags.  Just parse
away until your heart is content.

- doug


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

Date: Mon, 18 Aug 1997 15:27:01 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: HTML --> Perl conversion
Message-Id: <33f967ca.836178@news.tornado.be>

ebohlman@netcom.com (Eric Bohlman) wrote:

>Bart Lateur (bart.mediamind@tornado.be) wrote:
>: Tom Phoenix <rootbeer@teleport.com> wrote:
>
>: ...
>: >    while (<HTML>) {		# Don't ask! :-)
>: >	chomp;
>: >	s/\\/\\\\/g;
>: >	print "$_\n";
>: >    }
>
>: haven't you forgotten about "$" and "@"?
>
>No, he remembered how to make them a non-issue:
>
>: >    print "#!/usr/bin/perl -w\n\nuse strict;\nprint <<'END_HTML';\n";
>                                                         ^        ^
>Backslashes are the only special characters in single-quoted strings 
>(well, single quotes are special characters as well, but not in 
>here-documents).

A Perl script that can ONLY produce an identical copy of a HTML file is
pretty useless. At least you need the possibility for variable
interpolation (= substitute by value, for ordinary people). For this,
you must take these characters into account, plus change the above line
to:

 print "#!/usr/bin/perl -w\n\nuse strict;\nprint <<END_HTML;\n";

	Bart.


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

Date: Mon, 18 Aug 1997 08:05:45 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: HTML --> Perl conversion
Message-Id: <Pine.GSO.3.96.970818080500.25618O-100000@julie.teleport.com>

On Mon, 18 Aug 1997, Bart Lateur wrote:

> A Perl script that can ONLY produce an identical copy of a HTML file is
> pretty useless.

And thus I said in my original posting. It was explicitly not intended to
do more than that.

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 17 Aug 1997 11:15:06 +0200
From: Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
Subject: Re: Net::FTP documentation and examples
Message-Id: <yfmwwlli31h.ulp@gretchen.informatik.uni-dortmund.de>

>>>>> "TP" == Tom Phoenix <rootbeer@teleport.com> writes:

    TP> I don't think they're on the web in a browser-readable form,
    TP> but I haven't looked. :-)

Try http://ls6.cs.uni-dortmund.de/CPAN.html
You should be able to access (nearly) all POD from CPAN.

Ulrich Pfeifer
--
perl -e 'print map chr($_&=127), unpack "C*", pack "w", \
"28031325277245338375695089304165009203757780884355338"'


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

Date: 17 Aug 1997 10:38:40 +0200
From: Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
Subject: Re: perl -v seems to be lying
Message-Id: <yfmyb61i4q7.ulp@gretchen.informatik.uni-dortmund.de>

>>>>> "EtB" == Eli the Bearded <usenet-tag@qz.little-neck.ny.us> writes:

    EtB> I am strongly guessing that perl is finding the libperl.so from
    EtB> my previous version, but I do not want to remove that until I
    EtB> can complete 'make test'. Unfortuneately 'make test' has lots
    EtB> of tests that check the version number.... The LD_LIBRARY_PATH
    EtB> variable seems to be ignored.


You probably changed the 5.004_01 in the library paths to be 5.004.  I
moved the libperl.so temporary for running the tests when I did run in
this. But other perl scripts will not work until you reinstall the
libperl.so. You may edit you old perl binary to reflect the new path
to libperl.so ;-)

Ulrich Pfeifer
--
perl -e 'print map chr($_&=127), unpack "C*", pack "w", \
"28031325277245338375695089304165009203757780884355338"'


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

Date: 18 Aug 1997 16:16:09 GMT
From: horn@beaner.cs.wisc.edu (Jeffrey Horn)
Subject: Slick way to return everything within matching parens
Message-Id: <5t9sg9$l66@spool.cs.wisc.edu>

I am looking for a way to match everything within parens starting from
the first open paren "(" and going through the matching closing
paren ")".

For instance I want an input string like "(x+7*(a+b/c)+y*(x-y))-7" to
return "(x+7*(a+b/c)+y*(x-y))" instead of just "(x+7*(a+b/c)" which is
what I get if I just use \) in a pattern match.  I've written a routine
which goes through character by character counting the number of parens
open and closed and terminating when the difference goes to zero.

-- Jeff Horn
-- 
Jeffrey Horn (horn@cs.wisc.edu)        |BELZER,BERNHARDT,BOETTCHER,DRAVIS,FETTER
PHONE:(608) 244-8420                   |GAPINSKI,GAUGER,HARMS,HIRSCHINGER,HORNE
FAX:  (608) 221-5008                   |JUECH,KLAJBOR,KROIS,KRONING,LEMKE,RUNGE
http://www.cs.wisc.edu/~horn/horn.html |STOCK,TAUBERT,TRESKE,WILLMERT,ZILLMER


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

Date: Mon, 18 Aug 1997 11:11:56 -0400
From: Thad Welch <tw36027@glaxowellcome.com>
To: Michael Danielsson <Michael.Danielsson@ein.ericsson.se>
Subject: Re: Unix pwd
Message-Id: <33F8663C.BACDEBD4@glaxowellcome.com>

To do this by the book:
use Cwd;

$dir = cwd();
print "\n $dir \n";

If you don't have Cwd module, try (if your on unix)

chop($dir = `pwd`);




Michael Danielsson wrote:

> I would like to check if i am standing in the directory /tmp. How do I
>
> do this in perl.
>
> /Michael
> --
> ----------------------------------------------------------------------
>
> Michael Danielsson          tfn:    +46 54 29 43 64
> Ericsson Infotech AB        fax:    +46 54 29 40 01
> Box 1038
> S-651 15 KARLSTAD           memo: (Ericsson internal) ERI.EIN.EINMIDA
> SWEDEN                      mailto:Mikael.Danielsson@ein.ericsson.se
> ----------------------------------------------------------------------





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

Date: Mon, 18 Aug 1997 09:52:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Danielsson <Michael.Danielsson@ein.ericsson.se>
Subject: Re: Unix pwd
Message-Id: <Pine.GSO.3.96.970818095110.25618X-100000@julie.teleport.com>

On Mon, 18 Aug 1997, Michael Danielsson wrote:

> I would like to check if i am standing in the directory /tmp. How do I
> do this in perl. 

I don't know how you do it, but I use the CWD.pm module. :-)  Try the
command 'perldoc CWD' for more information. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 18 Aug 1997 09:47:10 -0700
From: John Devlin <devli002@gold.tc.umn.edu>
Subject: window.location...........?
Message-Id: <33F87C8E.6C74@gold.tc.umn.edu>

Senerio:  I have a page (page1) that calls another page (page2).  When
page2 is loaded, javascript is executed displaying a confirmation
messagebox.  In the javascript, if the user selects ok, I set the
window.location to a specific location.  If not, I set window.location
to different location.

Problem:  In Win3.1 using Netscape 3.0, this works fine.  I am having a
problem when trying to run this using Netscape 3.0 on WinNT.  When the
OK or Cancel buttons are pressed, the browser acts as if it was trying
to load a page but doesn't.  The browser seems to be waiting for another
user event when the ok or cancel button is pressed before executing the
window.location.  If I click once on the cancel or ok button, and then
press the keyboard or click anywhere on the screen, the window.location
works fine.  I found that if I double click on the buttons, everything
executes wonderfully.  Any idea what is going on?  

Thanks.....JOHN


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

Date: Mon, 18 Aug 1997 10:31:23 -0500
From: Dave Lilly <lilly@fedex.com>
Subject: Re: window.location...........?
Message-Id: <33F86ACB.794B@fedex.com>

John Devlin wrote:
> 
> Senerio:  I have a page (page1) that calls another page (page2).  When
> page2 is loaded, javascript is executed displaying a confirmation
> messagebox.  In the javascript, if the user selects ok, I set the
> window.location to a specific location.  If not, I set window.location
> to different location.
> 
> Problem:  In Win3.1 using Netscape 3.0, this works fine.  I am having a
> problem when trying to run this using Netscape 3.0 on WinNT.  When the
> OK or Cancel buttons are pressed, the browser acts as if it was trying
> to load a page but doesn't.  The browser seems to be waiting for another
> user event when the ok or cancel button is pressed before executing the
> window.location.  If I click once on the cancel or ok button, and then
> press the keyboard or click anywhere on the screen, the window.location
> works fine.  I found that if I double click on the buttons, everything
> executes wonderfully.  Any idea what is going on?
> 
> Thanks.....JOHN

Hmm...you know what?  That's not a Perl question.  Please keep that to a
javascript related newsgroup...

Thanks

-dave


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

Date: Mon, 18 Aug 1997 12:34:58 -0400
From: Benjamin Sugars <bsugars@sunpub.com>
Subject: Re: window.location...........?
Message-Id: <33F879B2.6E48@sunpub.com>

John Devlin wrote:
>
[ ... a bunch of javascript-related stuff deleted ... ]
>

My only guess is that you mistakenly posted to the wrong newsgroup
(this is comp.lang.perl.misc).

Followups to comp.lang.javascript.

-Ben

--
Ben Sugars <bsugars@canoe.ca>
Senior Webmaster,
CANOE Canadian Online Explorer,
http://www.canoe.ca/


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

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

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