[6597] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 222 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 2 16:28:24 1997

Date: Wed, 2 Apr 97 13:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 2 Apr 1997     Volume: 8 Number: 222

Today's topics:
     Re: ***WHO IS AGENT ACTION!?*** (David Alan Black)
     Re: accessing sqlplus or oracle through perl (Paul Antinori)
     Re: Adding to @INC for module installation? (Simon Hyde (aka Jeckyll))
     ANNOUNCE: WebMagick Image Web Generator (Bob Friesenhahn)
     arrg <lorraine@ait.nrl.navy.mil>
     Re: Can't get 2 way communication using sockets <tchrist@mox.perl.com>
     Cookies <questions@cookiecentral.com>
     Re: Could some one please help (Simon Hyde (aka Jeckyll))
     Re: Data struc. or algor. for multi-type lists (Simon Hyde (aka Jeckyll))
     Re: HELP: case insensitivity (Jason Bodnar)
     Re: HELP: case insensitivity (Tad McClellan)
     Re: HELP: case insensitivity (Simon Hyde (aka Jeckyll))
     Re: HELP: Unable to create sub "%s" error in code (CTR)
     MIME (base64) encoding script, help? <fmc@BizServe.com>
     Re: MIME (base64) encoding script, help? (Nathan V. Patwardhan)
     Re: New to PERL (Tad McClellan)
     re: OR operator, was: New Microsoft Perl Product (fwd) <flg@vhojd.skovde.se>
     Re: Parsing file problem (Simon Hyde (aka Jeckyll))
     Perl vs. C/C++ <dcorbett@jcaho.org>
     PerlQt (Qt-0.01) released <jql@accessone.com>
     Re: Replaceing Text <tchrist@mox.perl.com>
     server directory protection vs. cgi-bin style password (Paul Antinori)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 2 Apr 1997 19:51:50 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: ***WHO IS AGENT ACTION!?***
Message-Id: <5hudcm$asi@pirate.shu.edu>

agent@agent.com writes:

>      And my vote for movie of the year is AGENT ACTION!   

That's nice.  Now eff off.

David Black
dblack@icarus.shu.edu


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

Date: 2 Apr 1997 20:25:54 GMT
From: pa19@tiac.net (Paul Antinori)
Subject: Re: accessing sqlplus or oracle through perl
Message-Id: <pa19-0204971534500001@p4.ts10.bedfo.ma.tiac.com>

In article <33428DF8.179C@dbtinc.com>, jsmith@dbtinc.com wrote:

> I'm writing a perl script where I have a loop that requires accessing a
> sequence that is stored in oracle. How can I directly/quickly access the
> sequence without having to log on to sqlplus each time ?

In powerbuilder you code a line like:

select sequencename.nextval into :variable from dual;

dual is the table in oracle where the sequences are stored.

Paul


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

Date: Wed, 02 Apr 1997 19:27:59 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Adding to @INC for module installation?
Message-Id: <3343a962.19027922@news.uni-stuttgart.de>

On 27 Mar 1997 23:53:17 GMT, siler@compstat.wharton.upenn.edu (Jack
Siler) wrote:

>A box on which I use perl has 5.003 installed but not the CPAN
>modules.  I'm trying to install some of them in MYHOME/CPAN.  libwww,
>IO and CGI go in ok but libnet looks for IO socket in @INC during the
>perl Makefile.PL step and can't find it.  It ain't there, it's
>in CPAN.  I know one can use PREFIX= to specify an alternate place to
>install modules, I wonder if there's a similar parameter for
>Makefile.PL to add additional places to look for pre-requisite
>modules.  I remember (installing on a different machine) using such 
>a parameter to point to the perl libs when they were in my home
>directory.
>
>Close to the above subject: Is there a doc/faq that explains the
>module library structure; I can't figure out what goes where- lib/ or
>/lib/site_perl or ...
>
>Thanks very much.
>Jack
>
Take a look at perl -h and the @INC section of man perlvar, they'll
tell you that the following will work:

perl -I/your/path/to/costom/libs Makefile.PL


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

