[6679] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 304 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 15 10:17:09 1997

Date: Tue, 15 Apr 97 07:00:29 -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           Tue, 15 Apr 1997     Volume: 8 Number: 304

Today's topics:
     Re: "rename" PLEASE HELP!!! <dorman@s3i.com.anti-spam>
     [Q] Converting a string to lower case amas@lhr-sys.dhl.com
     Re: [Q] Converting a string to lower case <dbenhur@egames.com>
     Re: A Program to List All Dirs/SubDirs <tchrist@mox.perl.com>
     Re: A simple substitution <dbenhur@egames.com>
     Re: CGI : How to download exe file using Perl ? amas@lhr-sys.dhl.com
     Command Line <earl@bell.us>
     Connecting to an ODBC datasource from a Unix host <apollock@bit.net.au>
     DBM Obsolete? (Parillo)
     Re: How can I create a C extension to Win32 Perl? (Jamie O'Shaughnessy)
     Re: Kudos to Tom Christiansen and problems with OO <abraithw@fordx.xcom>
     limits of hashes/scalar? <Hans.Suijkerbuijk@SD.BE>
     Need  a math program netwatch@ix.netcom.com
     Re: Newbie Question: regexp email address.. <rfi@uebemc.siemens.de>
     Re: Newbie: Webify A Program? amas@lhr-sys.dhl.com
     Re: No GUI environment for Perl? (Jamie O'Shaughnessy)
     Re: OLE (Andrew Gruskin)
     Re: PerlIS - Where can I get it? <gordon.leslie.mcdorman@sap-ag.de>
     Professional and Affordable Web Design and Hosting <thomp132@expressionsmedia.com>
     Re: QUESTION: Class::Template variable access <tchrist@mox.perl.com>
     Re: QUESTIONS: how to use $self->SUPER:: with strict? <lpa@sysdeco.no>
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Michael Sperber [Mr. Preprocessor])
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Cyber Surfer)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Rainer Joswig)
     Re: SLEEP (.5) ??? (I R A Aggie)
     Re: sorting a *file* (yeah, I know, it's a mainframe co (David Alan Black)
     Re: Stupid questions. <dbaker@dkburnap.com>
     Two Perl Language Questions (Paul Matthews)
     Re: Why is $Line=~ s///; erasing = <tchrist@mox.perl.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 15 Apr 1997 09:09:44 -0400
From: Clark Dorman <dorman@s3i.com.anti-spam>
Subject: Re: "rename" PLEASE HELP!!!
Message-Id: <dragc1lgn.fsf@s3i.com>


shommel@elk.uvm.edu (Buzz) writes:
> The two files are chmod a+rwx.
> 
> I declared two variables with complete pathnames to the files:
> 
> $var1 = ("path/to/file1");
> $var2 = ("path/to/file2");
> 
> then within the cgi script put:
> 
> rename ("$var1", "$var2");
> 
> yet it does nothing? How come? How can I make it work?

Works for me.  I'm not sure why you are using all the quotes and parens,
though:  rename $var1, $var2 works.  

1.  Are you sure you are not doing it across filesystem boundaries?  From the
manual:

rename OLDNAME,NEWNAME
     Changes the name of a file.  Returns 1 for success, 0 otherwise.
     Will not work across filesystem boundaries.

2.  Are you doing #!/usr/bin/perl -w  (The -w is the important part)?

3.  Check the results of $!  i.e.:

rename $blah1 $blah2 or die "cant rename ($!)";

4.  Maybe the script does not have rwx capability even though you do.  

--
Clark


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

Date: Tue, 15 Apr 1997 04:41:09 -0600
From: amas@lhr-sys.dhl.com
Subject: [Q] Converting a string to lower case
Message-Id: <861096916.8895@dejanews.com>

Coming from AWK I feel a bit lost without certain of my favourite
function calls. One of these is the toLower() and toUpper() calls.
I am still new to this regexp stuff, so could someone show me how
to do this. A bit more detail might help: specifically I would like
to take a string that contains any sort of character and only change
the case of the alpabetic characters and leave the rest alone.

Thanks for any help

Andre

--
 ajmas@bigfoot.com
 Supporter of the better OSs:  MacOS, NeXT BeOS,
 Linux and variations...

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


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

Date: Tue, 15 Apr 1997 03:05:45 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: amas@lhr-sys.dhl.com
Subject: Re: [Q] Converting a string to lower case
Message-Id: <335352F9.40D5@egames.com>

[mail&post]
amas@lhr-sys.dhl.com wrote:
> Coming from AWK I feel a bit lost without certain of my favourite
> function calls. One of these is the toLower() and toUpper() calls.

Does excessive awk use result in an inability to consult
documentation?

> I am still new to this regexp stuff, so could someone show me how

Regexps are not the answer to everything.
There's also tr/// and the occassional builtin 
function :)

