[7931] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1556 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 31 10:07:51 1997

Date: Wed, 31 Dec 97 07:00:44 -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, 31 Dec 1997     Volume: 8 Number: 1556

Today's topics:
     Re: Bug: 30 chars of perl uses 269MB! (Nick Andrew)
     Re: Can you make a literal "@" show up in a format? (brian d foy)
     Re: cgi script for binary images (brian d foy)
     CGI.pm and $Q:: <patrick@kan.co.uk>
     Re: CGI.pm and $Q:: (brian d foy)
     Re: Get Method (brian d foy)
     Re: importing subroutines (brian d foy)
     IO redirection and env in Perl <robpang@cs.stanford.edu>
     Re: learning perl <jeff@webdesigns1.com>
     Re: list as a hash value? (brian d foy)
     Re: LWP SSL POST requests (Shishir Gundavaram)
     Re: LWP SSL POST requests <aas@sn.no>
     Re: Need help hand-coding an HTTP POST request (brian d foy)
     Need script to preview form data prior to submitting <infogen@infgen.com>
     Re: Need script to preview form data prior to submittin (brian d foy)
     Newbie question <bowens@eastman.com>
     Re: Novice needs advice (brian d foy)
     Perl location <s9ulzf@fnma.com>
     Re: Perl Resource Kit - UNIX Edition or wait for WIN 32 <sb@sdm.de>
     Re: Perl Resource Kit - UNIX Edition or wait for WIN 32 <sb@sdm.de>
     Re: PERL URL-Encoding <jdporter@min.net>
     Perl5 on NT4 with IIS4 <mario.v.abela@magnet.mt>
     Re: Removing "last" reference to an Object (brian d foy)
     Re: SHELL/REGEX GUNSLINGERS NEEDED!!! <jdporter@min.net>
     Re: Testing for null and spaces (brian d foy)
     undefined value snailgem@aol.com
     Re: word wrap routine (brian d foy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 31 Dec 1997 21:14:07 +1100
From: nick@zeta.org.au (Nick Andrew)
Subject: Re: Bug: 30 chars of perl uses 269MB!
Message-Id: <68d5tf$jdd$1@gidora.kralizec.net.au>

In <34a84c9e.887091580@news.mindspring.com> tnguru@termnetinc.com (Ben Coleman) writes:

>>Perl appears to be doing exactly what you told it to do(which may be at
>>variance with what you think you told it to do).
>>
>>The insertion of a little white space might make it easier to understand:
>>
>>$i = '(\\' x \ \ ''

I found the 'x' binary operator in the manual today. Thanks for the
explanation; it makes sense.

>Basically, your problem is that you're doubling the \ when you don't want
>to( a \\ becomes a literal \ in the string).  To insert a literal ', use
>\'.  thus what you originally wanted to do was:
>$i='(\'x\'';

Not quite. I was actually working on some code which would allow me to
pass fairly arbitrary data structures out of C++ and into perl, via
pipes/strings/ascii. The arbitrary data structures include ints, strings,
lists and associative arrays - each of which, by some coincidence, has
a corresponding Perl data type.

The challenge was to quote the structures in C++ and pass them to perl as
(say) $input such that I could do:

@list = eval $input;
or
%hash = eval $input;

and for data structures inside lists and hashes I could also use eval
(recursively if needed).

Quoting of strings with backslashes is a messy business, of course,
and when the quoting is several layers deep then the backslashes take
on a life of their own. It was during an experiment with a string
containing a single quote embedded inside a few nested lists that I
found the example above (due of course to incorrect quoting).

Nick.
-- 
Kralizec / Zeta Microcomputer Software  Fax: +61-2-9233-6545 Voice: 9837-1397
G.P.O. Box 3400, Sydney NSW 1043        http://www.zeta.org.au/


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

Date: Wed, 31 Dec 1997 03:52:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Can you make a literal "@" show up in a format?
Message-Id: <68d0mk$jdd@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <68cj66$nmr@camel20.mindspring.com>, "Janet Buehler" <janetbuehler@mindspring.com> wrote:

> I've created a Perl script that compiles some FTP statistics, and then
> writes it out in a formatted table to an email message to me. I would like
> to be able to specify the To:, From:, and Subject: headers in my REPORT_TOP
> format, so the header information is passed to /usr/lib/sendmail -t when I
> write the report:
> 
> format REPORT_TOP =
> To: me@mysite.com
> From: me@myserver.com
> Subject: FTP Statistics
> 
> Date--------------File----------Att--Suc---UF----Bandwidth
> .

> However, the format doesn't like to see those "@"s in the email addresses --
> it perceives them to be misused picture fields.

i'll defer on the original question to suggest not using a top of
page format like so.  you only need to send the mail header once.  if
your report has more lines than the defined length of the page, you'll
get all that mail header stuff again.  blech!

but back to your question.  there is this snippet from the perlform
man page:

     To get a real at or caret into the field, do this:

         format Ident =
         I have an @ here.
                 "@"

which looks like it can make for a really ugly format.  however, you
might consider not hardcoding the addresses in the format:

   format STDOUT_TOP =

   From: @*
   $from
   To: @*
   $to
   Subject: @*
   $subject
   .

good luck :)

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 03:26:51 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: cgi script for binary images
Message-Id: <68cv7d$dof@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <34A95931.40005D9A@slip.net>, sam wong <skwong@slip.net> wrote:

> I'm running into a problem having a perl cgi script send a adobe pdf
> file to the browser, the browser receives the header and launches
> acrobat reader, but the acrobat reader complains about no data in
> document.

> Code snippet:
> 
>    print "Content-type: application/pdf\n\n";
> 
>    open (BL, "6341258.pdf");
      
maybe something went wrong with the open?  always check your
return values!

also since you are sending a known amount of data, you might want
to send along a Content-length header as well.

good luck :)

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 14:10:47 +0000
From: Patrick Verdon <patrick@kan.co.uk>
Subject: CGI.pm and $Q::
Message-Id: <34AA5267.8DFD6385@kan.co.uk>

Hi,

I'm currently using CGI.pm and am doing the following:

$query = new CGI;
$query->import_names();

However if I then try to access the $Q:: namespace for
a query by doing the following:

for $x ( keys(%Q::) )
{
   print("Q KEY: $x, Q VAL: $Q::{$x}\n");
}

I get:

Q KEY: COLOUR_1, Q VAL: *Q::COLOUR_1 
Q KEY: STATUS, Q VAL: *Q::STATUS 

I don't know why I'm getting the '*Q::STATUS' instead
of the variable's value. Can anyone help?

Cheers.



Patrick


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

Date: Wed, 31 Dec 1997 09:52:59 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI.pm and $Q::
Message-Id: <68dlre$pe7@mtinsc04.worldnet.att.net>
Keywords: just another new york perl hacker

In article <34AA5267.8DFD6385@kan.co.uk>, Patrick Verdon <patrick@kan.co.uk> posted:

> I'm currently using CGI.pm and am doing the following:
> 
> $query = new CGI;
> $query->import_names();
> 
> However if I then try to access the $Q:: namespace for
> a query by doing the following:
> 
> for $x ( keys(%Q::) )
> {
>    print("Q KEY: $x, Q VAL: $Q::{$x}\n");
> }
> 
> I get:
> 
> Q KEY: COLOUR_1, Q VAL: *Q::COLOUR_1 

> I don't know why I'm getting the '*Q::STATUS' instead
> of the variable's value. Can anyone help?

you're mucking with the symbol table, not the data.  i'm not
sure why you are doing it that way, but you might want to 
change the package context to Q and then access the data
through symbolic references:

   package Q;

   foreach my $name (keys %Q::)
        {
        print "$name ", ${$name}, "\n";
        }

although this will break if $name is not a scalar (you fill in
the details - i just wanted to show the concept).

good luck :)

-- 
brian d foy                                 <http://computerdog.com>


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

Date: Wed, 31 Dec 1997 03:00:27 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Get Method
Message-Id: <68ctlu$4sc@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

[follow-ups set to a more appropriate newsgroup]

In article <883544656.1631780868@dejanews.com>, amerar@unsu.com wrote:

> If I want to send more than one parameter to a perl/cgi program using the
> GET method, I have two questions:
> 
> 1)  How do I seperate the fields??

see the CGI specification

> 2)  How do I parse them in the program?

use the CGI module.  it is your friend :)

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 04:14:46 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: importing subroutines
Message-Id: <68d219$jdd@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <34A9A8AB.9632C2B7@llnl.gov>, John Tannahill <jrt@llnl.gov> wrote:

> I have just spent quite a while trying to figure out how to call a perl
> subroutine that is
> in one file from a perl program in another file.

is this other file a module?  if so, look at the information about
@EXPORT and @EXPORT_OK which define how a module exports thingys 
into other packages.

is this other file simply required? are you using

   use subs qw(foo bar baz);

or other methods of predeclaring subroutines?

