[13293] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 703 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 2 14:07:21 1999

Date: Thu, 2 Sep 1999 11:05:13 -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           Thu, 2 Sep 1999     Volume: 9 Number: 703

Today's topics:
    Re: :)) <aqumsieh@matrox.com>
    Re: A concatenation problem... <Allan@due.net>
        Console Navigation. Reverse line-feed? <joneill@pgicompanies.com>
    Re: Console Navigation. Reverse line-feed? <gellyfish@gellyfish.com>
    Re: Counting duplicate list elements in Perl (Matthew David Zimmerman)
    Re: Counting duplicate list elements in Perl <crdevilb@mtu.edu>
    Re: Counting duplicate list elements in Perl <aqumsieh@matrox.com>
    Re: EMPLOYMENT: Perl/Web Developer <aqumsieh@matrox.com>
        END blocks and STDERR (Bill Moseley)
    Re: Equivalence <garethr@cre.canon.co.uk>
        Free Client/Server Windows NT Authentication script <louis@alten.net.nospam>
    Re: IPC::open2 duplicates output (I.J. Garlick)
        Life span of other modules variables (T. Alex Beamish)
    Re: Need "Universal" exporter.pm File <aqumsieh@matrox.com>
    Re: Need your help here. <arunas@an!m.org>
    Re: newbi needs help (Bill Moseley)
    Re: Perl vs. Samba <craig@ariel.hq.group.com>
    Re: Perl5 sendmail (John Casey)
    Re: Perl5 sendmail (John Casey)
        SCRIPTS!! <jwanla@my-deja.com>
        Sendmail fading away? (was  Re: Perl5 sendmail) <AgitatorsBand@yahoo.com>
    Re: shebang question for Win32 Perl/Apache <see.email.address@bottom.in.sig>
        Size <jimmy@blackhole-designs.com>
    Re: Size <jimmy@blackhole-designs.com>
    Re: Size (Larry Rosler)
    Re: Size (Bill Moseley)
    Re: SSL and Perl (Villy Kruse)
    Re: standalone perl apps on win/mac? (Henry Penninkilampi)
        symbolic reference <scmpoper@scmp.com>
    Re: Use of push when building an array? <aqumsieh@matrox.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Thu, 2 Sep 1999 11:32:24 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: :))
Message-Id: <x3yogflwcqf.fsf@tigre.matrox.com>


but86@my-deja.com writes:

> Thanks a lot!
> That was more I was ever expecting...
> 
> I will try this out as soon as I can.
> 
> :)
> Werner

	[I bet no body knows what you're talking about, 
	 so I might as well take credit for it :)    ]

You're welcome. I went to great lengths to provide such an answer. It
wasn't easy, but I managed to do it.

--Ala



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

Date: Thu, 2 Sep 1999 11:10:12 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: A concatenation problem...
Message-Id: <7qm46m$934$1@nntp3.atl.mindspring.net>

William wrote in message <7qm1v4$i74$1@nnrp1.deja.com>...
:I just only want to add "<" and ">" in the beginning and
:in the end of a string. But, for some reason, just don't works... Look
:this code piece:
:
:$a = "\<$_[0]\>";
:or
:$a = "\x3c$_[0]\x3e";
:or
:$a = "\<" . $_[0] . "\>";
:But don't works at all... In fact, I skip this problem by using another
:solution, but this don't go out my mind. How can I solve this?

What?  You don't need the extra escapes in examples 1 or 3 but they all
work.

#!/usr/local/bin/perl -w
use strict;
sub angles {
 my $a = "<$_[0]>";
 print $a;
 $a = "\x3c$_[0]\x3e";
 print $a;
 $a = "<" . $_[0] . ">";
 print $a;
}
angles('what');

__END__
Gives:
<what><what><what>

HTH

AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
People get annoyed when you try to debug them.
 - Larry Wall.




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

