[7883] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1508 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 19 11:17:21 1997

Date: Fri, 19 Dec 97 08:00:25 -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           Fri, 19 Dec 1997     Volume: 8 Number: 1508

Today's topics:
     Re: <SELECT MULTIPLE >  Script only gives one value. Ca <rootbeer@teleport.com>
     ANNOUNCE: IndexMaker 4.0: an index.html maker from PDF, <pivari@geocities.com>
     Re: Can I use -d,-e,-s.... in WinNT ? <rootbeer@teleport.com>
     Re: Evaluate blank text? <merlyn@stonehenge.com>
     For the Perl programmer who has everything... <ebohlman@netcom.com>
     Re: Forcing list context (Gabor)
     Fun with arrays (Erik Y. Adams)
     Re: Happy Birthday Perl ? <rootbeer@teleport.com>
     Re: Happy birthday Perl! <eglamkowski@usa.net>
     Re: Help needed <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
     HELP!  Bitwise XOR (^) doesn't work on strings? (Brian Wheeler)
     Re: HELP! Bitwise XOR (^) doesn't work on strings? (Honza Pazdziora)
     Re: mysterious "Missing $ on loop variable" error <rootbeer@teleport.com>
     Re: mysterious "Missing $ on loop variable" error (Andrew M. Langmead)
     Re: Net::Cmd - package question? (Jeffrey R. Drumm)
     Re: No Flock! -- Now What? (Nathan V. Patwardhan)
     Re: parsing lisp expression (Tony Bass)
     PERL 5.00404 / BSDI 3.0 INSTALL <matt@monmouth.com>
     Re: perl and grabbing HTML files using a URL via the we <rootbeer@teleport.com>
     Re: Perl and Website ON W95 <mdgoutte@asi.fr>
     Re: printing quotes with print command <xxTony.Curtis@vcpc.univie.ac.at>
     Re: printing quotes with print command (Gabor)
     Re: printing quotes with print command (Tad McClellan)
     Re: Single key input on NT4.0 with ActiveWare Perl <rootbeer@teleport.com>
     Re: Teaching programing <mdgoutte@asi.fr>
     Re: unshift, @INC, require??? <mdgoutte@asi.fr>
     Re: unshift, @INC, require??? (Mark)
     Web Architects Needed <cgaston@lds.com>
     Re: Why isn't this working? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Dec 1997 07:05:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Stephen P. Clouse" <stephenc@granddesign.com>
Subject: Re: <SELECT MULTIPLE >  Script only gives one value. Can you help?
Message-Id: <Pine.GSO.3.96.971219070203.23972L-100000@user2.teleport.com>

On Thu, 18 Dec 1997, Stephen P. Clouse wrote:

> foreach $pair (split(/&/,$cgiin)) {
>     $pair =~ s/\+/" "/ge;
>     $pair =~ s/%(..)/pack("c",hex($1))/ge;
>     ($key,$val) = split(/=/,$pair,2);
>     $cgi{$key} .= "\000" if $cgi{$key};
>     $cgi{$key} .= $val;
> }
> 

That's _still_ not the right way to do the decoding. It's _still_ better
to use a module that does it right. Please, if you must post code to do
this without using a module, make sure that your code at least follows the
spec. 

    http://hoohoo.ncsa.uiuc.edu/cgi/

Thanks.

-- 
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/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 17:01:12 +0000
From: Fabrizio Pivari <pivari@geocities.com>
Subject: ANNOUNCE: IndexMaker 4.0: an index.html maker from PDF,HTML,VRML and other files
Message-Id: <349AA858.7566@geocities.com>

Hi,

I'm glad to announce the version 4.0 of IndexMaker a perl script to make
an index.html file from PDF, HTML, VRML and other files.
At the moment, it uses
the /Author field, the first /Title field and in the /Subject field
every matched PDF files,
the <TITLE> </TITLE> field and  the META Description and Author fields
in every matched HTML files
the Info node field in every matched VRML 1.0 files
the WorldInfo node field info and title in every matched VRML 2.0 files
and the name of the file in the others.
It should work with PERL 4 and 5.

