[16540] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3952 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 8 18:05:41 2000

Date: Tue, 8 Aug 2000 15:05:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965772325-v9-i3952@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 8 Aug 2000     Volume: 9 Number: 3952

Today's topics:
        - Free ebooks and resources - <webmaster@swap-resources.com>
        4th State of the Onion? <aqumsieh@hyperchip.com>
    Re: 64 bit threaded perl on HP-UX 11 (Richard J. Rauenzahn)
        A fork and Socket problem! <T.Cockle@staffs.ac.uk>
    Re: CGI : CheckBox and Form Question <timewarp@shentel.net>
    Re: CGI.PM How to get all Form's value in a HashTable? <lr@hpl.hp.com>
    Re: CGI.pm not passing ampersands properly <timewarp@shentel.net>
        RE: CGI.pm not passing ampersands properly <saul_m@terra.es>
    Re: Converting from US dates/numbers to European dates/ <samara_biz@hotmail.com>
    Re: Converting from US dates/numbers to European dates/ <godzilla@stomp.stomp.tokyo>
    Re: Converting from US dates/numbers to European dates/ (Logan Shaw)
    Re: Converting from US dates/numbers to European dates/ <godzilla@stomp.stomp.tokyo>
    Re: Converting from US dates/numbers to European dates/ <juex@deja.com>
    Re: Converting from US dates/numbers to European dates/ <care227@attglobal.net>
    Re: Converting from US dates/numbers to European dates/ <flavell@mail.cern.ch>
    Re: Converting from US dates/numbers to European dates/ <waltman@netaxs.com>
        CPAN shell use in alternate perl directory (Bruce Z. Lysik)
    Re: DBI: LAST_INSERT_ID() getting the value of (Jon Drukman)
    Re: Different input_record_separator for different file (Mike Van Pelt)
    Re: Different input_record_separator for different file <uri@sysarch.com>
        Differing parses under 5.005, 5.6? <jboes@eoexchange.com>
        execute perl script without saying perl filename.pl <tanderse@fsl.noaa.gov>
    Re: execute perl script without saying perl filename.pl <Allan@due.net>
    Re: execute perl script without saying perl filename.pl kaivix@angelfire.com
    Re: execute perl script without saying perl filename.pl <care227@attglobal.net>
        Executing Unix commads on a IIS request pularis@my-deja.com
    Re: Expert advise needed (Logan Shaw)
    Re: Expert advise needed (Logan Shaw)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 8 Aug 2000 22:41:50 +0200
From: "COM Service" <webmaster@swap-resources.com>
Subject: - Free ebooks and resources -
Message-Id: <8mprjo$bt8$2@SOLAIR2.EUnet.yu>

I would like to know where I can find free ebooks and good resources about
Java, Perl, Unix, ASP and Visual Basic. Contact me at:
mailto:webmaster@brokerpal.com Thanks in advance.
Regards, Dejan
Editor of Broker Pal - Free list of expired domain names, domain news,
auction, web design, Internet marketing and web programming.
Subscribe: mailto:bizi-subscribe@listbot.com




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

Date: Tue, 08 Aug 2000 18:35:27 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: 4th State of the Onion?
Message-Id: <7aog33d2j3.fsf@merlin.hyperchip.com>


Hey all,

I couldn't find any links about Larry's 4th State of the Onion talk. Is
it out there? or has it been eclipsed by Perl6?

--Ala


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

Date: 8 Aug 2000 21:10:33 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: 64 bit threaded perl on HP-UX 11
Message-Id: <965769032.106883@hpvablab.cup.hp.com>



anevynni@my-deja.com writes:
>Hello,
>
>I'm trying to build DBD Oracle (for 8.0.6 64 bit) on HP-UX 11 and after
>struggling for a few days and reading everything I was able to find on
>Usenet, I have to ask for assistance really hoping someone will help me out.

