[7803] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1428 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 6 12:17:09 1997

Date: Sat, 6 Dec 97 09:00:24 -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, 6 Dec 1997     Volume: 8 Number: 1428

Today's topics:
     [Q] MacPerl Dialog Item Manipulations (Alviani, Frank)
     Re: \n under Activeware and Sarathy ports <elaine@planete.qc.ca>
     Re: \n under Activeware and Sarathy ports (Gurusamy Sarathy)
     BSD/OS 3.0 killing Perl script? ajni@iquill.net
     Re: Cross-platform way of interacting with user? <bowlin@sirius.com>
     Re: FORM MAIL for Novell Web Server <pvhp@forte.com>
     formmail - IE works, netscape doesn't (Greg Vinson)
     Re: graphic file dimensions in PERL? coulem@videotron.ca
     Help Perl beginner <jones-joe@usa.net>
     Re: Help Perl beginner <jong@mrc-lmb.cam.ac.uk>
     HELP! I'm trying to customize/modify a shopping cart sc jay@secure800.com
     Re: How To Test if number is ODD or EVEN? fil_nospam@login.net
     Re: HTTP/1.0 500 Server Error (blahblah.cgi is not a va <bowlin@sirius.com>
     Re: Inserting only the unique elements into an array .. <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
     Re: NEWBIE can't tar latest_tar.gz <dha@panix.com>
     odbc and system dsn <benoit@decollage.org>
     passing/returning a list of hashes to subs (how?) (Simon Oosthoek)
     Re: Perl editor needed (Michael Ng)
     Re: PERL Frusterations (semi-newbie) <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
     Re: Perl on Win32 using Watcom v. 11 (Philip Gwyn)
     Re: Perl4 is not Y2K (was Re: Forced to use brain-dead  (Philip Gwyn)
     problem with my() and s// (Iosif Fettich)
     Re: replacement for fork() on NT? (Michael Ng)
     Re: Web Discussion Board with RFC1867 file upload <billg@networkapparel.com>
     Win32 - Unable to use NetAdmin (Expect on local system) <fbellomo@home.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 05 Dec 1997 15:56:54 -0600
From: alviani@ix.netcom.com (Alviani, Frank)
Subject: [Q] MacPerl Dialog Item Manipulations
Message-Id: <alviani-ya02408000R0512971556540001@nntp.netcruiser>

Hello all,

A question for all the MacPerl gurus out there:

I've recently started working with MacPerl to do a tool which involves a
good deal of (below the surface) text manipulation. I need to have this
tool operate as a standard Mac application. Learning Perl is great fun, but
I have a question that specifically involves the MacPerl extensions that
interface with the Mac toolbox.

For the quicky interface involved, I'm using a dialog with a series of
buttons to invoke subroutines for the different discrete steps of the
processing involved (nothing exceptional here, except how compact it is in
MacPerl!) My problem involves working with the controls in the dialog,
beyond invoking a routine for a hit. I'd like to be able to enable/disable
certain buttons during the course of the user interaction, and need to
maintain at least 1 set of radio buttons. With straight C/Pascal code, this
is simple - pass a typecast itemHandle to the appropriate control manager
functions.

My question is simple - how do I do this in MacPerl? Simply passing the
itemHandle of an item to one of the Mac::Controls functions doesn't work,
as it isn't a CONTROL created within Perl. Trying to get a CONTROL by
getting it from the dialog bombs rather quickly. The documentation is quite
unclear on this, and the samples are too simple to be useful (for one
thing, they don't have any samples for checkboxes or radio buttons). If
someone could point me to an actual application that does this kind of
manipulation I'd be eternally grateful (but not dead...). Any other "how
to" demonstration would be equally delightful.

Thanks in advance,
Frank Alviani


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

Date: Sat, 06 Dec 1997 01:10:04 -0500
From: Elaine Lemire <elaine@planete.qc.ca>
To: Gurusamy Sarathy <gsar@engin.umich.edu>
Subject: Re: \n under Activeware and Sarathy ports
Message-Id: <3488EC3C.8238F88C@planete.qc.ca>

> =head2 Why won't my perl understand wildcards in arguments?
Yes, I realized all of that.  It's just that ActiveWare's port globbed
and your's doesn't.  For the record, I now use your port nearly
exclusively.  Going the extra mile and geting LWP and TK to work is very
very appreciated.

> Instead, the following solution works rather well. The nice things
> about it: 1) you can start using it right away 2) it is more powerful,
> because it will do the right thing with a pattern like */*/*.c
> 3) you can decide whether you do/don't want to use it 4) you can
> extend the method to add any customizations (or even entirely
> different kinds of wildcard expansion).
I wrote something very similar.

However, one draw-back to this approch is that you have to modify every
script that was writen for Unix or the ActiveWare port.  It would be
nice to make the transition form Unix to Win32 as transparent as
possible.
  
> >And asciimode files come out strange, say you have \r\r in
> >a file... or \r\r\n.
> >
> 
> You'll have to be a little more specific than that.  If the Activeware
> port strips them and the standard port doesn't, it's most likely a
> difference in the compilers used to build the two.  Perl has never
> done any explicit stripping of \r's.(*)

ActiveWare converts \r\n into \n and leaves any other \r alone.  This is
the behaviour I've come to expect from my experiance as a DOS programer.

Your port seems to strip any \r from the input.  

> (*) It might treat \r's just like other whitespace one of these days.
> Larry has spoken.
IMHO, this a very unix-centric approch and a very bad idea.  Better yet
would be to allow \n to represent the three EOL platform-specific
markers in the input and the platform-specific representation on the
output (\r for Mac, \n for Unix, \r\n for DOS, Win32 and OS/2 (what do
Amigas use?))

One side-effect of this is that you would be able to convert any text
file into the native EOL format with only:
    perl -pi.bk file.txt

Sound far out?  Maybe.  But don't forget that in C, \n isn't nessecarily
the same thing as \x0A.

-Philip


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

Date: 6 Dec 1997 07:24:10 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: \n under Activeware and Sarathy ports
Message-Id: <66auiq$elg@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <3488EC3C.8238F88C@planete.qc.ca>,
Elaine Lemire  <elaine@planete.qc.ca> wrote:
>> Instead, the following solution works rather well. The nice things
>> about it: 1) you can start using it right away 2) it is more powerful,
>> because it will do the right thing with a pattern like */*/*.c
>> 3) you can decide whether you do/don't want to use it 4) you can
>> extend the method to add any customizations (or even entirely
>> different kinds of wildcard expansion).
>I wrote something very similar.
>
>However, one draw-back to this approch is that you have to modify every
>script that was writen for Unix or the ActiveWare port.  It would be
>nice to make the transition form Unix to Win32 as transparent as
>possible.

But the solution I showed _is_ transparent.  You fit it in your %ENV
once and forget about it.  Perhaps you're missing the significance
of $ENV{PERL5OPT} ? (it's new in 5.004.)

>> difference in the compilers used to build the two.  Perl has never
>> done any explicit stripping of \r's.(*)
>
>ActiveWare converts \r\n into \n and leaves any other \r alone.  This is
>the behaviour I've come to expect from my experiance as a DOS programer.
>
>Your port seems to strip any \r from the input.  

I have verified that this is the behavior of the Borland RTL that is used
for the binary distribution.  You can always build the latest perl
sources using Visual C++, if you really want the other behavior.  I
consider putting raw \r's in text files (and expecting them to stay put)
very risky, so it's not clear why you're doing such a thing deliberately.

>> (*) It might treat \r's just like other whitespace one of these days.
>> Larry has spoken.
>IMHO, this a very unix-centric approch and a very bad idea.  Better yet
>would be to allow \n to represent the three EOL platform-specific
>markers in the input and the platform-specific representation on the
>output (\r for Mac, \n for Unix, \r\n for DOS, Win32 and OS/2 (what do
>Amigas use?))

Pardon me for not explaining fully; the approach you describe is part
of the big plan for dealing with line terminations in general.  The part I
was describing has to do with making perl sufficiently flexible in what
it considers 'whitespace', so that source with all three major terminations
will parse on all platforms.  You should look in the p5p archives for
details of the discussion, if interested.

 - Sarathy.
   gsar@umich.edu


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

Date: Sat, 06 Dec 1997 00:41:57 -0600
From: ajni@iquill.net
Subject: BSD/OS 3.0 killing Perl script?
Message-Id: <881389947.2115@dejanews.com>

Hello. I've written a Perl TCP/IP program which is supposed to run in the
background. It runs with no problem on Slackware Linux 2.0.29/Perl 5.003.
However, when I try to run it on BSD/OS 3.0 and Perl 5.004 or 5.003, it
just stops running after a while, with a "Killed" message (no core dump).

I'm still trying to rewrite the thing, but I was wondering if anyone has
come across this particular problem. Please do let me know...

Thanks!

- Alex

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


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

Date: Sat, 06 Dec 1997 01:40:13 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: John Brownie <john.brownie@pp.inet.fi>
Subject: Re: Cross-platform way of interacting with user?
Message-Id: <34891D7D.BE416D4@sirius.com>

How about using a Java interface.  This should be consistent
across platforms.  I know Selena Sol has made a Java to Perl bridge
available.  I think it was designed for applets, but you must be
able to use it to let a Java application talk with a Perl application.

I suppose that this assumes that MacPerl supports sockets.


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

Date: Sat, 06 Dec 1997 00:13:28 -0800
From: Peter Prymmer <pvhp@forte.com>
To: gdoucet@ait.acl.ca
Subject: Re: FORM MAIL for Novell Web Server
Message-Id: <34890928.7184@forte.com>

Guy Doucet wrote:


> Well, I found a SENDSMTP.PL script (part of a Toolkit v.2) from Novell's web
> site at:
> 
>   http://support.novell.com/Ftp/Updates/nwos/nwebs30/Date0.html
> 
> The script asks for a MAILHOST that will accept and forward SMTP mail. The
> script apparently uses the basic SMTP (HELO) as opposed to the enhanced
> (EHLO). Don't ask me what all that means. But nonetheless when I enter the
> IP address of my internet provider's MAIL server here in Canada (iStar), the
> script comes back and says "Error: Mail command failed sending: HELO"  and
> also "501 syntactically invalid HELO argument(s)". Apparently the istar mail
> server is a POP3 Server if that means anything. I don't expect anyone to
> download the script and troubleshoot it, but if any of the above means
> anything to you, would you shed some light on me.
> 
> Thank you
> Guy Doucet


The HELO stuff is a part of the latest protocol spec for SMTP via TCP/IP
(translation: email via internet protocols).  The original spec was in a
document called "RFC 822" but there are RFCs that supercede that one.
POP is a Post Office Protocol and is a bit newer. It is typically run
between a bigger higher powered POP mail server and wimpier client
desktop computers.  POP clients (email fetchers) exist for Macs and
MS-OS PCs.  Novell is most famous for their own IPX networking protocals
(that are not TCP/IP) hence it sounds like you are missing a program or
two that should be running on your server and doing something like a
IPX<->TCP/IP conversion, or perhaps there is a simple POP server that
you can run on your Novell Server. 

I personally am not really familiar with Novell products but I did see
that they ported perl 5 to Netware as a Netware Loadable Module (NLM)
That I have never seen anybody run.  Can you get basic 

   print "hello world\n";

scripts to run under the perl 5 NLM?  If so then your server trouble may
not lie with the perl programming language or installation but with the
networking configuration that you have set up.

Peter Prymmer


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

Date: 6 Dec 1997 13:43:57 GMT
From: vinsong@olympus.not.spam (Greg Vinson)
Subject: formmail - IE works, netscape doesn't
Message-Id: <vinsong-0612970606520001@ptpm028.olympus.net>

Hi,

I am a newbie to CGI's. I wrote a page following my ISP's instructions to
utilize their FormMail script.

It works in Internet Explorer but not Netscape. Am I doing something
really dumb or what? Any ideas will be appreciated. My ISP charges $90 an
hour for support. Big mistake signing up with them but I am stuck for the
time-being.

Please reply via e-mail (fixing typos). Thanks in advance.

--Greg

-- 
Greg Vinson                    <greg@vinson.completely.tired.of.spam>
           (fix typos to reply)
In Touch Enterprises        <http://www.olympus.not/personal/vinsong>
Home of 'Guide to Beadwork'        (over 6000 sold!)       /bead.html
Webscans Scanning  (1 cent per square centimeter)        (not = net)
and Hosting Services     ($20 per month)    <http://www.webscans.net>


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

Date: Sat, 06 Dec 1997 06:46:32 GMT
From: coulem@videotron.ca
Subject: Re: graphic file dimensions in PERL?
Message-Id: <3488f434.61991233@news.videotron.ca>

On Sat, 6 Dec 1997 02:59:35 +0000, Mark Worsdall
<jaydee@worsdall.demon.co.uk> wrote:

>It's alright you lot constantly saying use this module, use that module,
>but I cannot get the modules installed into my local-cgi-bin and my
>administrator hasn't done it either so I always end up with permissions
>problems.
>
>So how about other ways of doing things? Please...

Install it somewhere you have write permissions.  Then put
use lib qw(/path/to/your/lib/dir);
at the top of your CGI.  Or put
BEGIN { push @INC, qw(/the/path/thing/like); } 
if you don't have 5.004.

-Philip


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

Date: Sat, 06 Dec 1997 06:13:39 -0700
From: JJ <jones-joe@usa.net>
Subject: Help Perl beginner
Message-Id: <34894F83.22C2@usa.net>

Went and bought all kinds of books and want to start. Quesition is can I
can I do this on a windows 95 computer and have perl do all the
commands! 
Thank you 
JJ


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

Date: Sat, 06 Dec 1997 13:59:53 +0000
From: Jong <jong@mrc-lmb.cam.ac.uk>
To: jones-joe@usa.net
Subject: Re: Help Perl beginner
Message-Id: <34895A59.2847@mrc-lmb.cam.ac.uk>

JJ wrote:
> 
> Went and bought all kinds of books and want to start. Quesition is can I
> can I do this on a windows 95 computer and have perl do all the
> commands!
> Thank you
> JJ


Yes, see perl for win32

Jong

-- 
===================================================
     http://www.mrc-lmb.cam.ac.uk/genomes


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

Date: Sat, 06 Dec 1997 08:01:35 -0600
From: jay@secure800.com
Subject: HELP! I'm trying to customize/modify a shopping cart script, and I can't get up!
Message-Id: <881414186.12925@dejanews.com>

Everybody has to start somewhere.  I just started this job.  I was hired
to learn and maintain some "simple" html stuff.  Please look at
http://www.secure800.com/shop/frontpage.cgi and step through the process
of order entry.  WHY CAN'T I GET THE VALUE $subtotal to appear in the
HIDDEN "amount" field at the bottom of the order form in cart.cgi?  I
know it's probably something really simple.  P-L-E-A-S-E  H-E-L-P !!!

Jay Gilbert

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


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

Date: Sat, 06 Dec 1997 07:03:02 GMT
From: fil_nospam@login.net
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <3488f574.62311208@news.videotron.ca>

On Wed, 3 Dec 1997 12:15:32 -0500, phenix@interpath.com (John Moreno)
wrote:

>Ken Fox <fox@pt0204.pto.ford.com> wrote:
>
>> branderr@cuug.ab.ca (Roy Brander) writes:
>> > Ken Fox (fox@pt0204.pto.ford.com) wrote:
>> > : jay@dixonssurgical.co.uk (Jay Dixon) writes:
>> > : > I want to test if a variable is Odd (or Even)
>> > : 
>> > : As inspired by abigail:
>> > : 
>> > : perl -wle 'print "Even" if (1 x shift) =~ /^(1+?)\1$/'
>Explain it to him, and he'll probably realize
>that although it's kinda cute it's not very good.  

I'll give it a stab :
(1 x shift)  # create a string containing @ARGV[0] number of 1s in a
             # row 1 automaticaly gets turned into a string by 'x',
             # the string repeat operator (see perlop)
=~           # try to match it against
/^           # anchored at the begining
(1+?)        # match a substring of 1s, doing it the non-greedy way
\1           # match the same thing as parens on previous line
$            # anchored at the end of the string
/x;          # close pattern


Or another way of explaining :

String: 11111
  ^	matches begining of string
  (1+?) matches first 1
  \1	matches the next 1
  $	not at end yet, so we back-track
  (1+?) matches first 11
  \1	matches the next 11
  $	not at end yet, so we back-track
  (1+?) matches first 111
  \1	doesn't match, backtrack
  (1+?) matches first 1111
  \1	doesn't match, backtrack
  (1+?) matches first 11111
  \1	doesn't match, backtrack
  (1+?) can't match anymore, backtrack
  ^ 	can't match anymore, failed!

String: 1111
  ^	matches begining of string
  (1+?) matches first 1
  \1	matches the next 1
  $	not at end yet, so we back-track
  (1+?) matches first 11
  \1	matches the next 11
  $	end of string, so we match this pattern!

(NOTE: I know this isn't exactly how the regex matcher does it.  But
it's close enough for the purpose at hand, no?)

>For instance try it
>with a value of 4293999998 or even 73999998 and I think you'll see that
>it has minor difficulties.
To say the least!  Wouldn't $var&1 be better?

-Philip


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

Date: Sat, 06 Dec 1997 02:23:42 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: Alan <arich@u.washington.edu>
Subject: Re: HTTP/1.0 500 Server Error (blahblah.cgi is not a valid Windows NTapplication.)
Message-Id: <348927AE.AB5D79A9@sirius.com>

Alan wrote:
> 
> I get an 'HTTP/1.0 500 Server Error..' message everytime I attempt to
> post to a cgi script.  I'm using Perl 5 for NT.  Is there some
> configuration necessary on my NT server's IIS to get it to run cgi
> scripts?

Yes.  Two things need doing: you need to set the directory
the script is in to executable in the Internet Service Manager
and then you have to (drum roll please ...) edit the registry.

You can use the program regedit and go into the keys at

HKEY_LOCAL_MACHINE\SYSTEM 
 \CurrentControlSet 
  \Services 
   \W3SVC
    \Parameters 
     \Script Map

here you can associate an extension with an application.
You can have keys of ".pl" and ".cgi" that both have a value
of "C:\perl\bin\perl.exe %s"

If you forget the trailing %s then it won't work.

HTH


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

Date: Fri, 5 Dec 1997 21:58:16 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Inserting only the unique elements into an array ...
Message-Id: <66apfa$l0k@bgtnsc01.worldnet.att.net>

I'm not sure about the rest of it, but this (untested!) code looks to me
like it should add an element ($candidate) to an array (@array) if the
element doesn't already exist:

@_ = ("$candidate");
push(@array,@_) unless ( join(";",@array) =~ /$candidate/ );

Depending on what you have in mind, you might also try using an associative
array (here called %array):

$array{$candidate} = $candidate;

This way it doesn't matter if $candidate already exists in your array, the
routine just replaces $candidate with itself. You also avoid having to worry
about grep. :D

I'll let someone else tackle the question about $#list.

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

Narayan Moni wrote in message <66a5rb$qs7@bgtnsc01.worldnet.att.net>...
>Hi fellow PERLers
>
>Have a question for you. I am trying to insert an element into an array
>I want the element to be inserted ONLY if the element is not already
>in the list. I would prefer if I did not have to search the array
>element by element. The code I have looks somewhat like this ( I
>have deleted a bunch of code so as to focus on the questions I have ).
>
>@Values = ("abc", "def");
>
>&ReadValues (\@Values);
>
>sub ReadValues {
>    my ($List) = @_;
>    $Element = "abc";
>    &InsertIntoList ($List, $Element);
>}
>
>sub InsertIntoList {
>    my ($List) = @_;
>    if ( grep ($List, $Element) ) {
>        $List->[$#List] = $Element;
>    }
>}
>
>Now my question to you is
>
>1/ there a better way to go about this? If there is then I would
>       really like to know about it
>2/ In the debugger when I check the value of $#List in the function
>       InsertIntoList, it is -1. It seems that if I pass an array by
>       reference then it looses all these properties of aan array.
>       Is that a valid conclusion?
>3/ Can grep be used like above?
>
>Thanks a lot for the info. You could either send me mail at
>anish@worldnet.att.net or post your responses to this newsgroup.
>
>Sincerely,
>Anish.




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

Date: 6 Dec 1997 03:24:49 -0500
From: David Adler <dha@panix.com>
Subject: Re: NEWBIE can't tar latest_tar.gz
Message-Id: <vx9pvnaube7.fsf@panix.com>

mike@stok.co.uk (Mike Stok) writes:

> 
> In article <669c3o$spr@mtinsc05.worldnet.att.net>,
> Nick Nottleman  <Nick1pub@worldnet.att.net> wrote:
> >I am trying to extract latest_tar.gz on a SCO Unix box. The command i am
> >using is tar xvf latest_tar.gz.  I am getting directory checksum
> >errors.  Any help for a Newbie??
> 
> The .gz suffix indicates it's a compressed file, so you can do somehting
> like:
> 
>   gunzip -c latest_tar.gz | tar xvf -
> 
> where gunzip reads latest_tar.gz and squrts the decompressed version to
> tar's standard input.

Alternately, if you want to keep the zipped file around for any reason
and want to avoid unzipping and then rezipping the .tar file...

zcat latest_tar.gz |tar xvf -

Go wild. :)
-- 
David H. Adler - <dha@panix.com>
"The perversity of the Universe tends towards a maximum."


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

Date: Sat, 06 Dec 1997 13:02:40 +0100
From: Benoit de Mulder <benoit@decollage.org>
Subject: odbc and system dsn
Message-Id: <34893EE0.D7AAB715@decollage.org>

Hello, 


I'm looking for a way to create a system dsn on NT4 with a perl 
script. I'm using the win32::odbc and perl for win32.

I have no problem to create user dsn but I have a problem with system 
dsn, Does anyone have an idea, a sample or a link to solve this 
problem ?

Thank by advance

Benoit


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

Date: 6 Dec 1997 13:29:42 GMT
From: s.oosthoek@student.utwente.nl (Simon Oosthoek)
Subject: passing/returning a list of hashes to subs (how?)
Message-Id: <66bk06$8ne$1@pandora.cs.utwente.nl>

Hi,

I'm trying to write a Perl script at work to read a configuration file 
in a sub. The file is built up of a list of entries with multiple lines 
of key/value pairs. I want to call a sub to read the file into a Perl 
datastructure.

If I read all the documentation correctly, this should be done using 
hard references, but apparently I don't understand them enough to get it 
 to work properly.

below I'll try to write some code to show how I think it should work:

# calling the sub to read the data from the file:
@listofhashes = &readdata('file.data');

# assume $key has a value, $value should become the value 
# indexed by the $key in the third hash in the list
$value = %{@listofhashes[2]}{$key};

sub readdata {
  my $file = shift;
  open (FILE, "<$file") or die "oops: $!\n";
    LOOP: while ($line = <FILE>) {
      chomp $line;
      next LOOP if ($line =~ /^\s*$/);  # skip blank lines
      if ( $line =~ /\s*\[\d+\]\s*/) {  # "[\d+]" separates the hashes
        if (defined %tmp) {
          push (@cfgout, %tmp);
          undef %tmp;
        }
        next LOOP;
      }
      ($key, $value) = split (/\s*=\s*/, $line, 2);
      $tmp{$key} = $value;
    }
  close (FILE); 
  if (defined %tmp) { # handle the last case
    push (@cfgout, %tmp);
    undef %tmp;
  }
  return @cfgout;
}