What's new with version 4.0
Added the check to /Subject field in PDF files 
Now /Author, /Title, /Subject fields can be multiline fields 
Added a configuration file: option -c file (Default indexmaker.cfg)

This is the URL where you can find the tool
http://www.geocities.com/CapeCanaveral/Lab/3469

Enjoy it!
Have a nice Christmas and a happy new year!

Send me your suggestions.
-- 
     _/_/_/_/ _/_/_/     Fabrizio Pivari
    _/       _/    _/   mailto:pivari@hotmail.com
   _/_/_/   _/_/_/     mailto:pivari@yahoo.com
  _/       _/         mailto:pivari@geocities.com
 _/       _/         http://www.geocities.com/CapeCanaveral/Lab/3469/


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

Date: Fri, 19 Dec 1997 07:12:43 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Q-ball <a9438@mail.kscgeb.edu.tw>
Subject: Re: Can I use -d,-e,-s.... in WinNT ?
Message-Id: <Pine.GSO.3.96.971219071147.23972N-100000@user2.teleport.com>

On Fri, 19 Dec 1997, Q-ball wrote:

> Subject: Can I use -d,-e,-s.... in WinNT ?

Don't the release notes which came with your copy of Perl tell you whether
it supports those filetests? If not, first complain, then write a test
script that will tell you whether they work. :-)  Cheers!

-- 
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/
              Ask me about Perl trainings!



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

Date: 19 Dec 1997 06:58:37 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: stephenc@granddesign.com
Subject: Re: Evaluate blank text?
Message-Id: <8cpvmtsacy.fsf@gadget.cscaper.com>

>>>>> "Stephen" == Stephen P Clouse <stephenc@granddesign.com> writes:

Stephen> Since a null value always evaluates to false, just use:

Stephen> if (!($cgivar)) { gripe; }

Stephen> At least it works on every script I've written...

 ... until someone types in "0" in response to a field, and then
wonders why your script is complaining that it is "blank". :-)

Do as the others have suggested in this thread.  Something like:

	unless ($cgivar =~ /\S/) { ... }

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 256 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@ora.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: Fri, 19 Dec 1997 14:17:43 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: For the Perl programmer who has everything...
Message-Id: <ebohlmanELFx1J.HxC@netcom.com>

I stopped by the local F.A.O. Schwartz (upscale US toy retailer) and what 
did I see in the stuffed-animals section but an almost full-size 
(shoulders about five feet high) one-hump dromedary.  A little pricy, 
though: for $4000 you could get 100 copies of the famous book with its 
namesake on the cover and give them away to the kinds of newbie posters 
who wonder what a command line is.



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

Date: 19 Dec 1997 15:04:08 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: Forcing list context
Message-Id: <slrn69l2qe.co4.gabor@vinyl.quickweb.com>

In comp.lang.perl.misc, Peter Scott (psb@euclid.jpl.nasa.gov) on 19 Dec 1997 01:34:39 GMT writes:
# Okay, suppose you have a string you want to count the number of
# occurrences of a substring in, e.g., you want to find out how many
# "foo" there are in $s = "foofooraw for foodies".  Now $s =~ /foo/g
# will return a list of them, and we just want the size of the list;
# but doing $x = ($s =~ /foo/g) causes the /g modifier to be evaluated
# in scalar context (so it doesn't do any good to put "scalar" in there),
# and so it looks like one has to do my @a = ($s =~ /foo/g); my $x = @a;
# 
# It just rankles to name and create a new variable for this purpose;
# the laziness virtue in me thinks there has to be a way to do without.
# Is there?  What am I missing?

how about
$cnt = 0;
++$cnt while /foo/g;
print $cnt,"\n";

gabor.
--
    Oh, I'm totally outrageous -- I just never seem to inspire any
    outrage :-)
        -- Larry Wall


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

Date: Fri, 19 Dec 1997 07:35:41 -0800
From: erik@earthlink.net (Erik Y. Adams)
Subject: Fun with arrays
Message-Id: <erik-1912970735410001@pool015-max28.mpop2-ca-us.dialup.earthlink.net>

I'm writing a CGI to process some form input.  The form has multiple
values for some parameters.  I'm using CGI.pm to handle the gruntwork, but
I've hit on a question:  how can I get the number of elements in the array
returned by param()?

