[12060] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5660 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 14 05:07:08 1999

Date: Fri, 14 May 99 02:00:21 -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           Fri, 14 May 1999     Volume: 8 Number: 5660

Today's topics:
    Re: BUG FIX - Newbie question on CGI developing (Ronald J Kimball)
    Re: Character codes in Perl (Henry Gondorff)
    Re: Conditional search and replace within a text file <cassell@mail.cor.epa.gov>
    Re: How can i write perl script and ouput the base dire <cassell@mail.cor.epa.gov>
        how many people have obscure addresses (was Re: Extract <Russell_Schulz@locutus.ofB.ORG>
    Re: How to get current working directory? <cassell@mail.cor.epa.gov>
    Re: I need some help (Tad McClellan)
    Re: I need some help (Ronald J Kimball)
    Re: info about STDOUT (Martien Verbruggen)
    Re: japh tags (Ronald J Kimball)
    Re: libwww installation <cassell@mail.cor.epa.gov>
    Re: Match string at the beginning of each line <aghaeim@genesis.co.nz>
        newbie help on FormMail msshriyan@hotmail.com
    Re: Newbie question on CGI developing (Ronald J Kimball)
    Re: Pentium III Chips Released with IDs - Intel won't b (Mike Barber)
    Re: Perlish linguistics (aka shibbolethim) (Larry Rosler)
        PerlShop Error #6 <wkdwich@unix.asb.com>
        PerlSjop Mailing List <wkdwich@unix.asb.com>
    Re: read file assign variables <cassell@mail.cor.epa.gov>
    Re: regexp ?: how to ignore escaped delimiter? (Ronald J Kimball)
        storage used by arrays <jmjm@worldnet.att.com>
    Re: storage used by arrays zenin@bawdycaste.org
    Re: storage used by arrays ajs@ajs.com
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 14 May 1999 01:17:22 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: BUG FIX - Newbie question on CGI developing
Message-Id: <1drrrom.18jqae1vsl7ehN@p29.block1.tc5.state.ma.tiac.net>

Charles R. Thompson <design@raincloud-studios.com> wrote:

> What a lamo I am! Don't use double-quotes in your replace tag. Single
> quotes or some other delimiter will work much better. The double quotes
> will fail on HREF and SRC tags if there is no replacement key. Then you
> end up with a junky page. :(

HTML can use either double or single quotes around attribute values, so
if there's a problem with one, there could just as easily be a problem
with the other.  Basically, you have to make sure you don't nest quotes
with your replace tag.

BAD:  <img src="<replace="myimage">">
BAD:  <img src='<replace='myimage'>'>


Or you could just use the code I posted in my other followup, which
replaces all replace tags even when the key isn't defined.  :)


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 14 May 1999 03:03:36 GMT
From: gondorff@shaws.com (Henry Gondorff)
Subject: Re: Character codes in Perl
Message-Id: <373c91a5.44703899@news.intac.com>

On Mon, 10 May 1999 12:05:56 GMT, foxxii@my-dejanews.com wrote:

>There is no ASCII value for "left-arrow", "right-arrow", etc. They are
>character sequences. What character we're you expecting?

I am aware that they are not among the 128 characters that make up
standard ASCII, but I was hoping there was another function in 
Perl that recognizes them.  Obviously DOS is capable of doing this
since DosKey uses them, so it  must be a Perl problem.


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

Date: Thu, 13 May 1999 17:03:48 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Conditional search and replace within a text file
Message-Id: <373B6864.7F47BEC1@mail.cor.epa.gov>

MicroChip wrote:
> If they havent changed the math rules on me lately, a 30 second
> difference between the fastest and slowest of those methods, spread over
> 6 million iterations measures into the microseconds per execution. sorry
> guys, 10 microseconds isnt worth arguing over unless youre building an
> operating system, or a real-time interface (both of which would be best
> done in something other than perl) or an extremely heavily iterative
> program.
> 
> Until i get into writing my own operating system or something equally
> time critical, i'll forfeit a few microseconds and go for the
> flexible/simple regex approach.

As they say around here, TMTOWTDI.

And as plenty of people have said in other threads, if it doesn't
get executed multiple times, a microsecond hardly matters.  When
lots of code like this gets put together, times can add up.   But
you're the best judge of that.  For my work, usually readability
takes precedence over speed.  Whether regexen constitute readability
is another argument waiting to happen.  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 13 May 1999 17:08:49 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: How can i write perl script and ouput the base directory name to my  browser?
Message-Id: <373B6991.53BAFCA0@mail.cor.epa.gov>

Bradley W. Langhorst wrote:
> 
> you could try system or backticks to run a pwd

Which is not very portable.  For example, lots of win32 boxes
will blargh horribly on that.  As it says in the docs:

use File::Basename;

    ($name,$path,$suffix) = fileparse($fullname,@suffixlist)
        fileparse_set_fstype($os_string);
    $basename = basename($fullname,@suffixlist);
    $dirname = dirname($fullname);

Then use print() with the appropriate header, or a here-doc.

But the browser adds additional issues.  Is the poster
even in the directory he/she assumed?  

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 13 May 1999 16:17:53 -0400
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: how many people have obscure addresses (was Re: Extracting emails from array)
Message-Id: <19990513.161753.7X5.rnr.w164w_-_@locutus.ofB.ORG>

[
  Randal, why are you posting this to comp.lang.perl.misc ?  What does it
  have to do with Perl?  Haven't you been around long enough to know to
  not do that?  Anyway, I've redirected.
]

merlyn@stonehenge.com (Randal L. Schwartz) quotes and writes:

>> Although in real life, of course, excluding email addresses like the
>> two above is unlikely to exclude that many users.
>
> Do you dare exclude the CTO of a company that hasn't got a "nice clean
> c-symbol@foo.bar.com" email address wanting to buy a bunch of your
> stuff, but his email address is "pager:fred"@bob.big.com?

Yes.  He will already be losing so much mail that his missing mine won't
be particularly noticeable.

> Why do people always go back to the "but it wouldn't exclude THAT MANY
> people" argument?

Um... because it's true?  Dusty parts of 822 added for compromise long
ago aren't being used today, and are more likely to have errors in them
due to obscurity (do _you_ think the Wilt example is obvious?  I sure
don't, and I don't expect anyone else to find it so.) and infrequent use.

There's not a lot of value in being backwards compatible with something
which hasn't been powered up in 10 years.

> Just do it right.  Remember that to the left of the "@" can be
> ANYTHING and you won't go wrong.  Stop being so narrow minded.

Again I offer you this:   I will stop making this claim if you stop
using `merlyn@' as your address and switch to your `fred&barney@'
contrived example.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Thu, 13 May 1999 13:37:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to get current working directory?
Message-Id: <373B380F.6503D085@mail.cor.epa.gov>

Chim Kin Sang wrote:
> 
> Kevin A. Collins wrote:
> 
> > Hi there,
> >
> > I was just wondering if there is a standard way to get the path of the
> > current working directory. I've looked through a lot of the Perl
> > documentation, but haven't found an easy solution. I'm using Perl for
> > Win32 right now and there is a Win32::GetCwd() function, but I just
> > thought there might be a more portable solution.
> >
> > Thanks in advance!
> >
> > Kevin
> 
>   Actually, I also engage into the same situation. I am using IRIX 6.5.
> The way that I fix it is to use the argument input in the command line.
> For example.
>  csh:   some.perl_script  current_directory
> 
> and in the some.perl_script,
> 
> #!/bin/perl
>  $DIR=@ARGV[0];
>   print "$DIR \n";
> 
> #############################
> Can anyone suggest a more convienient way to define the current
> directory?

The most portable way to do it is also one of the easiest.

use Cwd;
$dir = cwd;  #or several other options if you <use> this module

or, if you're a good boy:

use strict;
    [some stuff here]
use Cwd;
my $dir = cwd;

and modern Perls already have it.

HTH,
David
-- 
David Cassell, OAO                            cassell@mail.cor.epa.gov
Senior Computing Specialist                      phone: (541) 754-4468
mathematical statistician                          fax: (541) 754-4716


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

Date: Thu, 13 May 1999 19:40:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: I need some help
Message-Id: <5unfh7.1m2.ln@magna.metronet.com>

tex2121@my-dejanews.com wrote:
:  I am trying to write a Perl program that displays the n most freqent m
: word sequences in an arbitrary number of input files. n , m and the
  ^^^^^^^^^^^^^^
: input file names should be specified on the command line.  The program
: should display the word sequences as well as the count of the number of
: times each occurs in the input files. The format of the command line
: arguments should be as follows:

: Program n m [list of input files]

: Also disreguard punctuation, case sensitivity numbers.


   So "word sequences" are what is left after removing them?

   Is "don't" one word or two words?


   Might the word sequence be broken across line breaks?


   Must overlapping word sequences be accounted for?

   i.e. for the sentence above with m=3, are there 2 sequences
   ( " Must overlapping word" and "sequences be accounted"), or
   are there these four:

      Must overlapping word
      overlapping word sequences
      word sequences be
      be accounted for

   ???


   You specification is wide open.

   It would be a waste of time for us to code it up, because
   you have left too many things for us to guess. We may guess
   wrong.


: I am stuck on how to start this problem.  I have not done much
: programing in perl, other than some tests of stuff that I am reading
: from a book I have. Any ideas would be appreciated.  Thanks


   1) delete all non-letter, non-whitespace characters

         s/[^a-zA-Z\s]//g;


   2) count the word sequences (non-overlapping is easier, so since
      it wasn't specified, I'll choose the easier interpretation :-)

         while ( /((?:\w+\s*){$m})/g ) {
            my $words = lc($1);           # copy and force to lower case
            $words =~ s/\s+$//;           # strip trailing whitespaces
            $cnt{$words}++;               # count the sequence
         }


   3) sort hash by values (numerically descending) after processing 
      the entire file, and print the top n ones:

         # we have a problem if there are less than $n in the list...
         foreach ( (sort {$cnt{$b} <=> $cnt{$a}} keys %cnt)[0..$n-1] ) {
            print "$_ ==> $cnt{$_}\n";
         }



   That should get you started.


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


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