Date: 2 Apr 1997 20:40:32 GMT
From: bfriesen@simple.dallas.tx.us (Bob Friesenhahn)
Subject: ANNOUNCE: WebMagick Image Web Generator
Message-Id: <5hug80$b66$1@nadine.teleport.com>


                        WebMagick Image Web Generator

WebMagick is a package which supports making image collections available
on the Web. It recurses through directory trees, building HTML pages,
imagemap files, and client-side/server-side maps to allow the user to
navigate through collections of thumbnail images (somewhat similar to
xv's Visual Schnauzer) and select the image to view with a mouse click.

WebMagick is based on the "PerlMagick" ImageMagick PERL extension rather
than external ImageMagick utilities (as its predecessor "Gifmap" is). This
alone is good for at least a 40% performance increase on small images.
WebMagick supports smart caching of thumbnails to speed montage generation
on average size images. After a first pass at "normal" speed, successive
passes (upon adding or deleting images) are 5X to 10X faster due to the
caching.
 
WebMagick supports a very important new feature in its caching subsystem:
it can create and share a thumbnail cache with John Bradley's 'xv' program.
This means that if you tell 'xv' to do an update, WebMagick montages will
benefit and you can run WebMagick as a batch job to update xv's thumbnails
without having to wait for 'xv' to do its thumbnail reduction (and get a
browsable web besides!).

WebMagick requires the ImageMagick (3.8.4 or later) and PerlMagick (1.0 or
later) packages as well as a recent version of PERL 5.

Obtain PERL version 5 from the Perl Language Home Page at
"http://www.perl.com/perl/index.html". Install PERL according to its
installation instructions.

Obtain ImageMagick from "ftp://ftp.wizards.dupont.com/pub/ImageMagick" (you
may want the LZW version in the 'lzw' subdirectory) or visit the
ImageMagick web page at
"http://www.wizards.dupont.com/cristy/ImageMagick.html".

Obtain PerlMagick from "ftp://ftp.wizards.dupont.com/pub/ImageMagick/perl"
or visit the PerlMagick web page at
"http://www.wizards.dupont.com/cristy/www/perl.html".

The WebMagick LSM is attached.

Begin3
Title:          WebMagick Image Web Generator
Version:        1.17
Entered-date:   31MAR97
Description:    WebMagick is a package which supports making image
                collections available on the Web. It recurses through
                directory trees, building HTML pages, imagemap files,
                and client-side/server-side maps to allow the user to
                navigate through collections of thumbnail images
                (somewhat similar to xv's Visual Schnauzer) and select
                the image to view with a mouse click. WebMagick is
                written in PERL and is compatable with PERL version
                5.002 and later. WebMagick uses the ImageMagick package
                and the PERL extension to ImageMagick (PerlMagick) and
                therefore requires that these packages be installed.

Keywords:       Web, ImageMagick, PERL, PerlMagick, graphics, GIF, JPEG
Author:         bfriesen@simple.dallas.tx.us (Bob Friesenhahn)
Maintained-by:  bfriesen@simple.dallas.tx.us (Bob Friesenhahn)
Primary-site:   http://www.cyberramp.net/~bfriesen/webmagick/dist/
			 97 kb webmagick-1.17.tar.gz
Alternate-site: ftp.wizards.dupont.com /pub/ImageMagick/perl
                         97 kb webmagick-1.17.tar.gz

Platforms:       Reqires UNIX, PERL, ImageMagick, and PerlMagick
Copying-policy: Freeware
End

======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us (Home)
bfriesen@spd.dsccc.com       (Work)
thefuzz@bix.com              (On BIX)
http://www.cyberramp.net/~bfriesen




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

Date: Wed, 02 Apr 1997 15:39:46 -0500
From: Brian Lorraine <lorraine@ait.nrl.navy.mil>
Subject: arrg
Message-Id: <3342C412.41C6@ait.nrl.navy.mil>

argggg... I'm writing a guestbook program right now in perl. I was just
about done with it and then i decided to change a little something on
one of the scripts "/cgi-bin/lorraine/gstbook.pl". It didn't work, agve
me some error message yadda yadda yadda.. so no biggie right? I just
change it back to the way it was (or at least the way i THINK it was)
and it still duzn't work.. rather odd cuz i ran it before... anyhoo I
ran it in the unix shell to see what line the so called "error" was on
and it said line 28... this one:

@eachrec = split(/##/, @wholething[0];

and it said something like some kind of syntax error on this line like

next 2 tokens "];"

hmmmm anyhooo if any of you have a little time could u maybe help me out
here. I saved the perl script that was giving me truble as a text file
@:
"http://www.ait.nrl.navy.mil/people/lorraine/gstbook.txt"
and the actualy script is at:
"http://www.ait.nrl.navy.mil/cgi-bin/lorraine.gstbook.pl"

thanks a bunch >:)

--------------------------------------------------------------
Brian "the BrAiN" Lorraine           lorraine@ait.nrl.navy.mil

 " ...if you want something badly enough and willing to work hard
          enough you'll get there in the end. "
						-Saffron-

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


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

Date: 2 Apr 1997 19:57:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can't get 2 way communication using sockets
Message-Id: <5hudn5$slj$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, tarcher@csu.edu.au writes:
:I am trying to a get a conversation going between a client and

:[Server]
:print CLIENT "How are you";
:$in = <CLIENT>;
:
:[Client]
:$in = <SERVER>;
:print SERVER "I'm Good thankyou!";
:
:Things just seem to hang. Am I creating a deadlock here?

You forgot to do 

    use FileHandle;
    CLIENT->autoflush(1);

and


    use FileHandle;
    SERVER->autoflush(1);

I'd bet nearly anything that this is the problem.  Or else you're on
an SGI with a broken stdio system.  Is there some place in the perlipc
or camel docs where I should more clearly talk about the need for
autoflushery?

--tom
-- 
	Tom Christiansen	tchrist@alumni.cs.colorado.edu


    "Winter is worth its wait in cold." --Larry Wall


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

Date: Wed, 02 Apr 1997 21:27:19 +0100
From: Andrew Pitt <questions@cookiecentral.com>
Subject: Cookies
Message-Id: <3342C127.5BF1@cookiecentral.com>

Hi,

We have just updated our site, there another 12 Javascript Cookies Demos
online. We have also set up a Cookie Message Board. For Full Information
on Persistent Cookies go to: http://www.cookiecentral.com

Thanks.

-- 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cookie Central
http://www.cookiecentral.com
questions@cookiecentral.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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

Date: Wed, 02 Apr 1997 19:27:53 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Could some one please help
Message-Id: <33426e8a.3961610@news.uni-stuttgart.de>

On Wed, 02 Apr 1997 10:26:12 +0100, alastair brown
<alastair@redboxad.demon.co.uk> wrote:

>Hi 
>
>Please could some one shed some light onto this problem. I'm trying to
>return some of the enviroment variables to my script using the following
>code
>
>$rem_host = $ENV{REMOTE_HOST}."!";
>$rem_add = $ENV{REMOTE_ADDR}."!";
>$browser = $ENV{HTTP_USER_AGENT}."!";
>
>And when I run it I get the following error message even though all of
>my variables have been returned.  Does anyone know how to turn this
>message off.
>
>CGI Error
>
>The specified CGI application misbehaved by not returning a complete set
>of HTTP headers. The headers it did return are:
>
>

This is not a problem with your perl, but your CGI (and therefore
should go in comp.infosystems.www.authoring.cgi), the problem is where
you print your output, you have not printed any headers, take a look
at the FAQ in comp.infosystems.www.authoring.cgi for more information
on headers.


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

Date: Wed, 02 Apr 1997 19:27:51 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Data struc. or algor. for multi-type lists
Message-Id: <334662ac.923455@news.uni-stuttgart.de>

On 1 Apr 1997 16:37:28 -0500, cml@cs.umd.edu (Christopher Lott) wrote:

>Hi,
>
>I'm working on processing input that is a list of elements,
>where an element can be either a simple token or another list
>(and lists have names).  So the best model of the data seems
>to be a list in which the elements can be of different types. 
>
>It sounds like a very natural thing for lisp, actually, but I
>think Perl is my best bet.  I know that I can process lists in
>Perl, but my reading of the Camel book says that the elements
>of a list must be all of the same type, either scalar, lists,
>hashes, etc.  

I didn't think this was so, I may be wrong, but I was pretty sure it
wasn't.

>If I were coding c/C++ I guess I would have a linked list of
>structs, and each struct would have a pointer that would point
>to a list in the case of a list (duh) and to nil in the case of
>a simple token.
>
You could do something like this in perl pretty easily, with something
like this, using a hash to simulate the structure, producing an array
of hashes, one of the values of which may or may not be an array:

undef @data;
$i = -1;
while(<DATA>){
	chomp;
	@line = split(/\|/);
	if ($#line == 0){
		$data[++$i]{'name'} = $line[0];
	}else{
		$data[++$i]{'name'} = shift(@line);
		$data[$i]{'list'} = [@line];
	}
}
# Loop through and display all values for the array, rather ghastly
with far too
#many @'s and $'s and braces
foreach(@data){
	print "Name: " . ${$_}{'name'} ;
	print ", with list: " . join (", ", @{${$_}{'list'}})  if
defined ${$_}{'list'};
	print "\n";
}
#This looks a little better
foreach $i(0..$#data){
	print "Name: " . $data[$i]{'name'};
	print ", with list: " . join (", ", @{$data[$i]{'list'}})  if
defined $data[$i]{'list'};
	print "\n";
}
__END__
plain line
line with array|this|being|the|array
or|this
pretty simple eh?|well|once|u|think|about|it
well..sorta anyway
well..|if you ignore the thousands of $'s and @'s and braces on the
join lines :-)

>I suspect there's some elegant way to do this in Perl, either in 
>the data structure, algorithm, or some wonderful Perl-thing.  There
>always has been in the past, why should this be any different?  If
>someone has time to share their ideas and insights, that would really
>be great. 

Well...I that may not look very elegant, but I think it's pretty nifty
:-)



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