I think you're going with an assumption here that the client libraries
for 64bit Oracle must be 64bit, too.  Not true.  I don't know if Oracle
is shipping 64bit client libraries yet, but they are certainly still
shipping 32bit client libraries.

>My understanding is that I'll need to compile 64 bit threaded perl to
>archieve this. 

Why do you think this?

>I tried two version: 5.6 and 5.005.03 with the same results.
>These are the steps: 1) sh Configure: changes to default settings: Build a
>threading Perl? [n] y

I think 32bit Perl is what you want.

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Tue, 08 Aug 2000 19:07:50 +0100
From: Tim Cockle <T.Cockle@staffs.ac.uk>
Subject: A fork and Socket problem!
Message-Id: <39904C76.56021A99@staffs.ac.uk>

Hi,

I  am writing a simple proxy and have hit a problem with forking.

Basically my proxy sits between the browser and the real-proxy (that
servers my department) parsing HTML.

I open a server socket and use the normal while loop to deal with
clients:
   while ($browser = $server->accept()) {

If I then fork (the line I use is next if $pid = fork;) and allow to
child to open a new socket to the real-proxy I get an error when I try
to write.
If though I the parent to open the connection to the proxy BEFORE I fork
every thing works fine!

Can some one tell me why please?!?!?!?!
And if/how I can get the child to open the socket to the real proxy?

Thanks in advance,

Tim



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

Date: Tue, 08 Aug 2000 13:59:04 -0400
From: Albert Dewey <timewarp@shentel.net>
Subject: Re: CGI : CheckBox and Form Question
Message-Id: <39904A68.F542DA41@shentel.net>

Let's say you have the following in your html form:

<input type=checkbox name=choice1 value=on>

Use the following perl do write to your database if the checkbox is not checked.

$Choice1 = param('choice1');

if($Choice1 ne "on")
    {
    put your database action here........
    }

What happens is that an unchecked checkbox will upload absolutely nothing to the
server, in other words it is ignored by the browser. If you use the above code
in Perl you will be writing a value to the database even though the form sent
nothing regarding the checkbox to the server because you have declared the
variable for the checkbox and it will contain nothing unless the web page has it
checked whereupon it will upload the value if "on" as in this example.

Etienne Laverdiere wrote:

> Hi, does anyone have resolves this problem :
>
> I have a form with a lots of <INPUT> (elements) and some of theses Inputs
> are CheckBox. I have made a database that read this form (with DBI) and put
> the value of each Input in it. When my Form have to read a checkBox that is
> checked, the database can put an 'on' into the related record (checkbox1 =
> 'on').
>
> But the problem is that when the checkbox is not checked, the form doesn't
> send the information, because it doesn't pass the name of the checkbox. So,
> my record is not update. (Because of the complexity of my database, and the
> hight number of checkbox in it, I would rather not duplicate all my checkbox
> into some hidden field with the same name, and then submit the hole form..)
>
>  I would like something like (if checkbox not check = > checkbox1 = 'off').
> I tried a simple Javascript that scan all my form and replace a empty value
> by a 'oof' but I am sure that the form does't sent the information. Here's
> the javascript that is run when submitting my form :
>
> function scanCheckBox(form){
>
>      for (var k=0;k<form.length;k++){
>         if ((form.elements[k].type == 'checkbox')&&(form.elements[k].checked
> == 0)){
>             form.elements[k].value = 'OF';
>            }
>       }
>      // return true; doesn't matter
>  }



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

Date: Tue, 8 Aug 2000 11:09:57 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: CGI.PM How to get all Form's value in a HashTable?
Message-Id: <MPG.13f9ecd43eb6be0d98ac4a@nntp.hpl.hp.com>

In article <eJXj5.19330$FZ1.245214@news20.bellglobal.com> on Tue, 08 Aug 
2000 17:47:54 GMT, Etienne Laverdiere <info@digitaltango.com> says...
> Hi I must use a 'local hashTable' because I need to pass it by reference in
> a function. like
> 
> &function(*hash1, *hash2, $string1);

That is not the proper way to pass by reference using Perl 5.

  function(\%hash1, \%hash2, $string1);

> It seems that a my variable cannot be pass by reference.

Not by using a typeglob, but certainly by using a proper reference, as 
shown above.

> Do you have another way? I am not very 'intuitive' with my and local..

Have you read perlfaq7 on this question?

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


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

Date: Tue, 08 Aug 2000 14:21:06 -0400
From: Albert Dewey <timewarp@shentel.net>
Subject: Re: CGI.pm not passing ampersands properly
Message-Id: <39904F92.5EFB3D2@shentel.net>

If you are depending on the info from a text box in an html form you might use
a little javascript error checking in your page to convert characters like the
ampersand to %26 before it gets posted and then decode it with your perl script
once the server receives it. This will prevent accidental parsing of your data
by your script at the '&' position in the text data.

Just a thought.

Edward Waldspurger wrote:

> I am using CGI.pm in a Perl script.  When a form field is submitted with an
> ampersand in it, everything after the ampersand is being dropped.  I have
> read the CGI documentation and could not find anything specific to
> ampersands in form fields.  After searching the news groups, the messages I
> found say that CGI.pm should take care of embedding the &s.  Here is the
> code I am using:
>
> my @formfields = param(); # Get all the form fields
> my %form;
>
> foreach (@formfields) {              # Take the form data and put it in the
> %form hash.
>  $form{$_} = param($_);
> }
>
> If I have a form field called "name", and I type in the value "Mr & Mrs
> Smith", instead of getting $form{name}="Mr & Mrs Smith", I get
> $form{name}="Mr" and $form{ Mrs Smith}=.
>
> How can I get the entire form field including the ampersand?
>
> --
> Edward Waldspurger
> Electronic Frontiers Consulting, Inc.



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

Date: Tue, 08 Aug 2000 20:53:36 GMT
From: "Saúl Martínez" <saul_m@terra.es>
Subject: RE: CGI.pm not passing ampersands properly
Message-Id: <kr_j5.7526$1p5.17694@telenews.teleline.es>

I have a similar problem,

I need to pass data from one cgi-script to another, but I don't know how to
transform the data to the specific CGI format, so under some browsers
(Netscape for example), the data is not readable.
I need to make a function in perl that preprocess the text data, but I do
not know how to do it.
I would thank anyone that could send me any help.

Saúl Martínez.

Albert Dewey <timewarp@shentel.net> escribió en el mensaje de noticias
39904F92.5EFB3D2@shentel.net...
> If you are depending on the info from a text box in an html form you might
use
> a little javascript error checking in your page to convert characters like
the
> ampersand to %26 before it gets posted and then decode it with your perl
script
> once the server receives it. This will prevent accidental parsing of your
data
> by your script at the '&' position in the text data.
>
> Just a thought.
>
> Edward Waldspurger wrote:
>
> > I am using CGI.pm in a Perl script.  When a form field is submitted with
an
> > ampersand in it, everything after the ampersand is being dropped.  I
have
> > read the CGI documentation and could not find anything specific to
> > ampersands in form fields.  After searching the news groups, the
messages I
> > found say that CGI.pm should take care of embedding the &s.  Here is the
> > code I am using:
> >
> > my @formfields = param(); # Get all the form fields
> > my %form;
> >
> > foreach (@formfields) {              # Take the form data and put it in
the
> > %form hash.
> >  $form{$_} = param($_);
> > }
> >
> > If I have a form field called "name", and I type in the value "Mr & Mrs
> > Smith", instead of getting $form{name}="Mr & Mrs Smith", I get
> > $form{name}="Mr" and $form{ Mrs Smith}=.
> >
> > How can I get the entire form field including the ampersand?
> >
> > --
> > Edward Waldspurger
> > Electronic Frontiers Consulting, Inc.
>




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

Date: Tue, 08 Aug 2000 14:22:36 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <39904FEC.B17AEB34@hotmail.com>

> ...are stating mathematicians routinely
> use a comma for a decimal point, everywhere except in America.

You would be very surprised but they do. Point is used only when you
deal with computers. If they write anything on paper in most european
countries they use comma for decimal point.

> * glances at her hand electronic calculator *

Most calculators use point, yeah, but the phrase "...mathematicians
routinely use a comma..." does not imply you're talking only about
computers and calculators, does it?

> I am skeptical.

Any particular reasons?


~Alex



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

Date: Tue, 08 Aug 2000 11:59:09 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <3990587D.23DCA036@stomp.stomp.tokyo>

"Alex T." wrote:
 
> > ...are stating mathematicians routinely
> > use a comma for a decimal point, everywhere except in America.
 
> You would be very surprised but they do. Point is used only when you
> deal with computers. If they write anything on paper in most european
> countries they use comma for decimal point.
 
> > * glances at her hand electronic calculator *
 
> Most calculators use point, yeah, but the phrase "...mathematicians
> routinely use a comma..." does not imply you're talking only about
> computers and calculators, does it?
 
> > I am skeptical.
 
> Any particular reasons?


Yes. I find myself standing in the middle of discussion
of Perl programming, computers and mathematics. I am 
hard pressed to find a relationship between cultural
aspects of comma usage and a decimal point for CPU
processing. Duh?

This discussion of cultural inflections is nothing
more than boys whom suffer terminal testosterone
poisoning looking to play weenie wagging one-upmanship
and, in reality, are grasping at inane straws hoping
to pull out a long one. 

I'll stick with the Scarecrow. Now that boy has got some
straw worth a stuffing. Interesting friends as well whom
are lots better with vocabulary to boot.


* gently flicks a snake doctor off her nose *

Darn mosquito hawks, they're as bold as dragon flies.

Godzilla!


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

Date: 8 Aug 2000 15:27:42 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <8mpqfu$a2s$1@provolone.cs.utexas.edu>

In article <39903784.41F71320@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>So, you are stating a computer CPU / math co-processor recognizes
>a comma as a decimal point

Generally, CPU's and math co-processors don't use decimal points
at all; instead, they store "floating point" numbers in a
mantissa/exponent format in which the mantissa is always
normalized the same way, so that there is no need to store the
decimal point[1] because it falls in the same place every time.

In other words, on most computers, floating point numbers neither
actually have points, and if they did, their positions would be fixed.

  - Logan

[1] Also, there is not decimal point since
    it's all happening in binary anyway.


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

Date: Tue, 08 Aug 2000 14:02:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <39907571.84C66663@stomp.stomp.tokyo>

Logan Shaw wrote:
 
> Godzilla!

> >So, you are stating a computer CPU / math co-processor recognizes
> >a comma as a decimal point
 
> Generally, CPU's and math co-processors don't use decimal points
> at all; instead, they store "floating point" numbers in a
> mantissa/exponent format in which the mantissa is always
> normalized the same way, so that there is no need to store the
> decimal point[1] because it falls in the same place every time.
 
> In other words, on most computers, floating point numbers neither
> actually have points, and if they did, their positions would be fixed.

 
So, enter this simple addition into your computer, favorite
calculator or my preference, a sliderule, without decimal points,

2.2 + 2.2

otherwords, without decimal points,

22 + 22 

and tell me what you get for a sum.

You boys will be exceptionally challenged to substantiate
your claims decimal points are not needed in mathematics.
Use commas all you want. Use floating point all you want.

I will continue to be realistic and use decimal points.

Whew.... last gasp grasp at straws. Thiers is more of a
fantasy than the Wizard Of Oz, but not nearly as entertaining.

Godzilla!


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

Date: Tue, 8 Aug 2000 14:12:03 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <399077a2$2@news.microsoft.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> wrote in message
news:39903784.41F71320@stomp.stomp.tokyo...
> So, you are stating a computer CPU / math co-processor recognizes
> a comma as a decimal point

Although it might not be totally impossible still I highly doubt that there
is any CPU or math co-processor that has any notion of what you call a
decimal point.
You may want to brush up on how numerical computation is done in a computer.

> and are stating mathematicians routinely
> use a comma for a decimal point, everywhere except in America.
> * glances at her hand electronic calculator *
>
> * glances at her antiquated wood sliderule *


The vast majority of countries in particular in Europe uses a decimal comma
instead of a decimal point. Japan (and some other FE countries) follow the
US, there you are right.

jue




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

Date: Tue, 08 Aug 2000 17:11:34 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <39907786.EFA5FE8F@attglobal.net>

"Godzilla!" wrote:
> 
> So, enter this simple addition into your computer, favorite
> calculator or my preference, a sliderule, without decimal points,
> 
> 2.2 + 2.2
> 
> otherwords, without decimal points,
> 
> 22 + 22
> 
> and tell me what you get for a sum.

Do you really think a computer sees 22?  What it sees is 10110

> 
> You boys will be exceptionally challenged to substantiate
> your claims decimal points are not needed in mathematics.
> Use commas all you want. Use floating point all you want.
> 
> I will continue to be realistic and use decimal points.

http://mathworld.wolfram.com/Mantissa.html
http://mathworld.wolfram.com/Binary.html


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

Date: Tue, 8 Aug 2000 23:16:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <Pine.GHP.4.21.0008082315430.1369-100000@hpplus03.cern.ch>

On Tue, 8 Aug 2000, Jürgen Exner wrote:

> The vast majority of countries in particular in Europe uses a decimal comma
> instead of a decimal point. Japan (and some other FE countries) follow the
> US, there you are right.

Maybe it's that the US follows Britain.  But I would say that,
wouldn't I.

Pity they can't get a sensible date format, though.




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

Date: 08 Aug 2000 17:25:03 -0400
From: Walt Mankowski <waltman@netaxs.com>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <m3g0ofsaxc.fsf@netaxs.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:

> Yes. I find myself standing in the middle of discussion
> of Perl programming, computers and mathematics. I am 
> hard pressed to find a relationship between cultural
> aspects of comma usage and a decimal point for CPU
> processing. Duh?

Duh.  :-)