Perhaps this example will explain it better:

   use CGI;
   $q = new CGI;

   @num = $q->param('p'); # @num now contains all values for 'p' from form
   $num = $#num; # $num now equals the number of elements in the array

   $num = (@foo = $q->param('p')); # same thing

   $num = $#q->param('p'); # DOESN'T WORK
   $num = $#($q->param('p')); # DOESN'T WORK

So, I've got two ways to get what I want, but I keep thinking that there's
some clever combination of $#@()[]{} to get what I want:  the number of
elements in the array.

Any ideas?

Erik

-- 
----------------------------------------------------------
Erik Y. Adams                           erik@earthlink.net
Information Systems Consultant                626/795-2701
Internet and Intranet Specialist


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

Date: Fri, 19 Dec 1997 07:20:20 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Oliver Much <uzs7ci@ibm.rhrz.uni-bonn.de>
Subject: Re: Happy Birthday Perl ?
Message-Id: <Pine.GSO.3.96.971219071914.23972Q-100000@user2.teleport.com>

On 18 Dec 1997, Oliver Much wrote:

> Is it true that Perl celebrated its 10th anniversary on 12/18/97 ?

Yes, Perl 1.0 was released ten years ago, now. If you're still running
that version, it's time to upgrade.

-- 
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/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 09:59:56 -0500
From: the count <eglamkowski@usa.net>
Subject: Re: Happy birthday Perl!
Message-Id: <349A8BEC.300@usa.net>

Xah wrote:
> 
> If you have a computer science degree branded on your forehead, the
> following poetry isn't for you. It is intended for the poor citizens of the
> Perl Republic in celebration of Perl's 10th anniversary.
> 
> Perl is the most beautifully designed computer language. (never mind what
> Larry said) In fact, I think Perl's intricate beauty vaults computer science
> beyond the stage of comprehension.

So, what's everybody's favorite feature of perl?

I'm very fond of symbolic references myself.  Makes possible all sorts
of things that are very difficult, or even impossible, in most other
languages.


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

Date: Fri, 19 Dec 1997 06:25:43 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Help needed
Message-Id: <67e041$81v@bgtnsc02.worldnet.att.net>

You're very close. This *can* be a simple problem. The big trick is in
making sure you get the right match every time. In general, one way to do it
is:

Say you want to find what's between "foo" and "bar" in a string $baz. You
could do something like this:

$_ = $baz;
$match = /foo([.\n]*?)bar/ && $1;

$1 (called a backreference) refers to whatever is in the first pair of
parentheses in the latest match. If the regex match works, && passes flow
control to the second half of the operation, which effectively makes this
operation $match = $1. Also, you need to check for both . and \n when you're
doing the match because . doesn't match \n, and if you're searching a file
you may come across a number of \n's.

But it can get more complicated than that. Suppose you have something as
common as

$_ = "<I>This</I> string can <I>really</I> mess things up.";

If you try

$match = /<I>([.\n]*?)<\/I>/ && $1

of course you'll get "This". But did you want "This"? Or did you want
"really"? Or did you want "This</I> string can <I>really"? (In which case
you would use (.*) to perform a greedy match.)

The point of all this is, if you're using data that gets handed to you,
choose your match strings carefully. Usually this is fairly easy. Sometimes
it can be a challenge to your programming creativity. :D If you're creating
your own data, choose match strings that you can easily detect.

You'll probably want to check out the online FAQs, which have more
information about regular expressions. Jeffrey Friedl's "Mastering Regular
Expressions" book (from O'Reilly, of course) is an excellent reference, and
contains an entire (very long) chapter about Perl.

Hope this helps,

--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl


Katalin Nadassy wrote in message <349A5500.7FF19BA8@ebi.ac.uk>...
>Hello,
>
>
>I'm new here in this newsgroup and also new in using Perl. I would like
>to ask you for your help in the following problem: I would like to open
>a file search for a certain string and then from that point where the
>string is found extract the content of the file until another string
>found and write it to a file.
>I know that is probably a very easy problem, but I would appreciate any
>suggestions and help.
>
>Thank you very much !
>
>
>Best regards,
>
>
>Kati
>
>




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