Date: Wed, 02 Apr 1997 19:16:42 GMT
From: jason@cimedia.com (Jason Bodnar)
Subject: Re: HELP: case insensitivity
Message-Id: <3342b039.178419454@news.onr.com>

"Aurangzeb M. Agha" <aagha@cis.ohio-state.edu> wrote:

>Sorry this is a bit long winded.  I'm using perl5.003 to grab zipcodes
>from a flat file.  The problem is that I initially wrote the code to
>handle numeric zipcodes only, and now I'm confronted with using Canadian
>zipcodes too.  I used:
>
>    # if $zipcode is a substring of $zip starting at position 0
>    if ($zipcode eq substr($zip, 0, $length)) {
>       # get $zip record
>    }
>
>which works fine for numerical and EXACT alpha-numeric matches.  How can
>I modify this code so that if $zipcode is 'V6k7y6' and $zip is 'v6k7y6',
>the if-statement is found true?
>
>I tried:
>
>    if (/$zipcode/i eq substr($zip, 0, $length))
>
>but this would obviosuly only match if I was doing a pattern search.
>

Why not just use a regexp to start with:

if ($zipcode =~ /$zip/i) { ...


-- 
Jason C. Bodnar
jasonb@onr.com
Internet Programmer
Cox Interactive Media


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

Date: Wed, 2 Apr 1997 13:53:19 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: HELP: case insensitivity
Message-Id: <ffduh5.8di.ln@localhost>

Aurangzeb M. Agha (aagha@cis.ohio-state.edu) wrote:
: Sorry this is a bit long winded.  I'm using perl5.003 to grab zipcodes
: from a flat file.  The problem is that I initially wrote the code to
: handle numeric zipcodes only, and now I'm confronted with using Canadian
: zipcodes too.  I used:

:     # if $zipcode is a substring of $zip starting at position 0
:     if ($zipcode eq substr($zip, 0, $length)) {
:        # get $zip record
:     }

: which works fine for numerical and EXACT alpha-numeric matches.  How can
: I modify this code so that if $zipcode is 'V6k7y6' and $zip is 'v6k7y6',
: the if-statement is found true?


if ($zip =~ /^$zipcode/i ) {
        # get $zip record
        ...


man perlre if you want to be able to do slick stuff easily with Perl...

If you don't want to learn how to use regular expressions, then give up on
using Perl...


: I tried:

:     if (/$zipcode/i eq substr($zip, 0, $length))
          ^^^^^^^^^^^

This will return perl's idea of a 'true' or 'false' (trying to match
$zipcode against whatever string is in $_).

It does not return any 'string' to compare with (at least not
the comparison you have there).


: but this would obviosuly only match if I was doing a pattern search.


This would obviously only match against the string contained in $_,
not the string contained in $zipcode.


: *ANY* help would be appreciated.  


Hope this helps!


: Please eMail me at: 

Please read the newsgroup at comp.lang.perl.misc





P.S. Go Wolverines!  ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Wed, 02 Apr 1997 20:10:00 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: HELP: case insensitivity
Message-Id: <3345bb62.23636908@news.uni-stuttgart.de>

On Wed, 02 Apr 1997 12:30:30 +0000, "Aurangzeb M. Agha"
<aagha@cis.ohio-state.edu> wrote:

>Sorry this is a bit long winded.  I'm using perl5.003 to grab zipcodes
>from a flat file.  The problem is that I initially wrote the code to
>handle numeric zipcodes only, and now I'm confronted with using Canadian
>zipcodes too.  I used:
>
>    # if $zipcode is a substring of $zip starting at position 0
>    if ($zipcode eq substr($zip, 0, $length)) {
>       # get $zip record
>    }
>
>which works fine for numerical and EXACT alpha-numeric matches.  How can
>I modify this code so that if $zipcode is 'V6k7y6' and $zip is 'v6k7y6',
>the if-statement is found true?
>
>I tried:
>
>    if (/$zipcode/i eq substr($zip, 0, $length))
>
>but this would obviosuly only match if I was doing a pattern search.
>
>*ANY* help would be appreciated.  Please eMail me at: 
>
>	aagha@cis.ohio-state.edu
>
>	Thanks,
>	Aurangzeb
>
>PS -- I use '$zipcode eq substr($zip...)' instead of '/$zip/ #match'
>because the length of $zipcode changes on a regular basis.  Thx.
The simple way to change this would be to do:
if (lc($zipcode) eq lc(substr($zip, 0, $length))) {
however to save having to calculate the lenght and use substr, you
could easily do:
if ($zip =~ /^\Q$zipcode/i){


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

Date: Wed, 02 Apr 1997 15:47:09 -0500
From: "David Turkel (CTR)" <dturkel@ndcinc.com>
Subject: Re: HELP: Unable to create sub "%s" error in code
Message-Id: <3342C5CD.15FB7483@ndcinc.com>

Oops, I found the error.  The code which is taken from the 2nd Ed. Camel
book has a signal handler in the "non-forking" code example that I
borrowed heavily from.

So, when the `command` was executed and completed a SIG{CHLD} was sent
to my parent process, which then tried to run the defined $SIG{CHLD}
subroutine, which didn't exist.

Oh Well.

Dave

David Turkel (CTR) wrote:
> 
> I am having a problem with trying to figure out what my error is here...
> Here is the code:
> 
> I am using perl5.002.  The error is RUNTIME and it occurs after the
> "if(Check_Completion" condition is true.  As soon as it tries to


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

Date: Wed, 02 Apr 1997 14:07:32 -0800
From: John Spaid <fmc@BizServe.com>
Subject: MIME (base64) encoding script, help?
Message-Id: <3342D8A3.1D5A@BizServe.com>

Hi,

I use a perl cgi program with html forms to mail attached MIME (base64)
files to folks who request it.  Right now I manually encode the files
from binary to base64, but I'd like to script in the base64 encoding so
I can encode binary files for attachments on the fly.  Can anyone offer
some help?

John
fmc@bizserve.com (John)


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

Date: 2 Apr 1997 20:36:01 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: MIME (base64) encoding script, help?
Message-Id: <5hufvh$b8g@fridge-nf0.shore.net>

John Spaid (fmc@BizServe.com) wrote:

: I use a perl cgi program with html forms to mail attached MIME (base64)
: files to folks who request it.  Right now I manually encode the files
: from binary to base64, but I'd like to script in the base64 encoding so
: I can encode binary files for attachments on the fly.  Can anyone offer
: some help?

Yes, get the MIME::* modules from a CPAN near you!  Each of these modules
is nicely documented for your hacking pleasure.  :-)

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Wed, 2 Apr 1997 14:14:09 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: New to PERL
Message-Id: <hmeuh5.cgi.ln@localhost>


[ if you are also new to Usenet newsgroups, then I suggest
  that you monitor the:

  news.announce.newusers

  newsgroup for a few weeks. You will pick up dozens of
  tidbits that will enrich your use of Usenet...
]



Banks Family (gilbertb@ns.flipag.net) wrote:
: Hi Perlers,

Hi.


: I a total beginner to PERL ... actually I haven't started.  I've 
      ^^^^^^^^^^^^^^
: downloaded PERL5 for Win32.  


You should look around at http://www.perl.com for the new FAQs 
( and the 'man pages', with a .pod filename extension if you don't
  already have them).


: How do I compile with it? 

That is covered in the man pages and FAQs.  ;-)


: What other things 
: do I need to know before jumping in?


The stuff that is covered in the man pages and FAQs.  ;-)