Locales are all about the relationshop between the local cultural
aspects of comma usage (and other things like dates and currency) and
how the computer represents the data internally.  Internally, IEEE
floating point numbers don't have ANY decimal points.  Locales allow a
programmer in the US to write

$pi = 3.14159

and a programmer in France to write

$pi = 3,14159

Both numbers will be stored internally exactly the same way.

Please read perldoc perllocale for more information.

Walt



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

Date: 08 Aug 2000 11:32:33 -0700
From: eldrik@logrus.com (Bruce Z. Lysik)
Subject: CPAN shell use in alternate perl directory
Message-Id: <878zu7ioxq.fsf@quicksilver.pacbell.net>

Hi folks,

Here's the situation I'm in:

I'm installing perl 5.6.0 for distribution on a bunch of systems.
I've followed the instructions in the INSTALL file which point to
-Dinstallprefix and -Dprefix, and then modifications of
$archlib/Config.pm and $archlib/.packlist.  That's all good.

I now have a tree in /tmp/perl5 which is ready for tarring.  But
before I do, I'd like to install to it a large set of modules using
the CPAN shell.  (perl -MCPAN -e shell)

I'm choosin the CPAN shell approach because there will be a large
amount of dependencies, and it's just really handy.

Is there a good way I can tell the shell to look in the /tmp/perl5
tree for installed modules, and do all installing there as well?

