[12947] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 357 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 3 22:07:43 1999

Date: Tue, 3 Aug 1999 19:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 3 Aug 1999     Volume: 9 Number: 357

Today's topics:
    Re: [offtopic]RE:Quot St and the Jeop Gm (Abigail)
    Re: [was]Re: reg expression <llornkcor@earthlink.net>
    Re: Adding time (Martien Verbruggen)
    Re: Adding time (Abigail)
    Re: anyone have a copy of SWIG (Abigail)
    Re: Autovivification? <tchrist@mox.perl.com>
    Re: Autovivification? <makarand_kulkarni@my-deja.com>
    Re: Autovivification? <neal@nsdev.org>
    Re: Autovivification? <neal@nsdev.org>
    Re: Autovivification? <tchrist@mox.perl.com>
    Re: checking disk space (Abigail)
    Re: editing pdf files via perl (Abigail)
    Re: Escaping HTML tags (Abigail)
    Re: formular data problem with Active Perl/NT (Abigail)
    Re: Help Please (Abigail)
    Re: Help Please (Abigail)
    Re: help with find command (Abigail)
    Re: How can I know what modules are installed on server <Spam@IsBadForTheInternet.com>
    Re: How can I trap/block a kill -9 signal (Martien Verbruggen)
    Re: How to get across Proxy? <makarand_kulkarni@my-deja.com>
    Re: how to remove cr/lf ??? (Larry Rosler)
    Re: how to remove cr/lf ??? (elephant)
    Re: mySql & Perl -> Something simple (Larry Rosler)
    Re: OPEN3() Function (Martien Verbruggen)
    Re: perl s///e weirdism||bug (Abigail)
    Re: Printing Form output to another frame (elephant)
    Re: towards uploading binary files... (Abigail)
        Web Startup Seeks Help, Programmer <bisonman@optonline.net>
    Re: What's a good database module to use? (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 3 Aug 1999 20:19:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <slrn7qf571.s67.abigail@alexandra.delanet.com>

llornkcor@my-deja.com (llornkcor@my-deja.com) wrote on MMCLXIII September
MCMXCIII in <URL:news:7o754c$nc8$1@nnrp1.deja.com>:
## All I am trying to do, is to get those *perl-programmers* to have some
## compassion when replying. I could care LESS who wrote WHAT book. Get
## off your high horses. Please


*ploink*