Date: 19 Dec 1997 14:59:19 GMT
From: bdwheele@indiana.edu (Brian Wheeler)
Subject: HELP!  Bitwise XOR (^) doesn't work on strings?
Message-Id: <67e247$8hu$1@dismay.ucs.indiana.edu>

It doesn't seem to work as advertised.
consider this script:

$a="0";
$b="1";
print $a&$b,",",$a|$b,",",$a^$b,"\n";

it outputs:
0,1,

Shouldn't it output 0,1,1?  I need this for a project I'm working on, and the
Camel 2 says it should work....

Here's my perl version:

[webdev@rabbit Reports]$ perl -v

This is perl, version 5.004_04 built for alpha-linux

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
                                                                            


Thanks for any help!
Brian Wheeler
bdwheele@indiana.edu


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

Date: Fri, 19 Dec 1997 15:38:11 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: HELP! Bitwise XOR (^) doesn't work on strings?
Message-Id: <adelton.882545891@aisa.fi.muni.cz>

bdwheele@indiana.edu (Brian Wheeler) writes:

> It doesn't seem to work as advertised.
> consider this script:
> 
> $a="0";
> $b="1";
> print $a&$b,",",$a|$b,",",$a^$b,"\n";
> 
> it outputs:
> 0,1,
> 
> Shouldn't it output 0,1,1?  I need this for a project I'm working on, and the
> Camel 2 says it should work....

It works, only you do not know it ;-) Perlop man page says

	Binary "^" returns its operators XORed together bit by bit.

Hmmm. What are the bits in string "0"? And bits in "1"? Try to run the
output of your script via od -c to see what's going on.

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, 19 Dec 1997 07:18:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: mysterious "Missing $ on loop variable" error
Message-Id: <Pine.GSO.3.96.971219071512.23972P-100000@user2.teleport.com>

On Fri, 19 Dec 1997, Bart Lateur wrote:

