[11902] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5502 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 28 03:07:13 1999

Date: Wed, 28 Apr 99 00:00:22 -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           Wed, 28 Apr 1999     Volume: 8 Number: 5502

Today's topics:
    Re: "learning perl" does not seem to be written well <uri@sysarch.com>
        form2email with file attachment <sfain@usa.net>
    Re: free computer13 <leekk@cs.utexas.edu>
        Help reading directories and displaying contents <mcalvo@maxcalvo.net>
        Impythonating PERL? (Avery Andrews)
    Re: Installing DBD-Pg-0.91 in RH 5.2 gcellis@my-dejanews.com
    Re: lwp-request hangs... <ronald_f@my-dejanews.com>
    Re: need CGI programmers???? (Steve Vertigan)
    Re: newbie: Replace \n with <br>\n <rash@ti.com>
        Parsing query strings pnguyen@aracnet.net
    Re: pearl sdf spf (Edward J Martinage)
    Re: Perl and Y2K (Larry Rosler)
    Re: Perl and Y2K (Tad McClellan)
        Perl Editor... <bennettd@asdi.saic.com>
    Re: Perl Editor... <ronald_f@my-dejanews.com>
        Perl Weekday Script (Cyberine2k)
    Re: Perl Weekday Script (Abigail)
    Re: Script Help (Tad McClellan)
        Simple if syntax Question morti_cne@my-dejanews.com
    Re: Simple if syntax Question <paladin@uvic.ca>
    Re: Simple if syntax Question <paladin@uvic.ca>
    Re: Simple if syntax Question (Larry Rosler)
    Re: Simple if syntax Question (Larry Rosler)
        Simple one? <cantrela@agcs.com>
    Re: Simple one? (Larry Rosler)
        using Find::file inside a sub-routine ..? (Meling Mudin)
    Re: Using string content as an a variable name <ronald_f@my-dejanews.com>
        What does this error message mean? (Blair Kingsland)
        When uploading files how do I count the characters in t <nospam@nospam.com>
        Winnipeg.pm meeting <randy@theory.uwinnipeg.ca>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 28 Apr 1999 01:02:19 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <x7vheh8hic.fsf@home.sysarch.com>

>>>>> "ETR" == Eric The Read <emschwar@rmi.net> writes:

  ETR> bart.lateur@skynet.be (Bart Lateur) writes:
  >> I call it the "apply" operator. The RHS does something; the LHS says
  >> what it does it to, i.e. the object of the operation. The operation on
  >> the right is applied to the variable on the left. In fact, it has
  >> nothing to do with any actual matching. It's just that the operations it
  >> currently supports are all kinda matching related. But any operation
  >> that reads and (possibly) modifies one variable is a candidate.

i call it bind as it binds the value on the left to the m//, s/// or
tr/// on the right. whethere it gets modified or not depends on the
rigth side only.

  ETR> That makes a great deal of sense, and I wish I'd seen something
  ETR> like this when I was teaching myself Perl.  But it's still an odd
  ETR> sort of operator; I haven't seen its like before.  Don't get me
  ETR> wrong, it's a really great idea, and it simplifies things
  ETR> immensely, but it's still a little weird, even for someone who's
  ETR> familiar with programming.

not for someone who has seen cshell and/or awk.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 28 Apr 1999 00:18:22 -0300
From: "Santiago Fainstein" <sfain@usa.net>
Subject: form2email with file attachment
Message-Id: <7g59jh$ucb$1@vnews.prima.com.ar>

Hi, I'm new to this group and also new to perl.
Does anybody know a form2mail script in perl with file attachment
capability? it can't be soupermail.
Thanks a lot!






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

Date: 28 Apr 1999 00:56:08 -0500
From: James Lee <leekk@cs.utexas.edu>
Subject: Re: free computer13
Message-Id: <7g67to$ar$1@cad5.cs.utexas.edu>

In comp.os.linux.setup opus007 <startrek@techcom.net> wrote:

: I hate spam.