Date: Fri, 14 May 1999 01:17:17 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: I need some help
Message-Id: <1drrqdf.9ctxr1ks902aN@p29.block1.tc5.state.ma.tiac.net>

Eric Bohlman <ebohlman@netcom.com> wrote:

> For maintaining the sequence counts, you're almost certainly going to
> want to use a multi-dimensional hash, so take a look at perllol and 
> perldsc.  You're going to have a slightly sticky time because the number
> of dimensions to the hash is variable rather than fixed, so you can't
> just use a fixed number of nested loops.  A recursive technique might be
> the best one.

Hmm, why a multi-dimensional hash?  I would use a single-dimensional
hash, with the keys as space-separated word sequences, and the values as
occurence counts.  This is really the same problem as counting
occurences of words, except 'words' is replaced with 'word sequences'.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Fri, 14 May 1999 03:05:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: info about STDOUT
Message-Id: <9qM_2.109$oO4.1131@nswpull.telstra.net>

In article <7gc896$jme$1@nnrp1.dejanews.com>,
	t-milleville@ti.com writes:

> So, how can we know if STDOUT is  redirect ?

The perl FAQ is your friend.

# perldoc perlfaq8
How do I find out if I'm running interactively or not?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | Mr Kaplan. Paging Mr Kaplan..."
NSW, Australia                      | 


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