> >+         foreach my $key ( keys %{$hashref} ) {

> I'm confused. Why would you need "my"? 

That code, without my(), would be an error under 'strict vars' unless $key
had been declared previously. And, of course, my() vars are more efficient
than globals in any case.

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/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 15:32:26 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: mysterious "Missing $ on loop variable" error
Message-Id: <ELG0I3.BM2@world.std.com>

bart.mediamind@tornado.be (Bart Lateur) writes:

>I'm confused. Why would you need "my"? If you don't use it, the variable
>is still local to the loop body. (That's right, as in local($key), not
>as in my($key)). As there is no sub call in the body, I don't see the
>need for "my".

But then the scope of the variable ends at the end of the loop, and
any further access will result in an error if "use strict 'vars'" is
enabled.

#!/usr/bin/perl -w
use strict;
# can use @lines or %count in entire file
my @lines = <>;
my %count;

for my $line (@lines) {
  my @words = split ' ', $line;
  for my $word (@words) {
    $count{$word}++;
  }
  # can no longer use variable $word.
}
# can no longer use either $line or @words

for my $word (sort {$count{$b} <=> $count{$a} } keys %count) { 
# can now use newly declared $word
# (added bonus: "for my $word" sounds like if could be useful in perl poetry.)
# the $a and $b are hacked in exceptions to use strict
  print "$word: $count{$word}\n";
}
#variable $word is now out of scope again.
-- 
Andrew Langmead


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

Date: Fri, 19 Dec 1997 14:19:37 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Net::Cmd - package question?
Message-Id: <349a7d3c.584933179@news.mmc.org>

On Thu, 18 Dec 1997 12:48:24 -0500, Alan Schneider <aschneid@geocities.com>
wrote:

>How can I use Net::Cmd with Net::Ftp?? I have all calls to Net::Ftp
>working fine. However, I am trying to catch "specific" error messages
>when ftp'ing (e.g., file or directory does not exist) and I am
>"ass?"uming that I should be using Net::Cmd to catch these error
>messages. Someone please give me a code snippet on how to use Net::cmd
>(message() seems to return what I want). It seems I cannot use a
>constructor to set up this object however??

The Net::Cmd methods are inherited by Net::FTP, and are available in your FTP
object.

So if you want to evaluate the message returned from a given $ftp->whatever,
simply check $ftp->message().

Anecdotal crap: I wrote an Email interface between an IBM VSE/ESA-based
mainframe (with FTP server support), and used quot() extensively for issuing
VSE/POWER commands; I then parsed the output returned via message().

Graham Barr has made my life soooooo much easier . . .

Here's the code snippet you requested . . . much deleted for brevity:

$ftp->login('acct','pass') or die $ftp->message();
my $rc = $ftp->quot("power d lst,cclass=$class");
if ($rc != 2) {
   logit('info','nothing queued to send');
  $ftp->quit;
  exit
}

my @listing = split "\n",$ftp->message();
shift(@listing); # get rid of the header
for (my $job = 0;$job < @listing;$job++) {
  my $JOB_T = "x11 A9 A6 x9 A6 x9 A*";
  my ($name,$quenum,$pages,$str) = unpack($JOB_T,$listing[$job]);
  yadda
  yadda
  yadda

-- 
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
420 Cumberland Ave, Portland, Maine 04101
Voice: 207-871-2150 Fax: 207-871-6501 Email: drummj@mail.mmc.org


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

Date: 19 Dec 1997 14:27:05 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: No Flock! -- Now What?
Message-Id: <67e07p$rcp@fridge.shore.net>

Steve (syarbrou@ais.net) wrote:
: Only Linux with perl 5.004_04 seems to support in on the UNIX end.
: Other versions like Sun OS have man pages and everything, but they
: don't work with multiple writes.  You end up loosing your log or it's

Only Linux ... I don't think so.  I'm sure that there are a number of
Unix folks who will disagree with you.  

--
Nathan V. Patwardhan
please don't send spam to pres@whitehouse.gov


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

Date: 19 Dec 1997 15:15:40 -0000
From: aeb@brains.cartoon.bt.co.uk (Tony Bass)
Subject: Re: parsing lisp expression
Message-Id: <67e32s$p8$1@brains.cartoon.bt.co.uk>

>From article <67deck$8nr$1@nntp1.ba.best.com>, by "Xah" <xah@best.com>:
> Is it feasible to use Perl to parse Lisp expression?

> For simplicity, let's say all atoms are just alphanumerics. Here is a sample
> expression,

> ((f 1 19) f2 (g h (2 5 9) 3))

> I want to bring out any of such expression's head outside the parenthesis
> and then change the paren to brackets, e.g. (f 1 2 3) becomes f[1 2 3]. The
> above sample becomes

> f[1 19][f2 g[h 2[5 9] 3]]

> and I also want to do the reverse operation. I'm wondering if it's feasible,
> say, by a Perl guru in a week? If not, is there in general a tool which I
> can do this?
> [...]

Assuming an otherwise unused character alternative to space is
available (tab in the example),

   calf$ cat try2
   #! /usr/local/bin/perl -w
   use strict;
   my $sexpr = '((f 1 19) f2 (g h (2 5 9) 3))';
   $sexpr =~ tr|\t| |;
   0 while $sexpr =~ s/\(([^ \(\)]*) *([^\(\)]*)\)/do {
    my $x = "${1}[$2]"; $x =~ tr| |\t|; $x; }/e;
   $sexpr =~ tr|\t| |;
   print "$sexpr\n";
   calf$


   calf$ try2
   f[1 19][f2 g[h 2[5 9] 3]]
   calf$ 

The reverse operation is left as an exercise.

    Tony Bass

-- 
# A E Bass                                      Tel: (01473) 645305
# MLB 3/19, BT Laboratories                     e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 7RE   DO NOT e-mail to From: line
#                                               Opinions are my own


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

Date: Fri, 19 Dec 1997 09:45:38 -0500
From: "Matthew Feinberg" <matt@monmouth.com>
Subject: PERL 5.00404 / BSDI 3.0 INSTALL
Message-Id: <67e15e$c82$1@news.monmouth.com>

I am trying to build perl 5.00404 under BSDI 3.0
I'm fine untill  make test, I run ./perl harness in ../t
Bellow are my results

My question is "Do I need 100% okay to build PERL or is there always going
to be some falure rate?"

Does anyone have experience with Perl 5 under BSDI 3.0 that can give some
pointers to make this work?

Output of ./perl harness:
Failed Test  Status Wstat Total Fail  Failed  List of failed
----------------------------------------------------------------------------
---
lib/anydbm.t      0   139    ??   ??       %  ??
lib/db-btree.t    0   139    ??   ??       %  ??
lib/db-hash.t     0   139    ??   ??       %  ??
lib/db-recno.t    0   139    ??   ??       %  ??
lib/filehand.t    0   139    11   10  90.91%  2-11
lib/io_sock.t     0   139    ??   ??       %  ??
lib/io_udp.t      0   139    ??   ??       %  ??
lib/io_xs.t       0   139    ??   ??       %  ??
lib/ndbm.t        0   139    ??   ??       %  ??
lib/opcode.t      0   139    ??   ??       %  ??
lib/ops.t         0   139    ??   ??       %  ??
lib/posix.t       0   139    ??   ??       %  ??
lib/safe1.t       0   139    ??   ??       %  ??
lib/safe2.t       0   139    ??   ??       %  ??
lib/sdbm.t        0   139    ??   ??       %  ??
lib/socket.t      0   139    ??   ??       %  ??
pragma/locale.t 139 35584    ??   ??       %  ??
Failed 17/153 test scripts, 88.89% okay. 10/4317 subtests failed, 99.77%
okay.

Matthew Feinberg
matt@monmouth.com




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

Date: Fri, 19 Dec 1997 07:22:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Frank Driver <fdriver@rnib.org.uk>
Subject: Re: perl and grabbing HTML files using a URL via the web
Message-Id: <Pine.GSO.3.96.971219072212.23972R-100000@user2.teleport.com>

On Fri, 19 Dec 1997, Frank Driver wrote:

> How do you get PERL to grab a HTML file from a URL 

Use the LWP module. 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/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 15:48:07 +0100
From: Marc de GOUTTES <mdgoutte@asi.fr>
Subject: Re: Perl and Website ON W95
Message-Id: <349A8927.7F5C@asi.fr>

Gilles Maire wrote:
> 
> Hi,
> 
> I have reinstalled my perl 5004 on my window 95 and when I execute a
> CGI I have a dos window and my script is excuted inside.
> Any idea please ?
> 
> Regards
> 
> GM
> 
> Amicalement
> 
>           Gilles.Maire@ungi.com
> |||||||||||||||||||||||||||||| - UNGI - ||||||||||||||||||||||||||||||
>           http://www.ungi.com

Maybe your reinstallation made some changes to your registers. Have a
look to the associations between file extensions and applications.
Marc de GOUTTES.
UNGI reader.
Affectueusement.


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

Date: 19 Dec 1997 15:07:52 +0100
From: Remove xx <xxTony.Curtis@vcpc.univie.ac.at>
To: bell@cet.com
Subject: Re: printing quotes with print command
Message-Id: <7xsorp77ev.fsf@vcpc.univie.ac.at>

Re: printing quotes with print command, Glen <bell@cet.com>
said:

Glen> Hello I hope you do not mind me asking a question
Glen> about perl.

Hmmmm, well, this _is_ a perl newsgroup :-)

Glen> I am trying to do this print NEWFILE " <body
Glen> bgcolor="#FFFFFF"
Glen> background="../backgrounds/ruff.jpg">"; but I get a
Glen> malformed header error. I am assuming this is because
Glen> of the quotes inside the quotes.  Is there a way to do
Glen> this and not cause an error.  I tried using %22 but
Glen> did not give me the proper background color or the

There's a number of ways of doing this.

You can

a) escape the quotes you want to appear in the output as \"

        print "string \"containing\" literal quotes\n";