More like framing than spamming.
Hmmm.. I love spams (the meat in the metal can kind).


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

Date: Tue, 27 Apr 1999 20:32:26 -0700
From: "Max Calvo" <mcalvo@maxcalvo.net>
Subject: Help reading directories and displaying contents
Message-Id: <yivV2.155$VW1.25132@news.uswest.net>

Hi all;

I need some help here folks. I am trying to get a perl script that will read
the contents of directory then I need the content displayed in a HTML
document. This directory has lots of jpegs and I need then to display in
aweb page. I am trying to automated webpages dinamically instead to created
a webpage each time there is an update. Here is the script that I am
currently workign with.

any help or pointers will be greatly appreciated.

Thank you very much
-Max

#!/usr/bin/perl -w

pendir (DIRLIST,"../wwj/data/sm");
@dirlist = readdir(DIRLIST);

print ("content-type:image/jpeg\n\n");
print ("<HTML><HEAD><TITLE>Directory Listing</TITLE></HEAD>\n");
print ("<BODY>");
print ("<TABLE BORDER=0><TR>\n");

foreach $x(@dirlist) {

        print ("<TD><IMG SRC=\"../wwj/data/sm/$x\"></TD>\n");

}

print ("</TABLE>");
print ("</TABLE>");
print ("</BODY>");
print ("</HTML>\n");




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

Date: 27 Apr 1999 22:42:57 -0700
From: andrews@Turing.Stanford.EDU (Avery Andrews)
Subject: Impythonating PERL?
Message-Id: <7g6751$5ql@Turing.Stanford.EDU>

It seems to me that it would be cool to be able to use python-style
whitespace-formatting when you wanted it, writing something like:

---
  use impythonator;

  foreach $thing in @list:
    print "$dict{$thing}\n"

  no impythonator;
---

Thereby loosing some of the brackets, parentheses & semicolons that
I find mostly to be a annoyance.  Has anyone thought of trying to do 
something like this?

 Avery.Andrews@anu.edu.au




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

Date: Wed, 28 Apr 1999 03:15:04 GMT
From: gcellis@my-dejanews.com
Subject: Re: Installing DBD-Pg-0.91 in RH 5.2
Message-Id: <7g5ufl$3qq$1@nnrp1.dejanews.com>

In article <37274fc1.129154774@news>,
  jbritain@home.com (Jim Britain) wrote:
> On Tue, 27 Apr 1999 03:12:58 GMT, gcellis@my-dejanews.com wrote:
>
> >I am linux newbie (4 months but I have done quite a lot of reading) trying to
> >install DBD-Pg 0.91 on a RH5.2 systen with DBI 1.06 and Perl
> >5.004.04 with postgresql 6.4.2. I installed postgresql 6.4.2 using RPMs.
> >Postgresql is properly installed as I am able to create and maintain
databases
> >and tables using psql. I get the following:
> >
> >output from 'perl Makefile.PL'
> >
> >Configuring Pg
> >Remember to actually read the README file !
> >$POSTGRES_HOME not defined. Searching for PostgreSQL...
> >Found PostgreSQL in
> >Writing Makefile for DBD::Pg
> >
> >******
> >
> >output from 'make'
> >
> >cc -c -I/include -I/usr/local/include/pgsql -I/usr/include/pgsql
> >-I/usr/lib/perl 5/site_perl/i386-linux/auto/DBI
> >-I/usr/lib/perl5/i386-linux/5.00404/DBI -I/auto/ DBI -I/DBI -Dbool=char
> >-DHAS_BOOL -I/usr/local/include -O2  -DVERSION=\"0.91\"
> >-DXS_VERSION=\"0.91\" -fpic -I/usr/lib/perl5/i386-linux/5.00404/CORE  Pg.c In
> >file included from Pg.xs:13: Pg.h:13: libpq-fe.h: No such file or directory
> >make: *** [Pg.o] Error 1
> >
> >******
> >
> >I am hoping somebody has done this or seen it before and will be able to help
> >me. I have been trying to do this for the last 4 days, including all weekend
> >and I am desperate.
>
> If you downloaded the precompiled binary file, then it is quite
> likely, you don't have the source file headers required to link other
> code.
>
> You'd be better off to download and compile Postgres on your machine
> (which would install the header, and library files).
>
> One step back, and two steps forward..
>
That was my preference and when I attempted the install, I had problems with
the 'gmake install' as well. That's when I turned to the RPM. I am thinking
that the problems were similar but I can't quite remember. Is there a way to
get the necessary source file headers and library files without going back to
compiling postgresql?

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Apr 1999 06:22:16 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: lwp-request hangs...
Message-Id: <7g69em$cum$1@nnrp1.dejanews.com>