a snippet of code might help us figure out what you are trying to do
so that we can point you in the right direction.

good luck. :)

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 00:17:49 -0800
From: "Robert Pang" <robpang@cs.stanford.edu>
Subject: IO redirection and env in Perl
Message-Id: <68cv8b$qgi@masters0.InterNex.Net>

Hi all,

I posted a question about how to do IO redirection in Perl last week and
gotten 2 replies.  Thanks a lot.  The way to do so is through TIEHANDLE
on STDIN and STDOUT.  I have gotten it work.  I should have studied
the documentation more carefully.

However, in the TIEHANDLE documentation, it does say that the TIEHANDLE
support is incomplete.  I wonder how incomplete it is.  Anyone has any idea?

Besides, I also want to redefine %ENV hash table with my own implementation
and I have it working through TIEHASH.  However, I want to access the
original
%ENV implementation in my own implementation.  I cannot do so because once
I tie %ENV with my own package, the original implementation is lost.  I
tried
doing tied %ENV to get the original handle but I got nothing returned.  I
also
tried to get a reference to the original %ENV and pass it to my own
implementation package.  However, when I try to access the original %ENV
through that reference, it loops back to my own implementation, thus making
a circular loop.  Does anyone know how to get that?

Many thanks.

Rob




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

Date: Wed, 31 Dec 1997 08:41:01 -0600
From: "Jeff Oien" <jeff@webdesigns1.com>
Subject: Re: learning perl
Message-Id: <68dl8r$khh@newsops.execpc.com>

I have a site called Perl Primer which may be of interest.
http://www.webdesigns1.com/perl/
--
Jeff Oien, WebDesigns
http://www.webdesigns1.com/
jeff@webdesigns1.com

>>hi im interested in getting started on learning perl/cgi scripts can
>>any1 point me to some good sites on the net to help me out or anything
>>else i may be interested in?
>





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

Date: Wed, 31 Dec 1997 04:18:01 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: list as a hash value?
Message-Id: <68d27c$jdd@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <68bl9v$qhv$1@nntp.Stanford.EDU>, luyung@leland.Stanford.EDU (Yung-Hsiang Lu) wrote:

> Hi,
> 
> Is there a way to store a list as a hash value?  It seems a very
> useful thing.  Here is an example to show the power of this feature:
> 
> $Sports{John} = ("swimming", "tennis", "football");

perhaps you wanted to use an anonymous array?

   $sports{'John'} = ["swimming", "tennis", "football"];

see the perldsc manpage, amongst others, for more details on
complex data structures in Perl.

good luck :)

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 31 Dec 1997 12:39:19 GMT
From: shishir@ruby.ora.com (Shishir Gundavaram)
Subject: Re: LWP SSL POST requests
Message-Id: <68dedn$p4h$1@amber.ora.com>

Chris Schoenfeld (chris@ixlabs.com) wrote:
: Now I need to hand-code a couple of POST requests with a few simple
: key-value pairs.
: 
: I have not, however, been able to find good documentation about what a
: HTTPS POST request looks like (or HTTP POST requests for that matter).

It "looks" the same, except for the fact the request is encrypted.
LWP doesn't support the "https:" protocol, and it would be quite
a challenge (legally, anyway) to implement.

--Shishir


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

Date: 31 Dec 1997 14:08:25 +0100
From: Gisle Aas <aas@sn.no>
Subject: Re: LWP SSL POST requests
Message-Id: <m367o5oe2e.fsf@furu.g.aas.no>

shishir@ruby.ora.com (Shishir Gundavaram) writes:

> LWP doesn't support the "https:" protocol, and it would be quite
> a challenge (legally, anyway) to implement.

LWP already support https if you have Net::SSLeay installed.

-- 
Gisle Aas


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

Date: Wed, 31 Dec 1997 04:22:02 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Need help hand-coding an HTTP POST request
Message-Id: <68d2es$jdd@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <34A98AB4.57E6@ixlabs.com>, chris@ixlabs.com wrote:

> POST /cgi-bin/theprogram.exe/W024/NJD0/?VId=00?KrId=0 HTTP/1.0
> Content-type: text/plain
> Content-length: 19
> RF.FED.02=1st Page

there needs to be a blank line between the HTTP message body and the
HTTP header.  see the HTTP specification [1] for more details.

good luck :)

[1]
referenced in the CGI Meta FAQ
<URL:http://computerdog.com/CGI_MetaFAQ.html>

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 08:11:18 -0500
From: Jonna Dersch <infogen@infgen.com>
Subject: Need script to preview form data prior to submitting
Message-Id: <34AA4476.20C8@infgen.com>

