[16288] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3700 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 00:05:30 2000

Date: Mon, 17 Jul 2000 21:05:14 -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: <963893114-v9-i3700@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 17 Jul 2000     Volume: 9 Number: 3700

Today's topics:
    Re: [NEWBI] Reg Exp request for help (Keith Calvert Ivey)
    Re: Active State Perl on IIS 4.0 RichardWoodward@hotmail.com
    Re: ARRAY PROBLEM <bwalton@rochester.rr.com>
    Re: Best solution for this? <twpyhr@mindspring.com>
    Re: closing read-only filehandles [was: Read a file int (Eric Bohlman)
    Re: closing read-only filehandles [was: Read a file int (jason)
    Re: Comparing Two Files Problem RichardWoodward@hotmail.com
        Could someone clone MS's IL for another OS? <rgparker@west.net>
    Re: Could someone clone MS's IL for another OS? <neilh@scintilla.org>
    Re: date in YYYYMMDDHH24MISS format (Craig Berry)
    Re: Fancy mail, need help <peter.sundstrom@eds.com>
    Re: How can i identify a "Not Integer" string ? <bwalton@rochester.rr.com>
    Re: How can i identify a "Not Integer" string ? (Abigail)
    Re: how to convert "1.2.3.10" to "01020310"? (Abigail)
    Re: how to convert "1.2.3.10" to "01020310"? (Craig Berry)
    Re: how to convert "1.2.3.10" to "01020310"? (Keith Calvert Ivey)
    Re: how to convert "1.2.3.10" to "01020310"? (Abigail)
    Re: How to get the machine (archtechture) type in Perl? (Gwyn Judd)
        limits on GET <jmcada@hotmail.com>
    Re: limits on GET (jason)
    Re: limits on GET (Eric Bohlman)
        Newbie - "open for read" w/ perl function (not shell) santi_fisher@my-deja.com
    Re: Newbie - How can I set up a secure directory that i (David Efflandt)
    Re: Newbie needs help! (Keith Calvert Ivey)
        Newbie Question <allanon.69@no.spam.bigpond.com>
        nslookup in Perl <lucas@cplhk.com>
    Re: nslookup in Perl <tony_curtis32@yahoo.com>
    Re: Object somehow becoming unblessed? (Eric Bohlman)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 18 Jul 2000 02:00:50 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: [NEWBI] Reg Exp request for help
Message-Id: <3976b9fd.7545363@news.newsguy.com>

cberry@cinenet.net (Craig Berry) wrote:

>First, be aware that any attempt to impose case on names is doomed.  How
>do you handle e.g. MacMann?  And there are a zillion other cases where
>that came from.

You put in a special case for the MacDonalds and annoy the
Macdonalds.  That's why Amazon lists an "McSe Training Kit".

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: Tue, 18 Jul 2000 01:40:56 GMT
From: RichardWoodward@hotmail.com
Subject: Re: Active State Perl on IIS 4.0
Message-Id: <8l0cj6$odm$1@nnrp1.deja.com>

Hello, Oleg.

If you have installed ActivePerl in a standard way and
asked for the html documentation, you should be able
to use your Windows Explorer and double click on
the file below (assuming you used c:\Perl as the
root of your perl package)--

C:\Perl\html\faq\Windows\ActivePerl-Winfaq6.html

There is some information there specific to IIS 4.

If you get stuck, send me private email detailing your
problem and I'll help if I can.

Regards,
Richard Martin Woodward
RichardWoodward@hotmail.com
=====================================


> I'm trying to make Active State Perl work on IIS 4.0 to be able to
> create server-side scripts in Perl, not only in JavaScript
> or VBScript.  I couldn't make it run successfully on my web
> server yet.  Is there a site with good
> instructions on how to set it up?
>
> Thanks,
> Oleg


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


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

Date: Tue, 18 Jul 2000 01:18:46 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: ARRAY PROBLEM
Message-Id: <3973B0B6.9EE1E1AD@rochester.rr.com>

-EViL-DOC- wrote:
 ...
> I am reading 2 files into separate arrays
> @array1 contains many lines of the following format.
> $array1[0] contains integer1,integer2,integer3,integer4,integer5,integer6
> 
> @array2 contains many lines of the following format.
> $array2[0] contains integer1,integer2,integer3,integer4
> 
> My question is how can i add the say third element from
> $array1[1] (EG. integer1,integer2,integer3,integer4)
>                                       ^^ This one
> 
> to the 2nd element of $array1[3] (EG. integer1,integer2,integer3,integer4
> 
> ^^ This one
> Thanks in advance !

By "add to", I assume you mean "take the sum of the two numbers and
replace the second number with that sum".  I also assume that the array
elements of @array1 contain references to anonymous arrays.  If so:

    $array1[3][1]+=$array1[1][2];

is one way.  Why did you mention $array2 in your intro when you didn't
use it in your question?
-- 
Bob Walton


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

Date: Mon, 17 Jul 2000 21:13:43 -0500
From: "Jennifer \"Jennova, Angelface of Death\" Martino"  <twpyhr@mindspring.com>
Subject: Re: Best solution for this?
Message-Id: <3973BD57.8561D23F@mindspring.com>

Harry of Harryworld wrote:

> Try Popeil's Pocket Fungus-Hawg.  This powerful little clipper
> (batteries not included) will make short work of that rampant mycelium.
> When the Fungus-Hawg's patented Fungus-Klippingz reservoir is full, just
> empty it into a skillet and saute the fungus in a little olive oil and
> garlic cloves.  Great on buttecelli pasta!  The Fungus-Hawg also chops,
> slices, dices, and makes great fungus fries!  And you get twelve free
> steak knives.

muahaha.

jenn
eeeee e   e  e eeeee e    e e   e eeeee  the web page you have reached
  8   8   8  8 8   8 8    8 8   8 8   8  http://twpyhr.usuck.com
  8e  8e  8  8 8eee8 8eeee8 8eee8 8eee8e Over 250 telephone sounds and
  88  88  8  8 88      88   88  8 88   8 recordings, The Unofficial
  88  88ee8ee8 88      88   88  8 88   8 Touch Tone Tunes FAQ and The
					 Phoney Dance.


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

Date: 18 Jul 2000 03:29:48 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: closing read-only filehandles [was: Read a file into a hash ?]
Message-Id: <8l0ivc$vjm$2@slb1.atl.mindspring.net>

jason (elephant@squirrelgroup.com) wrote:
: surely the closing of read filehandles is pro-active programming - 
: preventing problems that arise from unforseen uses of our code .. the 
: filehandle is going to be closed at some point - so why not do it 
: explicitly when we're finished with it

Didn't we have a thread a few weeks ago where somebody's problem turned
out to be that they were trying to unlink or rename a file on a Win32
system and they couldn't because they still had it open for reading? 



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

Date: Tue, 18 Jul 2000 04:00:38 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: closing read-only filehandles [was: Read a file into a hash ?]
Message-Id: <MPG.13de73b7c8a0cdaf9896e4@news>

Eric Bohlman wrote ..
>jason (elephant@squirrelgroup.com) wrote:
>: surely the closing of read filehandles is pro-active programming - 
>: preventing problems that arise from unforseen uses of our code .. the 
>: filehandle is going to be closed at some point - so why not do it 
>: explicitly when we're finished with it
>
>Didn't we have a thread a few weeks ago where somebody's problem turned
>out to be that they were trying to unlink or rename a file on a Win32
>system and they couldn't because they still had it open for reading? 

I didn't catch that one .. I'd be interested to read it - and read why 
people still see closing read-only filehandles as pointless

can you remember the subject - or part thereof so I can look it up ?

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Tue, 18 Jul 2000 01:58:22 GMT
From: RichardWoodward@hotmail.com
Subject: Re: Comparing Two Files Problem
Message-Id: <8l0djm$p5m$1@nnrp1.deja.com>

Hello, Oleg.

Before you get too much further along with this
"pretty much first Perl script," please reconsider!

The problem is (probably) much more complicated than
you realize at this point.  Also, it has been solved
(lots of ways) by others.  Do a search on the web
for "diff utility". You should get a lot of hits.

PS I would not often want to use perl variables
of 1.7G myself.  If the programming language
and operating system haven't solved the efficiency
problem in dealing with large files, it will probably
be very hard for you to solve it (and in each and
every application which uses large files).

Regards,
Richard Martin Woodward
RichardWoodward@hotmail.com
==============================================
In article <smpm12b7nd6126@corp.supernews.com>,
  "Oleg Kuzmin" <kuzmin@hotmail.com> wrote:
> Greetings!
>
> I'm trying to write my pretty much first Perl script, and it
> doesn't work the way I want it to.
>
> Here is a beginning - very simple, opening "old" file to be
> compared with the "new" one.  The results of comparison will
> go to the "result" file.
> "New" and "old" files are huge ASCII files, ranging from 146M
> to 1.7G in size.
>
> ----------------------------------------
>  use Getopt::Long;

<snip>
 .
 .
 .


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


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

Date: Tue, 18 Jul 2000 01:15:17 GMT
From: Randall Parker <rgparker@west.net>
Subject: Could someone clone MS's IL for another OS?
Message-Id: <MPG.13dd506ff77f90b298982b@news.onlynews.com>

Could someone write a clone of MS's new intermediate compiler language to 
native code compiler in order to write Perl, Python, or Eiffel on 
Windows, compile it to IL, and then eventually native code compile it on 
some other OS platform?

Does anyone think such a capability is a good idea?

Does anyone think that someone will do this?



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

Date: Tue, 18 Jul 2000 01:36:41 GMT
From: "Neil Hodgson" <neilh@scintilla.org>
Subject: Re: Could someone clone MS's IL for another OS?
Message-Id: <JwOc5.4757$4p3.35078@news-server.bigpond.net.au>

> Could someone write a clone of MS's new intermediate compiler language to
> native code compiler in order to write Perl, Python, or Eiffel on
> Windows, compile it to IL, and then eventually native code compile it on
> some other OS platform?

   I think its likely Microsoft will publish enough documentation to make it
possible to write an IL VM for other systems. Microsoft may even make an IL
VM available for other systems with the most likely being MacOS. If this is
going to happen, I'd expect it to be announced at MacWorld this week.

   The question here is to what extent Microsoft wants to beat Java/Sun.
Widespread availability of IL VMs would help this goal, while still allowing
differentiation of the preferred platforms on the basis of which libraries
are available. Microsoft will also have a large lead in designing IL VMs so
will be able to ensure best perfromance is on those preferred platforms.
They can also win on effort applied - when competing with their Java VM
Microsoft achieved very good benchmarks.

> Does anyone think such a capability is a good idea?
> Does anyone think that someone will do this?

   Yes to both.

   Neil







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

Date: Tue, 18 Jul 2000 01:21:30 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: date in YYYYMMDDHH24MISS format
Message-Id: <sn7c8qbfo53177@corp.supernews.com>

rrubin@rotor.net wrote:
: I need to format a date in the following format
: YYYYMMDDHH24MISS

  perldoc POSIX

see the strftime() function.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: Tue, 18 Jul 2000 15:18:47 +1200
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Fancy mail, need help
Message-Id: <8l0ibv$k4q$1@hermes.nz.eds.com>


Glen Heide wrote in message
<3cJc5.10881$_J1.117916@newscontent-01.sprint.ca>...
>Does anyone know how to send an e-mail with HTML formatting using Perl?
>I currently use the "sendmail" program on the Unix server to send a plain
>text e-mail message.


Use the MIME::Lite module.




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

Date: Tue, 18 Jul 2000 01:06:31 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: How can i identify a "Not Integer" string ?
Message-Id: <3973ADD5.37B09F27@rochester.rr.com>

Election wrote:
> 
> Hello everybody ...
>  I'm a beginner programmer in perl and I'd like to know ,
> How can identify a "Not Integer" string in perl ? actually
> I've got a string that stores the result like this
> 
> $string = int($n1 / $n2);
> 
> but it always gives me an integer number , so what should i do ?

It is unclear what you actually want, but if you want a real string
stored in $string, you could do:

  $string = int($n1 / $n2) . '';

which will coerce the result of int into a string.  Note that this is
mostly not needed in Perl because numbers and strings freely convert as
needed automatically.
-- 
Bob Walton


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

Date: 17 Jul 2000 22:52:38 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: How can i identify a "Not Integer" string ?
Message-Id: <slrn8n7ikp.ibq.abigail@alexandra.delanet.com>

Election (election@qualitynet.net) wrote on MMDXIII September MCMXCIII in
<URL:news:8l0s1b$j5f1@news.qualitynet.net>:
&& Hello everybody ...
&&  I'm a beginner programmer in perl and I'd like to know ,
&& How can identify a "Not Integer" string in perl ? actually
&& I've got a string that stores the result like this
&& 
&& $string = int($n1 / $n2);
&& 
&& but it always gives me an integer number , so what should i do ?


Good. So, you discovered that int() does what it is supposed to do.

I fail to see your problem.



Abigail
-- 
print v74.117.115.116.32, v97.110.111.116.104.101.114.32,
      v80.101.114.108.32, v72.97.99.107.101.114.10;


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

Date: 17 Jul 2000 21:37:11 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <slrn8n7e7f.ibq.abigail@alexandra.delanet.com>

Craig Berry (cberry@cinenet.net) wrote on MMDXIII September MCMXCIII in
<URL:news:sn77qujao5388@corp.supernews.com>:
:: Abigail (abigail@delanet.com) wrote:
:: : map {printf "%02d" => $_} split /\./ => '2.1.3.14';
:: 
:: Mapping in a void context?  Abigail??

Cargo cult answers? Craig??

Once again. There is absolutely nothing wrong with map in a void context.
If you don't like side-effect, please ditch Perl and use something like
Haskell, or another functional language. As for the potential inefficiency,
that has been known for years, and never considered inefficient enough to
actually fix. And that's a bug in the implementation of perl, and should
not be hold against a programmer of Perl.

::                                        And using double-quotes for a
:: static string, too.

What the fuck is wrong with that? 

::                      Why not do
:: 
::   printf '%02d', $_ foreach split /\./ => '2.1.3.14';

Because this is Perl and having more than one way to do it is a feature?

And besides, I first had everything in a string of printing it, and wrote:

    join "" => map {sprintf "%02d" => $_} split /\./ => '2.1.3.14';

Why change paradigms just because you are printing to STDOUT instead of
collecting it in a string?


Abigail
-- 
perl -Mstrict -we '$_ = "goto F.print chop;\n=rekcaH lreP rehtona tsuJ";F1:eval'


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

Date: Tue, 18 Jul 2000 02:18:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <sn7fk2i4o53172@corp.supernews.com>

Abigail (abigail@delanet.com) wrote:
: Craig Berry (cberry@cinenet.net) wrote on MMDXIII September MCMXCIII in
: <URL:news:sn77qujao5388@corp.supernews.com>:
: :: Abigail (abigail@delanet.com) wrote:
: :: : map {printf "%02d" => $_} split /\./ => '2.1.3.14';
: :: 
: :: Mapping in a void context?  Abigail??
: 
: Cargo cult answers? Craig??

Nope.  This is reasoned.  map must accumulate results and build a list
only to throw it away; for does not carry this overhead.  As the two have
roughly equal notational convenience, it makes sense to use the more
efficient choice.

: Once again. There is absolutely nothing wrong with map in a void context.
: If you don't like side-effect, please ditch Perl and use something like
: Haskell, or another functional language.

I enjoy functional languages -- did a lot of Lisp a while back, for
example -- but also like procedural languages.  I merely try to use the
appropriate tools for the style I'm currently applying.

: As for the potential inefficiency,
: that has been known for years, and never considered inefficient enough to
: actually fix. And that's a bug in the implementation of perl, and should
: not be hold against a programmer of Perl.

This one goes into the double-quoted static string category for me.  It
works, the efficiency delta is minimal...and yet, when I'm reading code
(including my own) and see double-quotes, my predictive parser starts
scanning for the interpolation points, and has to do a backtrack if there
aren't any.  Similarly, map makes me start thinking in terms of "Okay,
where will the resulting list go?", which must be abandoned when the void
context registers.

A lot of this stuff falls into the same more general category as e.g.
indenting your code, or including comments.  Perl doesn't care, but *you*
will, or the maintenance programmer who comes after you.

: ::                                        And using double-quotes for a
: :: static string, too.
: 
: What the fuck is wrong with that? 

See above.

: ::                      Why not do
: :: 
: ::   printf '%02d', $_ foreach split /\./ => '2.1.3.14';
: 
: Because this is Perl and having more than one way to do it is a feature?

Of course; and we can each pick the subset of WTDI which make us more
productive, now and in the future.

: And besides, I first had everything in a string of printing it, and wrote:
: 
:     join "" => map {sprintf "%02d" => $_} split /\./ => '2.1.3.14';
: 
: Why change paradigms just because you are printing to STDOUT instead of
: collecting it in a string?

Ask the poster to whom I responded; again, I still like my regex version,
which solved the orginal to-string version and thus the printing problem
as well.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: Tue, 18 Jul 2000 01:57:22 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <3975b939.7349372@news.newsguy.com>

cberry@cinenet.net (Craig Berry) wrote:

>Abigail (abigail@delanet.com) wrote:
>: map {printf "%02d" => $_} split /\./ => '2.1.3.14';
>
>Mapping in a void context?  Abigail??

Why are you surprised?  Abigail is the foremost proponent of map
in a void context.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: 17 Jul 2000 23:32:18 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <slrn8n7kuc.v90.abigail@alexandra.delanet.com>

Craig Berry (cberry@cinenet.net) wrote on MMDXIII September MCMXCIII in
<URL:news:sn7fk2i4o53172@corp.supernews.com>:
[] Abigail (abigail@delanet.com) wrote:
[] : Craig Berry (cberry@cinenet.net) wrote on MMDXIII September MCMXCIII in
[] : <URL:news:sn77qujao5388@corp.supernews.com>:
[] : :: Abigail (abigail@delanet.com) wrote:
[] : :: : map {printf "%02d" => $_} split /\./ => '2.1.3.14';
[] : :: 
[] : :: Mapping in a void context?  Abigail??
[] : 
[] : Cargo cult answers? Craig??
[] 
[] Nope.  This is reasoned.  map must accumulate results and build a list
[] only to throw it away; for does not carry this overhead.  As the two have
[] roughly equal notational convenience, it makes sense to use the more
[] efficient choice.

map, of course, doesn't have to. Every other function in Perl is able
to figure out its context, and act accordingly. I've never heard any
convincing argument (in fact, I've never heard any argument) why map
has to build a list regarding of its context. The fact that map does is
a bug in perl. In perl that is, not in Perl. There's no reason to avoid
map in Perl. There is a reason to fix the implementation of map in perl
though. However, it has been known for a long, long time, but hasn't been
found important enough to fix.

[] : Once again. There is absolutely nothing wrong with map in a void context.
[] : If you don't like side-effect, please ditch Perl and use something like
[] : Haskell, or another functional language.
[] 
[] I enjoy functional languages -- did a lot of Lisp a while back, for
[] example -- but also like procedural languages.  I merely try to use the
[] appropriate tools for the style I'm currently applying.
[] 
[] : As for the potential inefficiency,
[] : that has been known for years, and never considered inefficient enough to
[] : actually fix. And that's a bug in the implementation of perl, and should
[] : not be hold against a programmer of Perl.
[] 
[] This one goes into the double-quoted static string category for me.  It
[] works, the efficiency delta is minimal...and yet, when I'm reading code
[] (including my own) and see double-quotes, my predictive parser starts
[] scanning for the interpolation points, and has to do a backtrack if there
[] aren't any.  Similarly, map makes me start thinking in terms of "Okay,
[] where will the resulting list go?", which must be abandoned when the void
[] context registers.

I don't see a reason to change my programming habits for your strange
parser.  If you see a print, do you think "where will the resulting
value go"? As for strings, I am really baffled. Why on earth would you
backtrack? How do you read single quoted strings? If you read English,
do you do that letter by letter as well? I guess that use of qq or q
gives you a nervous break down. All those different delimiters! I hope
noone will ever tell you about autoquoted barewords. You'd experience
a brainmelt!

[] A lot of this stuff falls into the same more general category as e.g.
[] indenting your code, or including comments.  Perl doesn't care, but *you*
[] will, or the maintenance programmer who comes after you.

If a programmer gets confused if there's no interpolation happening in
a double quoted string, then than programmer should not program.

BTW, don't tell me you ever do s/^\s+//;, you should of course be doing
s'^\s+'';. You wouldn't want to confuse the maintenance programmer, having
to backtrack a 4 character string for missing interpolation!


Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT


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

Date: Tue, 18 Jul 2000 01:32:18 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: How to get the machine (archtechture) type in Perl?
Message-Id: <slrn8n7css.74k.tjla@thislove.dyndns.org>

I was shocked! How could J. H. Park <jong@ebi.ac.uk>
say such a terrible thing:
>**** Post for FREE via your newsreader at post.usenet.com ****
>
>Hi
>
>I want to tell if the machine I am in
>is a LINUX or SGI IRIX.
>
>Is there an easy way to do so in Perl?
>Or is there Shell variable already
>defined?

print `uname`;

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Reading is thinking with someone else's head instead of one's own.


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

Date: Mon, 17 Jul 2000 22:06:36 -0700
From: "Joshua McAdams" <jmcada@hotmail.com>
Subject: limits on GET
Message-Id: <8l0hdf$9ur$1@news1.alltel.net>

I am calling a cgi via A HREF and when I recieve my key/value pairs, I get
all but the last one.  A wierd looking char is appearing instead.  Is there
a limit on the size of the HREF I am passing.
here is the line that is being sent:
<a
href="http://classifiedcafe.com/cgi-bin/classifieds/classifieds.cgi?session_
key=39738f2539caa29a&modify_sections_input_form=on&section_to_modify=RealEst
ate">Modify General Options</a>

// section_to_modify shows up as ion_to_modify=RealEstate in the browser
window and as soon as I get the string from the GET, it looks this way.
There is some odd  char that shows up before it

Thanks in advance
jmcada

(Sorry if my terminology isn't the best... started with perl and cgi's
today)





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

Date: Tue, 18 Jul 2000 03:21:45 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: limits on GET
Message-Id: <MPG.13de6a99fae143089896e2@news>

Joshua McAdams wrote ..
>I am calling a cgi via A HREF and when I recieve my key/value pairs, I get
>all but the last one.  A wierd looking char is appearing instead.  Is there
>a limit on the size of the HREF I am passing.
>here is the line that is being sent:
><a
>href="http://classifiedcafe.com/cgi-bin/classifieds/classifieds.cgi?session_
>key=39738f2539caa29a&modify_sections_input_form=on&section_to_modify=RealEst
>ate">Modify General Options</a>
>
>// section_to_modify shows up as ion_to_modify=RealEstate in the browser
>window and as soon as I get the string from the GET, it looks this way.
>There is some odd  char that shows up before it

there's a special HTML code

  &sect;

which should generate the char § when on a web page .. but you have to 
have the semi-colon in there otherwise it shouldn't be interpreted AND 
the ampersand would be used up with it as well - so you'd actually get a 
modify_sections_input_form value equal to on§ion_to_modify=RealEstate

so .. the question arises - how is this being interpreted incorrectly .. 
and I don't really know .. an easy workaround would be to rename that 
parameter to something that doesn't start with sect .. like 
modify_section

but take a look at the HTML of the page with the link on it - see if 
there's a stray semi-colon in there

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: 18 Jul 2000 03:44:38 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: limits on GET
Message-Id: <8l0jr6$vjm$3@slb1.atl.mindspring.net>

Joshua McAdams (jmcada@hotmail.com) wrote:
: I am calling a cgi via A HREF and when I recieve my key/value pairs, I get
: all but the last one.  A wierd looking char is appearing instead.  Is there
: a limit on the size of the HREF I am passing.
: here is the line that is being sent:
: <a
: href="http://classifiedcafe.com/cgi-bin/classifieds/classifieds.cgi?session_
: key=39738f2539caa29a&modify_sections_input_form=on&section_to_modify=RealEst
: ate">Modify General Options</a>
: 
: // section_to_modify shows up as ion_to_modify=RealEstate in the browser
: window and as soon as I get the string from the GET, it looks this way.
: There is some odd  char that shows up before it

This is actually an HTML problem; your browser is interpreting "&sect" as 
an entity reference to a character representing a section symbol.  
Ampersands in URLs that appear in HTML documents need to be escaped as &amp;.



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

Date: Tue, 18 Jul 2000 03:38:01 GMT
From: santi_fisher@my-deja.com
Subject: Newbie - "open for read" w/ perl function (not shell)
Message-Id: <8l0jeo$t83$1@nnrp1.deja.com>

Hi,

I have a newbie question, and since I didn't find a "perl-newbie"
newsgroup I'm posting it here... sorry if it's way too basic.

I want to fetch a remote web page and extract certain information from
it to send in an email. I plan to use LWP::Simple's "getprint" function
to get the html code.

I thought the most elegant way to pipe getprint's STDOUT in order to
process it would be something like:

open (HTML, "getprint 'http://webserver.com/specific.page.html' |");

but I'm realizing that this kind of "open for reading" only applies to
shell processes and not to perl functions like getprint (am I right
here?).

What would be the best workaround for this ? I want to avoid writing
html code to a local file and then working on it. Should I read html
into an array ? Or is there a way to work directly with an "open for
reading" filehandle like I mentioned ?

TIA for your help. Regards,

Santiago


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


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

Date: 18 Jul 2000 01:40:56 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Newbie - How can I set up a secure directory that is only accessib;le through a cgi password script?
Message-Id: <slrn8n7dcc.kpp.efflandt@efflandt.xnet.com>

On Mon, 17 Jul 2000 16:05:55 GMT, Liam <lkenny@fisheries.org> wrote:
>I am tryoing to set up a password protected 'Members Only' section.
>I have written the script and gotten that together.  But I am
>uncertain on how to make a directory only accessible through the
>perl-cgi script.
>
>This may not be a definite perl question, it may be an html issue on
>the directory side.  I'm not sure.  If it isn't, I would appreciate
>any helpful direction you can point me in to resolve this issue.

Usually it is best to use server authentication which is fairly easy to do
with apache, http://www.apache.org/docs/mod/core.html#require
That way it would protect all html and other files in a dir or
subdirectories.  For questions see comp.infosystems.www.servers.unix

You might want to grab crypt.txt (crypt.cgi source) from
http://cgi-help.virtualave.net/pub/ or
http://hammer.prohosting.com/~cgi-wiz/pub/
for an example of how to crypt passwords if you don't have shell access.

For IIS4 I found something on http://www.15seconds.com/ like "Authenticate
using ASP without NT" that explains how to use .asp with an included
script instead of .html to auth web pages.  But I wouldn't know how to
protect other filetypes there except by serving them up by a protected
script.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: Tue, 18 Jul 2000 01:09:04 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Newbie needs help!
Message-Id: <3974ad70.4332646@news.newsguy.com>

Jim Mauldin <mauldin@netstorm.net> wrote:
>Keith Calvert Ivey wrote:

>> Jim Mauldin <mauldin@netstorm.net> wrote:
>>
>> >($link, $descr) = /\[(.*?)]/g;
>> >
>> Yes, but then you'll get the brackets included in $link and
>> $descr.
>
>Not so.  perldoc perlop, and try it on $_ = "[www.perl.org]\t[A Perl site]";
>It only returns what's inside the ( ) after matching the whole expression.

You've made me look more foolish I was by deleting the part my
comment applies to, where you said the parentheses were
unnecessary.  On looking back, I see that I misread your post,
and you weren't referring to the capturing parentheses.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: Tue, 18 Jul 2000 12:12:06 +1000
From: "Allanon69" <allanon.69@no.spam.bigpond.com>
Subject: Newbie Question
Message-Id: <zUOc5.13893$c5.37740@newsfeeds.bigpond.com>

Hi,

It's been years since I've done any real coding and now with my new job I've
got to learn Perl.  At this point I'm translating a HTML file to ASCII, yeah
I know I could use the HTML parser :) , at this stage this is more to teach
myself how things fit together than to do anything really useful. This is
the first thing I've written in Perl as well.

Anyway the problem is that I'm reading in a file, getting the title and
later searching for the title so I can replace it with some other text.  The
line below works fine if the text is one word, eg "FRED".  However if it
includes several words with spaces it doesn't match, eg. "FRED AND BARNEY".
I can't seem to find anything to give me a hint as to what to do here...
should I be quoting the $search with qw?

 .
 .
 .
 .
($first_pass = $_) =~
s{(</)(a|h[1..6])((\s.*?)?>)$search.*?(</)(a|h[1..6])(>)}{}isx;
 .
 .
 .
 .

Thanks in advance
--
Danny






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

Date: Tue, 18 Jul 2000 11:08:54 +0800
From: "Lucas Tsoi" <lucas@cplhk.com>
Subject: nslookup in Perl
Message-Id: <8l0ho4$ndq6@imsp212.netvigator.com>

Hi
In Perl, is there any function or module do the same matter liked Unix's
"nslookup"
and return the informayion?

Thanks for any helps!!




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

Date: 17 Jul 2000 22:43:58 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: nslookup in Perl
Message-Id: <87lmz0xfup.fsf@limey.hpcc.uh.edu>

>> On Tue, 18 Jul 2000 11:08:54 +0800,
>> "Lucas Tsoi" <lucas@cplhk.com> said:

> Hi In Perl, is there any function or module do the same
> matter liked Unix's "nslookup" and return the
> informayion?

http://search.cpan.org/ and look for "Net::DNS".

hth
t
-- 
"With $10,000, we'd be millionaires!"
                                           Homer Simpson


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

Date: 18 Jul 2000 03:26:11 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Object somehow becoming unblessed?
Message-Id: <8l0ioj$vjm$1@slb1.atl.mindspring.net>

Steve Leibel (stevel@coastside.net) wrote:
: Yes, that's exactly what was going on -- I was using the object as a hash
: key in order to keep track of my objects, and later recovering them via
: keys().  Well I won't do that again!!

If you ever really need to do such a thing, look at Tie::RefHash.



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

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


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