In article <WIsV2.3765$gv5.2049@news.rdc1.sfba.home.com>,
  "Stephen Warren" <swarren@slip.net> wrote:
> > I have installed libwww and successfully did a 'gmake test'. Now I would
> like
> > to use lwp-request to fetch a file.
> >
> > This works fine for local files, i.e.
> >
> > but it does not fetch documents on the Web.
> Sounds like you have a firewall/proxy server, which Netscape is configured
> to use and libwww isn't?

Bingo - that's it!!!!
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Apr 1999 04:17:53 GMT
From: vertigan@bigfoot.com (Steve Vertigan)
Subject: Re: need CGI programmers????
Message-Id: <37268aff.161977341@news.aurum.net.au>

David Cassell <cassell@mail.cor.epa.gov> wrote thus:

>cindycrawford@my-dejanews.com wrote:
>> 
>> need a CGI programmer?
>> check our website at
>> http://cgi-shop.com
>
>Yep, I sure need a CGI programmer.. who doesn't know the difference
>between CGI and Perl.
>
>Wait a minute..  Cindy Crawford?  CGI programmer?

Well now that you mention I haven't seen much mention of her since she was
in that movie with Richard Gere that flopped.  Who knows, if her career has
taken a turn for the worse why not?  I'm sure stranger things have happened.


--Steve
Models never die, they just turn into k-rad web d3signers!


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

Date: Wed, 28 Apr 1999 10:24:49 +0530
From: Ravi Shankar A S V <rash@ti.com>
Subject: Re: newbie: Replace \n with <br>\n
Message-Id: <37269499.9977074B@ti.com>

You are modifying the line held in the scalar $_ but not writing it back to the
file. Naturally, the file does not get updated.

-Ravi

Scott Oseychik wrote:

> I would like to pre-pend every newline character (\n) with <br>, so the
> final result would be:    <br>\n
>
> Here's my code so far, but I can't seem to get it to work:
>
> #!c:\perl\bin -w
>
> print ("Type in a file name: ");
> chomp($file = <STDIN>);
> open(FILEHANDLE,"+<$file") || die "Can't find $file!!\n";
>
> # for every newline character, replace it with
> # <br>, then a newline character
>
> while (<FILEHANDLE>)
> {
>     $_ =~ s/\\n/<br>\\n/;
> }
>
> close(FILEHANDLE);
>
> This script doesn't seem to do anything, but doesn't generate any errors,
> either.  Sorry if this is a dumb question...
>
> --Scott

--
  --------------------------------------------------------------------------------
A S V Ravi Shankar
IC Design Engineer
Texas Instruments (I) Ltd
Bangalore

email : rash@ti.com
Voice : +91(80)5099430
Fax : +91(80)5269838
  --------------------------------------------------------------------------------





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

Date: Wed, 28 Apr 1999 04:05:08 GMT
From: pnguyen@aracnet.net
Subject: Parsing query strings
Message-Id: <372688d6.3191970@news.aracnet.net>

Helllo,

I have a question I'd like to ask the Perl e-community out there.  It
is as follows:
	1. Given a query string from any search engines out there on