I've tried: /tmp/perl5/bin/perl -MCPAN -e shell

but then it complains it can't find CPAN.pm because it's already
looking in -Dprefix.  (Which is sensible, just problematic in this
situation.)

Has anyone tackled this sort of situation before?

Thanks in advance for any responses.

-- 
Bruce Z. Lysik  <eldrik@logrus.com>   http://www.logrus.com/~eldrik
GCS d++(-) a-- C++ ULS+++$ P+++$ L++ E+ W+++ N++ w--- M-- V PS PE
Y+ PGP+ t+ 5++ X+ R+ tv+ b++ DI+ G e++ h+ r y+ s


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

Date: Tue, 08 Aug 2000 20:01:38 GMT
From: jsd@cluttered.com (Jon Drukman)
Subject: Re: DBI: LAST_INSERT_ID() getting the value of
Message-Id: <slrn8p0pou.t0t.jsd@cluttered.com>

On Mon, 7 Aug 2000 23:15:27 +0100, Mark Worsdall
 <linux@worsdall.demon.co.uk> wrote:
>How can I return into my own variable the last auto inc id after an
>insert?
>
>This doesn't work:-(

this is mostly a database question, not a perl question.

>$sth = $dbh->prepare("SELECT LAST_INSERT_ID() FROM SearchPhrases");
>$sth->execute();
>$sth->finish();
>$phrases_id = $sth->fetchrow_array();
>print "ID: $phrases_id\n";