Hi,

I am looking for a perl script that will take the input from a form and
redisplay the data for the user to confirm or correct entered
information.  After they have confirmed the data entered I want to email
the results to the appropriate recipient. I have been a programmer for
many years but I am new to perl, so any help would be greatly
appreciated.

Thanks, and Happy New Year!


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

Date: Wed, 31 Dec 1997 08:43:47 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Need script to preview form data prior to submitting
Message-Id: <68dhpm$27p@mtinsc05.worldnet.att.net>
Keywords: just another new york perl hacker

In article <34AA4476.20C8@infgen.com>, infogen@infgen.com wrote:

> I am looking for a perl script that will take the input from a form and
> redisplay the data for the user to confirm or correct entered
> information.  After they have confirmed the data entered I want to email
> the results to the appropriate recipient. I have been a programmer for
> many years but I am new to perl, so any help would be greatly
> appreciated.

with which parts are you having trouble?

what are your data requirements?  they tend to be particular to the
application.

are you using CGI.pm?

and so on and so on....

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 31 Dec 1997 13:22:11 GMT
From: "Blaine Owens" <bowens@eastman.com>
Subject: Newbie question
Message-Id: <01bd15ef$35d720a0$13e288a8@PC83610221.kpt.emn.com>

I have a perl script which reads a file and parses out particular fields to
produce a report. One of the fields is like "(45.0%)" but I would like for
it to be just "45.0" in the report. What is the best way to strip the
leading "(" and the trailing "%)"? Thanks. 
-- 
Blaine Owens
bowens@eastman.com


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

Date: Wed, 31 Dec 1997 04:09:39 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Novice needs advice
Message-Id: <68d1nm$jdd@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <01bd158a$43fbfda0$010000c0@perdue>, "David Perdue" <KE4FOM@TECHNOLOGIST.COM> wrote:

> I'm trying to learn CGI programming. To that end I decided to *attempt* to
> teach myself Perl. Assume no previous programming experience.
> 
> In this short script, I'm attempting to learn how to use filehandles. I
> getting some data (one record per loop), and trying to write each record to
> a file.  Here it is:

your script works for me.  perhaps there are other problems?  turn
on warnings and check return values to see if you discover anything.
good luck :)

> #!/usr/bin/perl

add the -w switch to get warnings

> open(LIST,">>listfile");

make sure that you check your return values!

   open(LIST,">>listfile") or die "$!";

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 09:04:56 -0500
From: s9ulzf <s9ulzf@fnma.com>
Subject: Perl location
Message-Id: <Pine.SOL.3.96.971231090137.14986B-100000@dsysadm01>

Hi,

Is it possible to ask a perl program to search for perl in multiple
locations? For example, 
	try  
		#!/user/local/perl 

	first and if not found then try 

		#!/usr/opt/bin/perl?


Thank you.

Lin 
s9ulzf@fnma.com



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

Date: 31 Dec 1997 08:50:53 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Perl Resource Kit - UNIX Edition or wait for WIN 32 Edition?
Message-Id: <68d11d$ljj$1@bsdti6.sdm.de>

In article <34a83958.17253910@news.wwa.com>, Faust Gertz <faust@wwa.com> wrote:
> Should I buy the Perl Resource Kit UNIX Edition or wait for the WIN 32
> Edition?

> Here is my situation.  I use to play a round with my ISP's version of
> Perl, which was running under Solaris.  Yesterday, I broke down and
> bought one of those Windows 95 machines.  So, I decided it might be
> wise to enter the world of Perl for WIN 32.  That way I could  save on
> connect charges when I play with non-CGI and libwww stuff by doing it
> on my own machine.   My fear is that the WIN 32 Edition will be filled
> with all kinds of WIN 32 specific information and that I will lose out
> on lots of useful documentation by not buying the UNIX Edition.

As one of the contributors of, and from my experience with the UNIX
Perl Resource Kit, I presume that you will not lose anything by buying
the Win32 version, except maybe quite a bit of money... ;-)

(I suppose that the Win32 version will also contain a complete snapshot
of CPAN, and the documentation of the modules which are included is
probably exactly the same as in the UNIX version, except for modules
that have been updated by their authors in the meantime, I guess)

For that money you will get a countervalue, of course, but I doubt that you
really need the kit for just "playing around" with Perl on your own PC.