the Web eg.
http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=online+community 
or
http://netfind.aol.com/search.gw?search=online+community&lk=excite_netfind2_us&nm=aol&pri....
	2. How would I parse the search string from the rest of URL 
	3. so that only the value of the search keywords are return
(ie.online community) and the rest is garbage
	4.One the search keywords are returned I want to keep track of
how many time is the 'online community' appear out of all the URLs in
the log file.

If there is a script with similar functionality already existed out
there, can you please point it out to me as I am new to Perl and just
beginning to learn the language.  Many thanks.

peter



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

Date: 28 Apr 1999 04:17:06 GMT
From: ejm@cadence.com (Edward J Martinage)
Subject: Re: pearl sdf spf
Message-Id: <7g6242$jqc$1@news.cadence.com>

A famous Pearl customer once said,

"There are two products that we at XYZ Co. are very impressed with and they
are both called Purl"


There is training available, but it is through Cadence training organization.
There is not likely to be anything online in the public domain.


-- 
Ed Martinage


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

Date: Tue, 27 Apr 1999 20:16:44 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl and Y2K
Message-Id: <MPG.11901d72f1d4783d989961@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <01be911e$0843a590$ac255c18@glen> on Wed, 28 Apr 1999 
02:11:58 GMT, Glen Kaatz <gkaatz1@nycap.rr.com> says...
> OK,
> Excuse the dumb management question, but is Perl 5.003 for NT Y2K
> compliant?

perlfaq4:  "Does Perl have a year 2000 problem? Is Perl Y2K compliant?"

Perl is Y2K compliant.  Are you?

However, Perl 5.003 may have some security problems that your managers 
should be made aware of.  The current version is 5.005_03.  Upgrade now!
 
> Thanks,
> An ashamed programmer

Whatever it takes to earn a buck... 

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


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

Date: Tue, 27 Apr 1999 21:01:02 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl and Y2K
Message-Id: <ekm5g7.6k5.ln@magna.metronet.com>

Glen Kaatz (gkaatz1@nycap.rr.com) wrote:

: Excuse the dumb management question, but is Perl 5.003 for NT Y2K
: compliant?


   No it is not.

   You should stop programming in Perl immediately, recode
   everything in Visual Basic, and then go ask Frequently
   Asked Questions in some other newsgroup.


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


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

Date: Tue, 27 Apr 1999 21:10:43 -0700
From: "Darren Bennett" <bennettd@asdi.saic.com>
Subject: Perl Editor...
Message-Id: <85431001@NEWS.SAIC.COM>

    Can anyone suggest a decent NT/95 based Perl editor/debugger?? Also,
does anyone have any NT Server admin scripts or links to such?? Please
e-mail me them if you do.

                Thanks,
                            -Darren




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

Date: Wed, 28 Apr 1999 06:18:44 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Perl Editor...
Message-Id: <7g6982$cr5$1@nnrp1.dejanews.com>

In article <85431001@NEWS.SAIC.COM>,
  "Darren Bennett" <bennettd@asdi.saic.com> wrote:
>     Can anyone suggest a decent NT/95 based Perl editor/debugger??

I'm using emacs, enhanced by cperl-mode (an add-on package). Both can be
freely downloaded and it is available for NT too (I use it so far under Unix
only). For more information on emacs, see
http://www.objectcontinuum.com/emacs.htm. Also it might be a good idea to
have a look at gnu.emacs.help.

Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 28 Apr 1999 04:17:55 GMT
From: cyberine2k@aol.com (Cyberine2k)
Subject: Perl Weekday Script
Message-Id: <19990428001755.24458.00000460@ng98.aol.com>

Has anyone had experience writing a script to return relative dates?  I'm
attempting to write a simple Perl script that when given the arguments:

<specific date>, <offset in days>

it will return the non-Saturday/Sunday date.

For example, given '4/27/99' and an offset of 3, it should return '4/22/99'.

Any ideas appreciated.  I'm writing this for HP/UX OS, but I would expect the
solution would work on most UNIX platforms.

-cyb


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