two problems:

1. last_insert_id() doesn't use a "from" clause.
2. you're doing too much work.  :)

these two lines will replace the 5 you have above...

  @row_ary=$dbh->selectrow_array('SELECT LAST_INSERT_ID()');
  print "created new row with id $row_ary[0]\n";

oh, and you have one other choice.  for sufficiently modern versions of
mySQL/DBI/DBD::mysql, you can do this:

  my $sth=$dbh->prepare('INSERT INTO test (label) VALUES (?)');
  $sth->execute('new label');
  print "created new row with id $sth->{'insertid'} \n";

the key here is that the statement handle automatically has the
insertid element created.

-jsd-




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

Date: 8 Aug 2000 20:09:08 GMT
From: mvp@netcom.com (Mike Van Pelt)
Subject: Re: Different input_record_separator for different files.
Message-Id: <8mppd4$7s5$1@slb0.atl.mindspring.net>

In article <398F946D.CBA558B0@ipac.caltech.edu>,
Tim Conrow  <tim@ipac.caltech.edu> wrote:
>Mike Van Pelt wrote:
>> 
>> Is there a way to have a different input_record_separator for
>> different open files?
>> 
>> I'm trying to write a program for which one file needs to
>> be read with a different input_record_separator than the other.
>> 
>> ... [snip] ...
>> 
>> Huh?  Is there only one global input_record_separator for all
>> open files? ...
>
>Yes. 
>
>I know it's confusing because input_record_separator seems like it
>operates per-instance, but it operates on IO "class data" (sort of; it's
>really a global) rather than IO "instance data".

