[8338] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1955 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 23 03:08:49 1998

Date: Mon, 23 Feb 98 00:00:35 -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           Mon, 23 Feb 1998     Volume: 8 Number: 1955

Today's topics:
    Re: Avoiding $` <rjk@coos.dartmouth.edu>
        Contract - Unix,Perl and Sybase rgudipati@aol.com
    Re: DES compilation. (with stdarg.h) (Kaz Kylheku)
        Errata in "Perl 5 How-To" (2nd ed) from Waite Group Pre <kfortin@ufl.edu>
    Re: Errata in "Perl 5 How-To" (2nd ed) from Waite Group (Jeff Yoak)
    Re: Errata in "Perl 5 How-To" (2nd ed) from Waite Group <kfortin@ufl.edu>
    Re: Fill a hash ? (short post) <rjk@coos.dartmouth.edu>
    Re: Getting started with CGI/Perl <webmaster@fccj.cc.fl.us>
    Re: Getting started with CGI/Perl (Martin Vorlaender)
    Re: Help: Warning in string to number conversion. <rjk@coos.dartmouth.edu>
    Re: How can i add users to the passwd file in unix with <webmaster@fccj.cc.fl.us>
    Re: Killfile Triage <spt@cstr.ed.ac.uk>
        Law-enforcement apps ? <jwaustin@sympatico.ca>
    Re: Off-topic (Sorry, but I need your help) <rjk@coos.dartmouth.edu>
        Problem using GD to create VERY large gifs. (Fergus McMenemie)
    Re: regexp problem (Abigail)
    Re: regexp problem (Jonathan Feinberg)
        Runtime building of search expression <loyt@aals27.alcatel.com.au>
    Re: ts: Remove files in a PERL sript (Jonathan Feinberg)
    Re: ts: Remove files in a PERL sript (Craig Berry)
    Re: ts: Remove files in a PERL sript <tchrist@mox.perl.com>
    Re: ts: Remove files in a PERL sript <ebohlman@netcom.com>
        Uninitialized value chunk error <"no.#@&!spam"@no.spam.cyberdex.com>
        vec builtin function tvs_srs@hotmail.com
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 23 Feb 1998 01:07:27 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Avoiding $`
Message-Id: <34F1122A.D06BD478@coos.dartmouth.edu>

