[24041] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6238 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 9 11:10:51 2004

Date: Tue, 9 Mar 2004 08:10:11 -0800 (PST)
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, 9 Mar 2004     Volume: 10 Number: 6238

Today's topics:
    Re: Need help with Undeliverable Emails <whoknows@NoSpamPLZ.net>
    Re: Need help with Undeliverable Emails <jwillmore@remove.adelphia.net>
    Re: new to perl <t_lawetta@yahoo.com>
    Re: printf question <bart.lateur@pandora.be>
        Rockets Alternative <georgekinley@hotmail.com>
    Re: Rockets Alternative (Walter Roberson)
    Re: Rockets Alternative <vetro@online.no>
    Re: Rockets Alternative <usenet@morrow.me.uk>
    Re: Rockets Alternative <nobody@somewhere-else.com>
    Re: storing and accessing a has in a package (Anno Siegel)
    Re: storing and accessing a has in a package <nobull@mail.com>
    Re: storing and accessing a has in a package user@domain.invalid
    Re: storing and accessing a has in a package (Anno Siegel)
    Re: storing and accessing a has in a package user@domain.invalid
    Re: storing and accessing a has in a package <tadmc@augustmail.com>
    Re: storing and accessing a has in a package (Anno Siegel)
    Re: storing and accessing a has in a package <jurgenex@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 09 Mar 2004 13:50:59 GMT
From: whoknows <whoknows@NoSpamPLZ.net>
Subject: Re: Need help with Undeliverable Emails
Message-Id: <7Zj3c.46753$q4.886915@weber.videotron.net>

On Tue, 09 Mar 2004 00:37:58 -0500, James Willmore wrote:
>
>
> Impart your wisdom on how to use the sendmail (or Postfix equivalent)
> binary in a safe and secure fashion, will you ... please?  Instead of
> trolling :-)
>

I have to spell everything for you don't I?
I do not work for the Internet Security HellpDesk...
Here is a hint for you:

Start by adding to your programms:

#!/usr/local/bin/perl -T 
# tainted mode IS important
use strict;
use warnings;


And here is another hint for you:
while ( ! $clue) {
   read && learn;
}


-- 
 .signature: No such file or directory


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

Date: Tue, 09 Mar 2004 10:31:25 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Need help with Undeliverable Emails
Message-Id: <pan.2004.03.09.15.31.23.281853@remove.adelphia.net>

On Tue, 09 Mar 2004 13:50:59 +0000, whoknows wrote:

> On Tue, 09 Mar 2004 00:37:58 -0500, James Willmore wrote:
>>
>>
>> Impart your wisdom on how to use the sendmail (or Postfix equivalent)
>> binary in a safe and secure fashion, will you ... please?  Instead of
>> trolling :-)
>>
>>
> I have to spell everything for you don't I? I do not work for the
> Internet Security HellpDesk... Here is a hint for you:
> 
> Start by adding to your programms:
> 
> #!/usr/local/bin/perl -T
> # tainted mode IS important
> use strict;
> use warnings;
> 
> 
> And here is another hint for you:
> while ( ! $clue) {
>    read && learn;
> }

Cute :-)

