[9024] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2642 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 19 17:07:27 1998

Date: Tue, 19 May 98 14:00:28 -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           Tue, 19 May 1998     Volume: 8 Number: 2642

Today's topics:
    Re: Automation For Posting <intranets.guide@miningco.com>
    Re: Can't call method "Worksheets" without a package or <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Does Perl have a IDE?I don't like command line. lvirden@cas.org
    Re: Dowload Script Problem scott@softbase.com
    Re: Email type gateway (Andy Lester)
    Re: Exiting chunk mode. <danboo@negia.net>
        file locking question (Ryan McGuigan)
    Re: file locking question <jgoldberg@dial-but-dont-spam.pipex.com>
        Getting at the symbol table for an object. <steveg_nospam@gcg.com>
        Help! Redirect perlscript (President)
        How to include a file that contains subs <dkhosla@compaq.com>
    Re: How to include a file that contains subs (Craig Berry)
    Re: How to include a file that contains subs (Honza Pazdziora)
        How well does Perl work with VMS? violadawn@my-dejanews.com
    Re: HTTP/1.0 501 Not Supported <rickryan@mindspring.com>
    Re: I need help using the system command (Mark-Jason Dominus)
    Re: Is there a Perl IDE for win32 seeker79@yahoo.com
    Re: New IDE for Perl <Scott.L.Erickson@HealthPartners.com>
    Re: Non-static private variables <danboo@negia.net>
        perl cgi.pm not working carrr@mris.com
    Re: perl cgi.pm not working <due@murray.fordham.edu>
    Re: Perl for Win32 *not* in background? (Peter Alig)
    Re: Perl terminology <prophet@skepticult.org>
    Re: perl text editor for windows95 seeker79@yahoo.com
    Re: Question: Is Perl an acronym? (Alan Barclay)
    Re: regexp for strings of chars sloop@mailcity.com
    Re: regexp for strings of chars <lr@hpl.hp.com>
    Re: Something like "Visual Perl"? seeker79@yahoo.com
        still testing for empty array element - still stuck warmowski@my-dejanews.com
    Re: still testing for empty array element - still stuck (Mark-Jason Dominus)
    Re: TIMTOWTDI - regex vs. if (function) (brian d foy)
    Re: translate A-Z to 1-26 <aqumsieh@matrox.com>
        What specific functions should be in a Perl IDE? [Was:  lvirden@cas.org
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 19 May 1998 13:44:23 -0700
From: "Wiebe de Jong" <intranets.guide@miningco.com>
Subject: Re: Automation For Posting
Message-Id: <6jsq3g$l14$1@news.bctel.net>

Sounds like you are looking for a content management system. There are
several of these is the shareware/freewear category.

For the Windows or Mac users, there is Frontier 5, which can be found at
http://www.scripting.com/frontier5/

For the Perl/Linux people, there is Casbah, which is at
http://www.ntlug.org/casbah/

For more info, check out my website. I am also available for chats every
Wednesday.
-----
Wiebe de Jong, Intranets Guide for The Mining Company
email: intranets.guide@miningco.com
URL: http://intranets.miningco.com
Java based chat every Wed 7pm-9pm PT (Pacific)
http://intranets.miningco.com/mpchat.htm

Randy Borland wrote in message <355F87F7.2181EDE@erols.com>...
>
>My concern is the linking of the documents to the various product
>pages.  These documents are topical reports that "fit" under one or more
>of the categories on our Intranet.  I've schemed [in my mind] about a
>form and CGI script that would let the users identify the sections of
>the Intranet that the document should be linked to, and the script would
>[through PERL???] create the new links and move the doucment file(s) to
>the proper Intranet document directory.
>




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

Date: Tue, 19 May 1998 21:25:14 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Can't call method "Worksheets" without a package or object reference
Message-Id: <35625B2A.27D5@comenius.ms.mff.cuni.cz>

Brett.A.Hunsaker@usace.army.mil wrote:
> 
> This problem has appeared in several usenet postings, but I have yet to see a
> resolution.  Let's try again:
> 
> The environment:
>    ActiveState's Perl for Win32 build 316
>    Windows NT 4.0 SP3
>    Microsoft Excel for Windows 95
> 
> The following Perl code can be found at
> http://www.activestate.com/reference/Perl/Perl-Win32/oleauto.html
> 
> use OLE;
> $excel = CreateObject OLE 'Excel.Application'
>         or warn "Couldn't create new instance of Excel App!!";
> $excel->Workbooks->Open( 'test.xls' );

You should definitely test if the Open failed!
something like

$excel->Workbooks->Open( 'test.xls' )
or die "Couldn't open the file!\n";

I'm sure $excel contains some Error collection or something,
but I do not have docs nor Excel by hand :-(


> $excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)->{Value} = 'foo';
> $excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)->{Value} = 'bar';
> $excel->Save(); $excel->Quit();
> 
> Attempting to execute this code results in the following error:
> 
> Can't call method "Worksheets" without a package or object reference at
> duh.pl line 5.
> 
> I have tried this both with and without the Excel spreadsheet test.xls
> existing in the current directory before running the script.  Listing the
> current processes on the system shows that Excel is successfully started.
> 
> Any help would be appreciated.
> 
> Thanks in advance!