Date: Thu, 02 Sep 1999 15:52:28 GMT
From: "joneill" <joneill@pgicompanies.com>
Subject: Console Navigation. Reverse line-feed?
Message-Id: <03xz3.2063$LL2.18325@c01read02-admin.service.talkway.com>

So there's the characters \a, \b, \n, \t etc. for doing various things
at the command console. Is there a reverse line-feed escape character
or any way to get that kind of result? I am processing data, and would 
like to keep track of status on several different lines. ex:

record counter: 000001 <--- updated for every new record
adding... abcd123      <--- indicator of when a new group is added

How do I do this?

Jay O'Neill
PGI Companies
--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).



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

Date: 2 Sep 1999 17:11:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Console Navigation. Reverse line-feed?
Message-Id: <37cea1a2_1@newsread3.dircon.co.uk>

joneill <joneill@pgicompanies.com> wrote:
> So there's the characters \a, \b, \n, \t etc. for doing various things
> at the command console. Is there a reverse line-feed escape character
> or any way to get that kind of result? I am processing data, and would 
> like to keep track of status on several different lines. ex:
> 
> record counter: 000001 <--- updated for every new record
> adding... abcd123      <--- indicator of when a new group is added
> 

Depending on what kind of system you are on you might want to use the
module Term::Cap or Term::Screen  or Win32::Console if you are using that.

/J\
-- 
"Like Anne Robinson in a Korean restaurant, it'll be dog eat dog" -
Graham Norton


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

Date: 2 Sep 1999 16:29:04 GMT
From: mdz4c@node10.unix.Virginia.EDU (Matthew David Zimmerman)
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <7qm8kg$b0h$1@murdoch.acc.Virginia.EDU>

Uri Guttman  <uri@sysarch.com> wrote:
>>>>>> "MDZ" == Matthew David Zimmerman <mdz4c@node5.unix.Virginia.EDU> writes:
>
>  MDZ> Uri Guttman  <uri@sysarch.com> wrote:
>  >> perl -lne '$c{$_}++;END{print "$_,$c{$_}" for sort keys %c}'
>
>  MDZ>  perl -lne '$c{$_}++}{print "$_,$c{$_}" for sort keys %c'
>
>  MDZ> Hey, it's only four strokes, but I'll take what I can get. :)
>
>using the trick of }{ to close the -n loop block is not allowed anymore
>in the official rules of the professional perl golf association.
>use it again and you will be banned from all perl golf tournaments for a
>year.

Ah, but I'm still an amateur, and the rules are more relaxed on the
amateur circuit. We have mulligans and gimmies too. :)

Seriously, I've only been lurking here for 4 or 5 months, and I haven't
seen anything here or archived on dejanews about the '}{' thing, mainly
because deja.com's search engine chokes and dies on '}{'. Is there a
codified set of rules for the PPGA tour, and if there isn't, oughtn't we
(or, actually, you) make some?

--Matt
this probably means I can't drive a cart either, doesn't it?
-- 
Matthew Zimmerman ------------  http://www.people.virginia.edu/~mdz4c
Interdisciplinary Biophysics Program --------- University of Virginia
| "You got to be very careful if you don't know where you're going, |
| because you might not get there."                   -- Yogi Berra |


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

Date: 2 Sep 1999 16:52:05 GMT
From: Colin R. DeVilbiss <crdevilb@mtu.edu>
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <7qm9vl$mmv$1@campus1.mtu.edu>

charlie1009@my-deja.com wrote:
> For example, the list

> apple
> orange
> cherry
> cherry
> tomato
> apple
> cherry

> should sort to:

> apple,2
> cherry,3
> orange,1
> tomato,1

counting occurences of something is a readymade job for a hash.

#!/usr/bin/perl

@list = qw/apple orange cherry cherry tomato apple cherry/;
my %hash;

for $item (@list) {
    ++$hash{$item};
}

for $item (sort keys %hash) {
    print "$item,$hash{$item}\n";
}
__END__

will do the trick.

Colin


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

Date: Thu, 2 Sep 1999 12:11:25 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Counting duplicate list elements in Perl
Message-Id: <x3ylnapwaxe.fsf@tigre.matrox.com>


"Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net> writes:

> Uri Guttman wrote:
> > 
> > a little perl golf here
> > 
> > perl -lne '$c{$_}++; END{print "$_,$c{$_}" for sort keys %c}'
> 
>   perl -lne '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'
> 
> Four fewer strokes! (And no closing -n loop with }, either!) Do I get a
> prize? (Tested, too!)