Date: Fri, 14 May 1999 01:17:19 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: japh tags
Message-Id: <1drrqq6.16arh8tvaw8cgN@p29.block1.tc5.state.ma.tiac.net>

<todd_b_smith@my-dejanews.com> wrote:

> Let's get a thread going with people's tag lines that print "Just
> Another Perl Hacker." I've seen lots, but now I want to see them all!

Here's a one-liner that I use for posts about regexes:

perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


In this one, I guess it's pretty obvious where the words come from, but
it uses a somewhat obscure feature to get them.

#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
      perl -e'for(sort keys%main::){print if $$_ eq 1}
            ' -s  -- -' Just' -' another ' -'Perl ' -'hacker 
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]


This one is the same, but uses a different way of finding the words:

#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
      perl -s -e'print sort grep { /\s/ } keys %main::
            ' -- -is -' Just' -' another ' -'Perl ' -'hacker 
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]


I wrote this one just because I wanted to have a lot of keywords in a
row (aside from having to throw in a couple commas).  Also should be run
under sh.

perl -e 'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-



My favorite so far, though, is Abigail's abuse of the asterisk.  :)

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        perl -le 'print "Just another \u$^X hacker"'


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

Date: Thu, 13 May 1999 16:58:25 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: libwww installation
Message-Id: <373B6721.E11F71CC@mail.cor.epa.gov>

izzac@my-dejanews.com wrote:
> 
> I would like to use the library libwww on win NT, but I didn't find a
> installation guide for NT.  Anybody know where I can find it ?

It looks to me like you found it already.

> in the readme file, nothing explain for winNT. It says that run
> make
> make test
> and make install
> 
> so, what to do with this ?