I don't think Excel is looking for the file in the current directory
of your script.
I'd think it rather uses "c:\My Documents" or something.
It should be the same directory as you see if you 
launch Excel by hand and select File\Open.

You should always use full paths.

HTH, Jenda


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

Date: 19 May 1998 18:48:51 GMT
From: lvirden@cas.org
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jsk6j$sp8$1@srv38s4u.cas.org>


According to Greg Bacon <gbacon@cs.uah.edu>:
:In article <6jpr6c$dsp@mozo.cc.purdue.edu>,
:	gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
:: gbacon@cs.uah.edu (Greg Bacon) writes:
:: }What of Tk?  Tk code will run on many, many, many more platforms than
:: }the hoarde fodder will.
:: 
:: I think you mean, "What of SpecTCL, the tool that allows you to do Tk
:: GUI design, since Tk itself does nothing to alleviate the problem
:: mentioned."
:
:Unless SpecTCL will generate Perl code, no, I most certainly didn't mean
:SpecTCL.  I've used Tcl.  Tcl sucks.  (Hi, orwant! :-)  I was referring
:to Perl/Tk.

I think the tool meant was SpecPerl, which generates Perl/Tk code...
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

Date: 19 May 1998 17:26:34 GMT
From: scott@softbase.com
Subject: Re: Dowload Script Problem
Message-Id: <6jsfca$t0r$2@mainsrv.main.nc.us>

Alan K'necht (alan_k'necht@canadalife.com) wrote:
> I'm trying to setup up a page that will allow a user to download files
> based on their selection from a pull down menu. The problem that I'm
> having is that when the file is selected and about to be downloaded, the

> filename displayed in the "Save as..." dialog box is the name of the
> CGI.

Unfortunately, you are the victim of a coincidence. You are
coincidentally writing a CGI program that downloads a file.
What's really going on is your web server is not running the
CGI program. It's trying to dump it as-is to the browser, which
gets a .pl MIME type it doesn't know what to do with. Thus the
dialog. You're being led on a wild goose chase by the nature
of your CGI program.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 19 May 1998 19:50:17 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Email type gateway
Message-Id: <6jsnpp$fnq$1@supernews.com>

: I need to know if there is a script of some sort for an email reader/writer
: out there.  Preferably free.  But will pay if needed.

Yes.

HTH.

xoxo,
Andy



--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Tue, 19 May 1998 14:45:30 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Exiting chunk mode.
Message-Id: <3561D34A.64E24DAC@negia.net>

John Hong wrote:
> 
> I can turn on chunk mode with:  $/ = ".\n";
> But how do I turn it off?
> 
> I want it On during the subroutine (fileCreation), but off in the main
> while loop.

look into the 'local' operator. it will make your changes on $/
scoped dynamically, so once you exit the sub things should be back
to normal.

cheers,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: 19 May 1998 19:12:23 GMT
From: ryan@mail.ramresearch.com (Ryan McGuigan)
Subject: file locking question
Message-Id: <6jslin$7lv$1@news12.ispnews.com>