uri@sysarch.com wrote:
> 
> given a particular problem context we have shown several ways to not use
> $[`&']

Unfortunately, most of them were incorrect.

> my assumptions were no newline and not /g. i would have answered
> differently if they were required. the original poster seemed relatively
> new and probably doesn't know about /s, /g and pos().

And when the original poster starts using /s and /g, or strings with embedded
newlines, suddenly the solution he got from clpm will stop working.  It's okay
to make assumptions, *when they are warranted*.  In this case, we want an
alternative for $`, $&, and $'.  Any solution we come up with should work in
*all* situations in which $`, $&, and $' might be used.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: Mon, 23 Feb 1998 01:32:45 -0600
From: rgudipati@aol.com
Subject: Contract - Unix,Perl and Sybase
Message-Id: <6cr8mt$vdo$1@nnrp2.dejanews.com>

I have an immidiate requirement in SanFrancisco for Unix,Perl and some Sybase
background. This is a very long term 1 Year + contract with extensions. The
person should have very good communication skills.Please send me resume
immidiately.

E-mail : rgudipati@aol.com

Thanks
Ravikumar Gudipati

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 22 Feb 1998 22:17:59 GMT
From: bill@cafe.net (Kaz Kylheku)
Subject: Re: DES compilation. (with stdarg.h)
Message-Id: <6cq86n$s1v$1@brie.direct.ca>

In article <34EF7755.67368748@electriciti.com>,
Rocko Pebcakio  <yingyang@knob.com> wrote:
>Hello,
>we are trying to use the DES.pm module, and when we compile the C source
>code we find that we are missing a file. We are missing the file
>"stdarg.h"  This file is neccesary for the compilation of the DES
>library.

If it makes you feel any better, I deeply sympathize with you.

But what your question has to do with comp.lang.c is beyond me.


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

Date: Sun, 22 Feb 1998 22:57:53 -0500
From: Kevin Fortin <kfortin@ufl.edu>
To: mwaite@waite.com
Subject: Errata in "Perl 5 How-To" (2nd ed) from Waite Group Press
Message-Id: <34F0F3C1.628756F2@ufl.edu>

Hello, Mr. Waite

I am somewhat disappointed and angered by the sloppy editing on the
tables in chapter one of the book "Perl 5 How-To" by S. Asbury et al.
(2nd ed).  The erroneous tables mar an otherwise fine book.

In chapter one, the tables on operators and variables have many errors
that are apparent just from context, comparison with the text and code
samples, and this reader's previous programming experience.

In many cases, it is impossible to deduce what the correct information
should be.  There are so many obvious errors that one might wonder
whether the authors were trying to prevent novice Perl scripters from
learning the language.

Of course, I realize that proofreading an 850+ page programming book is
a difficult task.  However, I think it is reasonable for a reader and
customer to expect that a $49.95 book would at least have accurate
reference tables.

I came to your web site hoping to find this edition's errata available
for download, but did not.  I will have to look elsewhere for an
accurate Perl reference.

It's too bad that someone with a clear head and knowledge of the Perl
language was not able to proofread these tables before the book went to
press.  I am only part way through Ch. 1, but these errors cast doubt at
least upon the rest of the tables in this book.  (It appears that they
were typeset and proofread separately, as the rest of the book seems
fine.)

In fairness to the authors and to Waite Group Press, I should note that
the text itself and the code samples given are clear and seem to be
accurate and reasonably well proof-read.  In addition, what I have seen
so far of the text has been straightforward, enjoyable and
well-organized, and the book's design and layout are attractive.

Overall  it looks like a lot of thought went into this book and that it
will be very useful and informative.  However, the erroneous tables are
a serious defect that might keep this otherwise fine book from reaching
a wider audience.

Thank you for your time -- I hope you will forward my comments to the
appropriate parties at WGP.

Best wishes,

Kevin Fortin
Gainesville, FL

cc:  news:comp.lang.perl.misc



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

Date: Mon, 23 Feb 1998 06:57:17 GMT
From: jeff@yoak.com (Jeff Yoak)
Subject: Re: Errata in "Perl 5 How-To" (2nd ed) from Waite Group Press
Message-Id: <6cr6vu$1m@dfw-ixnews10.ix.netcom.com>

[posted and emailed]

Kevin Fortin <kfortin@ufl.edu> wrote:

>I came to your web site hoping to find this edition's errata available
>for download, but did not.  I will have to look elsewhere for an
>accurate Perl reference.

There is an errata page linked to the website and it can be directly
accessed at ftp://ftp.waite.com/pub/waite/Perl_5_Interactive_Course/ .

Cheers,
Jeff

-------------------------------
Jeff Yoak         jeff@yoak.com



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

Date: Sun, 22 Feb 1998 23:10:08 -0500
From: Kevin Fortin <kfortin@ufl.edu>
Subject: Re: Errata in "Perl 5 How-To" (2nd ed) from Waite Group Press
Message-Id: <34F0F6A0.EA399AB4@ufl.edu>

On my posting re: "Perl 5 How-To", my stated organization is incorrect.
I am NOT affiliated with the Northeast Regional Data Center (at the
Univ. of Florida) -- our SMTP server incorrectly supplied that as my
organization.

Kevin Fortin


In ref to:

Kevin Fortin wrote:

> Hello, Mr. Waite
>
> I am somewhat disappointed and angered by the sloppy editing on the
> tables in chapter one of the book "Perl 5 How-To" by S. Asbury et al.
> (2nd ed).  The erroneous tables mar an otherwise fine book.

> [ the rest of the posting is omitted ]



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

Date: Sun, 22 Feb 1998 22:38:27 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Laurel Shimer <autopen@autopen.com>
Subject: Re: Fill a hash ? (short post)
Message-Id: <34F0EF35.256AB45D@coos.dartmouth.edu>

[posted and mailed]

Laurel Shimer wrote:
> 
> I have data in a dbm file (for the time being). I need to get the data
> into a hash.

A dbm file *is* a hash.  What exactly are you trying to do?

> What is the proper technique for taking data from a single dimensional
> array and shoving it into a hash?

Let me see if I understand...  You want to copy the hash from the dbm file
into another hash, except you want the values in the second hash to be
anonymous arrays, i.e., foo => "bar&baz" becomes foo => [ "bar", "baz" ].
Is that right?

> [...]
> --------- Sample Code using 'push' - which is not the right concept
> #!/usr/local/bin/perl5

You should use -w

> $mydata="sort.test";
> $delim="&";
> 
> dbmopen (%mydata, $mydata, 0666) || die "$!\n";
> 
> print "First we push it in\n";
> while  ( ($key,$val) = each %mydata)   {
>    ($age,$height,$lastname)=split(/$delim/,$val);
>    print "$lastname is $age years old and $height feet tall\n";
>    $NextHashRow=$lastname=>{age => $age, height=>$height};
>    push @people, $NextHashRow;

$NextHashRow is a scalar variable.  You are trying to assign a list to it; the
two element list ($lastname, {age, $age, height, $height}).

Note that @people is an array.  It has nothing to do with %people, which is a hash.

> 
>    }
> print "Then we hash it on out \n";
> 
> foreach $value (@people) {
>    print "$value is $people{$value} {age} years old and

This is the first reference to the variable %people.  You seem to be having
trouble grasping the difference between variables of the same name.

$people is a scalar variable
@people is an array; also: $people[$a], @people[$a, $b]
%people is a hash;   also: $people{$x}, @people{$x, $y};
 people is a filehandle
&people is a subroutine

These are all different 'variables' which happen to have the same name. 
Assigning to @people has absolutely no effect on %people.

>    $people{$value} {height} inches tall \n";
>    }
> 
> print "Manuel is $people{Manuel}{age} years old \n";
> print "Manuel is $people{Manuel}{height} inches tall \n";

Do you want %people to be keyed on first name or last name?  Earlier it looked
like you wanted the keys to be last name, but here you used a key which is a
first name.

> dbmclose (%mydata);

As you said, push is not the right concept.  The right concept here is:
$people{$key} = $value;

So, assuming you want the keys to be last names:

#!/usr/local/bin/perl5
$mydata="sort.test";
$delim="&";

dbmopen (%mydata, $mydata, 0666) || die "$!\n";

while (($key,$val) = each %mydata)   {
   ($age,$height,$lastname)=split(/$delim/,$val);
   print "$lastname is $age years old and $height feet tall\n";
   $people{$lastname} = { age => $age, height => $height };
}

while (($name, $stats) = each %people) {
   print "$name is $stats{age} years old and $stats{height} inches tall \n";
}
# note that because $stats holds the anonymous hash, I didn't need to do
# $people{$name}{age}, which would also have worked.

dbmclose (%mydata);

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: Sun, 22 Feb 1998 23:05:20 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
To: Thad Rolling <thad@execpc.com>, thad@execpc.com
Subject: Re: Getting started with CGI/Perl
Message-Id: <34F0F580.B4EAC596@fccj.cc.fl.us>

[Posted & Mailed...]

See the http://www.perl.com...

Then lookup CGI.pm - it will be a BIG help...
(It is included with 5.004, so you may want to upgrade your Perl...)

HTH,
Bill

Thad Rolling wrote:

> Hello,
>
> I am getting started using Perl scripts via CGI on my web server.  My server
> is RedHat 4.0, Apache and Perl 5.003.  It looks like I am missing a
> configuration somewhere because when I try to run a Perl program through a
> web page, I get a "Server Error".
>
> Since I am new to Perl and CGI and Apache (but not HTML), I was wondering if
> anyone has a checkoff list of things needed to run Perl CGI programs.  A
> simple working example would be great too!
>
> Thanks,
>
> Thad
> thad@execpc.com





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

Date: Mon, 23 Feb 1998 05:22:41 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Getting started with CGI/Perl
Message-Id: <34f0f991.524144494f47414741@radiogaga.harz.de>

Thad Rolling (thad@execpc.com) wrote:
: I am getting started using Perl scripts via CGI on my web server.  My server
: is RedHat 4.0, Apache and Perl 5.003.  It looks like I am missing a
: configuration somewhere because when I try to run a Perl program through a
: web page, I get a "Server Error".

: Since I am new to Perl and CGI and Apache (but not HTML), I was wondering if
: anyone has a checkoff list of things needed to run Perl CGI programs.  A
: simple working example would be great too!

Have a look at the please-don't-be-offended-by-the-name Idiot's Guide
to Solving Perl CGI Problems, available at a friendly CPAN mirror near you
at http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html .

cu,
  Martin

P.S.: One adequate newsgroup for such questions would probably be
      comp.infosystems.www.authoring.cgi. F'ups narrowed to not
      include comp.lang.perl.misc.
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: Sun, 22 Feb 1998 17:10:36 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Diego Zamboni <zamboni@cs.purdue.edu>
Subject: Re: Help: Warning in string to number conversion.
Message-Id: <34F0A25E.1A97B5E@coos.dartmouth.edu>

[posted and mailed]

Diego Zamboni wrote:
> 
> I'm having a little trouble with string-to-number conversion. If I use the
> -w switch, Perl complains every time I want to use a string in a numeric
> context. The following code shows this:
> 
> $fh="blabla";
> if(1==$fh) { print "One\n"; }
> 
> If you run this with perl -w, you get `Argument "blabla" isn't numeric
> in eq at testNum.pl line 4' or something to that effect.

If you know you want to ignore a specific warning, you can turn off warnings
for that part of the code and still leave them on for the rest of your script.

(It's probably better to convert the string to a number before the if
condition.  Otherwise, the whole if block has to have warnings turned .)

{
  local $^W = 0;
  $fh += 0;
}
if ($fh == 1) { print "One\n"; }

On the other hand, I think the only way a string will convert to 1 is if it
matches this regex:

/^\+?0*1(?:\.0*(?:\D|$)|[^\d.]|$)/

(But there are probably cases I've missed in constructing it.  I had to
discard away several simpler versions.)

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/


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

Date: Sun, 22 Feb 1998 23:11:07 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
Subject: Re: How can i add users to the passwd file in unix with Perl?
Message-Id: <34F0F6DA.689E5243@fccj.cc.fl.us>

Anyone interested in the line of questioning in this Post; please see
http://webmaster.fccj.org/Webmaster/WebPass.html for a hint
in the right direction.

BUT BE WARNED - You will still need to do a lot of research on
Perl / Unix / et al...

Bill

PS - And, no, I won't support it.  Either figure it out, or forget about it...


> "Hagen" <insel@msn.com> writes:
>
> > How can i add users to the passwd file in unix?
> > Can someone help me
> > Hagen
> > insel@msn.com



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

Date: 23 Feb 1998 05:01:58 +0000
From: Richard Caley <spt@cstr.ed.ac.uk>
Subject: Re: Killfile Triage
Message-Id: <eyhyaz2q5h5.fsf@liddell.cstr.ed.ac.uk>

In article <6cqhff$k4l$1@csnews.cs.colorado.edu>, Tom Christiansen (tc) writes:

tc> Oh for Pete's sake, use a real filter. ;-)

Look, I refuse to install any filter which looks like it's more highly
evolved than homo sapiens, it will just get embarassing when it starts
critiquing the literrary style of my friends mail to me.

-- 
Mail me as rjc not spt@cstr.ed.ac.uk		_O_
						 |<



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

Date: Mon, 23 Feb 1998 01:26:22 -0500
From: "John W. Austin" <jwaustin@sympatico.ca>
Subject: Law-enforcement apps ?
Message-Id: <34F1168D.13B405C1@sympatico.ca>

I am currently wrapping-up a project in law-enforcement and am filling
in a missing link
with some perl code (on OS/2) instead of writing a much larger C++
program.  I am
very fond of the language, employed some polymorphism to handle message
traffic,
used regexp for parsing and may even use some XS to code some
OS/2-specific
stuff. The CPAN library will be extremely useful to me in the future if
I can manage to
sell some follow-on work.

I have found Perl to be much better-suited to my task than 90% of the
C++ code in this
application and am curious as  to whether there is anyone else in the
Perl world-domination conspiracy who is working on law-enforcement
problems.

Thanx in advance.



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

Date: Mon, 23 Feb 1998 01:10:44 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Off-topic (Sorry, but I need your help)
Message-Id: <34F112EF.658E61F8@coos.dartmouth.edu>

Allie wrote:
> 
> I know this off-topic and I apologize, but I've been
> really impressed with the knowledge and helpfulness of
> the people in this NG and I thought you might be able
> to help.

If you really want to show your appreciation for our knowledge and
helpfulness, post your messages to the proper newsgroups.

> And again, I apologize for getting so
> off-topic (and at such great length.....) but I really
> think you guys are knowledgeable and very good about
> helping beginners. And it seems like there's a lot of
> networking gurus here. Anyway, thanks in advance, allie

Apologizing for being an idiot isn't going to protect you from being flamed.

Here's a free clue for you: there are probably even more networking gurus in
the newsgroups about networking.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/
        It's funny 'cause it's true ... and vice versa.


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

Date: Sun, 22 Feb 1998 22:17:04 +0000
From: fergus@twig.demon.co.uk (Fergus McMenemie)
Subject: Problem using GD to create VERY large gifs.
Message-Id: <1d4uipc.dm4i02fng40wN@twig.demon.co.uk>

Hello

I am using Perl 5.002 and GD to create a very large GIF,
12000x6000 pixels. The script creats an empty gif and then
places umpteen seperate gif images into this new gif. It
then uses

                image->gif

to convert the gif from its internal data representation.
However the script then fails with:-

        Cant fork at /usr/local/lib/perl5/site_perl/GD.pm line 78


The same script running on the PC hangs.
-- 
======================================================================
Fergus McMenemie               Email:fergus@twig.demon.co.uk
Technology Basis     
======================================================================


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

Date: 23 Feb 1998 03:35:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: regexp problem
Message-Id: <6cqqqc$9vr$1@client2.news.psi.net>

mkolus@atomico.com.ar (mkolus@atomico.com.ar) wrote on 1637 September
1993 in <URL: news:6cqj6h$k31@edrn.newsguy.com>:
++ Hello!   Why this:  s/^From:\s([^\S]*)/\1/i;   return an string with the \n at
++ the end?.. i also tried [^\n\r] and didnt work.


First of all, you want s/^From:\s([^\S]*)/$1/i;

Second, \S doesn't match a newline. You are replacing "From:", followed
by a singly whitespace followed by one or zero non whitespace chars
by something else. Hence, you leave the trailing newline alone.

What you probably want is:

     s/^From://; chomp;

Or if you insist on a single regex:

     s/^From:(.*)\n/$1/;

Assuming there are no embedded newlines.



Abigail
-- 
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
           print+Just (), another (), Perl (), Hacker ();'


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

Date: Sun, 22 Feb 1998 23:09:38 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: regexp problem
Message-Id: <MPG.f5ac088bd7e6f1d989736@news.concentric.net>

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

mkolus@atomico.com.ar said...
: Hello!   Why this:  s/^From:\s([^\S]*)/\1/i;   return an string with the \n at
: the end?.. i also tried [^\n\r] and didnt work.

First: you should use $1, instead of \1.

Second: you'll want to

   chomp;

to get rid of the newline at the end of your input line.

Third: if you wanted to get rid of the newline with the regex, you'd have to 
specify that the newline is part of the match:

     s/^From:\s([^\S]*)\n/$1/i
                       ^^
But you should really use chomp, instead.  Hope this helps.
-- 
#!/usr/bin/perl -w --                     Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: 23 Feb 1998 18:07:40 +1100
From: Timothy Loy <loyt@aals27.alcatel.com.au>
Subject: Runtime building of search expression
Message-Id: <9a3ehayf2b.fsf@aals27.alcatel.com.au>

I am trying to write a perl thingie to search for things within
a range with 2 parameters.

File structure looks like:
Month,Day,Entry

Want to accept input like:
1:9-3:4,5:7
which means get any entry from 9th of Jan to 4th of Mar and
the entry on 7th of May

what is the best way to parse and search for this?

Currently I am using a flat text file and building a regexp
like '((((Month = 1 ) && (Day <= 9 )) ||
	((Month > 1) && (Month < 3)) ||
	((Month =3 ) && (Day <=4))) 
	||
	((Month = 5) && (Day = 7)) )'