b) use <<

        print <<EOT;
        string "containing" literal quotes
        EOT

c) use a different quoting character, e.g.

        print qq(string "containing" literal quotes\n);

and probably some other more obscure ones.

hth,
tony


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

Date: 19 Dec 1997 15:17:36 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: printing quotes with print command
Message-Id: <slrn69l3jm.co4.gabor@vinyl.quickweb.com>

In comp.lang.perl.misc, Glen Bell (bell@cet.com) on Thu, 18 Dec 1997 18:09:13 GMT writes:
# Hello
# 
# I hope you do not mind me asking a question about perl.
# 
# I am trying to do this
# print NEWFILE "  <body bgcolor="#FFFFFF" 
# background="../backgrounds/ruff.jpg">";
# but I get a malformed header error. I am assuming this is because of the 
# quotes inside the quotes.  Is there a way to do this and not cause an error.  
# I tried using %22 but did not give me the proper background color or the 
# background so i am assuming this was not correct.  Can you tell me how to do 
# this or if I can do it at all.

use either
print NEWFILE
    qq|<body bgcolor="#FFFFFF" background="../backgrounds/ruff.jpg">|;
or
print NEWFILE
    "<body bgcolor=\"#FFFFFF\" background=\"../backgrounds/ruff.jpg\">";