I recommend that you download the Perl for Win32 port by Gurusamy Sarathy,
which will serve you well (at the very least in the short term!) since it
already contains the most useful modules from CPAN in precompiled form,
and it supports adding new modules with MakeMaker, which makes it much
easier to install new modules.

See http://www.engelschall.com/u/sb/download/ for a copy of the distribution
file of that port and links to the original distribution!

> Can
> anyone verify or falsify my fear and give me some advice on the
> purchase?

See above. :-)

> Faust Gertz
> Philosopher at Large

Best regards,
-- 
    Steffen Beyer  <sb@sdm.de>  http://www.engelschall.com/u/sb/
     Feel free to visit my download area with free software at
              http://www.engelschall.com/u/sb/download/
    >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: 31 Dec 1997 08:57:52 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Perl Resource Kit - UNIX Edition or wait for WIN 32 Edition?
Message-Id: <68d1eg$ljj$2@bsdti6.sdm.de>

In article <34A84CF2.22DB00D7@cse.dnd.ca>, Phil Houstoun <pjhousto@cse.dnd.ca> wrote:
> Faust Gertz wrote:
> > 
> > Should I buy the Perl Resource Kit UNIX Edition or wait for the WIN 32
> > Edition?
> > 
> > Here is my situation.  I use to play a round with my ISP's version of
> > Perl, which was running under Solaris.  Yesterday, I broke down and
> > bought one of those Windows 95 machines.  So, I decided it might be
> > wise to enter the world of Perl for WIN 32.  That way I could  save on
> > connect charges when I play with non-CGI and libwww stuff by doing it
> > on my own machine.   My fear is that the WIN 32 Edition will be filled
> > with all kinds of WIN 32 specific information and that I will lose out
> > on lots of useful documentation by not buying the UNIX Edition.  Can
> > anyone verify or falsify my fear and give me some advice on the
> > purchase?
> > 
> > TIA
> > 
> > Faust Gertz
> > Philosopher at Large

> IMHO, break down one more time and install Linux on your box, you can
> then get the Unix version AND be able to do the CGI and libwww stuff.
> The paying for Perl thing is a joke.... right?

BTW, FreeBSD is more stable, more performant and easier to install than
Linux, so people told me.

The stability and ease of installation I can confirm from my own experience,
and I'm also very satisfied with the performance, but I have had nothing to
compare it with.

Available from http://www.freebsd.org/ or get the distribution CDs from
http://www.cdrom.com/ (that's "Walnut Creek CD-ROM" publishers).

Hope this helps.

Yours,
-- 
    Steffen Beyer  <sb@sdm.de>  http://www.engelschall.com/u/sb/
     Feel free to visit my download area with free software at
              http://www.engelschall.com/u/sb/download/
    >> Unsolicited commercial email goes directly to /dev/null <<


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

Date: Wed, 31 Dec 1997 09:03:20 -0500
From: John Porter <jdporter@min.net>
Subject: Re: PERL URL-Encoding
Message-Id: <34AA50A8.6BB@min.net>

Randal Schwartz wrote:
>
> Don't reinvent the wheel.  Don't copy code from some
> silly book in some cargo-cult-programming mode. 

For an interesting explanation of cargo cult mentality,
check out Feynman's article on Cargo Cult Science at
http://www.physics.brocku.ca/etc/cargo_cult_science.html


> That's how a lot of
> bad code gets executed, and how a lot of security holes get
> propogated.

Interesting use of the word "executed". I like it!

John Porter
jporter@logicon.com


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

Date: Wed, 31 Dec 1997 10:59:56 +0100
From: "Mario Abela" <mario.v.abela@magnet.mt>
Subject: Perl5 on NT4 with IIS4
Message-Id: <68d55t$aro@JAN.magnet.mt>

Hi,

Can anyone help me setting up Perl5 to run under IIS4 on NT or from where I
can get the info to set it up?

Mario Abela




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

Date: Wed, 31 Dec 1997 03:23:13 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Removing "last" reference to an Object
Message-Id: <68cv0l$dof@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <34A954C1.35E44E24@vbe.com>, Mark Kahn <mkahn@vbe.com> wrote:


> The problem is that one of the "current" record's elements is the ref that
> points to a blessed object that contains data related to that record.  If I
> copy all of "current"'s elements to "previous", I'd have an element in each
> that points to the same object.  I don't want to overwrite data in that
> object, so insead of copying that element (the ref) I create a new object
> (and ref, of course) for the new "current" record.  After I finish
> processing the "previous" record I'd like to destroy the object that it's
> ref points to (I assume that it persists otherwise, and this will slowly
> eat memory).
> 
> How do I release memory allocated to the object that the "previous"
> record's
> ref points to?  Do I just re-initialize the hash (%Prev = ();)?