Well, this may or may not work, but I would really like to know if this 
is the right way to do it... is it?

The next problem I'm not even going to write code for, because I really 
don't understand it:
Now I have this list of hashes and I want to pass it to a subroutine to 
get a list of values from all the hashes in the list. Now how do I do 
that?

I you can help me, I would really appreciate it. Please send me a copy 
by e-mail using simon_oosthoek@hotmail.com (so I can get it at work as 
well as at home). When I've got this figured out I'll post a summary and 
maybe this could be added to the FMTYEWTK about perl data structures 
documents?

Thanks,

Simon.



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

Date: 6 Dec 1997 08:00:22 GMT
From: syng@jalisco.engr.ucdavis.edu (Michael Ng)
Subject: Re: Perl editor needed
Message-Id: <66b0mm$flu$2@mark.ucdavis.edu>

<Previously, Larry Hanlon said he is looking for a Perl editor>

I personally love using Emacs, both in Unix/NT/Win95.   I use Emacs in 
almost all of my Programming tasks (except in Visual C++ and some short 
programs -- #line < 10).  I am a helpless color-lover.  The program 
displayed in NTEmacs is very colorful.  comment is green. string is brown 
etc.

Emacs is huge, if you wnat to get the whole package.

Justt my opinion.

--
Michael (syng@engr.ucdavis.edu)
+--------------------------------------------------------------+
| http://www.engr.ucdavis.edu/~syng/                           |
| <PGP public key: http://www.engr.ucdavis.edu/~syng/mike.pgp> |
+--------------------------------------------------------------+


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

Date: Fri, 5 Dec 1997 22:50:05 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: PERL Frusterations (semi-newbie)
Message-Id: <66asge$7v7@bgtnsc01.worldnet.att.net>

Here's a possible solution using associative arrays. I haven't tested it
yet, so caveat programmor. This assumes the database isn't sorted. If it is,
you should have a much easier time of it.

#!/usr/bin/perl -w

# print the <HTML> header, etc. up here

open(INFILE,"tab_delimited_file") or die "Can't open input file";
%genre = ();
%url = ();

while (<INFILE>) {
    my($myGenre, $group, $myUrl) = split(/\t/);
    $genre{$group} = $myGenre;
    $url{$group} = $myUrl;
    }

close INFILE;

open(OUTFILE,">outfile") or die "Can't write to outfile";
$index = "";

foreach $group (sort(keys(%genre))) {    # or %url, they should be the same
    $test = substr($group,0,1);    # get first letter of group's name
    unless ($test =~ /$index/i) {
        $index = $test;
        print OUTFILE qq!<A NAME="$index">\n!;
        }
    print OUTFILE qq!<I>$genre{$group}</I><B>$group</B><A
HREF="$url">$url{$group}</A>\n!;
    }

close OUTFILE;


Even if I screwed up on the code (possible, I haven't tested it and it's
been a long day) the logic should be the same. Check for the first letter of
the next group. If it doesn't match the previous first letter (since they're
sorted, that means it'll be farther down in the alphabet) assign the new
first letter to the test variable and print out the new test variable. Then
print out the HTML information.

Hope this helps. (Heck, hope this works!)

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

blacktape wrote in message <3488bef9.9286001@nntp.best.com>...
>I wrote a simple script for my friend, who is creating an extensive
>music database, and doesn't want to type in all of the html for a 1+
>meg file... what it does is this:
>
>takes a tab delimited file:
>genre group url
>rock aerosmith http://www.aerosmith.com
>etc etc..
>
>and turns it into this:
><I>genre</I><B>group</B><A HREF="url">url</A>
><I>rock</I><B>aerosmith</B><A
>HREF="http://www.aerosmith.com">www.aerosmith.com</A>
>
>simple enough.
>
>what i want to do with this script, is have it add in an <A
>NAME="letter"> for the first occurance of each letter, a-z, in the
>group name.
>
>ie:
>
><A NAME="a"><I>rock</I><B>aerosmith</B><A
>HREF="http://www.aerosmith.com">www.aerosmith.com</A>
><I>rock</I><B>anthrax</B><A
>HREF="http://www.anthrax.com">www.anthrax.com</A>
>etc etc for the A's, then onto the B's, C's... etc
>
>how would i go about doing this?  i've tried a do {} until, read the
>perlfaq and manpages, tried everything... but all i come up with is a
>bunch of errors.
>
>thanks for any help...
>
>j
>
>
>-j
>the dumber a person is, the longer it will take for them to find out that
you're killing them




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

Date: Sat, 06 Dec 1997 07:16:25 GMT
From: fil_nospam@login.net (Philip Gwyn)
Subject: Re: Perl on Win32 using Watcom v. 11
Message-Id: <3488fb51.63812535@news.videotron.ca>

On Thu, 04 Dec 1997 22:11:18 GMT, tnguru@termnetinc.com (Ben Coleman)
wrote:

>Has anyhone successfully built Perl 5.004 for Win32 using the Watcom v. 11
>compiler?  Any gotchas I should look out for?
>
Not that I've heard of.  I would be VERY interested in your results.
Only gotchas I can think of would be that any dynamic module (.pll)
compiled for with other compilers might not work.

-Philip


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

Date: Sat, 06 Dec 1997 07:10:35 GMT
From: fil@login.net (Philip Gwyn)
Subject: Re: Perl4 is not Y2K (was Re: Forced to use brain-dead perl 4 -- how do I accomplish task that is simple in perl 5 ?)
Message-Id: <3488fa23.63509877@news.videotron.ca>

On Thu, 04 Dec 1997 18:18:21 -0500, comdog@computerdog.com (brian d
foy) wrote:

>In article <-0412971655170001@aggie.coaps.fsu.edu>, fl_aggie@thepentagon.com (I R A Aggie) wrote:
>
>>+ >I R A Aggie <fl_aggie@thepentagon.com> wrote:
>
>>+ Eventually, people will say: "Perl 4!?!?! Who the hell did design such
>>+ crap!?!"
>>
>>"Larry Wall and Randal Schwartz and their involvement in the development 
>> of Perl 4 -- innocent dupes or criminal masterminds? Next on Geraldo!"
>
>should any reprinting of "Programming Perl, First Edition" have a scapegoat
>as the mascot? :)