# 
# please E-Mail me at bell@cet.com if you can help
# 
done.


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

Date: Fri, 19 Dec 1997 09:07:54 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: printing quotes with print command
Message-Id: <ak2e76.jg6.ln@localhost>

Stephen P. Clouse (stephenc@granddesign.com) wrote:
: 
: Hash: SHA1

: On Thu, 18 Dec 1997 18:09:13 GMT in message <<67borr$dvj$2@legends.cet.com>
: comp.lang.perl.misc>, bell@cet.com (Glen Bell) wrote:

: >I am trying to do this
: >print NEWFILE "  <body bgcolor="#FFFFFF" 
: >background="../backgrounds/ruff.jpg">";
: >but I get a malformed header error. I am assuming this is because of the 
: >quotes inside the quotes.  Is there a way to do this and not cause an error.  
: >I tried using %22 but did not give me the proper background color or the 
: >background so i am assuming this was not correct.  Can you tell me how to do 
: >this or if I can do it at all.

: Escape the quotes with backslashes, like so:

: print NEWFILE "<body bgcolor=\"#FFFFFF\" background=\"./background.ruff.jpg\">"

: Of course, double quotes are only needed if you're doing variable interpretation
: inside the string, so since there aren't any variables in here you could also
: just single quote it:

: print NEWFILE '<body bgcolor="#FFFFFF" background="./background.ruff.jpg">'


There's two ways. I'll point out two more ways to be able to use
double quotes without escaping them, yet still get variable interpolation.

If the path to the background JPEG is in $bg ($bg = '../backgrounds/ruff.jpg'):


1) alternative double quote delimiters.

   print NEWFILE qq!<body bgcolor="#FFFFFF" background="$bg">!;

I used ! as the delimiter. Since that character is not in my string,
I won't need to escape it. The 'qq' marker informs perl that you 
want to use a delimiter different from the usual double quote.

There are other "markers" for using delimiters alternative to normal
single quotes and backwards single quotes.

These are described in the 'perlop' man page.



2) "here-doc"

print NEWFILE <<EOF;
<body bgcolor="#FFFFFF" background="$bg">
EOF

This is described in the 'perldata' man page.



--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 19 Dec 1997 07:08:26 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John Gordon White <whitej@lci.com>
Subject: Re: Single key input on NT4.0 with ActiveWare Perl
Message-Id: <Pine.GSO.3.96.971219070619.23972M-100000@user2.teleport.com>

On Thu, 18 Dec 1997, John Gordon White wrote:

> How can I do single key input from the keyboard?  

Does the entry in the FAQ give you any help?

    http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq5/
          How_can_I_read_a_single_characte.html

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/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 16:24:00 +0100
From: Marc de GOUTTES <mdgoutte@asi.fr>
Subject: Re: Teaching programing
Message-Id: <349A9190.44A7@asi.fr>

In fact, the question is : you have to teach programing to young
students TO DO WHAT ?
Do you want them to learn about :
- computers ?
- networks ?
- maths ?
- algorithms ?
- games ?
The language you should choose depend on your aims.
It will also depend on the duration of your courses : few hours by month
? by week ?
And, finally, it will depend on your pupils' curiousity ! Remember that
Programing may be fun, but it may be boring, as every science can be.

Marc de GOUTTES


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