Abigail
-- 
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
          for (??;(??)x??;??)
              {??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 03 Aug 1999 19:12:16 -0600
From: llornkcor <llornkcor@earthlink.net>
Subject: Re: [was]Re: reg expression
Message-Id: <37A79370.A09E05D@earthlink.net>

Abigail wrote:
>
> 
> Do you have any suggestions as what to put in my killfile that ignores
> them? Because, due to lack of a timemachine, first reading the posting
> and then ignoring them doesn't work.
> 
 
No, I haven't any suggestions for your killfile, but perhaps self
restraint 
might come in handy? Believe me, I know how you feel, when I am in my
own 
field of professions and expertise, having seen/heard quite some curious
questions. My favorite one is "At what altitude do deer turn into elk
?"-
but I digress. I just feel bad for people coming here for help, and
getting
dug into to read the FAQ. While I admit, is good advice, not everyone
has time,
nor wants to delve full throttle into the multitudes of perl FAQ's, to
find
one seemingly simple answer. When you, with your vast amount of perl
knowledge,
could give a solid answer in a line or two, but choose not too.
 	And about teaching... you teach here just by sharing your knowledge.

	Perhaps having an intermediate/advanced ng and a separate newbie perl
ng
might help. I dunno.
and by the way- Isn't there a module DATE::TimeMachine, yet???
LP



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

Date: Wed, 04 Aug 1999 01:11:44 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Adding time
Message-Id: <krMp3.140$m62.6115@nsw.nnrp.telstra.net>

In article <7o806u$rfr$1@news.vsnl.net.in>,
	"Murali V" <diffs@vsnl.com> writes:
> Hi,
> 
> How do I add 2 hours to the epoch time with perl.

Since epoch is normally 0:

my $two_hours_later_than_epoch = 0 + 2 * 3600;

If you mean the current time:

my $now = time();
my $later = $now + 2 * 3600;

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Think of the average person. Half of
Commercial Dynamics Pty. Ltd.       | the people out there are dumber.
NSW, Australia                      | 


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

Date: 3 Aug 1999 20:49:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Adding time
Message-Id: <slrn7qf70i.s67.abigail@alexandra.delanet.com>

Murali V (diffs@vsnl.com) wrote on MMCLXIII September MCMXCIII in
<URL:news:7o806u$rfr$1@news.vsnl.net.in>:
`` 
`` How do I add 2 hours to the epoch time with perl.


I am not sure I understand your question.

If you want to change the time of the epoch, that's impossible.  Perl
doesn't allow for timetravelling, and even if it does, and you would
travel back to Dec 31, 1969, how are you going to postpone the new year
by 2 hours?

Now, it could be that you want the time of 2 hours after epoch. But that's
so easy:
   $time_two_hours_after_epoch = 2 * 60 * 60;
that I hardly believe that this is your question.


But what is your question?




Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:50:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: anyone have a copy of SWIG
Message-Id: <slrn7qf71v.s67.abigail@alexandra.delanet.com>

ezzi (jcetek@ezzi.net) wrote on MMCLXIII September MCMXCIII in
<URL:news:7UDp3.231$Bl2.25519@typ12.nn.bcandid.com>:
$$
$$ do's anyone have a copy of Dave Beazley's SWIG.
$$ http://www.cs.utah.edu/~beazley/SWIG  do's not work.


And you expect a copy will work?


You must be a believer!



Abigail
-- 
perl -wlpe '}{$_=$.' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 19:06:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Autovivification?
Message-Id: <37a79211@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Neal Sanche <neal@nsdev.org> writes:
:I'm running perl 5.004_04, which may be somewhat behind the times, but I
:think this 'effect' still exists. It is similar to some entries in the
:FAQ, but I'm still not sure why this is happening. Can someone explain
:it to me?

When you use the -> dereferencing arrow (or its equivalent)
on hashes or arrays, you get autovivification irrespective of
the lvalue or rvalue context.

Behold:

    undef $r;
    defined $r->{fred};
    print $r;

HASH(0x80d3f8c)

--tom
-- 
    "If you only have a nail, you tend to see every hammer as a problem."
    	--Larry Wall


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

Date: Wed, 04 Aug 1999 01:29:56 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Autovivification?
Message-Id: <7o852c$f9n$1@nnrp1.deja.com>

[  Neal Sanche <neal@nsdev.org> wrote: ]
> think this 'effect' still exists. It is similar to some entries in the

What 'effect' exists ?


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 04 Aug 1999 01:55:21 +0000
From: Neal Sanche <neal@nsdev.org>
Subject: Re: Autovivification?
Message-Id: <37A79D89.AA0E396C@nsdev.org>

Tom Christiansen wrote:

> When you use the -> dereferencing arrow (or its equivalent)
> on hashes or arrays, you get autovivification irrespective of
> the lvalue or rvalue context.
>
> Behold:
>
>     undef $r;
>     defined $r->{fred};
>     print $r;
>
> HASH(0x80d3f8c)

Okay, but how is this useful? It seems odd to me that the simple act of
checking whether a value is defined causes something else (unintended or
not) to be defined instead. If there is a good reason for it, that's fine
with me. It's certainly something to watch out for, because careless
programmers can sometimes cause these things to happen.

Thanks for the prompt response, and the courtesy cc.

-Neal

--
+-------- Neal Sanche +----+ [ neal@nsdev.org ] +------ ICQ 5516171 ------+
 Pryor's Observation:
        How long you live has nothing to do
        with how long you are going to be dead.





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

Date: Wed, 04 Aug 1999 02:05:37 +0000
From: Neal Sanche <neal@nsdev.org>
Subject: Re: Autovivification?
Message-Id: <37A79FF1.49593546@nsdev.org>

Makarand Kulkarni wrote:

> What 'effect' exists ?

Well, the effect of the following line:

   if (defined $WOW{here}{not}) {
   }

Is that, $WOW{here} becomes defined automatically, even if it was
previously undefined. Sometimes I wish that it wouldn't do that.

-Neal

--
+-------- Neal Sanche +----+ [ neal@nsdev.org ] +------ ICQ 5516171 ------+

 Adapt.  Enjoy.  Survive.





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

Date: 3 Aug 1999 20:02:00 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Autovivification?
Message-Id: <37a79f18@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Neal Sanche <neal@nsdev.org> writes:
:>     undef $r;
:>     defined $r->{fred};
:>     print $r;
:> HASH(0x80d3f8c)
:
:Okay, but how is this useful? It seems odd to me that the simple act of
:checking whether a value is defined causes something else (unintended or
:not) to be defined instead. 

Yes, I understand what you're saying.  By the time you get
to defined(), it's *too late*.  The expression has already been
evaluated, and the side-effect of that evaluation is to autovivify.
Note of course that the {fred} element has not been created.
There's really very little choice.  Although defined() has a few
tricks up its sleeve, it's nothing at all like what you want.
It's not special is the point.  It's just a function.  Any function
does this.

    undef $r;
    int $r->{fred};
    print $r;
HASH(0x80d3f8c)

Heck, so does this:

    undef $r;
    $r->{fred};
    print $r;
HASH(0x80d3f8c)

It's not defined().  defined() happens way too late in the game for
this to matter.  It's the arrow.  When you say to follow a pointer,
Perl makes sure you do, filling it in as needed.  That's why the very
first line of your program can be

    $hash{this}{that}{these}{those}{theirs} = 23;

Because that's really:

    $hash{this}->{that}->{these}->{those}->{theirs} = 23;

So you get your autovivication.

I don't necessarily expect you to like it, just understand it.
And consider what you'd lose without it.

--tom
-- 
 Freedom of the press belongs to those who own one.
	 --chip@tct.com (Chip Salzenberg) in what-is-usenet/part1


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

Date: 3 Aug 1999 20:52:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: checking disk space
Message-Id: <slrn7qf76n.s67.abigail@alexandra.delanet.com>

David (dkm@cs.bham.ac.uk) wrote on MMCLXIII September MCMXCIII in
<URL:news:Pine.SOL.3.96.990803134802.8032A-100000@dipsy>:
~~ 
~~ I am trying to write a simple script which will check how much space is
~~ left on a drive and give me a message or mail me when it reaches close to
~~ its capacity, any surgestions?


open (DF, "df -k |") or die $!;

while (<DF>) {
   parse the lines, find the one your interested in,
   mail yourself if over critical region.
}

close DF or die $!;


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:54:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: editing pdf files via perl
Message-Id: <slrn7qf7a0.s67.abigail@alexandra.delanet.com>

soumitra557@my-deja.com (soumitra557@my-deja.com) wrote on MMCLXIII
September MCMXCIII in <URL:news:7o6glf$85b$1@nnrp1.deja.com>:
!! Hello.
!! I have a pdf file .
!! I want to change some string within the file.
!! i.e. say the text in the pdf file has "abc woke up at 09 a.m."
!! I want to make it
!! "abc woke up at 11 a.m."
!! Is there a perl program which can do this for me.

perl -pi -we 's/abc woke up at 09 a\.m\./abc woke up at 11 a.m./' file.pdf




Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:57:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Escaping HTML tags
Message-Id: <slrn7qf7ep.s67.abigail@alexandra.delanet.com>

Karl Ahlin (karah@ida.liu.se) wrote on MMCLXIII September MCMXCIII in
<URL:news:37A6BBD5.7070E004@ida.liu.se>:
\\ 
\\ Is there a way to escape HTML tags? I want the browser to display the
\\ actual HTML tags, not interpret them and display their output. In other
\\ words, I want <IMG SRC="blabla.gif"> to be translated to &lt;IMG
\\ SRC=&quot;blabla.gif&quot;&gt;. Of course I can do this on my own, I was
\\ just wondering if there is a subroutine or package already available
\\ somewhere?


You're looking for a subroutine that does the work of a 10 char Perl program?



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:59:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: formular data problem with Active Perl/NT
Message-Id: <slrn7qf7ij.s67.abigail@alexandra.delanet.com>

Andre Probst (ap@andre-probst.de) wrote on MMCLXIII September MCMXCIII in
<URL:news:37A6F486.747D6269@andre-probst.de>:
[] 
[] read( STDIN, $buf, $ENV{'CONTENT_LENGTH'} );
[] %FELDER = &parse_cgi( $buf );

Why do people insist on using read the wrong way? Did you actually
bother to look up what read() garantees to do?

[] Under LINUX all works fine, under Active Perl for NT the formular
[] data which is received by the perl-script is always empty.

How would you know if you use read() in this way?


use CGI or suffer;


Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:35:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help Please
Message-Id: <slrn7qf64p.s67.abigail@alexandra.delanet.com>

Chris Wilkinson (chris.wilkinson@jacobsrimell.com) wrote on MMCLXIII
September MCMXCIII in <URL:news:37A6DA53.93C13842@jacobsrimell.com>:
() 
() This is the username and password for an application where the scripts
() needs to get some data from. Now what I want to do is to be able to
() prompt for a username and then a password instead of having it hardcoded
() into the script

RTFM. It's there.




Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:42:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help Please
Message-Id: <slrn7qf6jf.s67.abigail@alexandra.delanet.com>

Chris Wilkinson (chris.wilkinson@jacobsrimell.com) wrote on MMCLXIII
September MCMXCIII in <URL:news:37A70112.340BAAC0@jacobsrimell.com>:
|| Before anyone starts getting annoyed at me for replying to my own post, I
|| may be new to Perl but im not new to Usenet and know that some people get
|| rather anal about it all.
|| Seeing no-one has answered my request for help I will presume that my
|| problem is too trivial for people to bother about. All I wish to know is
|| what lines of code are needed to send a Prompt to the screen saying please
|| enter username and then store this value in a variable.
|| 
|| I have noted with interest the arguing that is going on within this group
|| and get the feeling that newbies like myself are not welcome ( unlike other
|| groups I post to where I will happily help anyone with a problem)  if that
|| is the case then fair enough but maybe the group name should be changed to
|| comp.lang.perl.misc.EXPERTS_ONLY


Let's see, you ask a question whose answer is found in the manual, and
you get annoyed you haven't received an answer in the 2h 45m after you
posted it - so you're joining the morons who just whine, whine, whine?

And you claim not to be new to Usenet?


I think you're a troll. A bad, sticking troll, with rotten teeth.


Welcome to my killdungeon.



*ploink*



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 21:02:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: help with find command
Message-Id: <slrn7qf7o2.s67.abigail@alexandra.delanet.com>

mr_potato_head@my-deja.com (mr_potato_head@my-deja.com) wrote on MMCLXIII
September MCMXCIII in <URL:news:7o7nvu$692$1@nnrp1.deja.com>:
 .. Hi,
 ..    Can anyone tell me how to convert this csh command line into perl so
 .. I can put it in my perl script?  Thanks in advance...
 .. 
 .. find /u1 -name "*99*" -mtime +3 -exec rm -r {} \;


system 'find /u1 -name "*99*" -mtime +3 -exec rm -r {} \;';



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 3 Aug 1999 20:50:16 -0500
From: "99% Energy" <Spam@IsBadForTheInternet.com>
Subject: Re: How can I know what modules are installed on server?
Message-Id: <l_Mp3.4571$k8.181137@newscene.newscene.com>

In your striving for perfect internet etiquette you forget the main point of
the internet in the first place: comunication. It is much more effective to
comunicate putting what you are writing on top of the message because that
is what your reader wants to see first, specially if it the thread has been
all read before.

Also you tend to generalize too much, dismissing people as lusers, morons,
or newbies. You can never know who is on the other side of the line. I am
not trolling, read the header message. I asked a perfectly legitimate Perl
question. Fortunately I got a good reply from Ray Cadmus answering perfectly
what I needed. Unfortunately I got some other replies from "Abigail" calling
me a moron and other flaming stuff, that is why this thread got out of
subject line :-(

I don't care if you get so offended because I include the quoting or after.
I have been frustrated finding a very interesting replying post and not
knowing what was the original post, a very common occurance in newsgroups.


99%
Malcolm Ray <M.Ray@ulcc.ac.uk> wrote in message
news:slrn7qevmu.1ao.M.Ray@carlova.ulcc.ac.uk...
> On 3 Aug 1999 15:53:06 -0500, 99% Energy <Spam@IsBadForTheInternet.com>
wrote:
> >I don't think is such a bad idea to quote the entire article when
replying
> >in newsgroups. A lot of NNTP servers don't get all the messages so its
nice
> >to see what the reply is about when you don't get the whole thread.
>
> How thoughtful.  Perhaps you could consider including the text of the
> previous half-dozen messages too, when they help to establish context.
>
> >I also always put the reply before the quote because its a nuisance to
have
> >to scroll to the bottom, specially in long messages, for both replying
and
> >seeing the message. The quote is mostly for the benefit of those who
haven't
> >seen the whole thread as I explained in the first paragraph.
>
> The quality of the trolls certainly is declining around here.  Bring
> back topmind!
>
> Then again, maybe you're for real.  I recently replied (by mail) to a
> query from a user, quoting the appropriate parts of his message in
> the sensible way.  He didn't reply for more than a week, though it was
> supposedly an urgent matter.  When he did so, he said "sorry for not
> replying sooner, but I didn't see your reply because I'd have had to
> scroll".  That's the danger of this ridiculous arse-about-face quoting
> style.  The lusers become conditioned to regard quoted text as something
> they can ignore.  As soon as they see it, they think "duh, I can stop
> reading now", and both their neurons shut down.  I wonder whether this
> could be exploited for subliminal advertising?
> --
> Malcolm Ray                           University of London Computer Centre




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

Date: Wed, 04 Aug 1999 01:05:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How can I trap/block a kill -9 signal
Message-Id: <jlMp3.136$m62.6115@nsw.nnrp.telstra.net>

In article <x3yyafsd4iy.fsf@tigre.matrox.com>,
	Ala Qumsieh <aqumsieh@matrox.com> writes:
> 
> "Ming" <fungs@logica.com> writes:
> 
>> Does anyone out there know how to trap/ignore a 'kill -9' signal for a Perl
>> process.
> 
> You need to have a look at the %SIG special hash. It is documented in
> perlvar. You should be interested in trapping the INT signal.

On which OS does SIGINT map to 9 :)? It is more likely that SIGKILL is
meant here, and that is untrappable on most OS's, as has been
explained in many other messages in this thread..

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: Wed, 04 Aug 1999 01:48:48 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: How to get across Proxy?
Message-Id: <7o865u$g2h$1@nnrp1.deja.com>

[ Srinivas Gorty <srinivas.gorty@sabre.com> wrote: ]
> I cannot get past our proxy server. Can someone tell me how to send
> authentication information to the proxy? I am using the

Try using LWP::UserAgent and LWP::AuthenAgent.
LWP::AuthenAgent is a simple subclass of LWP::UserAgent to allow the
user to type in username / password information if required for
autentication.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 3 Aug 1999 18:19:50 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how to remove cr/lf ???
Message-Id: <MPG.12113511d25df20c989dac@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <MPG.1212374efd7b559c989bd5@news-server> on Wed, 4 Aug 1999 
10:41:43 +1000, elephant <elephant@squirrelgroup.com> says...
> Larry Rosler writes ..
> >That is contrary to my experience and expectation.  How did you check 
> >the files?  If you used a Perl program, unless you binmode()ed the 
> >files, the I/O system will convert CR+LF to LF.
> 
> excellent .. my own stupid mistake .. thanks for that (it was also 
> contrary to my expectation - but I thought I'd tested it *8^)
> 
> however .. I'm still confused by my second test .. because isn't perl 
> meant to map "\n" to whatever line ending character sequence it is that 
> the operating system uses ?

<SNIP of confusion>

> don't worry .. I've just experimented myself out of my black hole .. the 
> transformation is only done on the read/write to a textual filehandle .. 
> and the transformation is not done on "\n" but rather on the LF character 
> itself ..

The internal representation of "\n" *is* the LF character itself (on 
Unix and Windows/DOS; in MacPerl it's the CR character; I won't speak 
for any other OSes).  But you seldom need to know more than that it is a 
single /\s/ character.

>            so that even
> 
>   print TEXTFILEHANDLE "one\015\012";
> 
> will output
> 
> one\015\015\012
> 
> to the file in question .. in which case - I'd have to say that the 
> perlop section is lacking - probably ActiveState's fault more than 
> anyone's - there's no mention of line ending characters in the win32 FAQs

There is a very weird documentation bug in the ActiveState distribution, 
at least through Build 517.  I haven't downloaded Build 518 yet to see 
if it is fixed.  I sent them a bug report recently, but haven't heard a 
response.

The bug is that their version of perltoc.html has no entry for perlport 
(of all things to omit!).  Edit .../perl/html/perltoc.html and duplicate 
and edit the entry for perlpod to include perlport.  Then reload it and 
look at the first entry in perlport:  ISSUES  Newlines.  Voilą -- it's 
all there!

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


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

Date: Wed, 4 Aug 1999 10:43:34 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: how to remove cr/lf ???
Message-Id: <MPG.121237c2b080e412989bd6@news-server>

[ item posted to comp.lang.perl.misc and CCed to Philip 'Yes, that's my 
address' Newton ]

Philip 'Yes, that's my address' Newton writes ..
>If you run NT, then yes. Of course. NT, Win9* and DOS all use crlf for
>line endings. Linux (and (?:Free|Net)BSD, BSD386, Solaris, AIX, etc.)
>don't; they use lf only. (Yes, there was an AIX for IBM's PS/2
>machines.)

you are right here Philip .. the test that I performed was stupidly wrong 
 .. my apologies

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Tue, 3 Aug 1999 18:27:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: mySql & Perl -> Something simple
Message-Id: <MPG.121136d66c6161c9989dad@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7o822a$db5$1@nnrp1.deja.com> on Wed, 04 Aug 1999 00:38:35 
GMT, Makarand Kulkarni <makarand_kulkarni@my-deja.com> says...
> 
> [ your code...]
> while (my @data = $sth->fetchrow_array)
>      {
>       print "<tr>";
>       foreach $col (@data)
>          {
>           print "<td align=left>$col</td>";
>           }
>        print "</td>\n"; # @@
> }
> [ your code ends..]
> 
> Don't you want to print </TR> tag in the last print stmt marked
> with @@ ?

This is off-topic, but the </TD>, </TH>, and </TR> tags are all 
optional.  So the </TD> there is just HTML noise.

By the way, let me take this opportunity to note that in contrast to 
many new people who overquote, you are consistently underquoting.  For 
example, much of the above is a quote from someone else, but is neither 
attributed nor indented properly.  Even the stinking Deja.com 
'newsreader' should be configurable to do better than that.

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


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

Date: Wed, 04 Aug 1999 01:08:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: OPEN3() Function
Message-Id: <LoMp3.138$m62.6115@nsw.nnrp.telstra.net>

In article <37A6FA32.507B8285@hp.com>,
	Greg Guerin <gregory_guerin@hp.com> writes:
>               Does anyone know where I can find information on the open3
> function or have a sample of code that uses it?  Thanks in advance.

Books are not always the best source of information, and in the case
of perl, the documentation that comes with it should always be the
first and the last place you look. In between you can use books :)

# man IPC::Open3
# perldoc IPC::Open3

I see that you use some NT thingy to post your articles: In case you
have the Activestate perl installed, the documentation is also
available as html on your local harddisk.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | We are born naked, wet and hungry. Then
Commercial Dynamics Pty. Ltd.       | things get worse.
NSW, Australia                      | 


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

Date: 3 Aug 1999 20:28:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl s///e weirdism||bug
Message-Id: <slrn7qf5om.s67.abigail@alexandra.delanet.com>

Andrew Cannon (acannon@spam.sr.hp.com) wrote on MMCLXIII September
MCMXCIII in <URL:news:37A73A1F.B7511A30@spam.sr.hp.com>:
?? test.C contains the following:
?? 
?? //        $Author:$
?? //        $Source:$
?? //        $Date:$
?? //        $Revision:$
?? void main() {
?? test=1;
?? }
?? 
?? execute on the command line the following:
??     perl -pi -e 's/(test=)(\d+);.*$/print $1.($2+1).";"/e' test.C
?? 
?? test.C now contains
?? //        $Author:$
?? //        $Source:$
?? //        $Date:$
?? //        $Revision:$
?? void main() {
?? test=2;1
?? }
?? 
?? I have tried adding more parenthesis to control the execution flow,
?? but I get the same result.  If this is not a bug, can someone explain
?? where the extra 1 comes from.

That's the return value of print, which is the replacement of your s///e.

What you want is:

       perl -pi -e 's/(test=)(\d+);.*$/$1.($2+1).";"/e' test.C

Now the replacement is 'test=2;', and no extra 1 will result.


Abigail
-- 
Whee, someone posting a good question. It includes code, data, the
result of the code, and what was expected.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 4 Aug 1999 10:56:18 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Printing Form output to another frame
Message-Id: <MPG.12123ac0e7ddbf3989bd8@news-server>

hads6307@my-deja.com writes ..
>I have a question and would appreciate some help
>on the use of a CGI script written in perl to
>take a simple input from a left frame form submit
>and have that input print out to the right frame.

if you can do this then you can't do it from the server side .. the 
client will need to tell the script which frame to use as the target for 
the output .. IF it can be done (I can't be bothered testing)

you might get away with something like

<form method="POST" action="/cgi-bin/yourscript" target="right_frame">

as you can see - this is not a perl question .. followups set

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 3 Aug 1999 20:33:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: towards uploading binary files...
Message-Id: <slrn7qf61j.s67.abigail@alexandra.delanet.com>

irf@netexecutive.com (irf@netexecutive.com) wrote on MMCLXIII September
MCMXCIII in <URL:news:7o7c2d$t0l$1@nnrp1.deja.com>:
%% hi i am relatively new to perl & :

You are new to colons?

%% to upload binary files (eg, gif etc), i tried using this code:
%% (data comes from an <INPUT TYPE=FILE> element)
%% ----------------------------------------------
%% read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
%% $dat=$buffer;

THAT IS WRONG!

What if you don't read enough?  Why don't you use 'use CGI;'?

%% #these next lines to get rid of data that is not part of the file
%% $dat=~s/.*\n.*\n.*\n//;
%% $dat=~s/\-+\d+\-+//;
%% $dat=~s/\n//g;
%% $dat=~s/\r//g;
%% 
%% print "Content-type: image/gif\n\n";
%% print $dat;
%% -------------------------------------------
%% funnily enough, the gif's size is retained but the image does not
%% come through. (i get a correct bounding-box, but broken image icon).
%% also, if i save it, the new file size is smaller than it should be.


Are you sure your substitutions on $dat are valid? Which spec do you
use that tells you that those substitutions give you a valid gif image?




Abigail
-- 
perl -wlne '}{print$.' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 04 Aug 1999 01:45:30 GMT
From: Dave <bisonman@optonline.net>
Subject: Web Startup Seeks Help, Programmer
Message-Id: <37A79A6A.548FA0C6@optonline.net>

Can you help?

          We are an independent development group based in NYC with an
outstanding web site concept, sound business plan, professional
experience, and the hungerto succeed.

          What's missing? An expert programmer (HTML, JAVA, CGI, SQL...)
who is like us: young, driven, and willing to go the extra mile to make
our dream into a reality.

          We're looking for an adventurous (and NYC-area based) soul who
would be willing to provide expertise in exchange for equity. Each
member of the team has pledged the same.  Our previous programmer turned
out to be a dud, and we need help quick!!!

          Can you help us find that person?

          If so, please respond to info@wrestlestock.com.

          Your assistance is greatly appreciated.

          Sincerely,

          Team WS
          www.WrestleStock.com



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

Date: 3 Aug 1999 20:13:50 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: What's a good database module to use?
Message-Id: <slrn7qf4r4.s67.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXIII September
MCMXCIII in <URL:news:37a6f452@cs.colorado.edu>:
??      [courtesy cc of this posting mailed to cited author]
?? 
?? In comp.lang.perl.misc, 
??     gmiller@iglou.com (Greg Miller) writes:
?? :	So what packages are availalble which don't require telnet to
?? :install them
?? 
?? This makes so little sense to me I cannot begin to know what you need
?? to do.
?? 
?? I don't mean to be harsh, but perhaps you should get real access to a
?? real computer.  This whole "strange-action-at-a-distance" model that even
?? moderately usable ISPs impose on Prisoners of Bill is no less painful than
?? was the situation when we'd dutifully surrender our cards to the mainframe
?? operators, and then the following day, receive a continuous-feed printout
?? showing nothing worked.  Then we give them reordered cards, and the day
?? following, get back more futile printouts.  I would rather be a cook
?? than work under those conditions.  I'm surprised anybody puts up with it.


I've never heard of an ISP that says "oh, you're running AIX at home?
We'll make an exception, and give you telnet access and access to a C
compiler".

Either you have an ISP that gives you full access, or you have one that
doesn't. Regardless of what you are running at home.

If I were an ISP, I wouldn't give my clients full access either, unless
they pay for it; or I knew them and know they are competent and trustworthy.



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

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

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


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