Date: 28 Apr 1999 05:03:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Weekday Script
Message-Id: <7g64q6$2gu$1@client2.news.psi.net>

Cyberine2k (cyberine2k@aol.com) wrote on MMLXVI September MCMXCIII in
<URL:news:19990428001755.24458.00000460@ng98.aol.com>:
"" Has anyone had experience writing a script to return relative dates?


Date::Manip;


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Tue, 27 Apr 1999 19:40:57 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Script Help
Message-Id: <9uh5g7.bh5.ln@magna.metronet.com>

JDDemme (jddemme@technologist.com) wrote:
: I'm working on a script o control what the user sees when the site lists the 
: midis in a directory. each midi has a
: file called (filename of midi).txt. The first line of the midi is the name of 
: the song, and the second line is the
: author. those are the only important lines here, for now. Here's the script. 
: If speaks for itself. oh, and, top.txt is
: the html for the page up to the point where the data should be inserted.


   I read that twice.

   I cannot find a question to answer in there.


   What is your question?


   On top of that, your code won't even compile.


: #!/usr/bin/perl


   You have a bug on the very first line of your program.

   See the very first bug listed in the BUGS section of the
   top-level perl man page (perl.pod).


: $DR = $ENV{'QUERY_STRING'};
:   opendir(DIR, $DR);

   check the return value

:   @files = grep(/\.mid$/,readdir(DIR));
:   closedir(DIR);
:   $mid = $files[0];


   You can lose the @files temporary variable, if you like,
   by taking a slice:

      $mid = (grep(/\.mid$/,readdir(DIR)))[0];