Is this considered valid Perl Golf:

	% alias p perl -nle
	% p '$c{$_}++;END{print"$_,$c{$_}"for sort keys%c}'

Eight (yes 8!!!) fewer strokes. That's VERY close to a hole in one!

:-)

--Ala



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

Date: Thu, 2 Sep 1999 10:52:55 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: EMPLOYMENT: Perl/Web Developer
Message-Id: <x3ypv01wek8.fsf@tigre.matrox.com>


hrdept@my-deja.com writes:

> #!/usr/bin/perl

You should be using '-w' and the strict pragma :-)

--Ala



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

Date: Thu, 2 Sep 1999 08:48:52 -0700
From: moseley@best.com (Bill Moseley)
Subject: END blocks and STDERR
Message-Id: <MPG.12383c3d5933915e9896f7@nntp1.ba.best.com>

I typically open STDERR to a file, and use that file as a lock file.

One problem is that the lock is on for the entire run time of the 
program, even if it is only needed to write a message or two during the 
program.

To limit the amount of time the lock is in place I could write all my 
log messages to a scalar, say $log_messages, and then write 
$log_messages to the file at the very end of the program, perhaps in an 
END block.

Questions:

1) Can I easily capture all STDERR messages (e.g. warnings) into my 
$log_message?  I guess I'd have to tie STDERR somehow.  (pointers, 
please?)

2) Should I open() and flock() my file in the END block, or would it be 
better to open() the file in a BEGIN and then flock and write 
$log_message in the END block.  This would be to catch any STDERR 
messages that I couldn't capture during the execution of the program.

3) My END block would be in a module of the program.  Any way to make 
this module's END block execute later than all other END blocks?

4) I assume the END blocks don't get called if running a script under 
mod_perl.  Anyone know if this is true?



Thanks,

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Thu, 2 Sep 1999 15:09:07 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: Equivalence
Message-Id: <si906pqrjg.fsf@cre.canon.co.uk>

SG <sg@midwal.ca> wrote:
> I'd like to create something like FORTRAN's "equivalence" statement:
> 
>   DIMENSION ARRAY(2)
>   EQUIVALENCE (ARRAY(1), A)
>   EQUIVALENCE (ARRAY(2), B)
> 
> In this case A and ARRAY(1) will point to the same memory location, so
> A = 1 and ARRAY(1) = 1 are equal actions.  How can I create the same
> structure in perl?