Argh.  Not what I wanted to hear, but thanks.  I was hoping there
was some way I could set it differently for the two files rather
than changing the global $/ back and forth.


-- 
Yes, I am the last man to have walked on the moon,    | Mike Van Pelt
and that's a very dubious and disappointing honor.    | mvp@netcom.com
It's been far too long.     -- Gene Cernan            | KE6BVH


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

Date: Tue, 08 Aug 2000 20:26:37 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Different input_record_separator for different files.
Message-Id: <x7bsz31oub.fsf@home.sysarch.com>

>>>>> "MVP" == Mike Van Pelt <mvp@netcom.com> writes:

  >> I know it's confusing because input_record_separator seems like it
  >> operates per-instance, but it operates on IO "class data" (sort of; it's
  >> really a global) rather than IO "instance data".

  MVP> Argh.  Not what I wanted to hear, but thanks.  I was hoping there
  MVP> was some way I could set it differently for the two files rather
  MVP> than changing the global $/ back and forth.

it is a well known problem that we are addressing in perl6. but the best
solution is not to change the global $/ around. better to use something like:

sub read_with_sep {
	my ( $fh ) = @_ ;

	local($/) = $my_rec_sep ; 

	return <$fh> ;
}

then the old value will automatically come back when you exit this sub.

you can also do that inline inside a code block.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Tue, 08 Aug 2000 15:34:37 -0400
From: Jeff Boes <jboes@eoexchange.com>
Subject: Differing parses under 5.005, 5.6?
Message-Id: <39906211$0$48168$44a10c7e@news.net-link.net>