: Also, I wanted to use PERL5 on a UNIX platform.  

Now you're talking ;-)


: How do I get a copy ... 

That is covered in the man pages and FAQs.  ;-)


: the copy I say had the ".tar.gz" extension it.  Do I need a special 
: application to open this file up?

 .gz is GNU zip format.

You uncompress it thus:

gzip -d foo.tar.gz

or

gunzip foo.tar.gz


Then you are left with the .tar (Tape ARchive) format.

You extract it thus:

tar xvf foo.tar


Or, if you have GNU tar, you can extract it in one fell swoop thus:

tar xzvf foo.tar.gz



: Thank You,

You're welcome.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 2 Apr 97 14:56:40 GMT
From: "Fredrik Lindberg" <flg@vhojd.skovde.se>
Subject: re: OR operator, was: New Microsoft Perl Product (fwd)
Message-Id: <01bc3f76$19c409a0$e20f10c2@odens.di.vhojd.skovde.se>

Paddy Spencer <paddy.spencer@parallax.co.uk> wrote in article
<859989020.901493@red.parallax.co.uk>...
> I know you can do this:
> 	$arg eq "-n" || die "Use -n you moron!!\n";
> and if you try doing 
> 	$arg eq "-n" || $arg = "-n";
> 
> it complains about modifying logical or operator. Any way around this
> or does one have to use the incredibly passe if(...){} construct?