:   open(mid,"$DR/$mid.txt);

   check the return value

:   $name = <mid>;
:   $artist = <mid>;
:   close(mid);



   This program will stop working if Perl 6 should happen to
   introduce a new "mid" keyword.

   Don't risk that. Use upper case in your filehandles.


: print "Content-type:text/html\n\n";

   I think you are missing a character there.

: open(top,"top.txt");

   check the return value

: @top = <top>;
: close(top)

   This program will stop working if Perl 6 should happen to
   introduce a new "top" keyword.

: foreach $tp (@top){

   I know you are missing a character there somewhere.


   At this point I realized I wasn't looking at real Perl code.

   So I stopped looking at it.


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


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

Date: Wed, 28 Apr 1999 05:32:05 GMT
From: morti_cne@my-dejanews.com
Subject: Simple if syntax Question
Message-Id: <7g66gm$aii$1@nnrp1.dejanews.com>

Can anyone tell me why this perl code snippet does not work?  TEAM is a
dropdown box on a form, I've double checked the spelling.  It always skips the
first if and accepts the second.  The files component.db and system.db are
simple text files with appropriate permissions assigned.  I admit that my perl
coding is a bit rusty, so any help you can provide is GREATly appreciated.

if ($FORM{'TEAM'} = 'Component') {
   $data_file = "component.db";
}
if ($FORM{'TEAM'} = 'System') {
   $data_file = "system.db";
}


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 27 Apr 1999 22:58:20 -0700
From: Draco Paladin <paladin@uvic.ca>
To: morti_cne@my-dejanews.com
Subject: Re: Simple if syntax Question
Message-Id: <Pine.A41.4.05.9904272256500.126920-100000@unix3.UVic.CA>

On Wed, 28 Apr 1999 morti_cne@my-dejanews.com wrote:

[snip]
> if ($FORM{'TEAM'} = 'Component') {
                    ^
This is the assignment operator.  The equality operator is ==.

-- 
Mother is the name for GOD on the lips and
hearts of all children.  - Eric Draven



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

Date: Tue, 27 Apr 1999 23:05:23 -0700
From: Draco Paladin <paladin@uvic.ca>
To: morti_cne@my-dejanews.com
Subject: Re: Simple if syntax Question
Message-Id: <Pine.A41.4.05.9904272258510.126920-100000@unix3.UVic.CA>

I hate accidently hitting the send button.
As I started to say:

On Wed, 28 Apr 1999 morti_cne@my-dejanews.com wrote:

[snip]
> if ($FORM{'TEAM'} = 'Component') {
                    ^
This is the assignment operator.  The equality operator is ==.  But == is
only for numbers.  The equality operator for strings is eq.  If you had
used -w it would have warned you about this.  Always use -w and 'use
strict'.

-- 
Mother is the name for GOD on the lips and
hearts of all children.  - Eric Draven



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

Date: Tue, 27 Apr 1999 23:10:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Simple if syntax Question
Message-Id: <MPG.1190462fbfa1037b989962@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7g66gm$aii$1@nnrp1.dejanews.com> on Wed, 28 Apr 1999 
05:32:05 GMT, morti_cne@my-dejanews.com <morti_cne@my-dejanews.com> 
says...
> Can anyone tell me why this perl code snippet does not work?  TEAM is a
> dropdown box on a form, I've double checked the spelling.  It always skips the
> first if and accepts the second.  The files component.db and system.db are
> simple text files with appropriate permissions assigned.  I admit that my perl
> coding is a bit rusty, so any help you can provide is GREATly appreciated.
> 
> if ($FORM{'TEAM'} = 'Component') {
>    $data_file = "component.db";
> }
> if ($FORM{'TEAM'} = 'System') {
>    $data_file = "system.db";
> }

Run your program again with warnings enabled (the '-w' flag), and see if 
that doesn't tell you what the problem is.

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


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

Date: Tue, 27 Apr 1999 23:15:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Simple if syntax Question
Message-Id: <MPG.1190476baaa1540989963@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <Pine.A41.4.05.9904272256500.126920-100000@unix3.UVic.CA> on 
Tue, 27 Apr 1999 22:58:20 -0700, Draco Paladin <paladin@uvic.ca> says...
> On Wed, 28 Apr 1999 morti_cne@my-dejanews.com wrote:
> 
> [snip]
> > if ($FORM{'TEAM'} = 'Component') {
>                     ^
> This is the assignment operator.  The equality operator is ==.

For one type of data, the equality operator is ==.  Not for this type of 
data.

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


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

Date: Tue, 27 Apr 1999 22:42:31 -0700
From: Andy Cantrell <cantrela@agcs.com>
Subject: Simple one?
Message-Id: <37269FC7.E6E36D30@agcs.com>

Consider the following:

 $m = "" ;
 foreach $str ("hi", "hi", "bye") {
    print "A $str\n" if ($str !~ /$m/);
    print "B $str\n" if ($str !~ /h/);
 };

 If I run this as is, I get the following:
  A bye
  B bye

 If I comment out the second print statement (print "B $str\n"),
 rerunning the program will not print anything.  Why do I loose
 the "A bye" output?  I'm guessing there is something left over
 in the regular expression special variables, but I'm not sure
 what.

-- 
Andy Cantrell
AG Communication Systems
E-Mail: cantrela@agcs.com
Office (AZ) (623) 582-7495 (Voice mail)
Office (WI) (414) 249-0215
Modem  (WI) (414) 249-0239


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

Date: Tue, 27 Apr 1999 23:34:02 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Simple one?
Message-Id: <MPG.11904bb2d28ae3be989964@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <37269FC7.E6E36D30@agcs.com> on Tue, 27 Apr 1999 22:42:31 -
0700, Andy Cantrell <cantrela@agcs.com> says...
> Consider the following:
> 
>  $m = "" ;
>  foreach $str ("hi", "hi", "bye") {
>     print "A $str\n" if ($str !~ /$m/);
>     print "B $str\n" if ($str !~ /h/);
>  };
> 
>  If I run this as is, I get the following:
>   A bye
>   B bye
> 
>  If I comment out the second print statement (print "B $str\n"),
>  rerunning the program will not print anything.  Why do I loose
>  the "A bye" output?  I'm guessing there is something left over
>  in the regular expression special variables, but I'm not sure
>  what.

>From perlop:  "If the PATTERN evaluates to the empty string, the last 
successfully matched regular expression is used instead."

If you are trying to see if a string is not the empty string, use
    $str ne ""
or
    length($str) != 0
or
    $str =~ /./s

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


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

Date: 28 Apr 1999 04:49:08 GMT
From: mudin@expert.cc.purdue.edu (Meling Mudin)
Subject: using Find::file inside a sub-routine ..?
Message-Id: <7g6404$457$1@mozo.cc.purdue.edu>

Hi, I am a newbie, and here's my question.
I found that File::find provides a great method of recursively
processing files in a directory. So I can have something like:
-----
use File::Find;
$dir1 = "/usr/local";
$dir2 = "/usr/bin";
$dir3 = "/etc/inet";
@dirlist = ($dir1, $dir2, $dir3);

sub process_files {
	# do some stuff in here
}
find (\&process_files, @dirlist);
-----

The nature of my project requires me to do all the above inside a particular
sub-routine. Is it possible?

sub Check {
	# do something
	# initialization, etc
	sub process_file {
		# do some other thing
	}
	find (\&process_file, @dirlist);
}

Thanks,

-mel


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

Date: Wed, 28 Apr 1999 06:31:48 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Using string content as an a variable name
Message-Id: <7g6a0l$de6$1@nnrp1.dejanews.com>

When you execute

$x="y"; $y="abc"; print "$$x\n"

abc gets printed. The important thing to note is that $x contains the variable
name without a leading "$", i.e. if you wrote $x="$y", this would not work.
You can also use this construct to change the value of $y:

$$x="xyz"; # sets $y

For more sophisticated applications, you may want to look at the eval
function. -- Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Apr 1999 06:50:32 GMT
From: blairk@istar.ca (Blair Kingsland)
Subject: What does this error message mean?
Message-Id: <pdyV2.1156$Ev1.746050@NewsRead.Toronto.iSTAR.net>

Hello:

I'm running ActivePerl on an Apache server. The program output is
correct, but I always get the following server error (warning)
message:

Value of <HANDLE> construct can be "0"; test with defined() at
/usr/local/etc/httpd/htdocs/tigron/cgi-bin/glossary.pl line 65535.

I can't find an explanation of this message anywhere. What does "line
65535" mean? The program file is only 25 lines long. Any help would be
appreciated. 

Thanks.

Blair Kingsland



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

Date: Tue, 27 Apr 1999 23:57:30 -0700
From: "Siri Dhyan Singh" <nospam@nospam.com>
Subject: When uploading files how do I count the characters in the resulting filename?
Message-Id: <7g6bfa$r4s$1@owl.slip.net>

Wow that was tough for a header . . .
I am using a html form to allow web clients to browse for a file and upload to a
predefined directory.

How do I count the characters in the resulting file name.
Client (C:\somepath\<file name to count>) to Server
(D:\someotherunrelatedpath\<file name to count>

Got part of the necessaries from page 165 of Learning Perl Win32 but I can't
seem to get anything goin . . . thanks.

$filename =~ tr/a-z0-9(some other stuff)//; # wow

while (/pattern/g){
    count++;
}

newbie
-SiriD




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

Date: Tue, 27 Apr 1999 23:15:07 -0500
From: "Randy Kobes" <randy@theory.uwinnipeg.ca>
Subject: Winnipeg.pm meeting
Message-Id: <7g62ba$ia6$1@canopus.cc.umanitoba.ca>

Hi,
   The next meeting of the Winnipeg Perl Mongers group will
be Wednesday, April 28 at 8:30 PM in Applebee's in the Grant
Park Plaza. All are welcome - hope to see you there.

            Best regards,
            Randy Kobes
--
Physics Department                    Phone: (204) 786-9399
University of Winnipeg                Fax: (204) 774-4134
Winnipeg, MB  R3B 2E9             http://theory.uwinnipeg.ca/
Canada                                       randy@theory.uwinnipeg.ca




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

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

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