i'm not completely sure of what you are doing, but it sounds as if
the current object has an instance variable that holds a reference
to the previous object.

the memory for the previous object will not be freed until its
reference count is zero.  so, once a record becomes a "previous"
record, there should be a method that gets rid of the reference. this
depends on how you've implemented your object though, but it is
not a difficult thing.

if this doesn't sound like what you are doing, perhaps you could
describe the object in a different fashion and we could take another
whack at it :)

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 09:24:32 -0500
From: John Porter <jdporter@min.net>
Subject: Re: SHELL/REGEX GUNSLINGERS NEEDED!!!
Message-Id: <34AA55A0.6230@min.net>

Robert,

Sure it's better to do it in Perl (that is what you asked, right? :-)
But you need the fix yesterday.
So try this:
Take the single-quotes out of the pregex file:

 (dataserver).*(miler)+
 (dataserver).*(citys)+
 (dataserver).*(demo)+

Add double-quotes around $REGEX in the command pipeline:

      ps -eo pid,args | egrep -v egrep | egrep "$REGEX" | awk '{print
$1}'

This worked for me.

John Porter
jporter@logicon.com


Rholder@sispost1.bis.adp.com wrote:
> 
[snip]
> 
>   #!/usr/bin/ksh -x
>   #
>   # pidfinder -- find the PID of a process given a regex that will
>   #              pluck that process from the output of ps -eo args,pid
>   #
>   for REGEX in `(cat /usr/local/scripts/pregex)`
>   do
>         ps -eo pid,args | egrep -v egrep | egrep $REGEX | awk '{print $1}'
>   done
>   # END OF SCRIPT
> 
> ....and here is what is in the file /usr/local/scripts/pregex:
> 
> '(dataserver).*(miler)+'
> '(dataserver).*(citys)+'
> '(dataserver).*(demo)+'
> 
[snip]
> Robert Holder
> Denver, Colorado


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

Date: Wed, 31 Dec 1997 03:09:05 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Testing for null and spaces
Message-Id: <68cu63$4sc@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <asquiresEM1497.F80@netcom.com>, asquires@netcom.com (Andy Squires) wrote:

> I'm trying to test whether or not a variable is blank or null and can't figure out why the following doesn't work.

> str1="     ";
> 
> if(str1=~ /^\s*$/) {
>     print "The field does not contain data\n";

i had always thought that whitespace were data. :)  are you also
concerned about a null byte?

> } else {
>     print "The field does contain data\n";
> }

[you forgot to include the thingys that make those barewords
variable names. are you using the -w switch? ]

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 31 Dec 1997 08:37:50 -0500
From: snailgem@aol.com
Subject: undefined value
Message-Id: <34AA4AAD.6755@aol.com>

This is driving me crazy:

#!/usr/local/bin/perl -w
use diagnostics;
use File::Copy;

##stuff initialized here

$from_file = "$common_dir/$this_htm";
$to_file = "$common_dir/copy_$this_htm";

copy ("$from_file", "$to_file");

The only new file here is $to_file. The code works ($to_file is
created),
but it generates the following warning that I'd like to get rid of:

Use of uninitialized value at /usr/local/lib/perl5/File/Copy.pm line 84
(#1)
    (W) An undefined value was used as if it were already defined.  It
was
    interpreted as a "" or a 0, but maybe it was a mistake.  To suppress
this
    warning assign an initial value to your variables.

Thanks.


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

Date: Wed, 31 Dec 1997 03:57:21 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: word wrap routine
Message-Id: <68d10k$jdd@bgtnsc02.worldnet.att.net>
Keywords: just another new york perl hacker

In article <slrn6aiupa.69c.gabor@vinyl.quickweb.com>, gabor@vinyl.quickweb.com (Gabor) wrote:

> In comp.lang.perl.misc, Joseph Cotton <jcotton@erols.com> wrote :
> # Does any one have a routine to word wrap a $string ?
> # I need to insert \n every 50 bytes or less, but not in the middle of a
> # word.
> 
> here is a quick and dirty solution.
> does  not address the problem of extra spaces at the beginning of
> lines

> s/(.{50})(?=\s)/$1\n/g;

what happens if the 51st character is not whitespace?

why does everyone want to try to re-invent Text::Wrap?  if you
want an example, look in the module rather than posting goofy stuff.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

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

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