you need paranthesis around the right part. The construct as you have
written is evaluated like this:

($arg eq "-n" || $arg) = "-n";

I e = has a lower priority then ||, So, you need to say:

$arg eq "-n" || ($arg = "-n");

Maybe you just took a simple example but if you want
to make sure that $arg is equal to "-n" why not just
simply do a :

$arg = "-n";

?

Hope this helps

/Fredrik



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

Date: Wed, 02 Apr 1997 19:28:00 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Parsing file problem
Message-Id: <3344ac90.19842294@news.uni-stuttgart.de>

On Thu, 27 Mar 97 17:34:00 GMT, ab20@tntvax.ntrs.com wrote:

>I have a file with the following record:
>
>|1997-02-13 00:00:00:000|N|NULL |NULL   |XYZ |NULL|JKL   |NULL      |123 
>
>My output should look like this:
>
>|1997-02-13 00:00:00:000|N|||XYZ ||JKL   ||123 
>
>Basically I'm just stripping the word "NULL" and any trailing spaces before 
>the next delimiter "|".  Is there a way using awk or perl to accomplish this?
>
>
>thanks in advance.... 
A nice perl solution:
open(INFILE, 'input');
open(OUTFILE, 'output');
while (<INFILE>){
	s/\|\s*NULL\s*\|/\|\|/g;
	print OUTPUT;
}


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