It wasn't for *my* benefit (remember, I don't use the binaries to send
email - I use Net::SMTP :-) ). Since you *appear* to have infinitely more
experience (working where you stated you do - "I run highly available
secure production networks. I do not trust ISPs. Period. If I need
something robust and reliable, I use MTA ( in a secure fashion with 'use
strict' and tained mode on).") on using the 'sendmail' binary to send
email securely and efficiently, I thought you *might* want to lend a hand
to the OP.  I mean, if all *you* do is turn taint checking on and 'use
strict', then your code isn't as secure as what you think it might be. You
have to do more in order to *use* variables with taint checking on.
`perldoc -q taint`, `perldoc perlsec` and `perldoc perlrun`.

So, do you have some Perl code to show us or more insults?

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"Acting is an art which consists of keeping the audience from
coughing." 



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

Date: Tue, 09 Mar 2004 15:09:14 +0100
From: Tony Muler <t_lawetta@yahoo.com>
Subject: Re: new to perl
Message-Id: <404dd00a$1_1@news.vo.lu>

Regent wrote:

> Eh, I'm programming Perl cgi with Apache, so the shebang is necessary.

Why don't you try it out?
My Apache is not on Win, otherwise I would do so.

Make a foolproof script (print "Content-Type: text/plain\n\nTest";)
and put it into your CGI directory. I would say it will work
without, because what is in the script-directory will be executed.

If you put a batch file there, it will be also executed.
Try a file called "mycgi.bat" containing:

echo Content-Type: text/plain
echo
echo
echo TEST SUCCEEDED

Knowing this all is not too important
T.



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

Date: Tue, 09 Mar 2004 13:06:56 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: printf question
Message-Id: <56gr405i010fitqm26pgbnjqdipii8jmue@4ax.com>


fifo wrote:

>
>printf '%08d|%03d', $i/1000, $i%1000;

Not a bad idea.

	(my $s = sprintf "%012.3", $i/1000) =~ tr/./|/;
	print $s;

-- 
	Bart.


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

Date: Tue, 09 Mar 2004 14:17:51 GMT
From: "George Kinley" <georgekinley@hotmail.com>
Subject: Rockets Alternative
Message-Id: <jmk3c.11154$k4.233803@news1.nokia.com>

Hi
Is there any  way  for rockets to fly in space , other then throwing mass
out in one direction and moving in other





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

Date: 9 Mar 2004 14:32:00 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: Rockets Alternative
Message-Id: <c2kkh0$inp$1@canopus.cc.umanitoba.ca>

In article <jmk3c.11154$k4.233803@news1.nokia.com>,
George Kinley <georgekinley@hotmail.com> wrote:
:Is there any  way  for rockets to fly in space , other then throwing mass
:out in one direction and moving in other

"I'll take Perl questions for $200 please, George."
-- 
Studies show that the average reader ignores 106% of all statistics
they see in .signatures.


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

Date: Tue, 09 Mar 2004 15:39:37 +0100
From: Vetle Roeim <vetro@online.no>
Subject: Re: Rockets Alternative
Message-Id: <m3znaqm6dy.fsf@quimby.dirtyhack.org>

* Walter Roberson
> In article <jmk3c.11154$k4.233803@news1.nokia.com>,
> George Kinley <georgekinley@hotmail.com> wrote:
> :Is there any  way  for rockets to fly in space , other then throwing mass
> :out in one direction and moving in other
>
> "I'll take Perl questions for $200 please, George."

  Perhaps he confused Perl with Perl ("Practical Extraction and Rocket
  Language")?

-- 
#!/usr/bin/vr


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

Date: Tue, 9 Mar 2004 14:44:08 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Rockets Alternative
Message-Id: <c2kl7o$t8t$1@wisteria.csv.warwick.ac.uk>


Quoth "George Kinley" <georgekinley@hotmail.com>:
> Hi
> Is there any  way  for rockets to fly in space , other then throwing mass
> out in one direction and moving in other

Yes.

Ben

-- 
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk


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

Date: Tue, 09 Mar 2004 15:58:10 -0000
From: "Pope Bob" <nobody@somewhere-else.com>
Subject: Re: Rockets Alternative
Message-Id: <104rqci6o820b73@corp.supernews.com>


"George Kinley" <georgekinley@hotmail.com> wrote:
>Hi
>Is there any  way  for rockets to fly in space , other then throwing mass
>out in one direction and moving in other

Absolutely.  Here in Texas, we're working on a new, top-secret,
plan called lassoo-drive.  I can't tell you much about it, but
ropes are involved....

-Pecos Billy-Bubba-Bob


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

Date: 9 Mar 2004 12:12:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: storing and accessing a has in a package
Message-Id: <c2kcbv$2lb$2@mamenchi.zrz.TU-Berlin.DE>

 <user@domain.invalid> wrote in comp.lang.perl.misc:
> How can I store a hash array so that I can access it within a package?

You declare it with "our".  It's not a matter of storage but of
declaration.

> E.g.
> 
> package mytest
> use strict;
> 
> sub new  {
> 
> 
>   my $class = shift; #class name
>   my $self = {}; #create a refence to self
> 
>   #store hash, so that if visible within the package
>   $self->StoreHash();
>   bless($self, $class);
> 
>   return $self
> }
> 
> sub GetHash  {
>   sub $self=shift;
>   ...
> }
> 
> sub StoreHash  {
>   sub $self=shift;
>   ...
> }

You don't say for what purpose you want to store the hash, and in your
code there is nothing to store.  No-one but you can fill in the missing
code in GetHash and StoreHash.

Anno


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

Date: 09 Mar 2004 12:03:34 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: storing and accessing a has in a package
Message-Id: <u9wu5u8bxl.fsf@wcl-l.bham.ac.uk>

user@domain.invalid writes:

> How can I store a hash array so that I can access it within a package?

I assume you mean "hash".

You are always within a package.

> E.g.
> 
> package mytest
> use strict;
> 
> sub new  {
> 
> 
>   my $class = shift; #class name
>   my $self = {}; #create a refence to self
> 
>   #store hash, so that if visible within the package
>   $self->StoreHash();
>   bless($self, $class);

You cannot call methods on $self until after you bless it.

How does StoreHash() know what to store?

You cannot store hashes and arrays in elements of other hashes or
arrays.

You can store references to hashes and arrays in elements of other
hashes or arrays.  This is just as good.  It also means that
storing/retrieving hashes and arrays "inside" an object is no
different from storing/retrieving scalars (because that's what you
actually do).

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 09 Mar 2004 14:46:05 +0200
From: user@domain.invalid
Subject: Re: storing and accessing a has in a package
Message-Id: <c2keaj$mno$1@ctb-nnrp2.saix.net>

Thanks for you response. The hash is for file names, but I
am currently reconsidering it.
Anno Siegel wrote:
>  <user@domain.invalid> wrote in comp.lang.perl.misc:
> 
>>How can I store a hash array so that I can access it within a package?
> 
> 
> You declare it with "our".  It's not a matter of storage but of
> declaration.
> 
> 
>>E.g.
>>
>>package mytest
>>use strict;
>>
>>sub new  {
>>
>>
>>  my $class = shift; #class name
>>  my $self = {}; #create a refence to self
>>
>>  #store hash, so that if visible within the package
>>  $self->StoreHash();
>>  bless($self, $class);
>>
>>  return $self
>>}
>>
>>sub GetHash  {
>>  sub $self=shift;
>>  ...
>>}
>>
>>sub StoreHash  {
>>  sub $self=shift;
>>  ...
>>}
> 
> 
> You don't say for what purpose you want to store the hash, and in your
> code there is nothing to store.  No-one but you can fill in the missing
> code in GetHash and StoreHash.
> 
> Anno



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

Date: 9 Mar 2004 13:09:28 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: storing and accessing a has in a package
Message-Id: <c2kfm8$2lb$3@mamenchi.zrz.TU-Berlin.DE>

[sequence re-arranged.  please don't top-post]

 <user@domain.invalid> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> >  <user@domain.invalid> wrote in comp.lang.perl.misc:
> > 
> >>How can I store a hash array so that I can access it within a package?
> > 
> > 
> > You declare it with "our".  It's not a matter of storage but of
> > declaration.
> > 
> > 
> >>E.g.
> >>
> >>package mytest
> >>use strict;
> >>
> >>sub new  {
> >>
> >>
> >>  my $class = shift; #class name
> >>  my $self = {}; #create a refence to self
> >>
> >>  #store hash, so that if visible within the package
> >>  $self->StoreHash();
> >>  bless($self, $class);
> >>
> >>  return $self
> >>}
> >>
> >>sub GetHash  {
> >>  sub $self=shift;
> >>  ...
> >>}
> >>
> >>sub StoreHash  {
> >>  sub $self=shift;
> >>  ...
> >>}
> > 
> > 
> > You don't say for what purpose you want to store the hash, and in your
> > code there is nothing to store.  No-one but you can fill in the missing
> > code in GetHash and StoreHash.

> Thanks for you response. The hash is for file names, but I

The question isn't *what* you want to store, but *for what purpose*,
in other words, what relation has the common hash to the individual
objects?  You still haven't answered that.

> am currently reconsidering it.

Hmm...

Anno


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

Date: Tue, 09 Mar 2004 15:44:45 +0200
From: user@domain.invalid
Subject: Re: storing and accessing a has in a package
Message-Id: <c2khoe$53$1@ctb-nnrp2.saix.net>

Anno Siegel wrote:

> The question isn't *what* you want to store, but *for what purpose*,
> in other words, what relation has the common hash to the individual
> objects?  You still haven't answered that.
> 

I want to be able to access different elements of the hash as required
using access methods, like "Next" for next value in hash, and so on.



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

Date: Tue, 9 Mar 2004 08:04:16 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: storing and accessing a has in a package
Message-Id: <slrnc4rjn0.490.tadmc@magna.augustmail.com>

user@domain.invalid <user@domain.invalid> wrote:

> I want to be able to access different elements of the hash as required
> using access methods, like "Next" for next value in hash, and so on.
                                        ^^^^^^^^^^^^^^^^^^
                                        ^^^^^^^^^^^^^^^^^^

Hashes are UNordered.

There is no "next" when talking about a hash...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 9 Mar 2004 14:41:08 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: storing and accessing a has in a package
Message-Id: <c2kl24$8nt$1@mamenchi.zrz.TU-Berlin.DE>

 <user@domain.invalid> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> 
> > The question isn't *what* you want to store, but *for what purpose*,
> > in other words, what relation has the common hash to the individual
> > objects?  You still haven't answered that.
> > 
> 
> I want to be able to access different elements of the hash as required
> using access methods, like "Next" for next value in hash, and so on.

That makes no sense.  Hashes are un-ordered, they don't have "next"
elements.  And it still doesn't explain the relation the hash has to
your objects.

Anno


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

Date: Tue, 09 Mar 2004 14:55:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: storing and accessing a has in a package
Message-Id: <pVk3c.79439$6K.42023@nwrddc02.gnilink.net>

user@domain.invalid wrote:
> I want to be able to access different elements of the hash as required
> using access methods, like "Next" for next value in hash, and so on.

There is no "next" for hashes.
You can consider hashes to be mappings or (partial) functions from a domain
into a codomain, just like e.g. length(). Would you also ask for the next
value of length()?

jue




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6238
***************************************


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