[6598] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 223 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 2 19:37:15 1997

Date: Wed, 2 Apr 97 16:00:22 -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           Wed, 2 Apr 1997     Volume: 8 Number: 223

Today's topics:
     Re: 5.004beta and $& <eryq@enteract.com>
     Re: arrg <danboo@ixl.com>
     Re: arrg <sib@worldnet.att.net>
     Re: Easy way to promote your web site (brian moore)
     file parsing <mbutler@es.com>
     FIREARMS SALE richardfeinberg@usa.net
     Re: How to declare (or my) a $$var variable? <bryan@eai.com>
     Re: How to sort an arrary? <wkuhn@uconect.net>
     Re: Is Perl the ultimate scripting language? lvirden@cas.org
     linux/socket calls (Wolfgang Prentner)
     Re: MIME (base64) encoding script, help? <eryq@enteract.com>
     New Perl Web Page <cgi@ctfire.com>
     Re: New Perl Web Page (Jason Bodnar)
     Re: Ousterhout and Tcl lost the plot with latest paper (Joe English)
     Re: Ousterhout and Tcl lost the plot with latest paper (Stefan Harms)
     Re: Perl class <rootbeer@teleport.com>
     Re: Perl mishandles some multidimensional array referen < hansm@icgned.nl>
     SybPerl 2.07 Compile <pat@episun1.med.utah.edu>
     The theoretically fastest way to iterate through all by <eryq@enteract.com>
     Tie() function in Windows95/NT <larryq@tuttle.com>
     Re: Unix and ease of use (WAS: Who makes more ...) <gavin@ic.ac.uk>
     Re: Wanted, a currency converter? Automatic file downlo <rootbeer@teleport.com>
     win95/winNT port of Berkeley dbm <micd@keicho.cs.uoregon.edu>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 02 Apr 1997 16:11:03 -0600
From: Eryq <eryq@enteract.com>
To: iancu@iil.intel.com
Subject: Re: 5.004beta and $&
Message-Id: <3342D977.7E6527EB@enteract.com>

Eric Bohlman wrote:
> 
> Igal Iancu (iancu@iil.intel.com) wrote:
> : while ($string =~ /0/g) {
> :       $found++;
> : }
> 
> [snip]
> 
> : foreach ($string =~ /0/g) {
> :       $found++;
> : }
> 
> [snip]
> 