Date: Wed, 02 Apr 1997 14:38:26 -0800
From: Dan Corbett <dcorbett@jcaho.org>
Subject: Perl vs. C/C++
Message-Id: <3342DFE2.526E@jcaho.org>

I am evaluating languages to use for creating a program to basically
read in a file, parse out some text, and rewrite the file. Eventually
this data will be uploaded into a database. Obviously, this can be done
in C/C++. Perl got thrown into the into the mix (this will be written on
an HP-9000), and I was wondering if anyone could help me with selling
points of Perl, such as: 

	1) How easy is it to learn?
	2) How well does it handle files and strings?
	3) What about support and documentation?	
	4) What about all this CGI and webserver stuff, etc. 

I have looked quite a bit for this info (so you don't think I'm
completely lazy), but was hoping to get an opinion from someone who has
used Perl and C. Any help would be greatly appreciated.


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

Date: 2 Apr 1997 20:40:03 GMT
From: "John Q. Linux" <jql@accessone.com>
Subject: PerlQt (Qt-0.01) released
Message-Id: <5hug73$b5v$1@nadine.teleport.com>

Hello,

  I, Ashley Winters, am pleased to announce the release of version 0.01
of my interface between Perl and Qt.

  Qt is a cross-platform C++ graphical development toolkit developed by
