[11754] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5354 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 11 18:07:27 1999

Date: Sun, 11 Apr 99 15:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 11 Apr 1999     Volume: 8 Number: 5354

Today's topics:
    Re: ActivePerl and Win95/Personal Web Server (Bill Moseley)
        Backslash escapes w/in *single* quotes? <jbc@shell2.la.best.com>
    Re: Backslash escapes w/in *single* quotes? (Larry Rosler)
        converting byte to Numeric jhenzel@gci-net.com
    Re: converting byte to Numeric (Larry Rosler)
    Re: Dan: Web site(s) <ma5ter@mudge.edu>
        Help my with cookie, pls <concrete@kki.net.pl>
    Re: Help with Perl and Microsoft Exchange <cassell@mail.cor.epa.gov>
    Re: Hotmail's Homepages <mathman100@geocities.com>
    Re: Hotmail's Homepages <mathman100@geocities.com>
    Re: How to Restrict CGI access? <cassell@mail.cor.epa.gov>
    Re: Is it possible to have "..." appear while processin <lowella@serv.net>
    Re: iterate @$list_ref same as @list ? 3pound@my-dejanews.com
    Re: iterate @$list_ref same as @list ? <aqumsieh@matrox.com>
    Re: LWP::UserAgent and POST <gisle@aas.no>
    Re: LWP::UserAgent and POST (S E  Lehtinen)
    Re: passing variables from PERL to JavaScript <cassell@mail.cor.epa.gov>
        Pays to use single, rather than double, quotes? <jbc@shell2.la.best.com>
    Re: Pays to use single, rather than double, quotes? (Larry Rosler)
    Re: perl and y2k (was Re: The millennium cometh -- even <cassell@mail.cor.epa.gov>
        Perl Development Environment (Aaron)
    Re: Perl Development Environment <dimitrio@sympatico.ca>
    Re: Privacy for ...A followup question <x@x.com>
    Re: question about hash keys <aqumsieh@matrox.com>
        start a background process and let it go.. <ptrainor@title14.com>
    Re: Text Search Program <cassell@mail.cor.epa.gov>
    Re: Text Search Program <cassell@mail.cor.epa.gov>
    Re: using perl to load a web page <stevenhenderson@prodigy.net>
    Re: Writers wanted for zine articles. <cassell@mail.cor.epa.gov>
    Re: Y2K (yes, again - sorry!) (Andrew M. Langmead)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 11 Apr 1999 14:05:59 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: ActivePerl and Win95/Personal Web Server
Message-Id: <MPG.117aae902db7dd8e98972c@206.184.139.132>

In article <7eqg55$f7d@chronicle.concentric.net>, phlip@politizen.com 
says...
> Bill Moseley wrote:
> >Or, be happy and download Apache from www.apache.org.
> 
> If you don't mind Apache for NT seems to swallow all CGI error
> messages and put them in neither error.log nor the output page...

Errors?!?  What errors? ;)

That's not my experience on Win 95.   Do you have the log files setup 
correctly?  Do you have something like "ScriptLog logs/cgi.log"?


-- 
Bill Moseley mailto:moseley@best.com


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

Date: 11 Apr 1999 20:06:27 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Backslash escapes w/in *single* quotes?
Message-Id: <371100c3$0$27373@nntp1.ba.best.com>

Random curiousity here...

The 2nd edition Camel says on p. 39, "single-quoted strings are not
[subject to backslash interpretation] (except for \' and \\, so that
you can put single quotes and backslashes into single-quoted strings)."

My question concerns '\\'. I seem to be able to successfully put a
single backslash in a single-quoted string and have it print out,
without resorting to a doubled backslash. The only situation I can
think of where it might be needed is if I wanted to insert the literal
string \' in the single-quoted string, e.g. 'here is a backslash
followed by a single quote: \\\''. In every other situation, though, it
seems that the backslash is just fine by itself (that is, it will be
represented literally in the string), and using a doubled backslash
will just give me a doubled backslash in the string.

Have I understood this correctly? Or is there more going on here than
I've realized?

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: Sun, 11 Apr 1999 14:03:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Backslash escapes w/in *single* quotes?
Message-Id: <MPG.117aadf41a4e948e98988d@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <371100c3$0$27373@nntp1.ba.best.com> on 11 Apr 1999 20:06:27 
GMT, John Callender <jbc@shell2.la.best.com >says...
 ...
> My question concerns '\\'. I seem to be able to successfully put a
> single backslash in a single-quoted string and have it print out,
> without resorting to a doubled backslash. The only situation I can
> think of where it might be needed is if I wanted to insert the literal
> string \' in the single-quoted string, e.g. 'here is a backslash
> followed by a single quote: \\\''.