and then do a run time //o on the built regexp

Is there a better way to achieve this?

The building of the regexp is very painful too, splitting
by ',' then '-' then ':'.

There must be a better way.

You help would be most appreciated.
-- 
Timothy Loy  
loyt@s054.aone.net.au                                         


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

Date: Sun, 22 Feb 1998 21:48:11 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: ts: Remove files in a PERL sript
Message-Id: <MPG.f5aad798712c461989734@news.concentric.net>

Martien Verbruggen (mgjv@comdyn.com.au) said...
: In article <6chuo9$a1j@news3.euro.net>, <soul@explorer.com> writes:
: > the reason people are asking questions that are in the faq and the
: > manpages is because the manpages are way technical and half the
: > time don't explain stuff thoroughly!
: 
: You could of course always hire a nanny to hold your hand and
: translate the difficult words. It's not a manual for a toothpick. It's
: documentation for a programming language.

Imagine:

"My gums keep bleeding horribly when I use toothpick 5.003.  Your stupid 
dental instrument sucks.  It's so hard and pointy!"

"I've got to brush my teeth tomorrow or I'll get fired!  Someone please brush 
my teeth!"

-- 
#!/usr/bin/perl -w --                     Just another Perl hacker,
(open 0),$_=<0>,s,.*- +,,,chop;for(split?@*?){($$_++or$}=$_,y,y \,\
y,<STDIN>,,$$=~s\^\"sub $_ {print'$}'};7"\ee),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg         jdf@pobox.com        Sunny Brooklyn, NY


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

