[9799] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3392 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 7 16:07:09 1998

Date: Fri, 7 Aug 98 13: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           Fri, 7 Aug 1998     Volume: 8 Number: 3392

Today's topics:
    Re: 
    Re: 
    Re: "Here" documents and the mystery that is FTP <pearse@mail.shebang.net>
    Re: ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in <erc@pconline.com>
    Re: ARGV truncations (Nem W Schlecht)
    Re: c2a: A bash prompt design helper <jdporter@min.net>
        Calling one Perl script from within another <michael@datahost.com>
        Can't sysopen(..., O_WRONLY|O_NONBLOCK) <fcusack@iconnet.net>
    Re: comp.lang.perl.announce redux <jimbo@soundimages.co.uk>
        confirm before submit karen_green@vsl.com
    Re: EASY $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ (Gary L. Burnore)
        Expression Tree Alogorithm <marks@webleicester.co.uk>
    Re: Help Help Please Help ! <jdporter@min.net>
        Need help with command line for CGI for NT <mokaction@hotmail.com>
    Re: ODBC, Perl, Unix and Macs (Chris Nandor)
    Re: Perl 'beutifier' (Steve Linberg)
    Re: Perl Docs.. forget the original post (Bart Lateur)
        Perl for Win32 Question <pmercer@verio.net>
    Re: Perl+ftp aircond@my-dejanews.com
    Re: perlfaq - frequently asked questions about Perl (pa <jdporter@min.net>
    Re: perlfaq - frequently asked questions about Perl (pa (Bart Lateur)
    Re: perltoot q: overriding new method and calling super <sidi@gt.ed.net>
    Re: Please help! (breaking a file into chunks) <boys@aspentech.com>
    Re: Please help! (Kelly Hirano)
    Re: question (Craig Berry)
    Re: question <bjlockie@nortel.ca>
    Re: re first language <jdporter@min.net>
    Re: Scoping Question <jdporter@min.net>
    Re: Server or Programmer problems? <perlguy@inlink.com>
    Re: system command <perlguy@inlink.com>
        Use of Uninitialized variable!! <hartmd00@molbio.sbphrd.com>
    Re: variable indirection [off topic - parens] (Nem W Schlecht)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 07 Aug 1998 15:03:05 -0400
From: John Porter <jdporter@min.net>
Subject: Re: 
Message-Id: <35CB4F69.37EE@min.net>

Bob Langdon wrote:
> 
> Sorry if this is the wrong group, but I couldn't find a Majordomo group.

Would you like to know why the cucumbers are so much more expensive at
the local farmer's market this year?

-- 
John Porter


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

Date: Fri, 07 Aug 1998 15:33:37 -0400
From: webmaster@retailernews.com$%^&* (Bob Langdon)
Subject: Re: 
Message-Id: <webmaster-ya02408000R0708981533370001@news.alt.net>

In article <35CB4F69.37EE@min.net>, jdporter@min.net wrote:
> 
> Would you like to know why the cucumbers are so much more expensive at
> the local farmer's market this year?
> 
> -- 
> John Porter

El Nino?

-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++
Bob Langdon
webmaster@retailernews.com
http://RetailerNews.com
_Retailer News Online_  Magazine -- for retail
business owners, managers, and salespeople.
                           --brought to you by:
Dealer Support Services
--website design and maintenance
++++++++++++++++++++++++++++++++++++++++++++++++++++


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

Date: Fri, 07 Aug 1998 14:35:09 -0500
From: pearse <pearse@mail.shebang.net>
To: Richard Bellavance <charlot@CAM.ORG>
Subject: Re: "Here" documents and the mystery that is FTP
Message-Id: <35CB56ED.84B711D6@mail.shebang.net>

Yes, yes. I'm using ASCII.

So, I'm got two things going on here.
    1) wintel editior is adding /r/n to EOF
    2) wintel editior is adding ^M to EOF

Which is it? And couldn't the perl interpreter be told that EOF = EOF/r/n =
EOF^M? If so, where do I post the patch?

Cheers,

Robert


Richard Bellavance wrote:

> In article <k_wy1.828$hF4.3627990@newbabylon.rs.itd.umich.edu>,
> Sean McAfee <mcafee@battlezone.rs.itd.umich.edu> wrote:
> >
> >Most likely the file you FTPed from your Wintel box has an extra carriage
> >return character at the end of every line.  Perl sees "EOF^M" at the end of
> >your here-document, which doesn't match your stated terminator "EOF".
> >Remove the ^M's with your favorite text editor, or with
> >"perl -i -pe 's/\cM$//' filename", or yet some other method, and try again.
> >
>
> Or, even more simple, just make sure you FTP the file over in ASCII mode.
>
> Richard.
> --
> Richard Bellavance            |
>                               |  "Rien n'est plus imminent que l'impossible."
> charlot@cam.org               |        - Victor Hugo
> http://www.cam.org/~charlot/  |
>



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

Date: Fri, 07 Aug 1998 19:33:36 GMT
From: Eric Foster-Johnson <erc@pconline.com>
Subject: Re: ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in text version archive?
Message-Id: <35CB56AE.6DFD28A3@pconline.com>

Marek Jedlinski wrote:

> Suggested solution: since gzip is unix-centric anyway, 
> please provide a
> .zip archive version as well.

The Windows program WinZip can extract .tar.gz files, such
as those stored on CPAN. (That is, it handles UNIX tar archives 
that have been gzip'ed.) I have downloaded a number of
Perl modules and installed them just fine on Windows.

Good luck,
-Eric

-- 
Eric Foster-Johnson
http://www.pconline.com/~erc/
mail: erc@pconline.com


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

Date: 7 Aug 1998 14:18:02 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: ARGV truncations
Message-Id: <6qfjta$nrr@abattoir.cc.ndsu.nodak.edu>

[courtesy copy e-mailed to author(s)]

In comp.lang.perl.misc, Kirk Moren  <kirkmo@us.ibm.com> wrote:
>I have a situation where an rexx program is calling a perl 5 program to
>perform some socket i/o.   The data is being passed to the perl program
>via arguments such as...
>
>`perl perlsock.pl host.com 5000 a long data string containing normal and
>special characters`
>
>Everything after the host name and port is considered data to be sent.
>The data contains
>some special characters occassionally such as hex characters (0a0dx) and
>this apparently confuses Perl due to the fact that all data subsequent
>to the special hex character is truncated and not available to @ARGV.

Can you give us a better example of a call that fails?  I'm not very
familiar with REXX, does it have something equivalent to 'open(FH, "|
command")' where you could then pipe your data to the perl script via
STDIN?  How are you reading in your arguments?  I'm assuming your doing
something like this:

#!/local/bin/perl
$host = shift(@ARGV);
$post = shift(@ARGV);
$data = join(' ', @ARGV);
 ....

-- 
Nem W Schlecht                  nem@plains.nodak.edu
NDUS UNIX SysAdmin        http://www.nodak.edu/~nem/
"Perl did the magic.  I just waved the wand."


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

Date: Fri, 07 Aug 1998 15:07:01 -0400
From: John Porter <jdporter@min.net>
Subject: Re: c2a: A bash prompt design helper
Message-Id: <35CB5055.3EA2@min.net>

Jim Foltz wrote:
> 
> Then c2a it, and it will crank out the correct ansi escape
> codes. Redirect the output, then source it to see your new prompt.

Neat!

Hey, you might also be interested in the Term::AnsiColor module 
available on CPAN.

-- 
John Porter


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

Date: Fri, 07 Aug 1998 12:50:25 -0700
From: Michael Stearns <michael@datahost.com>
Subject: Calling one Perl script from within another
Message-Id: <35CB5A81.B8B@datahost.com>

I would like to call one Perl script from another (which happens to be a
cgi that supplies an argument for the first script.)

What is the best way to accomplish this? It seems like the exec commands
works, but I was under the impression that this has some negative
security implications.

Thanks,
Michael Stearns


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

Date: Fri, 07 Aug 1998 18:41:22 GMT
From: Frank Cusack <fcusack@iconnet.net>
Subject: Can't sysopen(..., O_WRONLY|O_NONBLOCK)
Message-Id: <3viuk4octg.fsf@blockhead.iconnet.net>

Why doesn't this work?

#!/usr/local/bin/perl
require 5.002;
use strict;
use Fcntl;

my $MKFIFO = "/usr/bin/mkfifo";
my $FIFO_NAME = "/tmp/fifo";
# setup FIFO
unless (-p $FIFO_NAME) {
    unlink($FIFO_NAME);
    system($MKFIFO, $FIFO_NAME) && die "Can't create $FIFO_NAME: $!\n";
}

# let's try to open the pipe
sysopen(FIFO, $FIFO_NAME, O_WRONLY | O_NONBLOCK) || die "open: $!\n";
print "didn't block!\n";

__END__

I get back:

open: No such device or address

If I am reading from the fifo before calling this program, it works.
If I change O_WRONLY to O_RDONLY, it works.
If I get rid of O_NONBLOCK, it works (but blocks).

perl -v says:

This is perl, version 5.004_04 built for sun4-solaris

uname -a says:

SunOS blockhead 5.6 Generic_105181-06 sun4u sparc SUNW,Ultra-5_10

Tested on SunOS 5.6 and 4.1.3_U1

If I don't get this to work I have to fork and create pipes, ugh
it would be so much easier if this works as advertised!!!

thanks,
~frank

-- 
Frank Cusack       + Today's Haiku   No keyboard present
Icon CMT Corp.     + error message:  Hit F1 to continue
PGP: C001AA75      +                 Zen engineering?


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

Date: 07 Aug 1998 19:29:12 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: comp.lang.perl.announce redux
Message-Id: <u7m0kr6h3.fsf@jimbosntserver.soundimages.co.uk>

birgitt@minivend.com writes:

> No, more a lack of quality Perl books written in languages other
> than English in the first place.
> 
> But there are some and if they are good enough, they are either
> immediately  written in English by authors whose native language
> is not English, or they are considered good enough to be picked up
> by publishers in the English spoken countries and translated.

Not being a smart alec, and I am actually very interested, could you
provide a few titles?

-- 
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.


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

Date: Fri, 07 Aug 1998 19:11:16 GMT
From: karen_green@vsl.com
Subject: confirm before submit
Message-Id: <6qfjgk$irh$1@nnrp1.dejanews.com>

I have my a form and a CGI Script that shows a confirmation page and emails
me the results.  I need to change this so that I display the confirmation
page, give the user the option to make go back to make changes or submit the
order via the confirmation page. Can anyone tell me how I would modify my
code to do this.

Any examples would be greatly appreciated.

Karen

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 07 Aug 1998 19:23:58 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: EASY $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Message-Id: <35dd5430.76327185@nntpd.databasix.com>

On 07 Aug 1998 11:50:40 PDT, in article <35CAA370.FC48CB30@concentric.net>,
"Meta@concentric.net" <Meta@concentric.net> wrote:

>Path: databasix.com!netra-news.ntrnet.net!feeder.news.azstarnet.com!sunqbc.risq.qc.ca!newsfeed.wli.net!su-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.concentric.net!207.155.183.80.MISMATCH!global-news-master
>From: "Meta@concentric.net" <Meta@concentric.net>
>Newsgroups: comp.lang.perl.misc
>Subject: EASY $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
>Date: 07 Aug 1998 11:50:40 PDT
>Organization: Concentric Internet Services
>Lines: 255
>Message-ID: <35CAA370.FC48CB30@concentric.net>
>NNTP-Posting-Host: ts001d15.stp-fl.concentric.net
>Mime-Version: 1.0
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>X-Mailer: Mozilla 4.03 [en] (Win95; I)
>
>This really works. Please listen to me.
Sent to someone who WILL listen: abuse@concentric.net
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: Fri, 07 Aug 1998 20:32:15 +0100
From: Mark <marks@webleicester.co.uk>
Subject: Expression Tree Alogorithm
Message-Id: <35CB563F.73CE6D65@webleicester.co.uk>

Does anyone have an algorithm for building an Expression Tree from an
Infix Expression ?  Or even the code !

I could work it out for myself, but I could do with it quickly !

Mark.
--
================================
Mark Simonetti
se96ms@dmu.ac.uk
marks@webleicester.co.uk
http://www.cms.dmu.ac.uk/~se96ms
================================

"I used to be indecisive, but now I'm not so sure."




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

Date: Fri, 07 Aug 1998 14:32:08 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Help Help Please Help !
Message-Id: <35CB4828.1823@min.net>

Wei-Jen Chang wrote:
> 
> #!/usr/bin/perl
> 
> @array = (1,2,3,4,5,6);
> $count = 0;
> $count2 = 0;
> @temp = ();
> while ($count <= 5){
> 
>     $temp[$count2] = $array[$count];
> 
>     $temp[$count2+1] = $array[$count];
> 
>     $count2 = $count + 2 ;
>[...]

That should be 
	$count2 = $count2 + 2;
                        ^
                        ^NOTICE!

Of course, you could have easily avoided this error by writing

	$count2 += 2;

hth,
-- 
John Porter


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

Date: Fri, 7 Aug 1998 12:40:03 -0700
From: "Mok" <mokaction@hotmail.com>
Subject: Need help with command line for CGI for NT
Message-Id: <6qflel$1pq$1@usenet41.supernews.com>

Can anyone help us with a perl/CGI problem?  For some reason, perl scripts
are not parsed through CGI on our NT server.  Are there any help guides to
make sure that perl is running okay, and maybe a help guide as well for
making perl scripts to work through CGI?  Any help is appreciated; reply
back to larry@earthbiz.net .




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

Date: Fri, 07 Aug 1998 14:52:00 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: ODBC, Perl, Unix and Macs
Message-Id: <pudge-0708981452010001@192.168.0.3>

In article <35cb3838.0@news.new-era.net>, scott@softbase.com wrote:

# Forget it! FileMaker may be geting a revamp, but there's no way it will
# be able to compete with Oracle and DB2 on the high end as a networked
# database. You're not going to be able to access a Mac database from a
# UNIX box without a lot of pain and lots and lots of money for
# middleware connectivity products.

Well, performance aside, that's not absolutely true.  It wouldn't actually
be too tough.  MacPerl could provide a daemon that either accepts basic
database queries, or even accepts arbitrary Perl code with Penguin (which
I got working about a year ago with MacPerl, but never cleaned it up, and
a new Penguin is on its way, from what I've been told, and it supposedly
will fix its problems with MacPerl (newlines and
encryption/authentication), so I gave up worrying about it).

Anyway, someone does need to write a FileMaker module, but once thatis
done, then it would be fairly simple and painless (aside from performance)
to write a daemon to pass queries from client to database and back.  Most
likely, it would be done with Apple Events, which adds additional
performance pains, but sometimes performance is not an issue as much as
just getting the data.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Fri, 07 Aug 1998 14:49:35 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl 'beutifier'
Message-Id: <linberg-0708981449350001@projdirc.literacy.upenn.edu>

In article <6qfdqn$3am@mozo.cc.purdue.edu>, gebis@fee.ecn.purdue.edu
(Michael J Gebis) wrote:

> Purists will pish-posh both of my suggestions, pointing out that only
> the PERL interpreter can parse the PERL language thus far, but I'd
> recommend ignoring the purists and evaluating the functionality for
> yourself.

Pish-posh!  The best way to format your code the way you want to is to do
it yourself in the first place.  Go through your old code and clean it
up!  :)

Pish, I say, Posh!
_____________________________________________________________________
Steve Linberg                       National Center on Adult Literacy
Systems Programmer &c.                     University of Pennsylvania
linberg@literacy.upenn.edu              http://www.literacyonline.org


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

Date: Fri, 07 Aug 1998 19:39:52 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Perl Docs.. forget the original post
Message-Id: <35cf4d7f.25471194@news.tornado.be>

Chris Nandor wrote:

># In which case it's still wrong to suggest that listning to someone's opinion
># should be based on what they've "done for the Perl community"
>
>It is not wrong, it is absolutely right.  The Perl community is a
>meritocracy.  The more you do for the community, the more you are valed in
>the community.  If you are Larry or Tom, your opinion is heavily
>weighted.  If you are Gary Burnore, your opinion carries little, if any,
>weight.  This is how it is, and most of us think this is how it should be.

Now that smells like a horrible justification for conservatism.

"The PODs are great because WE wrote them."

Doesn't that sound just a little off?


	Bart.


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

Date: Fri, 07 Aug 1998 14:10:41 +0100
From: pat mercer <pmercer@verio.net>
Subject: Perl for Win32 Question
Message-Id: <35CAFCD1.3B32@verio.net>

hello,

  I've got a question regarding ActiveState's Perl for Win32.
Does anybody know the best way how to get the current directory?
Does ActiveState have the following UNIX equivalent, $ENV{PWD} ?

thanks.

-pat mercer


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

Date: Fri, 07 Aug 1998 19:41:11 GMT
From: aircond@my-dejanews.com
Subject: Re: Perl+ftp
Message-Id: <6qfl8n$kpr$1@nnrp1.dejanews.com>

In article <Pine.GSO.4.02.9808061530060.6559-100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@teleport.com> wrote:
> On Thu, 6 Aug 1998, MIKE KY wrote:
>
> > Does anyone know of a really good ftp program written in perl that can
> > capture multiple files off the web and ftp them to the server?
>
> I don't, but you could write one, with the help of a few modules, in a few
> minutes. Hope this helps!

Agreed - I wrote a quick and dirty routine that does something similar by
using calls to the Telnet.pm module. This worked fine, but I can assure you
that there are better solutions.

>
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 07 Aug 1998 14:41:58 -0400
From: John Porter <jdporter@min.net>
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <35CB4A75.1068@min.net>

Tom Christiansen wrote:
> 
> In comp.lang.perl.misc, pudge@pobox.com (Chris Nandor) writes:
> :No, on our GUI platforms we often use editors for viewing arbitrary text files.
> 
> That's a silly idea.  Why would you use an editor when you aren't editing?
> That's as stupid as [yadda yadda]

"What, you use SQL to retrieve AND modify database records?!?!"

-- 
John Porter


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

Date: Fri, 07 Aug 1998 19:39:54 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <35d04ea4.25763779@news.tornado.be>

Tom Christiansen wrote:

>:No, on our GUI platforms we often use editors for viewing arbitrary text files.
>
>That's a silly idea.  Why would you use an editor when you aren't editing?

Because, basically, an editor can do everything a pager can do, and more
(like correcting typing mistakes). It's a superset. No need for a pager.
Do you really need Word Viewer if you have Word?

And if you set to editor to read-only, it's just as safe.

	Bart.


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

Date: Fri, 07 Aug 1998 13:24:57 -0400
From: Chris Sidi <sidi@gt.ed.net>
Subject: Re: perltoot q: overriding new method and calling superclass' new
Message-Id: <35CB3869.5A64FDC5@gt.ed.net>

Tom Christiansen wrote:
>     Here's a version of new that takes this into consideration:
>
>         sub new {
>             my $proto  = shift;
>             my $class  = ref($proto) || $proto;
>             my $parent = ref($proto) && $proto;
>             my $self;
>             # check whether we're shadowing a new from @ISA
>             if (@ISA && $proto->SUPER::can('new') {
                                                   ^ add another ")"

>                 $self = $proto->SUPER::new(@_);
>             } else {
>                 $self = {};
>                 bless ($self, $parent);
                                ^ shouldn't this be $class? or (ref
$parent)?

>             }
>             $self->{PARENT} = $parent;
>             $self->{START}  = time(); # init data fields
>             $self->{AGE}    = 0;
>             return $self;
>         }


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

Date: Fri, 07 Aug 1998 20:18:51 +0100
From: Ian Boys <boys@aspentech.com>
Subject: Re: Please help! (breaking a file into chunks)
Message-Id: <35CB531B.3F54@aspentech.com>

Jonah Olsson wrote:
> 
> Hello!
> 
> In my chat system everything is logged and feeded into a file where each
> block of data (name, time, text etc.) starts and ends with %%%.
> 
> When printing each block I open the file into a string like this:
> 
> open (CHAT, "$datafile") || die "The chat will should be back soon! ($!)\n";
>    local $/;
>    $chat = <CHAT>;
> close (CHAT);
> 
> But how should I search for the blocks starting and ending with %%%? Is it
> better to use an array?
> 

Try reading the file and separating it into blocks as you go.

Suppose you have a data file like this:

block 1
foo
bar
blurgh
%%%
block 2
mickey
mouse
was
here
%%%
block 3
this is
enough

Then you could load it up like this:

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

my (@temp, @messages, $i);

open (CHAT, "datafile.txt") or die "Can't open message file, sorry: $!";

# read in the message blocks
while (<CHAT>) {
    unless (/^%%%/) {
        push @temp, $_;
    } elsif (@temp) {
        push @messages, [ @temp ];
        @temp = ();
    }
}
if (@temp) { push @messages, [ @temp ] };
close (CHAT);

# print out the message blocks
print scalar @messages, " messages found.\n";
print "They are:\n";
foreach (@messages) {
    print "---Message ",++$i,"---\n";
    foreach (@$_) {
        print;
    }
}

__END__

Of course, you could print out the messages as you go, instead of
storing them, but hopefully you get the idea.

Ian


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

Date: 7 Aug 1998 11:06:51 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: Please help!
Message-Id: <6qffnr$dn@Xenon.Stanford.EDU>

In article <XcHy1.3787$JR2.5619454@nntpserver.swip.net>,
Jonah Olsson <jonah@g-s.net> wrote:
>Hello!
>
>In my chat system everything is logged and feeded into a file where each
>block of data (name, time, text etc.) starts and ends with %%%.
>
>When printing each block I open the file into a string like this:
>
>open (CHAT, "$datafile") || die "The chat will should be back soon! ($!)\n";
>   local $/;
>   $chat = <CHAT>;
>close (CHAT);
>
>But how should I search for the blocks starting and ending with %%%? Is it
>better to use an array?

it would be better to use an array if the staring %%% and ending %%% are on
the same line. if they are not, then a scalar is probably better. even better
would be to use different starting and ending delimiters.
-- 
Kelly William Hirano	                    Stanford Athletics:
hirano@cs.stanford.edu	                 http://www.gostanford.com/
hirano@alumni.stanford.org      (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20


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

Date: 7 Aug 1998 18:09:40 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: question
Message-Id: <6qfft4$ca7$5@marina.cinenet.net>

Michael J Gebis (gebis@fee.ecn.purdue.edu) wrote:
[snip]
: really a perl question[1].  The collective brain of this group[2] doesn't
[snip]
: [2] Kept in a 55 gallon-drum in a garage in Hemet, California.

Well, that explains a *lot*.

---------------------------------------------------------------------
   |   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: Fri, 07 Aug 1998 15:05:02 -0400
From: Bob Lockie <bjlockie@nortel.ca>
Subject: Re: question
Message-Id: <35CB4FDE.534713FD@nortel.ca>

Craig Berry wrote:
> 
> Bob Lockie (bjlockie@nortel.ca) wrote:
> : I tried the following command on the MS IIS server and it doesn't work.
> :
> : print "Location: $goto\n\n";
> :
> : How do I do a location (HTTP) command on that server?
> :
> : It works on a Netscape server.
> :
> : On the MS server it tries to download to the browser a .pl file
> : which contains the text "print "Location: $goto\n\n";".
> 
> And the Perl aspect of this question is...?

Oops, sorry.


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

Date: Fri, 07 Aug 1998 14:51:15 -0400
From: John Porter <jdporter@min.net>
Subject: Re: re first language
Message-Id: <35CB4CA3.B72@min.net>

Tom Christiansen wrote:
> 
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc,
>     "Matt Heusser" <matt@pcr7.pcr.com> writes:
> :Answer - you might want to look at other languages,
> :but Assembler won't be one of them until you have
> :a real good grasp of C.
> 
> I think you mean that the other way around.  Knowing assembler
> helps in learning C.  I don't know about vice versa, though.

I think it could very well work the way he said.
But doing it in that order is likely to have the student
frequently saying things like "Is *that* how it's done
in assembler? What a pain in the ass!"
Whereas the person learning C after asm frequently says
"Aaahhhh, that's more like it."
But since they are essentially the same language, knowing
one makes learning the other easier.

-- 
John Porter


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

Date: Fri, 07 Aug 1998 14:58:39 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Scoping Question
Message-Id: <35CB4E5F.78B7@min.net>

sneaker@fccj.org wrote:
> 
>        open (outfile, "mytest") or die "can't: $!";
>        print outfile;
>...
>        open (outfile, "mytest") or die "can't: $!";
>        print outfile;

And people give me a hard time for always using

	open(F,"< $file")...
and
	open(F,"> $file")...

-- 
John Porter


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

Date: Fri, 7 Aug 1998 16:11:15 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Server or Programmer problems?
Message-Id: <35CB2723.961E3016@inlink.com>

My previous statement is WRONG, please forget I ever said it. :-)

Brent


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

Date: Fri, 7 Aug 1998 16:02:48 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: system command
Message-Id: <35CB2528.72AF6AC6@inlink.com>

Richard Kim wrote:
> 
> Is there any reason why I can't do this?
> 
> system("cp", "*.whatever", "/tmp/whatever/");
> 
> If I use individual files it seems to work fine, but I can't seem to use
> the wild card.
> 
> Any suggestions?

Yes, try this instead:

$command = "cp *.whatever /tmp/whatever/";
system($command);     

Brent


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

Date: Fri, 07 Aug 1998 14:18:32 -0400
From: hartmd00 <hartmd00@molbio.sbphrd.com>
Subject: Use of Uninitialized variable!!
Message-Id: <35CB44F8.75ABFFE9@molbio.sbphrd.com>

I am getting this message and I have no idea why I would.  I have a pl
file which does a require of another pl file.  When I make a call to one
of the functions in the required file I get an error.  The required file
is actually an auxillary file of some common sybperl functions.  From my
file I am making a call like so:

&sql_results("select name from syscolumns where object_name(id) = '$tb'
and name = 'id'",$dbproc,$delim))

This function sql_results in the required file looks like 

sub sql_results
local($sql_cmd, $dbproc, $delim) = @_;
  local($status, @data);
  ($status, @data) = sql_exec($sql_cmd, $dbproc, $delim);
 ...

and  sql_exec looks like
sub sql_exec sub sql_exec {
  local($sql_cmd, $dbproc, $delim) = @_;
  local(@data, $dbrows, @nextrow, $ret);
  .
  .
  .
 while(@nextrow = $dbproc->dbnextrow()) {
    if ($#nextrow < -1)) {                 # this is the run that gives
me the error
      push(@data, join($delim, @nextrow));
    }
  }

I have tried even setting $#nextrow to some number before this row and
it does not work.  I even put if ( -1 < 2) ... and it still gave me this
error.  What is going on here.

Thanks
Dave


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

Date: 7 Aug 1998 14:00:44 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: variable indirection [off topic - parens]
Message-Id: <6qfiss$nlh@abattoir.cc.ndsu.nodak.edu>

[courtesy copy e-mailed to author(s)]

In comp.lang.perl.misc, Tom Christiansen  <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, I wrote:
>:    my (%names;
>
>     my %names;

On a side note... I've noticed that a lot of code snippets posted to clpm
are missing a lot of parens, IMO.  However, in looking at the perlobj man
page (and others) I notice a lot of:

my $self = {};

 and

bless $self, $class;

Now, I've been off in my own little la-la land of perl programming for a
couple of years now and I'm trying get back into posting more on clpm, but
this is a bit shocking to me.  Is it generally taken that calls without
parens are easier to read or somehow otherwise preferred?  I disagree, but
that's merely my opinion.  Case in point, somebody followed up to one of my
posts the other day, saying that my code:

push(@ary, $_) while (<FH>);

Could "be simplified to":

push @ary, $_ while <FH>;

To which I *mentally* replied, "This guy is $(*#ed up".  But with all the
other code I've seen, I'm beginning to doubt my stance on this subject.

-- 
Nem W Schlecht                  nem@plains.nodak.edu
NDUS UNIX SysAdmin        http://www.nodak.edu/~nem/
"Perl did the magic.  I just waved the wand."


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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