Troll Tech, whose homepage is http://www.troll.no, and is available at
no charge for non-commerial purposes on various X-Window System platforms.
There is an MS Windows version, but it is strictly commercial.

  Perl is a popular interpreted language written by Larry Wall.
See http://www.perl.com/perl/ for info.

  PerlQt requires a Perl-5.004 (or a reasonable beta facsimile), which
should be available on a CPAN mirror (if not now, than soon) and Qt-1.1.
I've only compiled it on a Linux system. Technically, it should probably
compile on some non-Linux systems, but I can't be sure until someone
tries. ;)

  PerlQt is a fully object-oriented module (actually, set of >30 modules)
with an interface so closely mimicking the original C++ Qt interface that
the Qt documents apply as much to PerlQt as they do to the C++ version. Of
course, PerlQt doesn't have to deal with types and references and
pointers, and the garbage-collection is automatic, and a few other more
obscure things that most Perl programmers would consider natural and C++
programers would not.

  Over 30 Qt classes have been interfaced to Perl, and most of them have
(almost) all of their public, non-virtual, non-operator member-functions
interfaced. A couple classes have some virtual functions interfaced, but
only those required to run the PerlQt tutorials.

  Speaking of tutorials, Qt comes with 14 of them, which you can read
(with a detailed description) at http://www.troll.no/qt/tutorial.html.
I have ported these tutorials to PerlQt, and they are bundled with the
main PerlQt release.

  These tutorials illustrate the path from 'Hello World' to a complete
game. Widgets are created, callbacks are made, and many useful classes
are used. My criteria for the release of 0.01 was the correct working of
the 14 PerlQt tutorials. I perhaps should have made a lack of memory
leaks a criteria, but I didn't. :)

  One of the defining features of Qt is a callback method known as
'signals and slots'. I have created a limited version of it in this
version of PerlQt, just enough to get the tutorials working. A detailed
description of the 'signals and slots' mechanism can be found from
http://www.troll.no/qt/metaobjects.html, and the PerlQt version is
detailed in the PerlQt QObject pod.

  In the C++ version of Qt, signals and slots required syntax enhancement.
>From that need was born a program called moc (MetaObject Compiler), a
pre-processor which creates a new file filling in all the signal/slot
'holes'. Perl needs no such pre-processor because of it's ability to add
functions on the fly, and grab functions from their names, etc...

  The inspiration for the creation of this interface was both personal