You mean like a antique wood-cutting of a goat in a Flash Gordon
outfit?  Oops, thought you had writen "spacegoat".

-:)



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

Date: Sat, 06 Dec 1997 12:50:28 GMT
From: ifettich@netsoft.ro (Iosif Fettich)
Subject: problem with my() and s//
Message-Id: <348947b1.14851697@news.taide.net>

On Fri, 05 Dec 1997 15:21:53 -0800, Matthew Reimer <mreimer@vpop.net>
wrote:

>I'm trying to do variable substitution on a scalar with s//, but
>apparently it won't work with my variables. Is this a bug? Anybody have
>a workaround?
>
>Matt

I suppose you'll find another way to do what you really need to do, as
this seems to more a feature than a bug .. ;) 

According to the Camel book, second edition, page 255 (about symbolic
references):
---------------------
"Only package variables are visible to symbolic references. Lexical
variables (declared with _my_) aren't in a package symbol table, and
thus are invisible to this mechanism. For example:
local $value = "10";
{
   my $value = "20"'
   print ${"value"} ;
}

This will print "10", not "20". Remember that _local_ affects package
variables, which are all global to the package.
--------------------
Maybe I can help, if you say a few words more about what you are after
 .
Iosif Fettich
ifettich@netsoft.ro



>
>
>#!/usr/local/bin/perl5
>
>my $SOME_VAR = "ABCD";  # take out my and it will work
>my $string = 'the variable is $SOME_VAR';
>
>$string =~ s/\$(\w+)/${$1}/g;
>print "string: $string\n";
>
>exit;