The following code worked _just fine_ under 5.00503. Under 5.6, however,
perl complains about

Variable "$userdata" is not imported at testvars.pl line 7.
Global symbol "$userdata" requires explicit package name at testvars.pl
line 7. 

use strict;
use vars qw(%userdata %_pages @sortlist @showlist);

sub showfolder_count_unshown_items {
   return 0 if $userdata{show0};
   @showlist = grep((
                     $userdata{show0}
                     or /^f/
                     or !defined($_pages{$_})
                     or &refisnew($_pages{$_})
                     or ($_pages{$_}->{status} ne 'VALID')
                     or ($_pages{$_}->{score} > 0)
                     ), @sortlist);
   scalar(@sortlist) - scalar(@showlist);
}

Now, the odd thing here is that if you take line 7 and move it, 

   @showlist = grep((
                     /^f/
                     or !defined($_pages{$_})
                     or &refisnew($_pages{$_})
                     or ($_pages{$_}->{status} ne 'VALID')
                     or ($_pages{$_}->{score} > 0)
                     or $userdata{show0}
                     ), @sortlist);

then it parses just fine. (By the way, I realize that the logic in this
code is probably wrong, and since $userdata{show0} doesn't change within
the grep-loop, it really doesn't need to be re-evaluated for each trip.
That's not the issue. The code worked, and we were reluctant to change
it. Then 5.6 breaks it, and now we will rewrite it anyway.)

Is this a 5.6 bug?

-- 
Jeff Boes        |The number of computer scientists
|jboes@eoexchange.com
Sr. S/W Engineer |in a room is inversely            |616-381-9889 ext 18
Change Technology|proportional to the number of     |616-381-4823 fax
EoExchange, Inc. |bugs in their code.               |www.eoexchange.com


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

Date: Tue, 8 Aug 2000 14:14:36 -0600
From: "Travis" <tanderse@fsl.noaa.gov>
Subject: execute perl script without saying perl filename.pl
Message-Id: <8mpprb$bk6$1@peabody.colorado.edu>

Hi,

On Windows NT at the dos prompt you can just type in your perl script and it
executes but on Win98 I have to type in
perl filename.pl for my script to run.  Is there a way on Win98 to make it
run the perl script without having to type perl in front of it at a dos
window.

Really want I'm wanting to do is set up a webserver on my Win98 box to able
to execute perl cgi programs.

Thank you for your help.

Travis

Email: tanderse@fsl.noaa.gov





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

Date: Tue, 8 Aug 2000 16:48:33 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: execute perl script without saying perl filename.pl
Message-Id: <8mprm5$kje$1@slb3.atl.mindspring.net>

"Travis" <tanderse@fsl.noaa.gov> wrote in message
news:8mpprb$bk6$1@peabody.colorado.edu...
: On Windows NT at the dos prompt you can just type in your perl script and it
: executes but on Win98 I have to type in
: perl filename.pl for my script to run.  Is there a way on Win98 to make it
: run the perl script without having to type perl in front of it at a dos
: window.
:
: Really want I'm wanting to do is set up a webserver on my Win98 box to able
: to execute perl cgi programs.