growth and monetary benefit. Troll Tech is holding a Qt Programming
contest (http://www.troll.no/contest.html for info) and this program
will be my entry. I have learned quite a lot about both Perl and Qt in
the process of creating such a large interface.

  For those who are interested, there is no KDE (http://www.kde.org)
interface to PerlQt, nor is one planned before May 1st. If anyone wants
to take up the endeavour, contact me and we'll talk to set the libperlqt
API in stone (one of the soft ones).

My Perl module-list (http://www.perl.com/CPAN/modules/00modlist.long.html)
entry has been changed to indicate the alpha release status of PerlQt.

Qt             ad+O  Interface to the Qt toolkit                  AWIN

The (slightly modified) README.PERLQT included below shall enlighten you
still further.

README.PERLQT:

PerlQt is an incomplete but well-thought-out object-oriented interface
to the C++ GUI development library, Qt.

This release, PerlQt 0.01, is distributed under the LGPL and requires
Qt-1.1 and Perl 5.004 (or a beta version). I have only successfully
compiled PerlQt myself on my own RedHat Linux 4.0 system with a 2.0.28
kernel, running Perl-5.00390, which is a beta-release of Perl-5.004.

PerlQt has poor documentation: A few pages of pod documentation just 
stating if a method has been interfaced, and description of what few
changes were needed in the interface. But all of the Qt documentation
is just as valid with PerlQt as it is with C++ Qt.

PerlQt is easy to learn if you know Perl and Qt, because the interface
is the same as C++ Qt, and it makes the minimum number of changes mandated
by Perl.

PerlQt dramatically cuts down on development time and complexity because
of the Perl part! PerlQt does not require moc or headers or compiliation.
In exchange, it has a startup penalty of a few seconds.

PerlQt is fully object-oriented. All widgets and dialogs are Perl objects,
and, using inheritance, creation of new widgets is easy and natural.

PerlQt's interface to signals and slots allows signals and slots from
Perl and C++ to be connected to signals and slots in Perl and C++.

PerlQt is very fast because it is such a direct interface between Perl
and Qt. It does no translation of the interface from Qt, because the
interface is so elegant, well-designed, and easily converted to Perl.

PerlQt is copyright Ashley Winters <jql@accessone.com> and is distributed
under the terms of the LGPL and is subject to (as well as compliant with)
the Qt licensing regulations. AFAIK, PerlQt programs are subject to the Qt
license just as much as a C++ Qt program; although I think the Qt license
needs to be much more explicit about Qt clones and language interfaces.

PerlQt is available for free, and may be downloaded from any CPAN mirror
in the authors/Ashley_Winters/ directory as the file Qt-0.01.tar.gz.

Going to http://www.perl.com/CPAN/ will forward you to a CPAN mirror
which is close to you.

Qt is available for download from http://www.troll.no/dl/ or via
anonymous ftp to ftp.troll.no. See README.QT for information about
Qt and details about downloading Qt and licensing restrictions.

There is no specific discussion area for PerlQt, nor do I forsee one. If
you find a bug in the software, contact me, Ashley Winters, directly via
e-mail at jql@accessone.com. Any questions regarding Qt should be directed
towards the left hemisphere of your brain, which should cause you to begin
searching the Qt homepage which is at http://www.troll.no/ or the Qt
documentation in the html/ dir of wherever Qt was installed on your
computer. You did install Qt already, didn't you?

Should those measures fail, send a message to qt-interest@troll.no,
which is a mailing-list (send a message with "subscribe" in the body to
qt-interest-request@troll.no to subscribe), and I, as well as many other
knowledgeable people including the Qt authors, will try to respond to
your message.


You're only a fool if you don't try PerlQt,

Ashley (I can't believe I said that) Winters




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

Date: 2 Apr 1997 19:25:11 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Replaceing Text
Message-Id: <5hubqn$rki$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    ted@qp.com writes:
:@lines[$i] =~s/(@keywords[0])/<I>$1<\/I>/i;

Egads!  Those at signs should be dollars.  That will be a syntax
error in 5.004.

--tom
-- 
	Tom Christiansen	tchrist@alumni.cs.colorado.edu
    "That's okay.  Anyone whose opinion he cares about already knows that
    he doesn't care about their opinion."
    	--Larry Wall


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

Date: 2 Apr 1997 20:51:27 GMT
From: pa19@tiac.net (Paul Antinori)
Subject: server directory protection vs. cgi-bin style password
Message-Id: <pa19-0204971600240001@p0.ts18.bedfo.ma.tiac.com>

Where can I find more info on server directory protection vs. cgi-bin
style passwords?  Thanks

Paul


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

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

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