-----------------------------------------------------------------------
Iosif Fettich | e-mail: ifettich@netsoft.ro            ICQ UIN: 5496730
Mng. Director |                             phone/fax: +40-(0)65-162614    
NetSoft SRL   | mail:   NetSoft SRL,4300 Tg.Mures,O.P.1-C.P.172,Romania


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

Date: 6 Dec 1997 07:44:58 GMT
From: syng@jalisco.engr.ucdavis.edu (Michael Ng)
Subject: Re: replacement for fork() on NT?
Message-Id: <66avpq$flu$1@mark.ucdavis.edu>

A while ago I heard some one i/are working on Multi-threading Perl.  Hope I 
am correct.  I also want to know. 
Pls correct me if I am wrong.

Jeff Kehoe (kehoe@fc.hp.com) wrote:
::> Has anybody found a good 0 for fork() on NT?  I realize that
::> it isn't supported on NT, but wondered what people are doing in its
::> place on NT.

::> Thanks in advance for the help,
::> Jeff Kehoe

--
Michael (syng@engr.ucdavis.edu)
+--------------------------------------------------------------+
| http://www.engr.ucdavis.edu/~syng/                           |
| <PGP public key: http://www.engr.ucdavis.edu/~syng/mike.pgp> |
+--------------------------------------------------------------+


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