And of course, if you just want to count the number of '0'
characters in a string, tr/// is reportedly faster:

	$found += ($string =~ tr/0//);

HTH,
-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.enteract.com/~eryq
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: Wed, 02 Apr 1997 16:53:37 -0500
From: Dan Boorstein <danboo@ixl.com>
To: Brian Lorraine <lorraine@ait.nrl.navy.mil>
Subject: Re: arrg
Message-Id: <3342D561.96C@ixl.com>

Brian Lorraine wrote:
> 
> argggg... I'm writing a guestbook program right now in perl. I was just
> about done with it and then i decided to change a little something on
> one of the scripts "/cgi-bin/lorraine/gstbook.pl". It didn't work, agve
> me some error message yadda yadda yadda.. so no biggie right? I just
> change it back to the way it was (or at least the way i THINK it was)
> and it still duzn't work.. rather odd cuz i ran it before... anyhoo I
> ran it in the unix shell to see what line the so called "error" was on
> and it said line 28... this one:
> 
> @eachrec = split(/##/, @wholething[0];


try:

@eachrec = split(/##/, @wholething[0]);
                                     ^
                                     ^
You forgot your trailing paren. just before the semicolon.
Additionally you may want to change @wholething[0] to $wholething[0].


Dan Boorstein
danboo@ixl.com


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

Date: Wed, 02 Apr 1997 18:23:22 -0500
From: Scott Blanksteen <sib@worldnet.att.net>
To: Brian Lorraine <lorraine@ait.nrl.navy.mil>
Subject: Re: arrg
Message-Id: <3342EA6A.2A53@worldnet.att.net>

Brian Lorraine wrote:
> 
> @eachrec = split(/##/, @wholething[0];
                                       ^
                        Put a ')' here |

Scott


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

Date: 2 Apr 1997 19:42:32 GMT
From: bem@news.cmc.net (brian moore)
To: promotion@shoplet.com,info@ingress.net,postmaster@ingress.net,ellison@ingress.com,mike@ingress.net
Subject: Re: Easy way to promote your web site
Message-Id: <5hucr8$ign$1@news.cmc.net>

Um, Tony, old pal, you never answered my last post.  I even mailed you a
copy, but gosh, the address you post from doesn't work and my copy bounced.

So once again, this time with mail sent to addresses at the web site
you are advertising.  Perhaps they will know how to reach you and can
instruct you how to fix your news client.  I'm really sure it's something
weird, since I doubt someone in NY would configure their news client to
post as if they were in Australia.  I mean only a scammer would lie like
that and you seem so honest.

I've also mailed ingress.net's contacts since they may would be able to
reach you I'm sure.

In article <5hss7l$120@newsfeed.ingress.net>,
	ellison@ingress1.murdoch.edu.au (Tony Ellison[ny][shoplet.com]) writes:
> 
>                 INTERNET PROMOTION OUTLET
> 
> More important than how great your site looks is making sure that
> people come to visit. There are many search engines, directories and
> sites on the Internet.  Listing your site on all of them can be very
> time consuming and frustrating task.  Now, you can enlist your site
> with 50, 100, or 150 top search engines in two minutes for as low as:

Okay, here's the question: where is this list of "top" search engines.  How
are they rated, and by whom?  What are URL's for the top 50?

I love the net, you know.  It's Huuuuuge and always changing and I would
just love to have more search engines than the dozen or so that most people
know of.  I mean if "Bob's Burger Plaza" runs a search engine as nice as
say AltaVista, I'd be glad to use it to speed up my searches.

I'm sure this would be of value to your customers as well, since it is
to their benefit that people use all these "secret" search engines.

Again, if you can't provide this information, I'll have no choice but to
believe that you're just yanking your willy in public and making this stuff
up, which I'd really not want to think.

-- 
Brian Moore                      The opinions expressed above are my own, not
Sysadmin, C/Perl Hacker          necesarily my employers'.


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

Date: Wed, 02 Apr 1997 16:41:58 -0700
From: Melissa Butler <mbutler@es.com>
Subject: file parsing
Message-Id: <3342EEC6.66C2@es.com>

-- I am trying to extract data from a flat file by using the substr()
command, but it is not reading the right characters. Is there any
suggestions? I am trying to find a command that works similiar to the
cut command in shell script.

Here is a sample:
while ($varrec=<INPUT>){

	$compa = substr($varrec,20,25) 

}

mbutler@es.com


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

Date: Wed, 2 Apr 1997 15:59:06
From: richardfeinberg@usa.net
Subject: FIREARMS SALE
Message-Id: <5huhnf$n5f@usenet85.supernews.com>

An estate collection consisting of over 200 new and used handguns, long guns 
and shotsguns is available for sale. Call Richard at Guns Are Us for information and
pricing. 
Included in the collection are Glocks including the new Glock  30 (compact .45 - 
10 shot), Smith & Wessons, Rugers. Winchesters, and a large assortrment of 
paramilitary and law enforcement firearms. Firearms must be received by a Federal
Firearms Licensee.
telephone 508 285 8340
e-mail        gunsrus@gis.net

An abridged list of the items contained the firearm collection follows:
>MANUFACTURER..MODELOPTIONSCONDITIONS. PRICE(CASH)<
>AMT.BACKUP45,.40,9mmNEW.$265<

>ARMSCORAK-47 .22.STDNEW$165<
>M-16...22..STDNEW$165<

>ARSENALSLR-95..STDNEW$295<

>AUTAUGA ARMSAUT. 32STDNEW$450<

>BUSHMASTER(POST).XM15-E2S16,20,24"HBARNEW$695<
.IBIS..21" HBAR.NEW$625<

>CENTURY ARMS..MAS49/56..A LOTVG/EXC$360<
>..C-15HRD.CSVG/EXC$499<
>.K-983rd REICH.VG/EXC$169<
>
>DAEWOODR-200STDNEW.$465<

>GLOCK30FS, .45ACPNEW..$550<
>..29FS, 10mmNEW.$550<
>..17,19,26..FS,9mm..NEW..$420<
>..22,23,27..FS,.40S&WNEW.$420<
>..23C..PORTEDNEW.$480<
>..21FS, .45ACP.NEW.$480<

GRENDELP-30BLUE 30 rd	NEW.$280<

HI-POINT CARB.BLUE 10 rd	NEW..$150<
CHROME 10 rdNEW..$160<
>
>KELTECP-11..FS,MATTE..NEW..$220<
>P-11.FS,PKRD..NEW.$230<
>				
>MOSSBERGM590A1MARINECOTE.NEW..$335<
>.590PRKD,HT.SH.NEW..$325<
>
>RUGERKP94DLEINT.LSR..NEW..$650<
>.KP95DSTD..NEW..$265<
>.KP89DSTD..NEW..$335<
>.SP-1012"bbl.NEW..$330<
>M77VLEBIPOD,RINGS..NEW..$569<
>
>SAVAGE900TR..STD..NEW..$350<
>
>S&W.22AAS,S/SNEW$240<
>..457.BLUENEW.$365<
>..457.TWO TONE.NEW.$390<


GUNS ARE US


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

Date: Wed, 02 Apr 1997 17:03:40 -0600
From: Bryan Hart <bryan@eai.com>
Subject: Re: How to declare (or my) a $$var variable?
Message-Id: <3342E5CC.143@eai.com>

Wing Choy wrote:
> 
> I have large CGI form that has many fields and I using the
> following code to make it become a local variable in my perl
> script:
> 
> foreach $var ($query->param)
> {
>     # retrieve CGI variable and make it an actual perl variable
>     $$var = $query->param($var);
>     print "Setting $var to $$var\n";
> }
> 
> I would like to make my (localize) all these new variable.
> But if I do this:
> 
>     my $$var = $query->param($var);
> 
> I would get a error complaining this:
> 
>     Can't declare scalar deref in my at p_crTk line 52, near "$var ="
> 
> Can anyone suggest how do I declare these to be local variables?
> Thanks.
> 
>         Wing Choy
>         whc@mink.att.com


How about using a local hash instead??

 my %in;
 foreach $var ($query->param)
 {
     # retrieve CGI variable and make it an actual perl variable
     $in{$var} = $query->param($var);
     print "Setting $var to $$var\n";
 }


Bryan
-- 
-------------------------------
|  Bryan Hart                 
|  Network Products Engineer  
|  Engineering Animation Inc. 
|  Phone: (515) 296-5979
|  Fax: (515) 296-7025
|  Email: bryan@eai.com              
|  Web: http://www.eai.com/                          
-------------------------------
"A conclusion is simply the place where you got tired of thinking"


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

Date: Wed, 02 Apr 1997 15:03:25 -0500
From: Bill Kuhn <wkuhn@uconect.net>
Subject: Re: How to sort an arrary?
Message-Id: <3342BB8D.3E79D41D@uconect.net>

Okay, I'm confused by your question.

Is this a multidimensional array where each element of main array
contains a reference to an array containing
lastname,firstname,date,phone,location,manager OR is this an array where
each element is a string of the format (including commas)
lastname,firstname,date,phone,location,manager with the appropriate data
filled in for each "field"????

In the latter case you just use the perl function sort.  The default
sort should give you the results you want.  If you want to make more
elaborate sorting routines you should consult the Programming Perl book
or the manual pages and read about creating sort subroutines.

By the way sort doesn't "work" with associative arrays per se.  It
always takes an indexed array as an argument.  With an associative array
you may see sort used to sort the keys or values of that array using
keys() or values() to first create an indexed array for sort() to work
on.

-Bill
-- 
Bill Kuhn
Chief Developer
Wired Markets, Inc.
http://www.buyersindex.com


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

Date: 2 Apr 1997 20:31:15 GMT
From: lvirden@cas.org
Subject: Re: Is Perl the ultimate scripting language?
Message-Id: <5hufmj$old@srv13s4.cas.org>


Note that the poster posted an almost identical posting to this on
comp.lang.tcl, but didn't bother to stick around for any discussion.

Appears to be a 'hit-and-run' poster...
-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: 02 Apr 1997 20:48:32 GMT
From: prentner@monaco.kapsch.co.at (Wolfgang Prentner)
Subject: linux/socket calls
Message-Id: <PRENTNER.97Apr2224832@monaco.kapsch.co.at>

Dear colleagues !

If written my first perl script a couple
of days ago! Now, I am testing or try to
understand the perl socket calls.
 
Unfortunaley, the communications examples
don't work on my Linux box :-(! Could 
someone please clearify some steps in the
following example (Book: Perl 5 by Example)
the hole sample is also attached, please
see below.

1. I got the following error msg.

>perl sample.pl

Global symbol "packFormat" requires explicit package name at 18lst02.pl line 24.
Variable "$packFormat" is not imported at 18lst02.pl line 27.
Global symbol "packFormat" requires explicit package name at 18lst02.pl line 27.
Execution of 18lst02.pl aborted due to compilation errors.


2. No knowledge about the  line of 
   code ('S n a4 x8' ???)!

$packFormat = 'S n a4 x8';   # Windows 95, SunOs 4.1+
#$packFormat = 'S n c4 x8';   # SunOs 5.4+ (Solaris 2)

3. Why to have to pack the informations again?

connect(SMTP, pack($packFormat, AF_INET(), $port, $serverAddr))
    or die("connect: $!");

Any help would be appreciated

 Wolfgang


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

use Socket;
use strict;

my($mailTo)     = 'prentner@kapsch.co.at';
my($mailServer) = 'werk2.kapsch.co.at';

my($mailFrom)   = 'prentner@infosys.tuwien.ac.at';
my($realName)   = "Wolfgang H. Prentner";
my($subject)    = 'Test PERL Mail';
my($body)       = "Test Line One.\nTest Line Two.\n";

$main::SIG{'INT'} = 'closeSocket';

my($proto)      = getprotobyname("tcp")        || 6;
my($port)       = getservbyname("SMTP", "tcp") || 25;
my($serverAddr) = (gethostbyname($mailServer))[4];


socket(SMTP, AF_INET(), SOCK_STREAM(), $proto)
    or die("socket: $!");

$packFormat = 'S n a4 x8';   # Windows 95, SunOs 4.1+
#$packFormat = 'S n c4 x8';   # SunOs 5.4+ (Solaris 2)

connect(SMTP, pack($packFormat, AF_INET(), $port, $serverAddr))
    or die("connect: $!");

select(SMTP); $| = 1; select(STDOUT);    # use unbuffered i/o.

{
    my($inpBuf) = '';

    recv(SMTP, $inpBuf, 200, 0);
    recv(SMTP, $inpBuf, 200, 0);
}

sendSMTP(1, "HELO\n");
sendSMTP(1, "MAIL From: <$mailFrom>\n");
sendSMTP(1, "RCPT To: <$mailTo>\n");
sendSMTP(1, "DATA\n");

send(SMTP, "From: $realName\n", 0);
send(SMTP, "Subject: $subject\n", 0);
send(SMTP, $body, 0);

sendSMTP(1, "\r\n.\r\n");
sendSMTP(1, "QUIT\n");

close(SMTP);

sub closeSocket {     # close smtp socket on error
    close(SMTP);
    die("SMTP socket closed due to SIGINT\n");
}

sub sendSMTP {
    my($debug)  = shift;
    my($buffer) = @_;

    print STDERR ("> $buffer") if $debug;
    send(SMTP, $buffer, 0);

    recv(SMTP, $buffer, 200, 0);
    print STDERR ("< $buffer") if $debug;

    return( (split(/ /, $buffer))[0] );
}



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

Date: Wed, 02 Apr 1997 16:15:02 -0600
From: Eryq <eryq@enteract.com>
To: John Spaid <fmc@BizServe.com>
Subject: Re: MIME (base64) encoding script, help?
Message-Id: <3342DA66.81964FE@enteract.com>

John Spaid wrote:
> 
> Hi,
> 
> I use a perl cgi program with html forms to mail attached MIME (base64)
> files to folks who request it.  Right now I manually encode the files
> from binary to base64, but I'd like to script in the base64 encoding so
> I can encode binary files for attachments on the fly.  Can anyone offer
> some help?

Get a copy of the new MIME::Lite module, either
from the CPAN authors/Eryq directory, or directly from:

	http://enteract.com/~eryq/CPAN/MIME-Lite/

Documentation also online, at:

	http://enteract.com/~eryq/CPAN/MIME-Lite/docs/MIME/

You can do attachments, the files can be really long, you can output
the MIME to a string, or a filehandle, and you can even send the message
(on Unix).  Hope that helps!

-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.enteract.com/~eryq
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 2 Apr 1997 20:47:58 GMT
From: Jason Many <cgi@ctfire.com>
Subject: New Perl Web Page
Message-Id: <5huglu$b2i@sjx-ixn4.ix.netcom.com>

A brand new CGI/Perl web page has just opened!

Check out The CGI-BIN at http://www.ctfire.com/thebin/

It's the largest single collection of CGI scripts on the web!

The CGI-BIN includes CGI scripts to run message boards, chat programs, 
passworded pages, mailing lists, shopping carts, and a lot more!

 - Jason Many
 - The CGI-BIN
 - http://www.ctfire.com/thebin/
 -
 - cgi@ctfire.com



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

Date: Wed, 02 Apr 1997 22:08:47 GMT
From: jason@cimedia.com (Jason Bodnar)
Subject: Re: New Perl Web Page
Message-Id: <3342d896.188754067@news.onr.com>

Jason Many <cgi@ctfire.com> wrote:

>A brand new CGI/Perl web page has just opened!
>
>Check out The CGI-BIN at http://www.ctfire.com/thebin/
>
>It's the largest single collection of CGI scripts on the web!
>
>The CGI-BIN includes CGI scripts to run message boards, chat programs, 
>passworded pages, mailing lists, shopping carts, and a lot more!
>

Great, just what we need. Another site giving out free CGI programs
that will have countless people flocking to c.l.p.m with their
problems even though CGI does not appear once in the name of the
newsgroup.


-- 
Jason C. Bodnar
jasonb@onr.com
Internet Programmer
Cox Interactive Media


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

Date: 2 Apr 1997 12:17:21 -0800
From: jenglish@crl.com (Joe English)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5huesh$sgh@crl2.crl.com>


I thought Ousterhout's paper was a terrific piece of marketing.

He mentions Tcl and Visual Basic as the primary examples
of "scripting" languages, but since Visual Basic is Windows-only
and Tcl runs "everywhere" (i.e., on Windows, Macs *and* Unix --
other OSes don't have enough market share to really count),
that leaves Tcl as the quintessential scripting language.

Notice too how he presents Java as a "system programming language"
in the same class as C++, in contrast to its usual perception
as a niche language for creating Netscape applets.  (Not that
I disagree with this -- Java _is_ a pretty good general-purpose
language, certainly better than C++.)

He further argues that the combination of a good "system" language and
a good "scripting" language is an effective way to develop programs.
(Not that I disagree with this, either; it _is_ a pretty good
development strategy).  The (unstated) conclusion seems to be that
all you need for higher-level programming in the 21st century
are Tcl and Java.  Guess who owns both languages?

On the whole I thought he made some pretty good points, though
the paper certainly has flaws -- the failure to even mention
Lisp and Scheme (both of which have all the qualities he
cites as desirable in a scripting language), and his description
of strong typing as "too restrictive" typical of those who
have never used a strongly typed programming language with a _good_
type system like Haskell or ML.  But most of all, I couldn't
shake the feeling that I was reading an infomercial.


--Joe English

  jenglish@crl.com


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

Date: Wed, 02 Apr 1997 14:05:02 -0600
From: Stefan_Harms@mbnet.mb.ca (Stefan Harms)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <Stefan_Harms-0204971405020001@ts4m-7.mbnet.mb.ca>

In article <s6y208um0ey.fsf_-_@aalh02.alcatel.com.au>, Chris Bitmead
<Chris.Bitmead@alcatel.com.au> wrote:

> chen@adi.COM (Franklin Chen) writes:
> 
> > I've looked at the paper, and found it extremely misleading for its
> > omissions and factual inaccuracies.  In particular, I was baffled that
> > there was no mention _whatsoever_ of advanced languages such as
> > Scheme, ML, and Haskell--languages that to me seem most promising as
> > foundations for safe, efficient, and expressive prototyping/scripting
> > as well as general purpose programming.
> > 

I am surprised that NO reference is made to AppWare/MicroBrew, as a
parallel to Tcl.   Am I the only one seeing an analog situation?

-- 
Stefan_Harms@mbnet.mb.ca


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

Date: Wed, 2 Apr 1997 14:47:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeffrey Henigson <jeffhen@concentric.net>
Subject: Re: Perl class
Message-Id: <Pine.GSO.3.96.970402143749.26640E-100000@kelly.teleport.com>

On Wed, 2 Apr 1997, Jeffrey Henigson wrote:

> I'm taking a class in Perl (my first!) and my teacher requires that we
> visit the www.perl.com site to answer a few questions. The site appears
> to be down, however, so I thought I might ask them here. If anyone has
> answers, please send them to jeffhen@concentric.net Thanks a bunch! 
> 
> 1) What is one of Larry Wall's favorite books? If you get stuck you
> might try asking a Camel for help. 

"Lawrence of Arabia", a book about another guy named Larry and something
about camels.

> 2) What is the TOTAL number of all Perl bugs reported (open, closed, or
> otherwise)?

Seven, but we're still hoping to reach ten by the time the next version is
released. 

> 3) How many Alien Ports of Perl are listed ar CPAN? (How many operating
> systems does Pel run on?) What are they? 

Perl runs on sixteen different systems, including ENIAC, Timex-Sinclair,
and HAL-9000, and there are alien ports available for Cuisinart, Edsel,
Anorexia, Brown Cow, and Oedipus. 

Oh, I see that www.perl.com is back online, so you won't be needing these
answers to get your homework done. But come back when you have more
assignments, since I'm sure somebody here will be glad to make up answers
for those as well! :-)

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 2 Apr 1997 23:51:30 GMT
From: Hans Mulder< hansm@icgned.nl>
Subject: Re: Perl mishandles some multidimensional array references???
Message-Id: <5hure2$c5g@news.euro.net>

pduff@airmail.net (Patrick Duff) wrote:

> $Array = ( 'Value1', 'Value2');
> error:  "Useless use of constant in a void context"

Actually, it's a warning.  $Array is set to 'Value2'; perl is pointing
out that the constant 'Value1' isn't being used.

> So the moral seems to be when working with multidimensional arrays,
> you have to just play around  with all the possibilities until one works!

No, the morale is that it helps to understand the difference between a
reference and the thing it references.

> Does anyone care to expand on the above analysis to come up with a
> heuristic for determining the correct syntax ( $ or @ or %, and ( ) or
> [ ] or { } ) to use in all circumstances when specifying arrays and
> hashes with varying numbers of dimensions?

Tom Christiansen has done that.  You can find the result on page 257-264
of the turquoise Camel book (and, with recent versions of perl, in the
perllol man page).

--
Hope this helps,

HansM


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

Date: Wed, 02 Apr 1997 10:45:45 -0700
From: Pat Thomson <pat@episun1.med.utah.edu>
Subject: SybPerl 2.07 Compile
Message-Id: <33429B49.338E@episun1.med.utah.edu>

Hi All,
  i'm trying to compile SybPerl 2.07 for Perl 5.003 under Solaris 2.4
and having problems with CTlib. When i make the Makefile, i get the
message

can't find -linsck 

when making the makefile for CTlib. I can't find that library anywhere.
What is it, does it have a different name and residence under Solaris?
Everything compiles and tests fine besides that. Does this library
have anything with Sybase OpenClient? Any help would be appreciated

thanks
pat thomson


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

Date: Wed, 02 Apr 1997 17:25:10 -0600
From: Eryq <eryq@enteract.com>
Subject: The theoretically fastest way to iterate through all bytes in a string...?
Message-Id: <3342EAD6.520D7B6D@enteract.com>

Let's say I have a long string, and I want to perform a
mathematical operation on each byte in the string (regarded
as a 0-255 value)... no modification involved, just an update
of a running total (no it's not a checksum, but something like
that.)  What, in theory, is the fastest way to do this? 

	* a "for" loop with substr()? or unpack()? 
	* a while (m/./s)?
	* others?

TIA,
-- 
  ___  _ _ _   _  ___ _   Eryq (eryq@enteract.com)
 / _ \| '_| | | |/ _ ' /  Hughes STX, NASA/Goddard Space Flight Cntr.
|  __/| | | |_| | |_| |   http://www.enteract.com/~eryq
 \___||_|  \__, |\__, |___/\  Visit STREETWISE, Chicago's newspaper by/
           |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 2 Apr 1997 21:04:33 GMT
From: "Larry Quantz" <larryq@tuttle.com>
Subject: Tie() function in Windows95/NT
Message-Id: <01bc3fa9$3ea42920$1a11c882@trading-9.tuttle.com>

Hi everyone,

       We're trying to use the tie() function to do a little DBM
manipulation on our Windows95/NT machines here, possibly to be used down
the road on our Internet Information Server in some way.  The only thing
is, we can't seem to get it to do much of anything. Here's a sample:

use AnyDBM_File;
%fruit= ("Green", "Apple", "Orange", "Orange", "Yellow", "Banana");
tie(%tiedDB,'SDBM_File',"testfile",O_CREAT(),0666);
%tiedDB=%fruit;
print %tiedDB;
untie(%tiedDB);

What I understand is supposed to happen is a file called "testfile" will be
created on our machine, populated by the values of the %fruit associative
array.  Well, the code seems to run fine, but for whatever reason, we can't
get the "testfile" to be created, much less populated!  I know that
dbmopen() and dbmclose() aren't supported under Windows95/NT, but what
about tie()?  Or are we missing something really simple here.  Anyway,
thanks a lot.


				-Larry Quantz




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

Date: Wed, 02 Apr 1997 12:47:06 +0100
From: Gavin Tabor <gavin@ic.ac.uk>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <3342473A.794B@ic.ac.uk>

Terry Reedy wrote:
> 
> In article <33414A13.4D45@absyss.fr>, seay@absyss.fr says...
> > But remember that
> >everytime someone does some form of freeware (GNU,
> >Perl, Linux, whatever), this is a bit of socialism.
> 
> NO!  freeware is voluntary activity (free enterprise) with no guns or
> g-men in sight.  It is the opposite of socialism.

NO! freeware is communism - the theoretical version, not the
practical version - you do it because you want to do it, not
for any profit beyond what you need to live on.

-- 
Gavin Tabor


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

Date: Wed, 2 Apr 1997 14:50:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Robert <robert@chalmers.com.au>
Subject: Re: Wanted, a currency converter? Automatic file download?
Message-Id: <Pine.GSO.3.96.970402144859.26640F-100000@kelly.teleport.com>

On Wed, 2 Apr 1997, Robert wrote:

> Does anyone have any currency converter code?

    $marks = $dollars * $rate;

Round off the answer as needed. Although you may have had something
different in mind. :-) 

> Also, I need a perl script to automatically download a text file every
> night? 

If you want to write one, there are some helpful modules in CPAN. Good
luck!

    http://www.perl.com/CPAN/

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 02 Apr 1997 14:35:31 -0800
From: Michael Downhill <micd@keicho.cs.uoregon.edu>
Subject: win95/winNT port of Berkeley dbm
Message-Id: <3342DF33.1110@keicho.cs.uoregon.edu>

Looking for a 95/NT port of Berkeley dbm.
Moving a database from unix to windows.
About to give up and convert to MSAccess.
Any help greatly appreciated.

-Michael Downhill
-University of Oregon CS dept.



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

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

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