How can I read the last line of a file, and then append to it while having
it locked the whole time?  

thanks,
Ryan


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

Date: Tue, 19 May 1998 21:48:33 +0100
From: "Jeremy Goldberg" <jgoldberg@dial-but-dont-spam.pipex.com>
Subject: Re: file locking question
Message-Id: <6jsr8h$5gn$1@plug.news.pipex.net>

Ryan McGuigan wrote in message <6jslin$7lv$1@news12.ispnews.com>...
>How can I read the last line of a file, and then append to it while having
>it locked the whole time?


Try opening with a name prefix of "+<" (read/write, don't destroy contents),
then scan through all the lines, discarding till you get till the end, and
then just write:

open( MYFILE, "+<myfile" ) || die;
while( <MYFILE> )
    { }
$lastline = $_;
print MYFILE $freshline;

where $lastline is the lastline in the file, and $freshline is the line you
want to add.




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

Date: Tue, 19 May 1998 15:38:17 -0500
From: Steve Goldstein <steveg_nospam@gcg.com>
Subject: Getting at the symbol table for an object.
Message-Id: <3561EDB9.41C6@gcg.com>

In the camel book p 281, there is some code for getting at all the
variables of a package:

foreach $symname (sort keys %pkg::) {
	...

How do I generalize this to all variables in an instantiation of an
object?  Specifically, I want to hack some debugging code within the
_get_sock_info method in LWP/Protocol/http.pm.

That method looks like this:


sub _get_sock_info
{
    my($self, $res, $sock) = @_;
    $res->header("Client-Peer" =>
                 $sock->peerhost . ":" . $sock->peerport);
}

Now $sock is a IO:Socket::INET object.  I can get a list of all
variables in this package as above, but how do I get the values that are
defined in $sock?

	Steve Goldstein


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

Date: Tue, 19 May 1998 13:30:54 +0200
From: tg@place1.com (President)
Subject: Help! Redirect perlscript
Message-Id: <MPG.fcb8bd5e495c321989681@nntpserver.swip.net>

I need help with a easy cgi script which just redirect to a specific url 
when script is called. The script should have no logging and allow to 
include a script.cgi?whatever since i will filter out that ?whatever 
variabel in my loggfiles to count clicks for differnet sites.

/Tomas!


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

Date: Tue, 19 May 1998 18:56:28 GMT
From: "Deepak Khosla" <dkhosla@compaq.com>
Subject: How to include a file that contains subs
Message-Id: <01bd8357$d4d7fc80$b90e12ac@print-tst01>

Hi,
Is there a simple syntax in perl for including a set of subroutines etc. in
a separate file (library). I don't want to turn them into modules but would
like to share those among different progs. I could not find any ref to this
in the FAQs



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

Date: 19 May 1998 19:26:33 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to include a file that contains subs
Message-Id: <6jsmd9$ofq$2@marina.cinenet.net>

Deepak Khosla (dkhosla@compaq.com) wrote:
: Is there a simple syntax in perl for including a set of subroutines etc. in
: a separate file (library). I don't want to turn them into modules but would
: like to share those among different progs. I could not find any ref to this
: in the FAQs

perldoc -f require

('use' is the more modern form, but does demand more 'packaging' in the
stuff to be imported.  And be sure to note the 'ends with a true value'
requirement!)

---------------------------------------------------------------------
   |   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: Tue, 19 May 1998 20:07:13 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How to include a file that contains subs
Message-Id: <adelton.895608433@aisa.fi.muni.cz>

"Deepak Khosla" <dkhosla@compaq.com> writes:

> Hi,
> Is there a simple syntax in perl for including a set of subroutines etc. in
> a separate file (library). I don't want to turn them into modules but would
> like to share those among different progs. I could not find any ref to this
> in the FAQs

Check the man page perlfunc for word "include", it will point you to
require, do and use. Also, a module doesn't need to mean class,
module can contain just functions -- check perlmod for this.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Tue, 19 May 1998 20:16:29 GMT
From: violadawn@my-dejanews.com
Subject: How well does Perl work with VMS?
Message-Id: <6jspb0$m3n$1@nnrp1.dejanews.com>

Hi, there.
I need some suggestion from who has ported Perl on VAX/VMS.

I intend to use
Perl along with its sharewares to manipulate a large load of text files, most
of them are printable files. The platform is VAX/OpenVMS (or VMS). I wonder
how well Perl can handle these large amount of data. Also, are there any
support or documentation about Perl and Perl/VMS available either in written
or html format. If there are, where can I find those?

This is very important to my work. Any of your help will be gratefully
appreciated.


Dawn Ren

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


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

Date: Tue, 19 May 1998 16:05:01 -0500
From: "rickryan@ Mindspring" <rickryan@mindspring.com>
Subject: Re: HTTP/1.0 501 Not Supported
Message-Id: <6jsri7$mdv$1@camel15.mindspring.com>

Then how about:

Who cares what you think about my non-related question, just answer it.

On second thought, I think the first one was a little better. <BG>


Nathan V. Patwardhan wrote in message <6jsap4$i4j@fridge.shore.net>...
>rickryan@ Mindspring (rickryan@mindspring.com) wrote:
>: Please forgive me for this non-perl question.
>
>No, I won't.
>
>--
>Nathan V. Patwardhan
>hmm.  sounds like a job for root@localhost




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

Date: 19 May 1998 16:34:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: I need help using the system command
Message-Id: <6jsqcg$jj3$1@monet.op.net>
Keywords: aphorism erode idol wright


In article <35614426.B5635AB7@lynden.com>,
Steve DeWitt  <steved@lynden.com> wrote:
>if ($FORM{'R1'} eq "aml") {
>	$printers = `lpstat -o aml -l`;
>} elsif ($FORM{'R1'} eq "laf") {
>	$printers = `lpstat -o laf -l`;
> [Five others omitted]

Are you getting paid by the line or something?  I only ever saw this
kind of code in jokes about COBOL programmers.

Why not replace twelve lines with two?

  if ($FORM{R1} =~ /^(aml|laf|kent|gcom|fuji|ci1000|dp)$/) {
	$printers = `lpstat -o $FORM{R1} -l`;
  }


Then similarly:

>		if ($FORM{'D2'} eq "laf") {
>			system disable laf;
> ...

	if ($FORM{D2} =~ /^(laf|kent|gcom|fuji|ci1000)$/) {
	  system "disable $FORM{D2}";
	}

Did you mean to omit aml and dp here?  

It might be better to do this:

	@PRINTERS = qw(laf kent gcom fuji ci1000);
	$PRINTER_PAT = '^(' .  join('|', @PRINTERS) . ')$';

	...

	if ($FORM{D2} =~ /$PRINTER_PAT/o) {
	  system "disable $FORM{D2}";
	}

Then when you need to add a printer, you add it on exactly one place
at the tomp of the program; you don't have to go and edit a bunch of
different if-elsif-elses.


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

Date: Tue, 19 May 1998 20:19:26 GMT
From: seeker79@yahoo.com
Subject: Re: Is there a Perl IDE for win32
Message-Id: <6jspgd$m4v$1@nnrp1.dejanews.com>


> hello, I use activeware's version of perl for win32 and I was wondering
> if there is an IDE interface I can get for it, Any help would be
> appretiated
>

Yes, you can use Perl Builder at http://www.solutionsoft.com/perl.htm.

Dave Seeker

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


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

Date: Tue, 19 May 1998 14:49:27 -0500
From: Scott Erickson <Scott.L.Erickson@HealthPartners.com>
Subject: Re: New IDE for Perl
Message-Id: <3561E247.AA884AE3@HealthPartners.com>

Birgitt Funk wrote:
> All the wise men are using emacs, does that mean one really
> can't skip it ? Or is it just because you are not only wise,
> but also a (tiny bit) old(er), and in those days you just learned
> emacs anyhow and got used to it ?

I use emacs, not because I am wiser or older, but because everything
else on my unix box bites.

I have a choice between pico, vi, emacs, or some gui text editor. I
learned vi in college and gladly and promplty forgot how to use it once
I no longer needed it. Pico and the gui text editor are too feature poor
for my needs, therefore I use emacs. I would prefer to use BBedit on the
Mac, but I do not have that choice. Instead, I have to use an NT box and
an Unix box in an environment where most veryone just knows enough to
get the job done and in which they put no effort into finding better
tools or into learning how to better use the tools at hand.

If I sound a bit bitter, well, it is because I am. I want better tools.
However, I do have one tool that does well what I want it to, Perl.

Scott.


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

Date: Tue, 19 May 1998 14:42:31 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Non-static private variables
Message-Id: <3561D297.72E6E9D0@negia.net>

Mark-Jason Dominus wrote:
> 
> In article <6jqgt3$ml4$1@news.nyu.edu>,
> George Y. Lembersky <gyl8384@omicron.acf.nyu.edu> wrote:

[SNIP]

> >Is there any way to have instantiated variables that are private?
> 
> So I really can't answer your question, because I don't know what you
> want.  `private' to whom?    Protected from whom?

i think he is looking for a way to make a private instance variable,
or attribute, in the sense that it is unique to an object instance and
can't be accessed from outside the package even with the reference. i
believe he wants to force you through the object's methods.

package FOO;

sub new { bless {}, shift }
sub setAttribute {
  my ($self, $att, $val) = @_;
  $self->{'attributes'}->{$att} = $val;
}

package BAR;

$foo = FOO->new();
$foo->{'attributes'}->{'head'} = 'potato';  # not to be allowed
$foo->setAttribute('head', 'potato');       # required for access

not that i know of a way to do it, i'm just trying to clarify.
he's just not used to the perl mentality of high accessibility
yet.

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Tue, 19 May 1998 20:13:16 GMT
From: carrr@mris.com
Subject: perl cgi.pm not working
Message-Id: <6jsp4r$ll0$1@nnrp1.dejanews.com>

I have Perl for win32 version 5.004_02 copyright larry wall.  It installed
great but my code:

#!perl/bin/perl

   use cgi qw(:standard);
   my $favorite=param("flavor");
   print header(),start_html("ice_cream"), h1("hello ice cream");
   if ($favorite)
   {
	print p("Your favorite flavor is $favorite.");

   }else{
   print hr(), start_form;
   print p("Please select a flavor: ", textfield("flavor","mint"));
   print end_form(), hr();
   }

gives an error undefined subroutine & main::param called in line 4.  I have
installed perl on a network drive and have updated the registry scripts folder
to point to the drive location for .cgi & .pl files.  I have also added this
to my path.  It is like it doesn't know perl is loaded.  I am also trying to
use perlbuilder if that makes a difference.  It doesn't work with it or by
itself.

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


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

Date: 19 May 1998 20:45:04 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: perl cgi.pm not working
Message-Id: <6jsr0g$mkd$0@206.165.146.140>

[reply cc to author]

carrr@mris.com wrote in message <6jsp4r$ll0$1@nnrp1.dejanews.com>...
[snip]

>   use cgi qw(:standard);

          ^^^^^
Just off the bat,  here is one problem.  You have to remember that Perl is
case sensitive :-)

use CGI qw(:standard);

might work a tad bit better.

HTH

Allan M. Due
Due@discovernet.net
Admin@WhiteCrow.net

The beginning of wisdom is the definitions of terms.
- Socrates





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

Date: 18 May 1998 20:29:19 GMT
From: Peter.Alig@t-online.de (Peter Alig)
Subject: Re: Perl for Win32 *not* in background?
Message-Id: <6jq5mv$363$1@news02.btx.dtag.de>

Hi mike,
I think, the easiest way is, that on the one hand as the last statement your perl
script has to create a file before it finishs working. This file is used to tell
the batch process that perl has ended its work. On the other hand, your batch
file, after starting the perl process, has to wait in a loop checking the
existance of the file. After it has found the file it can go on and exit. The
statements in the batch file should be like these:

:LOOP
IF EXISTS file GOTO END
GOTO LOOP

:EXIT

Hope that this fullfills what you want

Peter

--
-----------------------------------------------------------------------
To Be Or Not To Be   ---> Shakespeare
Doo Bee Doo Bee Doo  ---> Sinatra

Peter Alig  Tel:      +49 6663 / 919 475
            E-Mail:   mailto:Peter.Alig@t-online.de
            HomePage: http://home.t-online.de/home/Peter.Alig/
-----------------------------------------------------------------------





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

Date: Tue, 19 May 1998 19:23:26 GMT
From: Jon Walsh <prophet@skepticult.org>
Subject: Re: Perl terminology
Message-Id: <m3som683qa.fsf@localhost.localdomain>

Tom Christiansen <tchrist@mox.perl.com> writes:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     Jon Walsh <prophet@skepticult.org> writes:
> :The Waite Group's Perl 5 book assumes no prior knowledge 
> 
> I think that's misrepresentative.  

Really? It got me started nicely. It covers the basics of programming
on your way to learning perl, which seems to be what was asked for. 
 
-- 
Sir Dr. Jon "Big Dave" Walsh, Bsd.     | Email : <prophet@skepticult.org>
Certified Psychic and Healtheologist   | WWW   :  http://www.skepticult.org
True/False Prophet and Fearless Leader | IRC   :  Undernet #skepticult
SKEP-TI-CULT. Worldwide Cabal          | Usenet:  alt.fan.bruce-kettler


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

Date: Tue, 19 May 1998 20:10:03 GMT
From: seeker79@yahoo.com
Subject: Re: perl text editor for windows95
Message-Id: <6jsov0$hpo$1@nnrp2.dejanews.com>


> > > Can someone recommend a good, easy-to-use text editor to use for writing
> > > perl programs on windows95? I used bbedit on a friend's mac, which is

Try Perl Builder at http://www.solutionsoft.com/perl.htm.

This is a complete IDE for Perl with color highlighting, integrated
debugging, etc.

Dave Seeker

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


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

Date: 19 May 1998 19:51:11 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: Question: Is Perl an acronym?
Message-Id: <895607456.460138@elaine.drink.com>

In article <ltd8dbupbv.fsf@asfast.com>, Lloyd Zusman  <ljz@asfast.com> wrote:
>wayne@Glue.umd.edu (Wayne C. McCullough) writes:
>
>> Lloyd Zusman (ljz@asfast.com) wrote:
>> : And to the best of my knowledge, the "Practical Extraction and
>> : Reporting Language" acronym was *not* the first one back-fitted by
>> : Larry Wall.  As early as 1988, I recall seeing his mention of another,
>> : possibly more appropriate acronym in the Perl man pages.
>> 
>> Yes, but he told you (in the man page) not to tell anyone he said that.
>
>True ... I had forgotten about that.  But then again, now that I think
>about it, I vaguely recall a smiley after that admonishment ... or is
>that just wishful thinking?

THe man page for perl1 had the alternative acronym, but no smiley.


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

Date: Tue, 19 May 1998 19:13:12 GMT
From: sloop@mailcity.com
Subject: Re: regexp for strings of chars
Message-Id: <3561d94d.49203470@news.xmission.com>

>|     @trips = m/.(?<=(?=($triple)).)/go;
>
>...Eh, would someone translate these magic regexps to something
>understandable. They are way of of my league. Thank you.

Someone already did.  His name is Friedl, and his book is called
Mastering Regular Expressions, published through O'Reilly & Assoc.,
Inc.




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

Date: Tue, 19 May 1998 12:37:10 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: regexp for strings of chars
Message-Id: <6jsn1j$9r@hplntx.hpl.hp.com>

[posted and emailed]

sloop@mailcity.com wrote in message
<3561d94d.49203470@news.xmission.com>...
>>|     @trips = m/.(?<=(?=($triple)).)/go;
>>
>>...Eh, would someone translate these magic regexps to something
>>understandable. They are way of of my league. Thank you.
>
>Someone already did.  His name is Friedl, and his book is called
>Mastering Regular Expressions, published through O'Reilly & Assoc.,
>Inc.


Before blowing this question away, you might have looked more closely at
the snippets in the submission that Jari Aalto was questioning.
I, for one, wondered what 'qr/.../' meant (quote regexp, but what is
that, in view of the interpolation in the next line?) and what is '?.' ?
I presume these are being introduced in Perl 5.005, but some discussion
might help.  Rude answers don't help.

|     $triple = qr/(?.(.)\1{2})/;
|
|     @trips = m/(?=($triple))/go;
|
| Note that I would be a little bit wary to use //g with zero-length
| expression - unless necessary.  Though it looks hard to avoid it in
| the above construct.  This
|
|     @trips = m/.(?<=(?=($triple)).)/go;

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: Tue, 19 May 1998 20:06:00 GMT
From: seeker79@yahoo.com
Subject: Re: Something like "Visual Perl"?
Message-Id: <6json8$l7d$1@nnrp1.dejanews.com>


> Has anybody heard about a programming environment for Perl similar to
> Visual Basic? Or at least an editor that creates indents and does some
> highlighting?

Check out Perl Builder at http://www.solutionsoft.com/perl.htm.

Dave Seeker

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


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

Date: Tue, 19 May 1998 19:24:08 GMT
From: warmowski@my-dejanews.com
Subject: still testing for empty array element - still stuck
Message-Id: <6jsm8o$hmc$1@nnrp1.dejanews.com>

First off, let me thank everyone who was gracious enough to reply to my first
post on this.  As an inexperienced Perl programmer, I greatly appreciate your
time.

I am reading in data lines, separating fields, and testing to see if a field
is empty within the scope of a foreach loop.

My problem is in testing a var for emptiness.  Here is the source:

$srcfile = "FOO.TXT";
$gluechar = ";";

open (SOURCE, $srcfile) || die "cant open $srcfile";
substr($srcfile, -4)='';
open (TARGET, ">>$srcfile".".dlm") || die "cant open output file";

@bigarray=(<SOURCE>);
	foreach (@bigarray) {

	last if =~/< Report./;

	next if =~ /[DUFT]/;
	next if =~ /^\s/;
	next if =~ /User N./;
	next if =~ /Full Na./;
	next if =~ /Groups./;
	next if =~ /Belong./;

	@fields = split(/3/);
	$userid = $fields[1];
	$username = $fields[2];
	$group = $fields[3];

	next if $group eq '';               # here is the problem

# what I need is to skip the line if $group is empty.  The debugger says
# that $group evals to 0 '      '   but the next if does not execute.  Is
# $group not empty?  Here is an example of input lines:
#
#
# 3 01105002   3                      3 EVERYONE             3
# 3            3                      3                      3

	$servername = $srcfile;

	$outputstring = join($gluechar, @fields);
        print TARGET $servername.$outputstring;
	next;
}

close (SOURCE);
close (TARGET);
exit(0);


Version 5.003 Win32.

Thnaks very much again,

-r

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


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

Date: 19 May 1998 16:27:19 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: still testing for empty array element - still stuck
Message-Id: <6jspv7$jfr$1@monet.op.net>
Keywords: chaplaincy crony erratum lien


In article <6jsm8o$hmc$1@nnrp1.dejanews.com>,
 <warmowski@my-dejanews.com> wrote:
>open (SOURCE, $srcfile) || die "cant open $srcfile";
>substr($srcfile, -4)='';
>open (TARGET, ">>$srcfile".".dlm") || die "cant open output file";

Don't do that; it's obfuscated.  Do it this way:

	$FILE = 'FOO';
	$srcfile = $FILE . '.TXT';
	$targetfile = $FILE . '.dlm';
	open (SOURCE, $srcfile) || die "can't open $srcfile: $!";
	open (TARGET, ">>$targetfile") || die "can't open $targetfile: $!";

Putting $! into the error message is very useful too.

>@bigarray=(<SOURCE>);
>	foreach (@bigarray) {

	while (<SOURCE>) {

would do the same thing and be more efficient.  Your version reads the
entire file into memory all at once.

>	last if =~/< Report./;

This is almost right.  You meant to say

	last if $_ =~ /< Report./;

You can abbreviate this to just:

	last if /< Report./;

>	$userid = $fields[1];
>	$username = $fields[2];
>	$group = $fields[3];

You might like to write this as

	($userid, $username, $group) = @fields[1,2,3];

>	next if $group eq '';               # here is the problem
>
># what I need is to skip the line if $group is empty.  The debugger says
># that $group evals to 0 '      '   but the next if does not execute.  Is
># $group not empty? 

Right, not empty.  '' is a string with no characters in it. 
'      ' is a string of six characters which happen to be blank.  One
is zero characters long and the other is six characters long.  How
could they be equal?

It's good that you are using the debugger.  Having such a complete
report makes it easy to answer your question.

If you want to ask whether or not $group is all blanks, you could do:

	next if group =~ /^ *$/;

It might be better to change your `split' to discard spaces instead:

>	@fields = split(/\s*3\s*/);

This will trim all the space off of the front and back of each field;
then $group will be empty.


>        print TARGET $servername.$outputstring;

A good habit to get into is to write this as

>        print TARGET $servername, $outputstring;

There's no point in concatenating two strings here; they get
concatenatied when you print them out.




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

Date: Tue, 19 May 1998 15:04:14 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: TIMTOWTDI - regex vs. if (function)
Message-Id: <comdog-ya02408000R1905981504140001@news.panix.com>
Keywords: from just another new york perl hacker

In article <3561AC4A.6A2FBCFC@matrox.com>, Ala Qumsieh <aqumsieh@matrox.com> posted:

>brian d foy wrote:
>
>> In article <355C5C10.97247F07@matrox.com>, Ala Qumsieh <aqumsieh@matrox.com> posted:
>>
>> >Ward Kaatz wrote:
>> >
>> >> I considered but avoided use of (s)printf based on the camel book
>> >> observation (pg 200, 2nd ed.).
>> >
>> >I don't see any considerations about using sprintf on that page of the
>> >camelbook .. or on any other page for that matter!!!
>>
>> it's in the text for the printf function.  i beleive he refers to the
>> last sentence on the page.  sometimes, if things are immediately
>> apparent, a closer reading is warranted.
>
>I still don't see any mentioning of *sprintf* ;-)
>
>They talk about using print instead of printf .. but
>
>not using print instead of sprintf (which is not very useful!)

really?  are you sure you are looking at the same book?  "sprintf" is
used three times, one of which says that printf is "exactly equivalent to"

   print FILEHANDLE sprintf LIST

seems pretty clear.

but perhaps this was just a troll.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


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

Date: Tue, 19 May 1998 13:42:07 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: translate A-Z to 1-26
Message-Id: <3561C46F.7C1A9EF5@matrox.com>

Shaun Sides wrote:

> Original message by: Juping  Jin <juping+@pitt.edu>
> Date: 18 May 1998 22:21:38 GMT
> Subject: translate A-Z to 1-26
>
> > I want to translate A-Z symbols to numberical symbols, and tried:
> >
> >           s/([A-Z])/ord('\1')-65/g;
> >
> > but it doesn't work. How can I achieve this result?
>
> I may be wrong, but it looks to me as if you could use:
>
>         tr/A-Z/1-26/g;
>
> Lemme know if I'm just an idiot, though. ;-)

You are :-)
Did you try it before posting? First of all, tr/// doesn't have a g
modifier!
Your statement replaces all As with 1s, all Bs with 2s and every other
capital letter with 6.
Nice try though ;-)

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





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

Date: 19 May 1998 18:53:35 GMT
From: lvirden@cas.org
Subject: What specific functions should be in a Perl IDE? [Was: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jskff$sp8$2@srv38s4u.cas.org>


According to Eric Bohlman  <ebohlman@netcom.com>:
:fsg@gallo.ultranet.com wrote:
:: IDEs are tools that perform a certain function.  They have no inbuilt 

:One could argue that IDEs were created to fulfill a need that no longer
:exists.  They originated as DOS applications, where they served an


My thought as I plow thru all of the comments is whether one person's
reference to IDE is the same as the next.

So, for those of you who are asking for a Perl IDE, as I mention in
the subject:


What specific functions are you seeking in a Perl IDE?

Perhaps after the requirements are detailed, folk can point to specific tools
to meet those requirements, tools can be written, or users can be left
to their own devices.

I have often found that I was asked to write software by a user because
they _thought_ they knew the solution they wanted before understanding the
problems they were trying to overcome.  Once the user and I focused on
the problem, we could see if existing tools, or enhanced tools, could
meet their needs.
-- 
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.


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

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

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