If you're using a modern version of ActiveState Perl, here's what
you do with that.  You throw it away.  Use ppm instead.  At a
command prompt type:
   ppm install libwww
and let ppm do all the installation for you.

If you're not using a modern version of ActiveState Perl, then
you either [1] have an old, out-dated, festering camel carcass
which needs to be upgraded; or [2] you (or someone near to you)
installed a different version of Perl on your NT box.  Case 1:
upgrade.  Case 2: you must have the program make [or dmake or
gmake or the moral equivalent thereof] on your system, and you
just type those lines, one at a time, at a command prompt.
If you get no error messages, you're golden.

> thanks.

you're welcome.
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 14 May 1999 14:43:54 +1200
From: Me <aghaeim@genesis.co.nz>
Subject: Re: Match string at the beginning of each line
Message-Id: <373B8DEA.71F13E2E@genesis.co.nz>

Sheila Eugenio wrote:
> 
> How can I an IP pattern matched in a log file, such that if it each line
> has the ff:
> 172.16.190.97, -, 5/1/99, 0:37:28
> 172.16.190.97, -, 5/1/99, 0:41:45
> 172.16.38.100, -, 5/1/99, 2:14:03
> 172.16.38.100, -, 5/1/99, 2:14:03
> 172.16.25.26, -, 5/1/99, 4:17:32
> 172.16.25.26, -, 5/1/99, 4:17:33
> 
> what I will have printed are just the IP addresses:
> 172.16.190.97
> 172.16.38.100
> 172.16.25.26
> 
> my code:
> $dir = 'D:/WINNT/system32/LogFiles';
> open (LOG, '>D:/WINNT/system32/LogFiles/sample.log');
> open (LOGFILE, "$dir/in9905.log") or die ("Cannot open file\n");
> while ($line = <LOGFILE>) {
>         ##I  don't know how the pattern matching will go about
>         }
> }
> thanks in advance for any help..

try this
	($var,$junk)=split /\,/,$_,2;
and use $var then.

---------------------------------------------------------------------
Protect privacy, boycott Intel PIII: http://www.bigbrotherinside.org
---------------------------------------------------------------------


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

Date: Fri, 14 May 1999 07:49:36 GMT
From: msshriyan@hotmail.com
Subject: newbie help on FormMail
Message-Id: <7hgkif$nb9$1@nnrp1.deja.com>

hi
please help me anybody
i have downloaded formmail from matt's script archive and cannot seem
to get it working on my comp
i am using ms win 98 with pws as my web server
the error i am getting is - no end of error encountered before end of
file reached
please help
tia
manoj


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Fri, 14 May 1999 01:17:20 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Newbie question on CGI developing
Message-Id: <1drrrf3.1kiojptz0olfuN@p29.block1.tc5.state.ma.tiac.net>

Charles R. Thompson <design@raincloud-studios.com> wrote:

> # iterate through each of the hash keys...
> while ( ($key, $value) = each %pagestuff){
>   # find all instances of the named key and replace it
>   # with a value from the hash
>   $pagelines =~ s/<replace="$key">/$pagestuff{$key}/;
> }

Hmm, that seems backwards to me.  In particular, Perl has to recompile
the regex each time, and you're doing extra work for keys that don't
appear in the file.  Also, without a /g, you only allow each template
key to appear once in the file.


How about replacing that loop with the following?

$pagelines =~ s/<replace="([^"]*)">/$pagestuff{$1}/g;


But then you get into problems with non-existing keys...

$pagelines =~ s/<replace="([^"]*)">/
                exists $pagestuff{$1} ? $pagestuff{$1} : ''/eg;


TMTOWTDI.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 14 May 1999 01:42:20 GMT
From: al013@freenet.hamilton.on.ca (Mike Barber)
Subject: Re: Pentium III Chips Released with IDs - Intel won't budge
Message-Id: <7hfv1s$oi5$1@mohawk.hwcn.org>

HELP!  HELP!
THE PARANOIDS ARE AFTER ME!!!!!

			  	      ___
			     	  Mike Barber
			    
			    Drink Coffee and Destroy





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

Date: Thu, 13 May 1999 21:00:43 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perlish linguistics (aka shibbolethim)
Message-Id: <MPG.11a53fc25648d577989a61@nntp.hpl.hp.com>