Date: Fri, 19 Dec 1997 14:55:04 +0100
From: Marc de GOUTTES <mdgoutte@asi.fr>
Subject: Re: unshift, @INC, require???
Message-Id: <349A7CB8.3D0D@asi.fr>

Mark wrote:
> 
> : > unshift (@INC, "L:\scripts\mec", "L:\scripts\mec\subs",
> : >          "L:\scripts\mec\calendar\");
> : >
> : >
> : > Now it does not work,
> 
> : Try this code after (you've fixed :-) the line above, and see whether it
> : shows you what's going on. :-)
> 
> :     print "\@INC contains:\n", map "  $_\n", @INC;
> 
> Okay, I fexed the double qoutes. "->' but it still is not accessing
> the files in the other directories, so what else could be wrong.
> I am really at a loss here.
> 
> mark
> 
> --
> mec --gt2863a
> 

I had the same problem. I resolved it by executing unshift inside
"BEGIN", like this :

BEGIN {
unshift (@INC, "L:\scripts\mec", "L:\scripts\mec\subs",
         "L:\scripts\mec\calendar\");
}

Let me know if it works.

Marc de Gouttes.


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

Date: 19 Dec 1997 14:21:09 GMT
From: gt2863a@acmez.gatech.edu (Mark)
Subject: Re: unshift, @INC, require???
Message-Id: <67dvsl$rvr@catapult.gatech.edu>

: I had the same problem. I resolved it by executing unshift inside
: "BEGIN", like this :

: BEGIN {
: unshift (@INC, "L:\scripts\mec", "L:\scripts\mec\subs",
:          "L:\scripts\mec\calendar\");
: }

No this still does not work, this is exactly what I have
in the directory L:\scripts\mec\calendar\test.pl

#!/usr/local/bin/perl

print"Content-type: text/html\n\n";
BEGIN {
   unshift (@INC, 'L:\scripts\mec\subs');
}
require (test_too.pl);
print"<HTML><body>";
print"HELLO  WORLD";
print"<BR>";
&printtest;
print"</body></html>";

In this directory L:\scripts\mec\subs

I have this code

sub printtest{

print"HELLO AGAIN WORLD";

}
1;

Why won't this work. I also tried putting the path directly in the
require statment as follows 

require ('L:\scripts\mec\calendar\test_too.pl');

this doesn't work either. What is going on?!

HELP

mark



--
mec --gt2863a
 


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

Date: Fri, 19 Dec 1997 09:40:30 -0500
From: Chris Gaston <cgaston@lds.com>
Subject: Web Architects Needed
Message-Id: <349A875E.608CC9D1@lds.com>

Logical Design Solutions, a leader in the design and development
of Interactive Business Communications has immediate full-time
openings in their New York, NY and Morristown, NJ offices for
Web Architects.

Job Description:
In this visible role, the ideal candidate will possess 2+ years
experience in configuration of Internet technologies as part
of a multi-tiered information technology architecture.
Keeping up-to-date with current technology trends is
essential, as is the ability to evaluate appropriate technology
components for development and delivery environments.
This individual must also have the ability to integrate
application support technologies with preexisting client IT
infrastructure.  Experience with C/C++, Perl, HTML,
Java, CGI and knowledge of Internet protocols and standards
is required.  Knowledge of CORBA and Active X is a big
plus.

Send resume with cover letter and salary requirements to:

Technical Recruiter
Logical Design Solutions
Phone: (973) 971-0100
Fax:   (973) 971-0103
Email: recruiter@lds.com

For more information on this and other positions please visit:
http://www.lds.com




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

Date: Fri, 19 Dec 1997 06:58:53 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Guido Smit <guido@sportnet.nl>
Subject: Re: Why isn't this working?
Message-Id: <Pine.GSO.3.96.971219065532.23972K-100000@user2.teleport.com>

On Thu, 18 Dec 1997, Guido Smit wrote:

> Only the perl script is not doing what is should do.. 

That's very vague. What is it doing that you don't like?

> $privilege = USER_PRIV_USER;

Are you using a module which defined this? I recommend using 'use strict'
and -w to prevent this sort of thing from sneaking in as an error.

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/
              Ask me about Perl trainings!



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

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

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