Date: Sat, 06 Dec 1997 08:21:22 -0500
From: Bill Guindon <billg@networkapparel.com>
To: Brian Sullivan <brians@helicon.com>
Subject: Re: Web Discussion Board with RFC1867 file upload
Message-Id: <34895152.E2E67282@networkapparel.com>

(Sender CC'd via email)

Brian Sullivan wrote:
> 
> Does anybody have any knowledge of a Web based discussion board system
> written in Perl supporting RFC1867 file uploads.
> 
> Specifically I would like to allow posts that have file attachments, store
> the uploads, preserve the attachment with the message and allow downloads.
> Does such a beast exist?

Yep, one can be had from Selena Sol's site at:
selena.mcp.com




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

Date: Sat, 6 Dec 1997 07:10:48 -0500
From: "Frank Bellomo" <fbellomo@home.com>
Subject: Win32 - Unable to use NetAdmin (Expect on local system)
Message-Id: <66bfav$bhe$1@ha2.rdc1.nj.home.com>

HI,

I have included the code below, but the problem is consistent with all the
functions in this module.
All examples that I have found so these function running on local system
only.

Unless $SOMESYSTEMNAME = '' (the local system) this does not work.
I have tried \\\\$SOMESYSTEMNAME, $SOMESYSTEMNAME.xxx.com, IP addresses,
etc.
This holds true for every win32 function I have tried.

Please let me know what I am doing wrong..

Thanks

Frank

 Win32::NetAdmin::UserGetAttributes($SOMESYSTEMNAME,$userName,
                               $Getpassword,
                               $GetpasswordAge,
                               $Getprivilege,
                               $GethomeDir,
                               $Getcomment,
                               $Getflags,
                               $Getscriptpath) || warn();
 # Copy users current information to fields that don't change
 $passwordAge  =  $GetpasswordAge;
 $privilege = $Getprivilege;
 $homeDir   = $GethomeDir;
 $comment = $Getcomment;
 $flags  = $Getflags;
 $scriptPath = $Getscriptpath;

 # Input new information into users account on server x
 Win32::NetAdmin::UserSetAttributes($SOMESYSTEMNAME, $userName,
     $password,
     $passwordAge,
     $privilege,
     $homeDir,
     $comment,
     $flags,
     $scriptPath) || warn();

 print "Completed Server ",$LIST[$x]," if no warnings shown", "\n";







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

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

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