In article <373B88D9.67AE31BA@sprynet.com> on Thu, 13 May 1999 22:22:17 
-0400, vepxistqaosani <fbart@sprynet.com> says...
> I was wondering why the plural of pragma was not pragmata in the Camel
> book. A quick Web search verified that it would be good Greek -- and is
> even used in some HTML Perl documentation. Did O'Reilly assume that
> Greek plurals just won't work in a world of small Latin and less Greek?
> 
> But how many of you perlers out there use "pragmata" (or "lemmata", for
> that matta)?

Hoi polloi ('the many', per a discussion earlier this week that 
proceeded from the derivation of Esparanto plurals that started with a 
complaint about 'problemo' not being correct in any Romance language).

Kudos to you for raising this important issue.  (That's a singular noun, 
of course; plural, kudoi -- see above.  There's no such thing as one 
kudo.)  But perhaps there are more appropriate forums for it -- er, fora 
for it.  Or forget it.  :-)

Good Greek and good Latin do not good English make.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 14 May 1999 03:55:38 GMT
From: Debbie Doerrlamm <wkdwich@unix.asb.com>
Subject: PerlShop Error #6
Message-Id: <373B9EBA.69756003@unix.asb.com>

Long story, but I ended up actually BUYING pershop under the name of 
 cash cart.. the guy is a dolt.. says it WILL NOT run on an NT, but 
 others not only say it will, I have used carts that are currently 
 running on an NT, I suppose he may have changed some stuff to not allow 
 it.. but I doubt that. 

 My current carts are on a UNIX server but seem to have a FIT on AOL
(all versions). Get all the way to the Place Order page, and when
clicked get an transmission error #6

 For the life of me I can't figure it out, it works everywhere else just 
 fine. Again.. I have asked this guy repeatedly to give me a list of all 
 the transmission errors and I get no response.

I am not the only one getting this transmission error #6 using the AOL
browser..
I just tried on AOL 3.0 and earlier on the 4.0 Earlier was connected via
tcp/ip connection, this time with 3.0, I am dialed straight into AOL

AOL 3.0 does not allow use of stand alone MS IE or Netscape (using 4.0
you can use them), so I can not simply redirect them there.. to many
still use AOL 3.0

Last test was to dial into AOL 4.0 ver I got the following response when
clicking on the place order button:
Invalid Transmission #6 received from: 152.163.204.69
If your connection was interrupted, you must Enter the shop from the
beginning again.

After receiving the error, I went into the site using MS IE 3.02 and was
told I had an order in progress.. went to view order, then place order
and bingo.. transaction was taken

Any ideas here??
-- 
Regards,
Debbie -->> Online Scanned Nailart Contest Winners now Online!!

 ^v^   ///\o/\\\    ^v^ 

Debbie Doerrlamm       webmaster2@beautytech.com
(AIM- Nailgodess or NailGdsss) 

Wicked Wich Nails, WWWeb Services, Ronkonkoma, NY
       World Wide Salon Referral Program
http://beautytech.com/   http://salonmart.com   http://webcentre.com/


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

Date: Fri, 14 May 1999 04:12:10 GMT
From: Debbie Doerrlamm <wkdwich@unix.asb.com>
Subject: PerlSjop Mailing List
Message-Id: <373BA29A.E1529AC5@unix.asb.com>

After reading some of the obnoxious nasty replies to plea of help on
PerlShop here, I decided to set up a mailing list for dicussion and
trouble shooting.
The list can be subscribed to by sending a blank email to:
perlshop-subscribe@topica.com

-- 
Regards,
Debbie -->> Online Scanned Nailart Contest Winners now Online!!

 ^v^   ///\o/\\\    ^v^ 

Debbie Doerrlamm       webmaster2@beautytech.com
(AIM- Nailgodess or NailGdsss) 

Wicked Wich Nails, WWWeb Services, Ronkonkoma, NY
       World Wide Salon Referral Program
http://beautytech.com/   http://salonmart.com   http://webcentre.com/


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

Date: Thu, 13 May 1999 17:35:21 -0700
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: read file assign variables
Message-Id: <373B6FC9.38AC81D0@mail.cor.epa.gov>

mikecard@my-dejanews.com wrote:
> 
> In article <373B06E2.669F2A86@vt.edu>,
>   Brian Rectanus <brectanu@vt.edu> wrote:
> > You cannot use uninitialized variables whaen using the -w flag.
> >
> 
> i removed the -w now when i run the script uhm nothing gets printed out.
>  I would expect the last two lines of the txt document to be printed
> since (i thought) they would be assigned to the $link and $description
> variables.
> [snip of code]