This is a job for a tied scalar.  See the `perltie' manpage for the
details.  Here's an example:
  
    package ArrayElement;

    sub TIESCALAR {
      my ($class, $array, $element) = @_;
      bless [ $array, $element ], $class;
    }

    sub FETCH {
      my ($self) = @_;
      my ($array, $element) = @$self;
      $array->[$element];
    }

    sub STORE {
      my ($self, $new) = @_;
      my ($array, $element) = @$self;
      $array->[$element] = $new;
    }

    package main;

    @ARRAY = qw(foo bar);
    tie $A, ArrayElement => \@ARRAY, 0;
    tie $B, ArrayElement => \@ARRAY, 1;

-- 
Gareth Rees


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

Date: Thu, 2 Sep 1999 12:30:01 +0100
From: "LA" <louis@alten.net.nospam>
Subject: Free Client/Server Windows NT Authentication script
Message-Id: <Hmyz3.73$7K2.5964@typhoon01.swbell.net>

My question is, why do the following scripts work locally, on my standalone
NT box, but when I try to put the NT server script on an NT machine logged
onto an NT domain, no users are validated? (the user rights of the account
running the script are correct AFAIK)

Does the server script need to run on an NT server? on a BDC? a PDC?

Thanks,

Louis

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

A typical exchange runs like this (server responses are preceded by --> ):

USER
-->Received USER cmd
 <username>
-->Received username
PWD
-->Received PWD cmd
<password>
-->User authenticated (or -->User rejected)

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

#
# NT Authentication Server version 1.0
#
# by Louis Alten
#

use IO::Socket;
use Win32::AdminMisc;

#-----------------------------------------
# Server configuration

$addr = 'enter.your.address.here';
$port = 8012;
$domain = 'YOURDOMAIN';
#-----------------------------------------

$sock = new IO::Socket::INET ( LocalAddr => $addr,
    LocalPort => $port,
    Proto   => 'tcp',
    Listen   => 5,
    Reuse   => 1
    );
die "Socket could not be created. Reason: $!\n" unless $sock;

while ($new_sock = $sock->accept())
 {
 while (defined (chomp($buf = <$new_sock>)))
  {
  if ($buf eq 'USER')
   {
   print $new_sock "Received USER cmd\n";
   chomp ($user = <$new_sock>);
   print $new_sock "Received username\n";
   chomp ($buf = <$new_sock>);
   if ($buf =~ 'PWD')
    {
    print $new_sock "Received PWD cmd\n";
    chomp ($pwd = <$new_sock>);
    if (Win32::AdminMisc::LogonAsUser ($domain,$user,$pwd))
     {
     Win32::AdminMisc::LogoffAsUser ();
     print $new_sock "User validated\n";
     }
    else
     {
     print $new_sock "User rejected\n";
     }
    } # if ($buf eq 'PWD')
   else
    {
    print $new_sock "Received $buf - expecting PWD\n";
    }
   } # if ($buf eq 'USER')
  else
   {
   print $new_sock "Received $buf - expecting USER\n";
   }
  } # while (defined ($buf = <$new_sock>))
 } # while $new_sock = ($sock->accept())
close($sock);

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

#
# NT Authentication Client Version 1.0
#
# by Louis Alten
#

use IO::Socket;

#-----------------------------------------
# Client configuration

$addr = 'your.hostname.here';
$port = 8012;
#-----------------------------------------

$sock = new IO::Socket::INET (PeerAddr => $addr, PeerPort => $port, Proto =>
'tcp');
die "Socket could not be created. Reason: $!\n" unless $sock;

while (<STDIN>) {
 print $sock $_;
 $response = <$sock>;
 print $response;
}
close ($sock);




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

Date: Thu, 2 Sep 1999 17:30:30 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: IPC::open2 duplicates output
Message-Id: <FHG0Mu.L0x@csc.liv.ac.uk>

In article <37CE23FD.F6B70E86@euenet.uni-duisburg.de>,
Joerg Honerla <honerla@euenet.uni-duisburg.de> writes:
> 
> I've tested a simple example from the perlipc man page
> 
>           use FileHandle;
>           use IPC::Open2;
> 
>           some print statements included ....
> 
>           $pid = open2( \*Reader, \*Writer, "cat -u -n" );
>           Writer->autoflush(); # default here, actually
>           print Writer "stuff\n";
>           $got = <Reader>;
> 
> It run's fine in the normal shell but if I start it as a cgi script,
> every output written before the open2 statement including the line
> "Content-type: text/html" was duplicated.
> 
> Any solution?

Welcome to the club. You probably are not going to like the solution but
here is what I did.

It's very simple, make all the calls to open2, collect the results in
whatever variables are necessary and close all references to anything to
do with the open2 calls.

Then and then only start printing to STDOUT. That means you can't put

	print "Content-type: text/html\n\n"

right at the top of your script either. All output to STDOUT has to occur
after you have finished with open2. Just be thankfull you only got 2
copies, I have had four before today.

It's not pretty but it does work and the only way I ever found of getting
around the problem. Unless anyone else has a solution?

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

Nature abhors a hero.  For one thing, he violates the law of
conservation of energy.  For another, how can it be the survival of the
fittest when the fittest keeps putting himself in situations where he
is most likely to be creamed?
                -- Solomon Short



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

Date: Thu, 02 Sep 1999 17:18:51 GMT
From: talexb@tabsoft.on.ca (T. Alex Beamish)
Subject: Life span of other modules variables
Message-Id: <37ceb134.76191574@news1.on.sympatico.ca>

Hmm. Most odd.

I've written one package called dograph that has package variables
that get created at the top of the file, outside of any subroutine
definitions.

Now I am calling this package from another package. The function call
dograph::Create works fine. However when I try to access some of the
global variables in dograph that have been set to values based on my
call, I get blank values.

I am using $#dograph::NewSymbol to find the index of the last element
of @NewSymbol in dograph .. I believe that's the correct syntax ..
there should be stuff in there, but the array (and the other
variables) appear to be empty.

Help?


   T. Alex Beamish -- TAB Software
Toronto, Ontario -- www.tabsoft.on.ca


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

Date: Thu, 2 Sep 1999 12:00:13 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Need "Universal" exporter.pm File
Message-Id: <x3yn1v5wbg2.fsf@tigre.matrox.com>


mgjv@comdyn.com.au (Martien Verbruggen) writes:

> 
> In article <x3y3dwywcc4.fsf@tigre.matrox.com>,
> 	Ala Qumsieh <aqumsieh@matrox.com> writes:
> > ebohlman@netcom.com (Eric Bohlman) writes:
> >> John R. Maiocchi (jrmaiocchi@home.com) wrote:
> >> : Looking for exporter.pm file. For a friend and I don't know what
> >> : version. Needs to have security that will enable IP banning?
> >> 
> >> Huh?  exporter.pm is part of the standard Perl distribution;
> > 
> > I am tempted to add that the correct name for that module is:
> > 
> > 	Explorer.pm
> 
> And I am tempted to add that 'Explorer.pm' and 'exporter.pm' differ in
> more than just case :)

I could swear I wrote Exporter.pm not Explorer.pm! What was I
thinking?!

Believe me, I am not going mad, although I am starting to reconsider
that after I watched "The Shining" for the first time a couple of days
ago.

--Ala



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

Date: Thu, 2 Sep 1999 10:06:07 -0600
From: "Arunas Salkauskas" <arunas@an!m.org>
Subject: Re: Need your help here.
Message-Id: <37cea07a@news.cadvision.com>

Make your program find out what date it is, rather than having it insist
that you tell it.  That should be straight-forward in Perl - if you can't
figure that out buy a book.  O'Reilly's 'Learning Perl' is a good bet.

Post news - read news.  As somebody put it somewhere in some group I was
reading: answering questions in Newsgroups is a public service which I do
for free - answering questions by email is consulting for which I charge
money.

--
- Arunas Salkauskas
High Point Designs
www.highpointdesigns.com

Lex wrote in message <7qlu12$io7$1@clio.net.metrotor.on.ca>...
>Hi Everyone;
>
>I need to run a batch job everyday at specified time with a date parameter
>such as
>startjob.bat 0831
>                            for the 31th of August if that is the today's
>date or
>Startjob.bat 0901.
>(The date should be the today's date).
>
>I know that I can schedule the job to run at the specific time using the
>'at' scheduler in NT but how can I automate the part where I have to type
>the date everyday and of course I would like to use perl and also may be
>utilizing the date modules.
>
>Thanks very much for your support and please send reply's to
>dazimi@oradev.csis.csd.metrotor.on.ca
>
>
>
>




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

Date: Thu, 2 Sep 1999 08:25:01 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: newbi needs help
Message-Id: <MPG.123836a7810341879896f6@nntp1.ba.best.com>

Michael Godfred (mtg82814@ratheon.com) seems to say...
> I have a form, that when submitted it brings up a new window which calls
> a java applet.  Is there a way to have the window controlling the applet
> to be minimized automatically.  I tried the javascript newsgroup to see
> if they knew how to minimize a window, but all they told me was how to
> close one.

Run for cover, everyone!

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Thu, 2 Sep 1999 12:14:00 -0400
From: "Craig Barkhouse" <craig@ariel.hq.group.com>
Subject: Re: Perl vs. Samba
Message-Id: <rst8f1ppj7127@corp.supernews.com>


Andrew C. Holmes <andy@aholmes.u-net.com> wrote in message
news:z2wz3.1072$H5.125564@newsr2.u-net.net...
> I also have ActivePerl for Win32 BUT I can create/open, write to and close
a
> SAMBA shared file.  I would suggest you don't have the correct
permissions,
> is this script running as the same ID on the share ???

I'm not sure what you mean by the same ID.  The script is running locally on
my NT machine, so there's no concept of a user ID for the script.  I can
display, rename, delete, etc. files from the NT command line on the shared
drive, so I believe my permissons are OK.  Are the permissions somehow
different when just working from the command line vs. running a program like
a Perl script?

I should have mentioned more about the error that Perl is giving me.  I
changed the die() statement so that it prints out $!, the error message.  It
prints out the nebulous "Invalid argument" error message (EINVAL).

I'm running a pretty old version of Samba on the server.  It's 1.9.10.  I'm
going to see if I can update it to something newer.





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

Date: Thu, 02 Sep 1999 15:17:22 GMT
From: jcasey@workingventures.ca (John Casey)
Subject: Re: Perl5 sendmail
Message-Id: <37ce94d6.674553416@wv-proxy>

Thanks Ken I will check them out...

On Wed, 01 Sep 1999 21:48:44 GMT, kag@kag.citysource.com (Kenneth
Graves) wrote:

>In article <37cd928b.608430136@wv-proxy>, John Casey wrote:
>>I use OMNICRON HTTPd as my web server and have configured it for PERL
>>5.004 just because I can use it on any machine 95/98/NT. I only have
>>98 at home. I have NT at work and have IIS3.0 loaded on it. I will
>>eventually be sending this site to another server which could be UNIX,
>>NT or what ever other server my client decides to go with. Isn't there
>>a comparable perl module for PERL5 that compares to SENDMAIL, or am I
>>over simplifying it.
>
>Net::SMTP or Mail::Mailer, depending on taste.
>
>Sendmail is an external program, not part of Perl.  It used to be
>fairly standard on Unix machines, but can't be assumed to be
>present.  /usr/lib/sendmail and /usr/sbin/sendmail are the two
>most common directories to find it in when it is present.
>
>--kag



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

Date: Thu, 02 Sep 1999 15:24:21 GMT
From: jcasey@workingventures.ca (John Casey)
Subject: Re: Perl5 sendmail
Message-Id: <37ce9523.674630277@wv-proxy>

Thanks Ron...got to your site...cute dogs...gonna take a bit to
consume the page.

Aussie..eh? Cool, my wife and I have been IRC regulars on the Austnet
server for several years now. Our room is #1-chat and we have had
several IRC parties over the past 3 years and have thus met 5
Australians in person and one more is comming in a month or so. Nice
people.

Thanks again

On Thu, 2 Sep 1999 12:55:18 +1000, "Ron Savage"
<ron_savage@non-hp-australia-om5.om.hp.com> wrote:

>There's a mail tutorial on my web site. Some Perl packages work both under
>Win* & Unix.
>
>--
>Cheers
>Bus: rons@hpaco.aus.hp.com
>Home: ron@savage.net.au
>http://savage.net.au/
>
>
>



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

Date: Thu, 02 Sep 1999 16:20:22 GMT
From: Webmaster <jwanla@my-deja.com>
Subject: SCRIPTS!!
Message-Id: <7qm83m$n9n$1@nnrp1.deja.com>

http://www.the-monolith.com/thescriptring/

Do you have a web site containing information in any of the following
areas:

-samples scripts (Javascript, dHTML, VBScript, etc.)
-help sections including tutorials or help pages
-general scripting information
-links to pages containing any of the above

Then join the script ring to increase your sites exposure and web
traffic.  By joining The Script Ring and placing some
code to the bottom of a page on your web site, it can become part of a
network of sites with a common interest, SCRIPTS!!

http://www.the-monolith.com/thescriptring/


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


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

Date: Thu, 02 Sep 1999 15:20:42 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Sendmail fading away? (was  Re: Perl5 sendmail)
Message-Id: <eBwz3.48$K4.5894@news.shore.net>

Kenneth Graves <kag@kag.citysource.com> wrote:
: Sendmail is an external program, not part of Perl.  It used to be
: fairly standard on Unix machines, but can't be assumed to be
: present.

Is Sendmail becoming less common than it used to be? What's replacing it?

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Thu, 02 Sep 1999 09:52:18 -0700
From: Daniel Kirkdorffer <see.email.address@bottom.in.sig>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: shebang question for Win32 Perl/Apache
Message-Id: <37CEAB42.50D71AB8@bottom.in.sig>

Yes.

Larry Rosler wrote:
> 
> In article <37CDA466.ADF1033B@bottom.in.sig> on Wed, 01 Sep 1999
> 15:10:46 -0700, Daniel Kirkdorffer <see.email.address@bottom.in.sig>
> says...
> > Got it.  My problem was all the examples I saw were on C: and of course
> > I've installed Apache on E:.  #!\usr\bin\perl works fine now that
> > I've made a usr\bin\ directory on E: with perl.exe in it.
> 
> I assume you mean #!/usr/bin/perl, because your Unix systems won't be
> happy with backslashes.
> 
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com

--
Daniel Kirkdorffer
Sr. Consultant, Syllogistics, LLC.
Email: dan.kirkdorffer 'at' syllogistics 'dot' com
       daniel.kirkdorffer 'at' attws 'dot' com
Web:   http://www.syllogistics.com/
       http://members.aol.com/dankirkd/
Visual Cafe Tips:
       http://members.aol.com/dankirkd/vcafe.htm


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

Date: Thu, 02 Sep 1999 15:39:45 GMT
From: Jimmy Humphrey <jimmy@blackhole-designs.com>
Subject: Size
Message-Id: <37CE9A33.2040E32@blackhole-designs.com>

Is there a way I can capture the "size" in bytes of a paticular part of
a HTML form field?

Jimmy


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

Date: Thu, 02 Sep 1999 16:09:11 GMT
From: Jimmy Humphrey <jimmy@blackhole-designs.com>
Subject: Re: Size
Message-Id: <37CEA11A.8F29B608@blackhole-designs.com>

Like, the size in bytes of an image somebody is uploading before I write
it to file.  

Jimmy


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

Date: Thu, 2 Sep 1999 10:04:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Size
Message-Id: <MPG.12384de0583b94a3989f10@nntp.hpl.hp.com>

In article <37CEA11A.8F29B608@blackhole-designs.com> on Thu, 02 Sep 1999 
16:09:11 GMT, Jimmy Humphrey <jimmy@blackhole-designs.com> says...
> Like, the size in bytes of an image somebody is uploading before I write
> it to file.  

I am new at this particular game, but this is the code I put together.  
Suggestions for improvement would be welcome.


use LWP::UserAgent;

my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', $url);
my $response = $ua->request($request);
$response->is_success or die "Couldn't get '$url'. ",
    $response->code, ' ', $response->message, "\n";
my $size = $response->headers->{'content-length'};


If you want to get the size first, replace 'GET' by 'HEAD' above.  Then, 
if you wish, proceed to GET the whole file.

Question for the knowledgeable:  If I want to get a huge file in chunks 
rather than in one swell foop, do I have to write my own socket handler 
or is there a module that can do that?

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


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

Date: Thu, 2 Sep 1999 10:47:13 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Size
Message-Id: <MPG.123857fa715c77729896f8@nntp1.ba.best.com>

Larry Rosler (lr@hpl.hp.com) seems to say...
> use LWP::UserAgent;
> Question for the knowledgeable:  If I want to get a huge file in chunks 
> rather than in one swell foop, do I have to write my own socket handler 
> or is there a module that can do that?

Oh, it's my lucky day!

perldoc LWP::UserAgent





-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: 2 Sep 1999 17:08:57 +0200
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: SSL and Perl
Message-Id: <7qm3u9$rrk$1@pharmnl.ohout.pharmapartners.nl>

RLD <admin@wasi.com> wrote:


>Can anyone lend a hand in how I would accomplish this?  All I've seen
>available so far is Net::SSLeay which I guess is what I need, however
>installing the modules has proven to be a nightmare... is there another way?
>Can LWP modules be tweaked possibly to allow for this type of Post?


The latest Net::SSLeay should work properly with openssl version 0.9.3a and
is also claimed to work with version 0.9.4.  Any other combination will
prpbably not work.

--
Villy


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

Date: Fri, 03 Sep 1999 01:09:13 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: standalone perl apps on win/mac?
Message-Id: <spamfree-0309990109130001@d6.metropolis.net.au>

In article <7qj4v4$do6$1@nnrp1.deja.com>, but86@my-deja.com wrote:

> how can i make standalone perl programs for windows that support tk?
> 
> and what about my mac? is it possible to create perl standalones for
> mac, too?
> 
> unitl now i used perl just as a scripting language for cgis, but perl is
> really cool, and if it would be possible, i would love to create some
> little desktop applications with it. they had to be GUI based and should
> work on win and mac standalone. their goal would be text
> manipulating/file operations (basically to update or configure other
> perl scripts).

Matthias Neeracher ported Perl to the Mac.  The result is MacPerl, which
you can find out more about at <http://www.macperl.com/>.  MacPerl has the
ability to build applications which bundle the Perl interpreter with the
code.  MacPerl also lets you interact with the MacOS, thus letting you
create a GUI.  MacPerl: Power and Ease is a book written by Vicki Brown
and Chris Nador which covers the basics of using MacPerl to create a GUI. 
A web version of the book is available online if you want to check it out.

Henry.


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

Date: Fri, 03 Sep 1999 01:17:38 +0800
From: scmpoper <scmpoper@scmp.com>
Subject: symbolic reference
Message-Id: <37CEB131.A6BE59E6@scmp.com>

I am learning perl from "Programming Perl" and have question
on chapter 4 page 254 about symbolic reference. As it said:

"What happens if you try to dereference a value that is not a hard
reference? The value is then treated as a symbolic reference."

${identifier};     # same as $identifier
${"identifier"};   # also $identifier, but treated as symbolic
reference.

I would like to know is there a dereference happen or just a normal
variable assigment in the code below:

${identifier} = 1;

Many thank........




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

Date: Thu, 2 Sep 1999 10:49:02 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Use of push when building an array?
Message-Id: <x3yr9khweqq.fsf@tigre.matrox.com>


news <news@news.news> writes:

> I am reading in a colon separated file and splitting it like this:
> 
> ($dbfirstname,$dblastname,$dbage)=split(/:/);
> 
> I am then trying to match entries based on form input, but this only
> prints the last match. Should I be using push here?
> 
>   # This only prints the last match
>   @results= "$dbfirstname $dblastname $dbage" if $dbage == $formage;

Why don't you try and see for yourself?
It would certainly be much much much faster than posting to usenet.

--Ala



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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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