Date: 23 Feb 1998 03:03:10 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ts: Remove files in a PERL sript
Message-Id: <6cqote$12e$1@marina.cinenet.net>

Tom Christiansen (tchrist@mox.perl.com) wrote:
: In comp.lang.perl.misc, bem@news.cmc.net (brian moore) writes:
: :Larry, Tom, Randal, and the rest of the people responsible for the Perl
: :docs did a great job of writing them.  
: 
: Thanks, but s/Randal// -- he hasn't written any manpages.

I count _Learning Perl_ and _Programming Perl_ among the "Perl docs" -- 
'doc' neq 'online doc' (though admittedly that's what most of this thread 
has talked about).

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 23 Feb 1998 03:45:05 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: ts: Remove files in a PERL sript
Message-Id: <6cqrc1$5ki$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
:I count _Learning Perl_ and _Programming Perl_ among the "Perl docs" -- 
:'doc' neq 'online doc' (though admittedly that's what most of this thread 
:has talked about).

Don't stop there.  Randal has a lot of mangazine articles that are 
worth reading.

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


Sometimes when you fill a vacuum, it still sucks.   --Rob Pike


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

Date: Mon, 23 Feb 1998 05:44:32 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: ts: Remove files in a PERL sript
Message-Id: <ebohlmanEotHA8.Gns@netcom.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:
:  [courtesy cc of this posting sent to cited author via email]