Removing the -w is never a solution to the problem.  That's like
seeing the oil light come on in your car, and just taping some
duct tape over the light so you don't see the warning anymore.
The problem is still there, and likely getting worse with every
minute.  Larry R. gave a good solution, with a good way of handling
that warning.  Use -w.  It's good for you.  And consider moving to
'use strict;' also.  The first time you type $liens when you meant
$lines, and the program warns you about it, you'll be glad you
did.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 14 May 1999 01:17:24 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: regexp ?: how to ignore escaped delimiter?
Message-Id: <1drrsge.ugwgra1mk01l6N@p29.block1.tc5.state.ma.tiac.net>

Spica <reply@newsgroup.please> wrote:

> On 13 May 1999 17:44:19 GMT, ilya@math.ohio-state.edu (Ilya
> Zakharevich) wrote:
> 
> >Yet another example of not trusting this book for best advice.
> 
> As I'm totally fresh to this regular expressions topic, I had found
> this book by searching on the web and decided to order it as in aid to
> learning perl. Is it not a good book? Or are some of the examples just
> outdated with new revisions of perl? Any comments welcome. (I'm still
> going to wait for the book order to arrive as I have 30 days to return
> it but wouldn't mind hearing comments from others....)

Mastering Regular Expressions is an excellent book!  Ilya's disparaging
comments are based on the fact that he has added many features to Perl's
regular expression syntax since the book came out.

However, these new features tend to be limited in scope or rather
difficult to understand, so you probably won't use them very often
anyway.

Thus, Mastering Regular Expressions is still an extremely useful book.
In particular, it should be very helpful in understanding *how* regular
expressions work, not just what they do.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: Thu, 13 May 1999 23:37:01 -0400
From: Joe Miklewicz <jmjm@worldnet.att.com>
Subject: storage used by arrays
Message-Id: <373B9A5D.8DDD0FE9@worldnet.att.com>

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<p>I've just started to use Perl and I don't seem to be able to find an
answer to this in the FAQs or Perl Programming.
<p>If I reference an array for the first time like so:
<p>$array[100] = 5;
<p>$array[ 0 .. 99] are undefined, but is any space allocated for them
in the array?
<p>I need to store some data in an array but the indexes will be large
numbers like 250000, 250001, etc. There won't be any data for an index
less than 250000. My concern is that if I use an array where the smallest
an index will ever be is 250000 I will have an array with a lot of empty
space allocated. I know I could subtract 250000 before using the number
to index into the array but there are reasons I'd rather not do this. My
alternative would be to use a hash.
<p>Thanks,
<br>Joe
<br>jmjm@worldnet.att.net
<br>&nbsp;</html>



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

Date: 14 May 1999 04:13:21 GMT
From: zenin@bawdycaste.org
Subject: Re: storage used by arrays
Message-Id: <926655335.45706@thrush.omix.com>

[posted & mailed]

Joe Miklewicz <jmjm@worldnet.att.com> wrote:
: <!doctype html public "-//w3c//dtd html 4.0 transitional//en">

	Lose the HTML and you might get a response.

-- 
-Zenin (zenin@archive.rhps.org)

        My code is filled with comments!  It's just that my comments are
        written in Perl.


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

Date: Fri, 14 May 1999 05:47:54 GMT
From: ajs@ajs.com
Subject: Re: storage used by arrays
Message-Id: <7hgdea$hip$1@nnrp1.deja.com>

In article <373B9A5D.8DDD0FE9@worldnet.att.com>,
  Joe Miklewicz <jmjm@worldnet.att.com> wrote:

> If I reference an array for the first time like so:
> $array[100] = 5;
> $array[ 0 .. 99] are undefined, but is any space allocated for them
> in the array?

Yes and no. No space is allocated for the elements of the array, but the
array itself takes up a linear amount of space based on the highest
index (give or take a few).

> I need to store some data in an array but the indexes will be large
> numbers like 250000, 250001, etc. There won't be any data for an index
> less than 250000.

There are several things you can do. One: just use an offset (e.g.
$ary[$index-250_000]) or, you could use a hash (e.g. $ary{$index}),
which will only store the elements that you give it, but the keys are
treated as strings.

The other option is ugly, and has many drawbacks, but if you really need
to (think twice, and then think again), you can set $[, which modifies
the base index of an array (thus, you could make 250000 the first
element of every array). $[ would actually be very cool if it were
per-array AND lexically scoped, but such is not the case, and thus you
get yourself into the nasty problem of modifying EVERYONE's base array
index.

-AJS


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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