> to do this. A bit more detail might help: specifically I would like
> to take a string that contains any sort of character and only change
> the case of the alpabetic characters and leave the rest alone.

Try:  man perlfunc | grep lower

It should answer your query.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"



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

Date: 15 Apr 1997 13:39:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A Program to List All Dirs/SubDirs
Message-Id: <5j00ef$r3p$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    wayne@netcom.com (wayne t. watson) writes:
:Anyone have a simple program to list all
:the directories and subdirectories below a given
:directory?  Maybe something like:

#!/usr/bin/perl

@lines = `du @ARGV`;
chop(@lines);
&input($top = pop @lines);
&output($top);
exit;

sub input {
    local($root, *kid, $him) = @_[0,0];
    while (@lines && &childof($root, $lines[$#lines])) {
	&input($him = pop(@lines));
	push(@kid, $him);
    } 
    if (@kid) {
	local($mysize) = ($root =~ /^(\d+)/);
	for (@kid) { $mysize -= (/^(\d+)/)[0]; } 
	push(@kid, "$mysize .") if $size != $mysize;
    } 
    @kid = &sizesort(*kid);
} 

sub output {
    local($root, *kid, $prefix) = @_[0,0,1];
    local($size, $path) = split(' ', $root);
    $path =~ s!.*/!!;
    $line = sprintf("%${width}d %s", $size, $path);
    print $prefix, $line, "\n";
    $prefix .= $line;
    $prefix =~ s/\d /| /;
    $prefix =~ s/[^|]/ /g;
    local($width) = $kid[0] =~ /(\d+)/ && length("$1");
    for (@kid) { &output($_, $prefix); };
} 

sub sizesort {
    local(*list, @index) = shift;
    sub bynum { $index[$b] <=> $index[$a]; }
    for (@list) { push(@index, /(\d+)/); } 
    @list[sort bynum 0..$#list];
} 

sub childof {
    local(@pair) = @_;
    for (@pair) { s/^\d+\s+//g; s/$/\//; }		
    index($pair[1], $pair[0]) >= 0;
}

-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    double value;                /* or your money back! */
    short changed;               /* so triple your money back! */
            --Larry Wall in cons.c from the 4.0 perl source code


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

Date: Tue, 15 Apr 1997 03:12:13 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Jeff Yoak <jeff@yoak.com>
Subject: Re: A simple substitution
Message-Id: <3353547D.3671@egames.com>

Jeff Yoak wrote:
> What is a good way to change the first letter of each word in a string
> to uppercase?

$str =~ s/(\w+)/\u$1/g;

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's people like you wot cause unrest!"



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

Date: Tue, 15 Apr 1997 06:32:09 -0600
From: amas@lhr-sys.dhl.com
Subject: Re: CGI : How to download exe file using Perl ?
Message-Id: <861103496.11452@dejanews.com>

The first part of sending a binary file is getting the MIME type right.
If you are going to be dealing with various different types of file
types, then your program could read in the mime types file, look for
the appropriate file ending and then use that as the MIME type for your
file.  Otherwise, you could use application/octet-stream (according to
my netscape prefs).

So your header would be:

Content-Type: application/octet-stream;
Content-Disposition: inline; filename="The file Namw.xxx"

followed by the compulsory blank line. The second of the
two lines tell the browser what the file is to be saved
as.

Then you could open the file operator and use the until
end of file read:

   open (THEFILE);
   while (<THEFILE>) {
      print $_
   }
   close (THEFILE);

I hope this helps. I tested what I said an it worked. If you
want a copy of the source email me and I will send it to you.

Andre

--
Signature Says: Hello World

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


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

Date: Tue, 15 Apr 1997 14:40:46 -0700
From: Chris Andrew <earl@bell.us>
Subject: Command Line
Message-Id: <3353F5DE.13EE@bell.us>

Hello,

I have a nagging question that has been on my mind for quite some time,
but that the man pages and FAQ do not seem to address.

Where do I find *larger* examples of the use of the -e (command-line)
switch in Perl?

The most extensive explanation I have found (1 line long) is in Learning
Perl side 191 and does not help me much.

Thanks.


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

Date: 15 Apr 1997 08:51:28 GMT
From: "Andrew Pollock" <apollock@bit.net.au>
Subject: Connecting to an ODBC datasource from a Unix host
Message-Id: <01bc497a$57a23fe0$045e12cb@minotaur>


Hi,

I understand that there is a Win32:ODBC module, but is there anything out
there for connecting to an ODBC datasource from a Unix box? I'd really like
to be able to talk to our SQL Server running under NT from our Unix
machine.

Thanks in advance

Andrew
----
Andrew Pollock		Senior (hey I'm the only one) Programmer
apollock@bit.net.au	http://staff.bit.net.au/apollock
Brisbane Internet Technology Pty Ltd


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

Date: 15 Apr 1997 12:13:51 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: DBM Obsolete?
Message-Id: <5ivrdv$le9@linet06.li.net>

My Perl Doc in HTML format appears to say the DBM is obsolete, and
has been replaced with tie and untie. However the example in the doc:
    # print out history file offsets
         tie(%HIST, NDBM_File, '/usr/lib/news/history', 1, 0);
         while (($key,$val) = each %HIST) {
             print $key, ' = ', unpack('L',$val), "\n";
         }
         untie(%HIST);
does not seem to work for me (I think it may be realted to NDBM_File),
while DBM still seems to work.

Any advice?


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

Date: Tue, 15 Apr 1997 11:35:41 GMT
From: joshaugh@uk.oracle.com (Jamie O'Shaughnessy)
Subject: Re: How can I create a C extension to Win32 Perl?
Message-Id: <335567ea.1892878546@newshost.us.oracle.com>

On Sun, 13 Apr 1997 02:56:18 GMT, len@clark.net (McWilliams) wrote:

>I'm have a short piece of C code I would like to include in a Perl Win
>32 script. I've looked at perlxstut in an attempt to understand how to
>do this. Unfortunately the h2xs utility referred to in perlxstut is
>not part of my Win32 Perl installation (5.003_7 build 303). I've
>installed gnu_win32 on my system.
>
>Could someone give me some guidance as to how to proceeed from here?
>
>Thanks,
>
>Len McWilliams
>Frederick, MD
>

Try SWIG:

http://www.cs.utah.edu/~beazley/SWIG/

Jamie

___________________________________________________________________________ 
Jamie O'Shaughnessy                        Work: joshaugh@uk.oracle.com 
Oracle Designer/2000 Forms Generator Team  Home: jamie@thanatar.demon.co.uk 
______________________________________________________  __  __ _  __ .   __ 
Opinions expressed here are my own and not those of... (__)|-</-\(__ |__ -_ 


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

Date: Tue, 15 Apr 1997 09:49:29 +0100
From: Andrew J Braithwaite <abraithw@fordx.xcom>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Kudos to Tom Christiansen and problems with OO
Message-Id: <33534119.41C6@fordx.xcom>

Tom Christiansen wrote:
> 
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, will@Starbase.NeoSoft.COM (Will Morse) writes:
> :I just thought I'd mention that Tom is also an outstanding pianist.
> 
> Not as good a pianist as Larry is a violinist.
> 
> --tom
> --

You could both start a band. You just need a name ... Perl Jam perhaps ? :-)

-- 
Andrew Braithwaite                      Email:  abraithw@ford.com    (Work)
Powertrain Control Systems Engineering          gf10@dial.pipex.com  (Home)
Ford Motor Company                      Tel: +44 (0)1268 404115
The opinions expressed are my own and not those of Ford Motor Company.
"Remove the x's in Email address when replying to this message."


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

Date: Tue, 15 Apr 1997 15:31:41 -0700
From: Hans Suijkerbuijk <Hans.Suijkerbuijk@SD.BE>
Subject: limits of hashes/scalar?
Message-Id: <335401CD.336A@SD.BE>

Hi,

With a Perl-CGI-script, i connect my intranet to an access-db via ODBC
(I use the Win32::ODBC-functions). Important is that the doc-field in
the A-table contains a SGML-document, which can be 2 - 3 Mb.
I catch the result of a query in a hash, like:

$db = new Win32::ODBC ...
$sql = "select doctitel, doc from A where ...";
$db->Sql($sql);

$db -> FetchRow();
%hash = $db->Datahash;
$doc = $hash{'doc'};

The problem is: the hash is empty in the case the SGML-doc is quite
long. When I shorten the SGML-document, this works well. My question is:
are there limits to the size of hashes/scalars? And if yes, what is a
solution to read the content of a long field in a database?

thanks!


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

Date: Tue, 15 Apr 1997 13:10:24 GMT
From: netwatch@ix.netcom.com
Subject: Need  a math program
Message-Id: <33537bf3.380389@nntp.ix.netcom.com>

I need a perl program that will add.sub, multi, amd div. numbers.
It must have 3 levels of difficulty. Level 1 use numbers from 1 to 5,
level 2  use numbers from 1 to 20, and level 3 use numbers from 1 to
50. 
I also need a perl program that can be use as a address book. It must
have name and phone number fields
Thank you.


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

Date: 15 Apr 1997 10:50:14 +0200
From: Ronald Fischer <rfi@uebemc.siemens.de>
To: Ask Bjxrn Hansen <ask@plys.net>
Subject: Re: Newbie Question: regexp email address..
Message-Id: <xz2ohbg3c1l.fsf@uebemc.siemens.de>

>>>>> On Fri, 11 Apr 1997 23:28:44 +0200
>>>>> "rn" == rn Hansen <Ask> wrote:
rn> What's the best way to get an email address from a line like:
rn> 
rn> From: John Doe <jd@foo.com>
rn> or
rn> From: jd@foo.com
rn> or
rn> From: jd@foo.com (John Doe)
rn> 
rn> I only want to jd@foo.com part in either case..
Assume that your line is stored on $line, and the extracted address
should go to $addr.
One possibility would be to define exactly how an email address looks
like:
  $name=q,[a-zA-Z:_.0-9"$!%]+,; # set of characters that can be part of
                                # a name in an email address
  $patt="${name}\@$name";       # that's the pattern for the whole address
  $line =~ /($patt)/ && $addr=$1; # store address to $addr
The advantage of this solution is that it can handle many more line
formats than you gave. The disadvantage is that it may not catch very
exotic addresses [actually, I am not sure if my definition of $name is
complete; it is based on what I have seen so far in email addresses].

A more conservative approach would be to assume that the line MUST be
in one of those forms you gave above. In this case, you would use the
following pattern (warning: I tested the first solution, but did not
test this one, so please regard it as a rough outline, since it may
contain errors):

foreach $alts ("[^<]+<(.+)>", "(.+) +[(].*", "(.+)")
{
    if($line =~ /^From: +$alts *$/)
    {
        $addr=$1;
        last;
    }
}

Probably there are more elegant ways to do this, and I'll bet that
your post will raise some discussion...
-- 
Ronald Otto Valentin Fischer (PGP public key available on request)
business:	ronald.fischer@uebemc.siemens.de
private:	ronald.fischer@acm.org
http://ourworld.compuserve.com/homepages/ronald_fischer/


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

Date: Tue, 15 Apr 1997 05:51:03 -0600
From: amas@lhr-sys.dhl.com
To: jeffo@execpc.com
Subject: Re: Newbie: Webify A Program?
Message-Id: <861100937.10168@dejanews.com>

In article <01bc47ae$804c58e0$4642cfa9@Pjeffo.execpc.com>,
  "Jeff Oien" <jeffo@execpc.com> wrote:
>
> Hi,
> Here is a program based on one of the exercises in
> the Llama book. I have two questions.
> 1. How can I get this to work within a browser
> environment either on the same page if possible or with
> the answer being stated in a new page. I'm familiar with
> the Content-type...print etc. but not sure how to put it
> in a form and run it.

How you finally approach the problem will depend very much
on the web server that you are using. In most cases if your
server know that the script is to be treated as a CGI-scipt
then it will execute it.  Anything going to the STDOUT, will
automatically go to the server output. But as you said you
know this.

There are two ways of calling a script, either via a fixed
link:

  http://www.myweb.example/cgi-bin/myscript.pl?value=hello

The question mark indicates that anything after that point
it a parameter.

Or, as you want a form.  To tell the browser that this data
is in a form, you first need to open up the form context:

<FORM METHOD="GET" ACTION="http://www.myweb.example/
                                      cgi-bin/myscript.pl">

</FORM>

Anything between these two points will be parameters to your
script (indicated in ACTION).

Next, you need to add somewhere for the user to provide the
data. In this case a text box:

  <INPUT TYPE="TEXT" NAME="value">

The name part indicates the field name and when your data is
passed it will look like value=hello+world. Do note that
certain characters are converted to symbols and others again
are prefixed by a '%' followed by a number, though if you get
a copy of cgi-lib.pl this should take care of it for you.

You may want to copy of the Barebones guide to HTML:

 http://werbach.com/barebones/

and also look at the source to a certain number of forms that
people have implemented (learning by example).

> 2. Why doesn't this work when I eliminate the spaces
> in the $ax$b=$c so that it prints 3x2=6 (or whatever)?
> --------------
> print "I am a multiplication robot.\nPlease type in any number, then
> press Enter: ";
> chomp($a = <STDIN>);
> print "Please type in another number: ";
> chomp($b = <STDIN>);
> $c = $a * $b;
> print "$a x $b = $c\n";
> print "Yay!";

I tried the program out and chomp does not seem to be recognised by my
version of Perl (4.x). Taking it out it works, though I can sort out
spaces:

MAIN: {
	print "I am a multiplication robot.\nPlease type in any";
        print "number, then press Enter:";
	$a = <STDIN>;
	$a =~ s/ //; #removes any spaces
	print "Please type in another number: ";
	$b = <STDIN>; #removes any spaces
	$b  =~ s/ //;
	$c = $a * $b;
	print "$a x $b = $c\n";
	print "Yay!";
}

I hope this helps you on your way.

Andre

--
ajmas@bigfoot.com
Supporter of the great M$ alternatives:
MacOS, BeOS, OS/2, Linux and variations, NeXT, etc.

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


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

Date: Tue, 15 Apr 1997 11:32:49 GMT
From: joshaugh@uk.oracle.com (Jamie O'Shaughnessy)
Subject: Re: No GUI environment for Perl?
Message-Id: <335464db.1892095843@newshost.us.oracle.com>

On 11 Apr 1997 13:04:06 GMT, scott@lighthouse.softbase.com () wrote:

>Jamie O'Shaughnessy (joshaugh@uk.oracle.com) wrote:
>: I'm no linux supporter (never used it) but Win95's multitasking
>: is about as bad as you could get.
>
>That hasn't been my experience. I regularly run an incredible number of
>applications at once. I generally have a DB2 database, Emacs, and run
>the compiler from Emacs to do software development.  I usually have the
>MSDN viewer open and maybe other language documentation open. I have
>one or more command prompt windows open. Usually I have Word open to
>work on the manual for the product I'm developing, and I often have PFE
>open to print out source files.  I almost always have a web browser and
>one or more telnet sessions open, and Organizer. And usually Paint Shop
>Pro too if I'm working on my web site.  This is all simultaneously.
>
Well here, running on the same hardware setup NT and 95 are worlds apart. Doing
a build of our software (which generates > 0.5Gb of browse info) grinds 95 to a
halt while NT allows you to continue working, although at a slower pace. When
we do a build, we basically leave a 95 machine well alone as it's just too slow
to use. Right now I'm doing a build on NT and also using Agent (downloading
news), running Netscape 4, Visio, Word 6, File manager, a couple of command
lines open, KEA terminal onto a unix box, Performance Monitor, clock,
Developer/2000 Forms Builder and Designer/2000 Design Editor (both very heavy
weight products). 95 would almost standstill running those apps, never mind
doing a build at the same time.

We're running decent spec Dell machines with 64Mb-128Mb of memory and the very
latest and fastest SCSI disks (basically the fastest you can get). So this is
no machine problem. We have also invested much time in setting these machines
up and setup is not a problem either.

>: Sorry Scott but you've just lost all crefibility.
>
>My crefibility is not the question. I simply am reporting what my
>experience has been.  Perhaps a well-tuned and well-maintained system
>is a rarity -- maybe I should have an open house and invite people to
>come watch me develop software or something.
>
>Scott

Maybe I was a bit harsh on you, but 95 is no serious development platform. If
you really do like 95, try NT4. Within a week you won't be going back.

Jamie

___________________________________________________________________________ 
Jamie O'Shaughnessy                        Work: joshaugh@uk.oracle.com 
Oracle Designer/2000 Forms Generator Team  Home: jamie@thanatar.demon.co.uk 
______________________________________________________  __  __ _  __ .   __ 
Opinions expressed here are my own and not those of... (__)|-</-\(__ |__ -_ 


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

Date: Tue, 15 Apr 1997 08:42:27 GMT
From: agruskin@melbpc.org.au (Andrew Gruskin)
Subject: Re: OLE
Message-Id: <33533f55.1223659@news.melbpc.org.au>


On Mon, 14 Apr 1997 08:59:40 -0700, Sam <sschleif@sedona.ch.intel.com>
wrote:

>I'm trying to run MS Access using the OLE module.  I've used the
>examples to run Excel, but this isn't working with Access.  Any ideas?
>
>Thanks,
>
>Sam

Post your code so it is easier for others to see your problem.


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

Date: Tue, 15 Apr 1997 08:43:50 GMT
From: Gordon McDorman <gordon.leslie.mcdorman@sap-ag.de>
Subject: Re: PerlIS - Where can I get it?
Message-Id: <uvi5oy8u1.fsf@sap-ag.de>

Larry Honig <lonewolf@driveway1.com> writes:

> 
> I can't find the PerlIS.dll in either the NT ResKit or in the downloaded
> version of perl 5.003 (only perl100.dll)

Look under the Download section of <URL:http://www.activeware.com>

Assuming you have an Intel platform, you'll need to get
PlSEi306.exe (or a newer version when available).

My impression is that the FAQ, available through the same site, is an
invaluable resource when trying to set up Perl for ISAPI.

-- 
-------------------------------------------------------------- 
The opinions expressed above are mine, not my employer's 
      
gordon.leslie.mcdorman@sap-ag.de                               


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

Date: 15 Apr 1997 11:27:41 GMT
From: Kris Thompson <thomp132@expressionsmedia.com>
Subject: Professional and Affordable Web Design and Hosting
Message-Id: <5ivond$9h8$4454@msunews.cl.msu.edu>

Welcome to Expressions Multimedia...

  We would like to extend an invitation to visit us at http://www.expressionsmedia.com.

  We specialize in providing professional yet inexpensive web page designs and web site hosting.

  Please be forwarned, many of our sites include ActiveX and Java and are optimized for Internet
Explorer 3.0, so they many not look right in some browsers.

  Also, check out our newest site for the Blue Cardinal Motorsport racing team, they can be found
at http://www.expressionsmedia.com/bluecard.

  I would like to thank you for your time,

           Kris Thompson
           thomp132@expressionsmedia.com


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

Date: 15 Apr 1997 13:21:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: QUESTION: Class::Template variable access
Message-Id: <5ivvc4$q40$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    brannon@bufo.usc.edu (Terrence M. Brannon) writes:
:a> print $u->$index;

Put parens there:

    print $u->$index();

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
The use of COBOL cripples the mind; its teaching should, therefore, be
regarded as a criminal offense.
                --E. W. Dijkstra (1982)


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

Date: Tue, 15 Apr 1997 10:56:10 +0200
From: Luca Passani <lpa@sysdeco.no>
To: "Terrence M. Brannon" <brannon@bufo.usc.edu>
Subject: Re: QUESTIONS: how to use $self->SUPER:: with strict?
Message-Id: <335342AA.6D40@sysdeco.no>

I might make a blunder since I'm a Perl OO beginner too, 
but I read in Perltoot that SUPER:: only exists in an 
overridden method call.
 Is this your case? is the syntax you use valid for declaring
some sort of inline method?  
 Furthermore, OBJ2 is a class and from the Perl5 I read that when
you invoke a class method, the first parameter is a string, 
not a reference (which you have when you invoke the method
on an object).
Why is the invocation of a method on a string (rather than
on a object) supposed to work?
 Furthermore, $self has not been blessed yet, when you invoke
the method. How can perl know where to go and get what you are 
looking for?
 If I am missing something, please let me know. 

Luca

Terrence M. Brannon wrote:
> 
> How can I fix this without hard references to the superclass? This
> might make a nice FAQ. I just started using objects today, downloaded
> Class::Template and ran into this brick wall.
> 
> main::(-e:1):   42
>   DB<1> use OBJ2
>   DB<2> $n = new OBJ2;
> OBJ2 self: OBJ2Can't use string ("OBJ2") as a HASH ref while "strict refs" in use at (eval 5) line 4, <IN> chunk 2.
>   DB<3>
> 
> package OBJ2;
> use Class::Template;
> use OBJ;
> @ISA= (OBJ);
> 
> members OBJ2 {
>     'd'     => '@',
>     'c'     => '$',
>             };
> 
> sub new {
>     my $self = shift;
>     print "OBJ2 self: $self";
>     my $r = InitMembers( $self->SUPER::InitMembers() );
>     bless $r;
> }
> 
> 1

--
======================================================================
Luca Passani.          | Sysdeco Innovation AS, http://www.sysdeco.no
Email: lpa@sysdeco.no  | Trondheimsveien 184, 0570 Oslo, Norway
Tel: (+47) 22 09 66 06 | Fax: (+47) 22 09 65 03
======================================================================


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

Date: 15 Apr 1997 14:41:08 +0200
From: sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <y9lencca26z.fsf@modas.informatik.uni-tuebingen.de>

>>>>> "Smiljan" =3D=3D Smiljan Grmek <Smi@4mate.hr> writes:

Smiljan> Michael Sperber [Mr. Preprocessor] wrote:

>> 
>> Anyone who has to read and write production code in Perl or Tcl or C++
>> within the same period as, say, Scheme, can testify to that.
Smiljan> [ie Scheme is better]
>> 

Smiljan> *Anyone* is a fairly large concept - please go find an average
Smiljan> programmer without experience in Tcl and Scheme, present him/her w=
ith
Smiljan> appropriate manuals and have h/h read/write code ...

"Anyone" has nothing to do with averages.  "Anyone" is anyone.  Find
one person that has to read and write *production code* in one of
Perl, Tcl, C++ *and* Scheme who doesn't agree.

As for the "average programmer without experience," (which is not what
my post referred to, but so what) refer to Paul Hudak's and Mark
Jones's paper

"Haskell vs. Ada vs. C++ vs. Awk vs. ..."

(I believe published in the Journal of Functional Programming, but
also available from

/nebula.systemsz.cs.yale.edu:/pub/yale-fp/papers/NSWC
)

which reports a DoD study involving (among others) Lisp, C++, and
Haskell.  The object was to implement a "Geometric Region Server".
The Haskell folks also repeated the experiment with a Haskell novice
that finished *even faster* than the expert Haskell programmer.   
The abstractions used in the Haskell code are pretty much the ones a
Lisp programmer would use.  (The Lisp guys also finished very
quickly.)  These abstractions also happen to be not as readily
available to, say, Tcl or C++ programmers.

-- 
Cheers =3D8-} Mike
Friede, V=F6lkerverst=E4ndigung und =FCberhaupt blabla


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

Date: Tue, 15 Apr 1997 14:08:08 +0100
From: cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <MPG.dbd663093c0d5fb98976e@news.demon.co.uk>

With a mighty <JSA.97Apr14170139@alexandria>,
jsa@alexandria uttered these wise words...

> In article <MPG.dbaa4deac2b5dc8989767@news.demon.co.uk> cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer) writes:
> 
> > If I had the time, I'd write a "Lisp for Dummies" book. At least, I'd 
> > attempt it. The result probably wouldn't get published, as I doubt 
> 
> Isn't this basically what the "Little Lisper" is?

I've yet to read it, alas, but from what I've read _about_ it, I 
suspect this is true. Certainly a number of people who could easily be 
described as "sceptics" have made favourable comments about this book.

Yes, it's on my list of "books to get". The trouble is, there are so 
many books on that list, and most of them are about Lisp. ;-) Still, 
I'll get there someday.
-- 
<URL:http://www.wildcard.demon.co.uk/> You can never browse enough
  Martin Rodgers | Programmer and Information Broker | London, UK
            Please note: my email address is gubbish.


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

Date: Tue, 15 Apr 1997 14:09:52 +0200
From: joswig@lavielle.com (Rainer Joswig)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <joswig-ya023180001504971409520001@news.lavielle.com>

In article <3353200E.52CD@maths.anu.edu.au>, Graham Matthews
<graham.matthews@maths.anu.edu.au> wrote:

> Lisp can do what Tcl can do just as well, since in Lisp everything is a
> list.

Where was the smiley?

Where have you been the last twenty years?

In Lisp is not *everything* a list.

Common Lisp for example has numbers
(diverse floats, fixnum, bignum, complex, ratio),
arrays, characters, hashtables, structures, objects, functions,
cons, symbols, strings, ...

And guess what, they are ****not**** represented as lists.

-- 
http://www.lavielle.com/~joswig/


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

Date: Tue, 15 Apr 1997 09:33:22 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: SLEEP (.5) ???
Message-Id: <fl_aggie-ya02408000R1504970933220001@news.fsu.edu>

In article <seligmanE8nAuJ.G8s@netcom.com>, seligman@netcom.com (Scott) wrote:

+ In article <7vzpv1o41w.fsf@speedy.speakeasy.org>,
+ Brett McCormick  <brett@speedy.speakeasy.org> wrote:
+ > 
+ > You could use select.  (man perlfunc)
+ 
+ How?  The man pages would seem to suggest select is a file handle
+ utility, nothing more.

>From page 211 of the Blue Camel:

 select (ready file descriptors)

 select RBITS, WBITS, EBITS, TIMEOUT

 The four-argument select operator is totally unrelated to the previously
 described operator [of the same name].

Seems to be two selects. You needed to read a bit further... :)

James

-- 
Consulting Minster for Consultants, DNRC

To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: 15 Apr 1997 11:49:11 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: sorting a *file* (yeah, I know, it's a mainframe concept)
Message-Id: <5ivpvn$6fu@pirate.shu.edu>

Hello -

dbambw@panther.gsu.edu (Michael) writes:

>Hi all,

>I am in the process of re-writing some of our COBOL programs in
>perl.  In one of these, I need to sort a file of records.  Each
>rec might have 10 or 12 fields in it, the fist three being a 5 digit
>workorder number, followed by a last name then a first name.

>The records come in in workorder number, and I need to sort them to
>an outfile in lastname/firstname sort order.

>All the sorting methods in perl seem to be set up to handle associative
>arrays (ie ONE key field, ONE data field). I don't see how a *record*
>(in the mainframe meaning) could be set up as an assoc array, but I
>can't figure out how to *sort a file* (again in the mainframe concept).

>So how 'bout it, any other ex-COBOLers out there?:-)

Never touched the stuff :-)  And, indeed, there may be aspects of
mainframe records which I'm unaware of....

However, the following might serve as a starting point for you: 

#!/usr/local/bin/perl -w

my @sorted = sort namesort <DATA>;
print @sorted;

sub namesort {
    my ($an, $al, $af) = split /\s+/, $a;
    my ($bn, $bl, $bf) = split /\s+/, $b;
    ($al cmp $bl) or ($af cmp $bf) or ($an <=> $bn); # for identical names :-)
}

__DATA__
12345 Black Clint fieldx fieldy
67890 Smythe Ethel fieldx fieldy
54321 Smith John fieldx fieldy
09876 Black David fieldx fieldy


David Black
dblack@icarus.shu.edu



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

Date: 14 Apr 1997 23:52:51 GMT
From: "David Baker" <dbaker@dkburnap.com>
Subject: Re: Stupid questions.
Message-Id: <01bc492e$dd2453c0$c7a3bece@micronclientpro.dkburnap.com>

If you don't ask, you won't know.  I think that's what newsgroups are all
about.

Do try to exhaust all options to find the answer.  FAQ's are your best bet!

Thanks,

David



Magnus Holmberg <pucko@lysator.liu.se> wrote in article
<334CCC52.1538@lysator.liu.se>...
> Hi!
> 
> I've got a mail from someone that thinks that I have asked many stupid
> questions and thinks that I should RTFM before I ask some more
> questions.
> I wounder if someone knows a newsgrop for perl-beginners where I can ask
> my "stupid" questions whithout disturbin all experts hear?
> 
> Thanks!
> 
> /Mag.
> 


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

Date: Tue, 15 Apr 1997 19:05:04 +1000
From: plm@pcug.org.au (Paul Matthews)
Subject: Two Perl Language Questions
Message-Id: <335344C0.67368979@pcug.org.au>

G'Day,

In the artical entitled 'Irregual Expressions', Tom Christiansen
outlines how it would be nice to have a recursive matching with
nesting.  The example he gives is :

   /\b(?{begin)\b.*\b(?}end)\b/i

to match begin...end blocks.  Being in a position where this
form of pattern matching would be nice, is there any 'offical'
plans to include this in some future version of the language? 
Is so when?


Having done some work lately in Delphi, I have grown to
appreciate it is 'in' keyword.  An example (from memory) is
   
   if var in ['a','b','c'] then
   begin
     :
   end

I think you can see how it works.  Although the same 
thing in perl with 'grep' this could look nicer

   if( $var in @array )
   {
     :
   }

Any thoughts on whether this would be a worthy inclusion in
the language?

-- 
Paul Matthews                                   mailto:plm@pcug.org.au




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

Date: 15 Apr 1997 12:33:05 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why is $Line=~ s///; erasing =
Message-Id: <5ivsi1$npe$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author+p5p via email]

In comp.lang.perl.misc, 
    dblack@icarus.shu.edu (David Alan Black) writes:
:Admitting that I couldn't find mention of this in perlop or
:the Camel - testing it in any case gave me a segfault:

Perlop: 

    If the PATTERN evaluates to a null string, the last 
    successfully executed regular expression is used instead.

So in fact, you *should* be able to say stuff like this
And not incur 3x regcomp overhead:

    if ( $flintstones =~ /put $something[$odd] here $bonus/ ) {
	$fred    =~ s//old/;
	$pebbles =~ s//new/;
	$betty   =~ s//borrowed/;
	$dino    =~ s//blue/;
    } 

The core dump makes this somewhat more difficult. :-) P5P is looking at
it, but it's only been a few hours, so be patient.  :-)  I suspect that
your little core-dumping test case:

    $_ = "abc";
    if (/a/) { s//e/; }

might even make its way into the regression suite.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    "No, I'm not going to explain it. If you can't figure it out, 
     you didn't want to know anyway..." --Larry Wall 


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

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

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