: In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
: :I count _Learning Perl_ and _Programming Perl_ among the "Perl docs" -- 
: :'doc' neq 'online doc' (though admittedly that's what most of this thread 
: :has talked about).

: Don't stop there.  Randal has a lot of mangazine articles that are 
: worth reading.

And remember his Web Techniques column, one installment of which is the 
canonical FM for CGI authors who don't understand concurrency control.



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

Date: Sun, 22 Feb 1998 23:28:31 -0800
From: Eric Hilding <"no.#@&!spam"@no.spam.cyberdex.com>
Subject: Uninitialized value chunk error
Message-Id: <6cr8h5$cim$1@bulb.garlic.com>

My script works (almost) okay except several addresses do not
get written to the .csv file - and have no clue as to what
all the STDERR messages are that came up.  Had to retype all
of them as couldn't figure out how to write directly to a file.

Any insight as to why these occur, and why only a few address 
don't get written when most do okay would be appreciated.

Tnx.

Eric Hilding

P.S. If you're going to e-mail, use the word perl and my last name
     owercase with the you-know-what in-between  :-)
===============================================

(STDERR printed on the screen & retyped)

Use of unitialized value at mls222.pl.txt line 29, <INFILE> chunk 396
Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 397
Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 397
Use of unitialized value at mls222.pl.txt line 29, <INFILE> chunk 570
Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 571
Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 571
Use of unitialized value at mls222.pl.txt line 29, <INFILE> chunk 576
Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 577
Use of unitialized value at mls222.pl.txt line 46, <INFILE> chunk 577