AFAIK, you don't need that functionality.  Just configure your web server
correctly.  That is my experience with Apache and O'reilly's WebSite.

HTH

AmD

--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
"You got to be very careful if you don't know where you're going, because you
might not get there."
 - Yogi Berra




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

Date: Tue, 08 Aug 2000 20:55:27 GMT
From: kaivix@angelfire.com
Subject: Re: execute perl script without saying perl filename.pl
Message-Id: <3t_j5.565$juZ4.9568592@tomcat.sk.sympatico.ca>

Use one of these:

chmod +x script_name.pl
chmod 755 script_name.pl

This will render your script executable, and you can run it like this:

script_name.pl (rather than 'perl script_name.pl')

good luck!

>
>              execute perl script without saying perl filename.pl
>                                       
>   From: "Travis" <tanderse@fsl.noaa.gov>
>   Reply to: [1]"Travis"
>   Date: Tue, 8 Aug 2000 14:14:36 -0600
>   Organization: University of Colorado, Boulder
>   Newsgroups:
>          [2]comp.lang.perl.misc
>   Followup to: [3]newsgroup(s)
>
>Hi,
>
>On Windows NT at the dos prompt you can just type in your perl script and it
>executes but on Win98 I have to type in
>perl filename.pl for my script to run.  Is there a way on Win98 to make it
>run the perl script without having to type perl in front of it at a dos
>window.
>
>Really want I'm wanting to do is set up a webserver on my Win98 box to able
>to execute perl cgi programs.
>
>Thank you for your help.
>
>Travis
>
>Email: tanderse@fsl.noaa.gov


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

Date: Tue, 08 Aug 2000 16:59:44 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: execute perl script without saying perl filename.pl
Message-Id: <399074C0.8C50B5DB@attglobal.net>

kaivix@angelfire.com wrote:
> 
> Use one of these:
> 
> chmod +x script_name.pl
> chmod 755 script_name.pl
> 
> This will render your script executable, and you can run it like this:
> 

Actually, it renders an error.  The poster clearly specified he 
was using Win98.


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

Date: Tue, 08 Aug 2000 19:18:55 GMT
From: pularis@my-deja.com
Subject: Executing Unix commads on a IIS request
Message-Id: <8mpmet$cl8$1@nnrp1.deja.com>

Hi Perl God(s),

  I am running IIS on NT server 4.0.As an enhancement to the server I
want to add the functioanlity of being able to execute commands on a
unix host ( running Solaris ) and somehow magically get the output back
to the IIS/NT server and display the result as an HTML page. The idea
being able to provide a web based interface to execute commads on a unix
host. All n every help will be deeply appreciated. Thanks a much


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 8 Aug 2000 15:40:19 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Expert advise needed
Message-Id: <8mpr7j$a3r$1@provolone.cs.utexas.edu>

In article <39901B56.A43AFEB4@yahoo.co.uk>,
Nick Condon  <nickco3@yahoo.co.uk> wrote:
>perlfaq3 contains the question "How can I hide the source for my Perl program".
>In summary: You can't. Put a tough license on it.

Well, you should be able to hide it just about as well as you can hide
it for code in just about any other language.

"All" you have to do is embed the perl interpreter in a C program which
decrypts input files when loading them, using a key that's built into
the executable of the program.  You could probably even just modify the
regular perl exectuable's source rather than writing your own C program
that does this.

  - Logan


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

Date: 8 Aug 2000 15:41:18 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Expert advise needed
Message-Id: <8mpr9e$a4j$1@provolone.cs.utexas.edu>

In article <slrn8p06h1.st1.abigail@alexandra.foad.org>,
Abigail <abigail@foad.org> wrote:
>Ask your boss whether he's a criminal himself, who illegally copies
>books, CDs and dollar bills. If he isn't, ask him why he assumes your
>customers are.

All it takes is for one customer to illegally copy the source code for
there to be a problem.

  - Logan


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3952
**************************************


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