More situations than just that.  Suppose you wanted to have a backslash 
as the last character in the single-quoted string?  'foo\\'

>       In every other situation, though, it
> seems that the backslash is just fine by itself (that is, it will be
> represented literally in the string), and using a doubled backslash
> will just give me a doubled backslash in the string.

Using a doubled backslash gives a single backslash in the string, no 
matter what it is followed by.

You seem to have done some experimentation.  Why not try this one:

print '\\foo\\\'\\';

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


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

Date: Sun, 11 Apr 1999 19:47:11 GMT
From: jhenzel@gci-net.com
Subject: converting byte to Numeric
Message-Id: <3710fa97.191850396@news.gci-net.com>

Hi

I am trying to read a GIS file (ESRI Shapefile)
(http://www.gis.umn.edu/fornet/docs/MapServer/av_shape.pdf) that the
structure is published for but am having problems converting byte
values I read in from the file to integer and doubles

Here is the source code I am using.

open(FH, 'l:\biod\webbiod\source\rio_negro.shp')    or die "Can't open
input:  $!\n";
    read(FH,$FileCode,4,0) ;
    read(FH,$FileLength,4,24) ;
	read(FH,$Version,4,28) ;
	read(FH,$ShapeType,4,32) ;
	read(FH,$XMin,4,36) ;

    $intFileCode = join('', unpack('n*',$FileCode));
    $intFileLength = join('', unpack('N*',$FileLength));
    $intVersion = join('',unpack('v',$Version));
    $intShapeType = join('',unpack('V*',$ShapeType));
    $intXMin = join ('',unpack('V*',$XMin));

    print "File Code = ".$intFileCode."\n";
    print "File Length = ".$intFileLength."\n";
    print "Version = ".$intVersion."\n";
    print "Shape Type = ".$intShapeType."\n";
    print "X Min = ".$intXMin."\n";

The documentation states the the File Code is at Byte 0 and is a Big
Endian Integer with a value of 9994.  I can get this but cannot get
the other values.  For example, the File length is at Byte 24 (Big
Endian Integer), the Version at Byte 28 (Little Endian Integer) with a
value of 1000, etc.  I just keep getting a 0 for these other values.

Any suggestions on what I am doing wrong would be greatly appreciated.
I think it is something simple that I am missing.  I have gone
throught the PERL docs and nothing hits me.
Thanks

Jerry Henzel


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

Date: Sun, 11 Apr 1999 13:42:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: converting byte to Numeric
Message-Id: <MPG.117aa9108b1e003398988c@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <3710fa97.191850396@news.gci-net.com> on Sun, 11 Apr 1999 
19:47:11 GMT, jhenzel@gci-net.com <jhenzel@gci-net.com >says...
>...
>     read(FH,$FileCode,4,0) ;
>     read(FH,$FileLength,4,24) ;
> 	read(FH,$Version,4,28) ;
> 	read(FH,$ShapeType,4,32) ;
> 	read(FH,$XMin,4,36) ;
 ... 
> The documentation states the the File Code is at Byte 0 and is a Big
> Endian Integer with a value of 9994.  I can get this but cannot get
> the other values.  For example, the File length is at Byte 24 (Big
> Endian Integer), the Version at Byte 28 (Little Endian Integer) with a
> value of 1000, etc.  I just keep getting a 0 for these other values.
> 
> Any suggestions on what I am doing wrong would be greatly appreciated.
> I think it is something simple that I am missing.  I have gone
> throught the PERL docs and nothing hits me.

I assume you read the documentation for the read() function:

perldoc -f read

but misinterpreted the meaning of the optional fourth argument (OFFSET).  
This specifies where in the target string to place the newly read data.  
You seem to think it means an offset in the file being read.

Just drop the fourth argument from each of your calls, and all should 
work as you want.

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


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

Date: Sun, 11 Apr 1999 18:25:53 GMT
From: "ma5ter" <ma5ter@mudge.edu>
Subject: Re: Dan: Web site(s)
Message-Id: <RO5Q2.10$z83.45@c01read02.service.talkway.com>

On Sun, 11 Apr 1999 17:34:08 GMT nousnauts@my-dejanews.com wrote:
>  dan:
> Hi, May name is Rey
> 
> I am interested in learning how to build sites, but if I need to
> build a "hot mail", "ebay", or "Yahoo"
> that includes  automated registering with password etc.  Do you think
> Perl and Unix are the best way to go?
> 

For beginning a site like that, yes.  Getting things going on a
Linux/Apache box with Perl is a good beginning point, then move things
into C and get an OpenBSD box with secure Apache as you move along.

> Also,  I sold a couple of words (domains) and one of the new owners
> is asking me if I know of anyone that could develop them-  fleamarket.net
> and  distressedproperty.net
> 
> I advised them to get a Sony Mavica because it seems they know almost
> nothing about internet.  This should help them email or upload jpgs. and
> help a developer.
> 
> Can you know some names of books or sites that could help me find scripts
> for these site styles?   Also,  do you do any work on the side and can
> you propose some package if I provide the server and info?
> 
O' Reiley and * Dummies books help me a lot.  Also, for anything Java,
check the free Sun tutorials and info, www.Sun.com

> Thanks,
> Sincerely,
> Rey
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
--
Posted via Talkway - http://www.talkway.com
Surf Usenet at home, on the road, and by email -- always at Talkway.



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

Date: Sun, 11 Apr 1999 23:34:15 +0200
From: "Wiktor" <concrete@kki.net.pl>
Subject: Help my with cookie, pls
Message-Id: <Vy8Q2.4715$lN.77758@news.tpnet.pl>

Hi,

There are 2 pages in ASP. First serve to login
to the second. When I post to the first I got
cookie in HTTP header from server, for example:

    HTTP/1.1 200 OK
    Server: Microsoft-IIS/4.0
    Date: Fri, 09 Apr 1999 22:36:44 GMT
    Content-type: text/html
    Set-Cookie: ASPSESSIONID=IOKGKQQZLBSJWXVB; path=/home
    Cache-control: private
    Connection: close

What should I repost to the server to get to the
second page ?

I tried to post that:

Cookie: $Version="0"; ASPSESSIONID=IOKGKQQZLBSJWXVB; $Path="/home";
browserName=&browserVersion=&login=mylogin&password=mypassword

But it didn't work. I received this, in place of real second
page:

<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a
HREF="second.asp">here</a>.</body>

The same effect is when I post only login parameters:
browserName=&browserVersion=&login=mylogin&password=mypassword
without cookie. I think that server didn't accept
my cookie because of somewhat misspelling
problem. Am I right ? Is there a way to check that ?

Maybe I don't understand something and $ and "
signs are unnecessary. I used to use HTTPPost
from http-lib.pl, so my cookie is posted via this
function, and maybe it is doing split or something
else with its parameters. Please, tell me what is
the correct, raw format of cookie's posted to the
server and what code you are using to post it ?

Regards,
Robert







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

Date: Sun, 11 Apr 1999 13:32:57 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Help with Perl and Microsoft Exchange
Message-Id: <371106F9.EEEC6DCD@mail.cor.epa.gov>

Chris Newman wrote:
> 
> I have a survey form on our corporate intranet and I collect responses
> in a flat file on the server. I am confident that I can design a Perl

Yep, you can do all this in Perl.  Let's look at the details...

> script that accepts the contents of the file into an array,

If you're reading the contents of a file off a hard disk, then any intro
book (or the FAQ) can tell you how to do this in a couple lines.
If you're slurping a list from your web form, then look at CGI.pm and
the libwww bundle.  There are multiple tools there that will do all your
dirty work.  See CPAN - get to the multiplexer via www.perl.com .

But.. you may want more than a simple array:

>                                                             perform a
> field sort

Oh.  You want to break up the input lines into a list of lists, or a
hash of lists, or something more complex than just an array.
Look at your Perl documentation.  Use the 'perldoc' program to read
the following sections:
perlref    [Perl references]
perldsc    [Perl data structures intro]
perllol    [Perl data structures: lists of lists]
These should get you started.  Then a sort should be straightforward.
perldoc -f sort

>            and generate a report in HTML.

CGI.pm can do this easily.  But if you're going to send this as an 
attachment, do you need it to be html?  Just a thought...

>                                          I then want to send this
> report as an attachment to my e-mail account (we run Microsoft Outlook
> and Exchange Server).

Check out the Mail::* modules at CPAN.  Mail::Mailer is unix-centric, 
while Mail::Internet uses Net::SMTP, which should do the trick.  
I think M$ Exchange Server handles SMTP.

And an attachment too?  This is now a MIME issue.  The MIME::Lite module
should do what you want without too much overhead.  But if you want
more,
there are other MIME::* modules at CPAN.

> I am not sure how to go about this? Can someone help me or at least
> point me to an appropriate reference?

Start with the FAQ and the docs that came with your installation of 
Perl - unless your sysadmin was naughty.  Those are excellent 
resources no one should ignore.

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Sun, 11 Apr 1999 15:47:07 -0400
From: "mathman100" <mathman100@geocities.com>
Subject: Re: Hotmail's Homepages
Message-Id: <7equ68$2i8@sjx-ixn9.ix.netcom.com>

Tsuji <tsuji@zd5.so-net.ne.jp> wrote in message
news:7eldgv$k5s$1@news01dg.so-net.ne.jp...
> No, there is no such thing as hiding scripts, until Internet Explorer 5
came
> along. IE5 has a new feature that allows scripts to be encoded. It's
decoded
> on the client side and run, but until someone decides to hack it (which
> probably won't be long), there is no way to view encoded IE5 scripts. It

Simple - get the encoding algorithm and run it on the document.  Also, when
a browser decodes something, why can't it just show the decoded document?
Some hacking could make a browser show that source instead of the original
source, and some browsers that will implement encoding might show the
decoded source anyway.

> shows up on your browser as a bunch of commented gibberish. The
disadvatage
> is, of course, that encoded scripts can only be run on IE5, and all other
> browsers will ignore it. (BTW, I can also read Hotmail's scripts by simply
> going to view source) If a script is operating but you can't see it in the
> source, it is probably been linked to an external file (to see the source,
> type in the name of the external script file, and the browser will prompt
> you to save it or open it. It's simple ascii text). To include a script
from
> an external file, you'll see a tag like this:
>
> <SCRIPT SRC="external.js" TYPE="text/javascript"
> LANGUAGE="JavaScript"></SCRIPT>
>
> Note that this is not script hiding, and anybody can still read the source
> easily.
>
>
> Patrick Fong wrote in message ...
> >Hi
> >
> >I know the answer to this question may violate copyright laws, but
perhaps
> >someone could give me a hint about the answer.
> >
> >If anyone has been to Hotmail.com, and tried to view the source to their
> >homepages, you will not be able to. How does someone protect other people
> >from viewing the source to their homepages? (I have seen this question in
> >a FAQ at irt.org and the answer is you cant).Perhaps someone would know?
I
> >am very interested in it because of the security issues involved in it.
> >
> >Oh btw, where can I find out about protecting pages from being viewed? As
> >in password protect a page? I know of JavaScript capabilities and to some
> >extent Perl. I have looked in developer.netscape.com and found nothing
and
> >also Perl.com. Perhaps someone who is doing WWW stuff professionally may
> >be able to point me in the right direction.
> >
> >Tnx in advance
> >
> >P.
>
>
>
>
>
>
>
>
>
>
>
> .
>




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

Date: Sun, 11 Apr 1999 15:51:44 -0400
From: "mathman100" <mathman100@geocities.com>
Subject: Re: Hotmail's Homepages
Message-Id: <7equet$2nk@sjx-ixn9.ix.netcom.com>

That's hiding script from older browser that don't support Javascript so
that the actual code doesn't display on the page, but it is viewed with the
source. For example:

<Script Language=Javascript>
<!-- hide me
  // some script here
-->
</Script>

The <!-- and --> tags are HTML comment tags, and the // is a javascript
comment tag.

--

-MM
<stecomp@telusplanet.net> wrote in message
news:370DBA9B.B4AF2EBC@telusplanet.net...
> has something to do with the placement of the comment characters <!-->
> i read it somewhere and forgot, but there was a way to hide script
> hopefully this note will jar someone elses memory.
>
>
> Patrick Fong wrote:
>
> > Hi
> >
> > I know the answer to this question may violate copyright laws, but
perhaps
> > someone could give me a hint about the answer.
> >
> > If anyone has been to Hotmail.com, and tried to view the source to their
> > homepages, you will not be able to. How does someone protect other
people
> > from viewing the source to their homepages? (I have seen this question
in
> > a FAQ at irt.org and the answer is you cant).Perhaps someone would know?
I
> > am very interested in it because of the security issues involved in it.
> >
> > Oh btw, where can I find out about protecting pages from being viewed?
As
> > in password protect a page? I know of JavaScript capabilities and to
some
> > extent Perl. I have looked in developer.netscape.com and found nothing
and
> > also Perl.com. Perhaps someone who is doing WWW stuff professionally may
> > be able to point me in the right direction.
> >
> > Tnx in advance
> >
> > P.
> >
> >
****************************************************************************
*********
> > So how?
> >
> >
****************************************************************************
*********
>
>
>




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

Date: Sun, 11 Apr 1999 13:56:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to Restrict CGI access?
Message-Id: <37110C77.220FD503@mail.cor.epa.gov>

multilinks@my-dejanews.com wrote:
> 
> In article <m1hfqotm44.fsf@halfdome.holdit.com>,
>   merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> > >>>>> "global3" == global3  <global3@my-dejanews.com> writes:
> >
> > global3> I am trying to modify the access.conf server configuration file to
> > global3> restrict CGI access from remote hosts to CGI files in a particular
> > global3> directory yet allow CGI access in the same directory for visitors to
> my
> > global3> web site (i.e., people who come using their browsers). I have been
> trying
> > global3> this code:
> >
> > Hmm.  I missing something here, or perhaps you are.
> >
> > What is the difference between "access from remote hosts" and "access
> > in the same directory for visitors"?  How does it look any different
> > to the web server?
> >
> > I suspect it doesn't, and hence, your problem is unsolveable.
> >
> > And, for the record, this is *not* a Perl question.  You would have
> > gotten much more precise response posting in
> > comp.infosystems.www.authoring.cgi.
> >
> > --
> > Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
> > Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
> > Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger
> merlyn@teleport.com)
> > Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
> > Quote: "I'm telling you, if I could have five lines in my .sig, I would!" --
> me
> >
> 
> I am following up for Agni.  I will try the group you mentioned.  I can do
> what is described here using PERL but I cannot from the web server level.  If
> I use the PERL code:
> 
> $remote = $ENV{'REMOTE_ADDR'};
> 
> $refer = $ENV{'HTTP_REFERER'};
> 
> unless ($refer =~ /mydomain\.net/ || $refer =~ /365\.1\.14\.97/ || $remote =~
> /365\.1\.14\.97/) {
> exit;
> }
> 
> This allows me to restrict all remote hosts from accessing my CGI script yet
> anyone that actually visits my web site with a browser will be able to access

I don't think so.  The HTTP-REFERER can be trivially spoofed, so a
spoofer
will get right into your system.  If you only want to protect against
people
who wouldn't try something naughty, then why bother to set up any
protection
at all?
BTW, I hope that .365.1.14.97 is the real IP address...

> my  CGI scripts.  The problem here is that PERL must still be called to
> enforce this restriction.  I want to block remote hosts before they get to
> PERL and costs me server resources.

Then you definitely are defining this as a non-Perl issue!  So Randal 
was right, as usual.  Always listen when the gurus speak, even if they 
tell you something you don't want to hear.

Since what you want is now defined as a server issue rather than an html
or cgi or Perl issue, your best bet is in one of the newsgroups devoted
to server-specific issues.  Good luck.
 
> Hope this is clearer and that you can help.  Thanks for your time.
> 
> Vladimir
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 11 Apr 1999 21:25:11 GMT
From: L Anderson <lowella@serv.net>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <7er3vn$hpa$0@199.201.191.2>

You may want to add 

# Disable buffering for STDOUT
$| = 1;

so you can see the "."s as the program progresses and not just in one
swell foop.


L A


Tad McClellan wrote:
> 
> Poohba (poohba@io.com) wrote:
> : If so how?...
> 
>    Sure.
> 
>    You sprinkle
> 
>       print '.';
> 
>    statements in amongst the long-running code.
> 
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas


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

Date: Sun, 11 Apr 1999 18:58:34 GMT
From: 3pound@my-dejanews.com
Subject: Re: iterate @$list_ref same as @list ?
Message-Id: <7eqrcn$voe$1@nnrp1.dejanews.com>

 ... would it help to know this sub is being called as a closure?

In article <qNqP2.42$Ji.544128@rsnws01.mn.mediaone.net>,
  "Jay J" wrote:
> before I post this wacky routine.. in pseudo-code:
>
> Is there a good reason why foreach'ing (@$list_ref) should act different
> than foreach (@list) ?
>
> I'm while {$_=~ /$pattern/ig} matching inside this foreach and exiting the
> foreach on <condition> ... In a list-ref scenario it picks up where it left
> off on a previous call to this sub, normal list... works like it should*.
>
> thanks..
>
> -Jay J
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 11 Apr 1999 14:11:44 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: iterate @$list_ref same as @list ?
Message-Id: <x3y4smn9gdc.fsf@tigre.matrox.com>


"Jay J" <SpamMeNOT.3pound@iname.com> writes:

> before I post this wacky routine.. in pseudo-code:
> 
> Is there a good reason why foreach'ing (@$list_ref) should act different
> than foreach (@list) ?

Depends on what @list and $list_ref are. If you mean:

	$list_ref = \@list;

then both foreach statements should be identical.

> I'm while {$_=~ /$pattern/ig} matching inside this foreach and exiting the
> foreach on <condition> ... In a list-ref scenario it picks up where it left
> off on a previous call to this sub, normal list... works like it should*.

Can you post some code?
It it very hard to guess what you are doing wrong there. (I wanted to
mention the Crystal::Ball module joke here, but I tried it before and
it didn't work).



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

Date: 11 Apr 1999 15:04:15 +0200
From: Gisle Aas <gisle@aas.no>
Subject: Re: LWP::UserAgent and POST
Message-Id: <m3zp4fe2b4.fsf@eik.g.aas.no>

Douglas Clifton <doug@weboneinc.com> writes:

> I have learned how to use:
> 
> HTTP::Request::Common qw(POST);
> LWP::UserAgent;
> 
> to automate POSTing form variables to a CGI script.
> 
> However this does not work under the https protocol.

There is no reason this should not work.  Does GET to an https server
work for you.  Did you install Crypt-SSLeay?

-- 
Gisle Aas


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

Date: Sun, 11 Apr 1999 20:31:30 GMT
From: hombre@nowhere.no (S E  Lehtinen)
Subject: Re: LWP::UserAgent and POST
Message-Id: <CE7Q2.304$xe7.334@read2.inet.fi>

Gisle Aas <gisle@aas.no> wrote:

>> to automate POSTing form variables to a CGI script.
>> 
>> However this does not work under the https protocol.

>There is no reason this should not work.  Does GET to an https server
>work for you.  Did you install Crypt-SSLeay?

I have had such similar problem that the standard LWP library does not
support https GET nor POST, although the documentation shortly
mentions those. Should they work without any special tricks if SSLeay
is installed?

S E Lehtinen
- does not cast Perl for swines




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

Date: Sun, 11 Apr 1999 14:17:12 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: passing variables from PERL to JavaScript
Message-Id: <37111158.4AC69AF1@mail.cor.epa.gov>

Jeff Thies wrote:
> 
>   How do you pass a variable from Perl to JavaScript?
> 
> Jeff

You don't.  Perl has a built-in feature that automatically disables
Javascript and VBScript whenever encountered.  :-)

Sorry, I couldn't resist.  Actually I think you might want to supply
a little more info.  I assume this is a webserver, although you 
submitted this question to a ng which doesn't focus solely on webtrafe.
Does one program call the other?  If so, which is the parent process?
Or do they run independently, and you want to open a pipe from one to
the other?  In general, Perl is designed to play nice with other
children, so there are a variety of ways to do this, depending on
the circumstances.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: 11 Apr 1999 20:16:29 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Pays to use single, rather than double, quotes?
Message-Id: <3711031d$0$27373@nntp1.ba.best.com>

One more dumb question about single- vs. double-quoted strings: If I
know that I don't want interpolation of variables or interpretation of
backslash escapes, is it in my interest to use single quotes rather
than double quotes to delimit my strings? What I mean is, is there some
kind of performance benefit to my script, over and above whatever
benefit I get from not having to escape literal $'s and @'s in my
double-quoted string?

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: Sun, 11 Apr 1999 14:15:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Pays to use single, rather than double, quotes?
Message-Id: <MPG.117ab0b3db640ef998988e@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <3711031d$0$27373@nntp1.ba.best.com> on 11 Apr 1999 20:16:29 
GMT, John Callender <jbc@shell2.la.best.com >says...
> One more dumb question about single- vs. double-quoted strings: If I
> know that I don't want interpolation of variables or interpretation of
> backslash escapes, is it in my interest to use single quotes rather
> than double quotes to delimit my strings? What I mean is, is there some
> kind of performance benefit to my script, over and above whatever
> benefit I get from not having to escape literal $'s and @'s in my
> double-quoted string?

There is a minuscule performance benefit to single quotes.  But if that 
is meaningful in your application, you shouldn't be using Perl.

The real benefit is in the readability (and hence maintainability) of 
the program.  Used consistently, single quotes and double quotes convey 
different semantics about the strings (in one word, simple vs complex).

The only exception I make is for the null string, which I prefer to 
write as "" (four hen-scratches), because just '' (two hen-scratches) 
looks too much like one double-quote character.

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


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

Date: Sun, 11 Apr 1999 14:10:03 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perl and y2k (was Re: The millennium cometh -- eventually)
Message-Id: <37110FAB.7C1B64B5@mail.cor.epa.gov>

Russell Schulz wrote:
> 
> "David L. Cassell" <cassell@mail.cor.epa.gov> writes:
> 
> >> > Oh no!  He's right!  All programming languages are Y2K noncompliant,
> >> > since someone somewhere can misuse them!
> >>
> >> Does your response mean:
> >
> > [e]  I was trying to lighten up this thread a little.
> 
> I've done that; I once posted a followup asking how to do graphics in
> Turbo Pascal saying it could only be done in C, and set followups to
> alt.silly -- one person responded, and complained bitterly and rudely
> about my stupidity, and when I pointed out their own headers said
> `alt.silly', they thought I was harassing them.
> 
> The tragedy, and the reason I responded, is that people have _seriously_
> posted these exact things -- that it's up to the programmer to read and
> memorize every odd representation in the language and its libraries, and
> that Perl has no more y2k problem than would a pencil.
> 
> Scary, isn't it?  It's hard to work on fixing a problem when you can't
> even acknowledge the problem exists.
> --
> Russell_Schulz@locutus.ofB.ORG  Shad 86c

What I find scary is that the real programmers all know the problem
exists, and even have general ideas of what is required to fix it.
But many people seem to feel that it's cheaper to just be ready to sue
the pants off someone else later.  The following exchange comes to mind
for some reason:

PHB: "Remember when I said people are our most important resource?
     Well it turns out that money is our most important resource.
     People are ninth."
Wally: "I have a feeling I shouldn't ask this.. but what was eighth?"
PHB: "Carbon paper."

Happy to brighten your day,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Sun, 11 Apr 1999 14:33:40 -0500 (CDT)
From: aaron@soltec.net (Aaron)
Subject: Perl Development Environment
Message-Id: <Pine.LNX.4.04.9904111427250.20923-100000@localhost.pants.org>

I think more of what we mean is

integrated debugger - when I say integrated, I want to step through the code, display watched variables, all the things that perl -d gives us now, but available inside the editor (much like Perlbuilder)

possibly a class hierchary panel (like in some of the Visual microsoft tools) - I know that at least something to let us know what functions we've defined (and maybe even what prototypes we've declared) would be absolutely great

I would like the ability to use whatever editor I wished.  I like VIm some folks like Vile some like Emacs and there are probably pico zealots out there

as I type this out, I'm thinking that possibly it wouldn't be terribly hard to do with tcl/TK or perl/TK

though speed, would it be fast enough?

I've never written a GUI app for *nix so I'm not sure

as I talk about this

I'm thinking that this would be a pretty good project.

Anyone want to join with me in an attempt?


Aaron
-----
It snowed a lot out here.
	-Kathy, Aaron, Avi, Vern




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

Date: Sun, 11 Apr 1999 18:19:55 GMT
From: Dimitri Ostapenko <dimitrio@sympatico.ca>
Subject: Re: Perl Development Environment
Message-Id: <3710E810.5280020@sympatico.ca>

JDDemme wrote:

> Does a good perl dev environment exist?
> For linux?
>
> I'm sick of going to Elvis(vi) then out and typing ./XXXXX!!!! then back to
> elvis, and out to command line.
>
> Thanks,
> JDDemme
> jddemme@technologist.com

Ever tried MultiEdit (http://www.softexport.com/multiedit.htm) ?

In my former life as a full-time systems programmer I used it a lot. It has
different environments for different languages and you can compile/execute with
the click of a button. Multiple windows, grep on external files, ftp, html ...

Get a trial version and see for yourself.

Dimitri Ostapenko





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

Date: 11 Apr 1999 19:34:34 GMT
From: "x" <x@x.com>
Subject: Re: Privacy for ...A followup question
Message-Id: <7eqtga$45f$0@208.231.50.134>

If I access my personal web site (which is running SSL) can the admin see
the content of my web site. Also, if I use basic HTTP authentication
(.htaccess, etc.) will the admin be able to intercept my password and log on
to my SSL site?

(I am not interested in goofing off at work; I just have to occasionally
check my web site to see if one of my clients had and emergency.)

Andy





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

Date: Sun, 11 Apr 1999 14:08:09 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: question about hash keys
Message-Id: <x3y67739gja.fsf@tigre.matrox.com>


boson@earthlink.net (Boson) writes:

> 
> I have been experimenting with the hash keys...I don't understand why
> this little code prints out "b c". I was expecting "a b c" or maybe
> just "c". 
> 
> $h{123} = 'a';
> $h{'0123'} = 'b';
> $h{'123'} = 'c';
> print "$h{$_} " foreach (keys %h);
> 
> I am sure there is a simply explanation. Help!

Hash keys are strings. The number 123 is cast into the string
'123'. So the third assigment overrides the first one. The string
'0123' is different from the string '123'.

Makes sense now?

Note: If your keys are all numeric, it might be worthwile using a
regular array. Access time is faster for arrays, and they take up less
space.

HTH,
Ala



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

Date: Sun, 11 Apr 1999 17:19:51 -0400
From: Pat Trainor <ptrainor@title14.com>
Subject: start a background process and let it go..
Message-Id: <Pine.LNX.4.05.9904111717510.25452-100000@aura.title14.com>


	I have a main script that must call another script. The parent
needs to continue regardless of any returns from the child. The child will
take longer that the parent to close.

	What are the suggestions on how best to do this? I've tried many
incarnations with no success.

TIA!

pat 	
:)

ptrainor@title14.com (key: www.title14.com/pgp/pat.key)  
Programming Rates: I do it: $20 You watch: $40 You help: $80



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

Date: Sun, 11 Apr 1999 13:44:06 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: mfo@home.com
Subject: Re: Text Search Program
Message-Id: <37110996.39AA7651@mail.cor.epa.gov>

Michael O'Connor wrote:
> 
> Hello,

Hello.  Let me preface this by pointing out that (1) comp.lang.perl
has been dead for YEARS, and (2) IMHO you cross-posted a bit too much.
 
> I'm working on a project that is to have a user input a text string and then
> search for that text string in a bunch of text files.  Then I am to display
> those text files that have that text string in it.  I would like to use
> windows or an internet browser to ask for the input and to display the
> output.  I am using Windows 98 on a stand alone machine.  I have been
> investigating Perl for doing the text searching.  I have had difficulty
> using Perl to drive my internet browser.  Perl is designed for a Unix
> environment not for a windows environment.  Perl wants to only open up a
> text window.  Does anyone know drivers for windows or internet browsers
> using Perl? Should I be using a different programming language? Any
> suggestions?
> 
> Thank you for your help!
> 
> Please send information to my email: mfo@home.com.
> 
> Mike

Easy in Perl.  Get ActiveState's lastest build and use their PerlScript
to do the browser windows.  In addition, the CGI.pm module will help you
a *lot*.

HTH,
David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Sun, 11 Apr 1999 13:46:57 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Text Search Program
Message-Id: <37110A41.4F6FE766@mail.cor.epa.gov>

dana@oz.net wrote:
> 
> In comp.lang.perl Michael O'Connor <mfo@home.com> wrote:
> 
> : I'm working on a project that is to have a user input a text string and then
> : search for that text string in a bunch of text files.  Then I am to display
> : those text files that have that text string in it.  I would like to use
> : windows or an internet browser to ask for the input and to display the
> : output.  I am using Windows 98 on a stand alone machine.  I have been
> : investigating Perl for doing the text searching.  I have had difficulty
> : using Perl to drive my internet browser.  Perl is designed for a Unix
> : environment not for a windows environment.  Perl wants to only open up a
> : text window.
> 
> If you _really_ want to use Perl, the easiest would be to make a dialog
> in C++, and call Perl from within to do the text search by passing the
> result of the dialog.
> 
> --
> 
> ---------------------------
> Dana Booth <dana[at]oz.net>
> Tacoma, Wash., USA
> ---------------------------

It's not polite to tease the neophytes, Dana.  Only someone who is not
very familiar with Perl & PerlScript would think this is the *easiest* 
approach.  :-)

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Sun, 11 Apr 1999 13:59:52 -0500
From: "Steven T. Henderson" <stevenhenderson@prodigy.net>
Subject: Re: using perl to load a web page
Message-Id: <a58Q2.23132$oa3.263939@news.san.rr.com>

or even better, just change the URL:


print <<RELOAD;
Content-type: text/html\n\n
<HTML><HEAD></HEAD><BODY><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;
URL=$HTML_HOME/$HTML_DEFAULT\"></BODY></HTML>
RELOAD



Jonathan Feinberg wrote in message ...
>psalzman@landau.ucdavis.edu (Pete) writes:
>
>> i'd like to load up a page, say,
>>    http://landau.ucdavis.edu/psalzman/version.html
>> read the entire content into a variable, say,
>>    $output
>
>   use LWP::Simple;
>   $output = get('http://landau.ucdavis.edu/psalzman/version.html');
>
>--
>Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
>http://pobox.com/~jdf




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

Date: Sun, 11 Apr 1999 14:11:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Writers wanted for zine articles.
Message-Id: <3711101C.4EF11992@mail.cor.epa.gov>

Port Lord wrote:
> 
> Columbia 2032 (C2032) is looking for individuals who would like to write
> articles for our zine. Topics include: Phone systems (cellular/normal),
> Cryptography, IRC, TCP/IP, Programmiung,Information Warfare, Computer Security
> and just about anything pertaining to computers /or phones. We have been around
> approximately 10 months. We just released our biggest (93.4k) and best edition
> yet, which can be downloaded under 'library at www.homestead.com/c2032 . In our
> effort to expand our distribution, quality, and quantity of the zine, we are
> looking for more writers and or willing people to distribute the zine. Our
> subscribers and writers consist of people from within the hack/phreak community
> and professional individuals alike. Please send all responses to
> C2032@theglobe.com . We are a freelance zine so if it is money you want please
> dont respond.

Okay, will do.  I mean, won't do.

I'd rather try to get something in TPJ any day.

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Sun, 11 Apr 1999 18:05:17 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Y2K (yes, again - sorry!)
Message-Id: <FA1E8t.FnF@world.std.com>

bart.lateur@skynet.be (Bart Lateur) writes:

> I can't even imagine
>what part of Perl could even possibly not be Y2K compliant.

Versions of pod2man more than a couple of months old.

-- 
Andrew Langmead


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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