#!/usr/bin/perl -w
# mls222.pl   Eric Hilding  2/22/98
# 
# Perl script to extract APN#, Status Code & Address from "#3" MLS print
data
# and print to an ASCI .csv file for use as a lookup table in a database
program
#
# DATA FILE FORMAT LINES TO PARSE (complete file contains blank lines &
other stuff)
# 736317 CBR  34 1/5/1        $279,900    26/AU/97 14470 MONTEREY HWY
# 408-779-5000 PN:825-05-021      MAP:43-70-33    AA:1.14         SCH:0
0 0
#
# Status code is last digit in "d/d/d" on first data line
# Address is 25 or less characters after the single space following the
dd/mm/yy date
# APN# is ddd-dd-ddd immediately following "PN:" on the 2nd data line
#
print "Enter File Name To Parse: ";			#instructions for entering file
name
$filename = <STDIN>;					#enter file name to parse
open (INFILE, "$filename");				#open input file
while ($line = <INFILE>)				#primary loop
{
 if ($line =~ m/^\d{6}/ || $line =~ m/^\d{3}\W\d{3}\W\d{4}/) #only parse
these 2 lines
  {							     #and skip all other lines
   if ($line =~ m/^\d{6}/)
     {
      $line =~ m/.*\d\/\d\/(\d).*\d{2}\/\D{2}\/\d{2}\s(.{5,25})/;
#extract Status Code
							#and Address from this data line
       $stat = $1;					#assign status code from $1
       $addr = $2;					#assign address from $2
       $addr =~ s/^\s+|\s+$//g;  			#whitespace cleanup on address
     }
   if ($line =~ m/^\d{3}\W\d{3}\W\d{4}/)
     {
       $line =~ m/PN:(\d{3}\W\d{2}\W\d{3})/;  		#extract actual parcel
number from this line
       $apn = $1;					#assign parcel number from (new) $1
       &writeapnfile unless $line !~ m/PN:/;  		#only call subroutine
after parcel number
							#has been extracted from second data line
     }
  }
}
close (INFILE);	#close input file

### SUBROUTINE TO PRINT APN#, STATUS CODE & ADDRESS TO ASCII .CSV FILE
sub writeapnfile
  {
   open (FILE ,">>apnfile");				#open output file for append
   print FILE "$apn,$stat,\"$addr\"\n";		#	write data to file
   close (FILE);					#close output file
  }
# END OF PERL SCRIPT


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

Date: Mon, 23 Feb 1998 01:26:51 -0600
From: tvs_srs@hotmail.com
Subject: vec builtin function
Message-Id: <6cr8bq$us5$1@nnrp2.dejanews.com>

Can somebody give a simple example for vec function? Perlfunc manpage is
pretty cryptic on this. BTW, I use perl 5.004_03.


regards,

Shankar

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

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

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