[10678] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4270 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 21 15:07:22 1998

Date: Sat, 21 Nov 98 12:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 21 Nov 1998     Volume: 8 Number: 4270

Today's topics:
        CGI security -- help!!!!!! <softsci@eagle.ca>
    Re: CGI tools - Shopping Basket <softsci@eagle.ca>
    Re: chmod (Peter J. Kernan)
    Re: chmod (Tad McClellan)
    Re: Extending a scalar's reserved memory <jason.holland@dial.pipex.com>
        Matching Text Outside HTML Tags dodadnau@my-dejanews.com
    Re: mode_perl and cgi confusion (Peter J. Kernan)
    Re: PAGE WITH ERROR IF BLANKS (Tad McClellan)
    Re: Passing HASH as a parameter (Bart Lateur)
    Re: Passing HASH as a parameter (Peter J. Kernan)
    Re: perl 5.005_02 ()
    Re: Processing files applying exclusion criteria (Charles Demas)
    Re: programing fun: trees: FlattenAt <rick.delaney@shaw.wave.ca>
    Re: Recommend Perl books? <due@murray.fordham.edu>
    Re: shopping cart <dpuryear@usa.net>
        should `-w' become the default? (was Re: How do I sort  <Russell_Schulz@locutus.ofB.ORG>
    Re: Sum by group <r28629@email.sps.mot.com>
    Re: Sum by group <r28629@email.sps.mot.com>
    Re: system() executes at unexpected time in SunOS4, Per (Rich)
        The dumbest question ever - HELP!!! <mikeham@samart.co.th>
    Re: The dumbest question ever - HELP!!! <softsci@eagle.ca>
    Re: The dumbest question ever - HELP!!! <due@murray.fordham.edu>
        valid chars in an email address, and reasonable chars ( <Russell_Schulz@locutus.ofB.ORG>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sat, 21 Nov 1998 13:49:32 -0500
From: "Kumar Sundaram" <softsci@eagle.ca>
Subject: CGI security -- help!!!!!!
Message-Id: <73725a$esj$1@mur2.odyssey.on.ca>

How would you write a secure CGI script?  I mean, I am creating a form
processor script using perl but I would like to know how secure can I make
that script to be.  Like, remove the SSI in the input, No inclusion of any
scripting language in the user input, etc..
Could anyone help me on this one??

Also, I would like to know, if user enters the his/her name in the name
field I want only letters and maybe a ,(comma) .  I don't want user to input
numbers in the name field and letters in phone number field.  Does anybody
know how to do this?
Thanks in advance...
Kumar




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

Date: Sat, 21 Nov 1998 13:32:46 -0500
From: "Kumar Sundaram" <softsci@eagle.ca>
Subject: Re: CGI tools - Shopping Basket
Message-Id: <73715t$ere$1@mur2.odyssey.on.ca>

Check out the following sites:
 www.cgi-resources.com
www.freecode.com
Good luck!
juliegee@iname.com wrote in message <7368hb$igk$1@nnrp1.dejanews.com>...
>Hi all,
>
>I am writing some HTML pages for a company and they need some CGI.
>They have around 9,000 products and I think they need something like
>a "Shopping basket" on their web site.
>
>Is there a CGI program available or a Tool to help me write the CGI
>for a "Shopping basket" type web site.
>
>What I mean by shopping basket is the user should be able to browse through
>the products and add each one to the shopping basket as he/she likes.
>Then at the end, the "check out", the CGI will give them a list of all
things
>put in the basket and the total cost.
>
>If there are any programs avaliable to help me with this, please let me
know.
>
>All replies are greatly appreciated.
>
>Julie Gee.
>juliegee@iname.com
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: 21 Nov 1998 16:26:49 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: chmod
Message-Id: <736pk9$6nh$1@alexander.INS.CWRU.Edu>

In article <3655E200.340C75A9@harris.com>,
	"PERL ROCKS!" <emills@harris.com> writes:
[...snip...]
> Why   doesn't
> 
>    $cnt = chmod 0777, 'file1', 'file2';
> 
> have to have "("'s around the list, as in:
> 
>    $cnt = chmod 0777, ('file1', 'file2');
> 
> My llama book says that lists are surrounded by parens..
[...snip...]
With parens you provide a list context.

perldoc -f chmod
=item chmod LIST
            ^--------means that chmod provides the list context

-- 
	Perl is Even a Radical Language
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


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

Date: Sat, 21 Nov 1998 12:51:51 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: chmod
Message-Id: <742737.4e1.ln@flash.net>

PERL ROCKS! (emills@harris.com) wrote:
: Sorry to bother everyone - but I just had a question on my own response (does that make this a recursive
: post)?

: Why   doesn't

:    $cnt = chmod 0777, 'file1', 'file2';

: have to have "("'s around the list, as in:

:    $cnt = chmod 0777, ('file1', 'file2');


   parenthesis around (nearly) _all_ function calls are optional.

      $cnt = chmod 0777, 'file1', 'file2';

      $cnt = chmod(0777, 'file1', 'file2');

   those should work fine too.

   If you like parens, use them, if you don't, then don't   ;-)



   from the 'perlsub' man page:

      NAME(LIST);    # & is optional with parentheses.
      NAME LIST;     # Parentheses optional if predeclared/imported.
      &NAME;         # Makes current @_ visible to called subroutine.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 21 Nov 1998 17:32:52 +0000
From: Jason Holland <jason.holland@dial.pipex.com>
To: Matt Knecht <hex@voicenet.com>
Subject: Re: Extending a scalar's reserved memory
Message-Id: <3656F944.8334C051@dial.pipex.com>

Matt Knecht wrote:
> 
> A good way to trim a bit of time off building a large array would be to
> pre-extend the array.  Something like:
> 
> $array[5_000] = '';
> 
> That way, Perl will fetch all the memory it thinks it should need to
> fill in array elements 0 .. 4_999 at once.
> 
> Is there a similar trick for scalars?
> 
> --
> Matt Knecht - <hex@voicenet.com>

Hello Matt,


What about:

	$scalar = "1" x 999;

That is a letter ex by the way.


Bye!


-- 
sub jasonHolland {
    my %hash = ( website =>
'http://dspace.dial.pipex.com/jason.holland/',
                 email   => 'jason.holland@dial.pipex.com' );
}


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

Date: Sat, 21 Nov 1998 19:38:29 GMT
From: dodadnau@my-dejanews.com
Subject: Matching Text Outside HTML Tags
Message-Id: <7374rk$80j$1@nnrp1.dejanews.com>

What regex should be used to match text outside of HTML tags in an HTML
document?

For example:

<!--Northern Arizona University URL-->
<a href="http://www.nau.edu">Northern Arizona University</a>

Would like the regex to match "Northern Arizona University" outside tags (not
just that string...would generally like to match *any* string outside HTML
tags, keeping all tags intact).

Thanks!

--Gary

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


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

Date: 21 Nov 1998 17:19:33 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: mode_perl and cgi confusion
Message-Id: <736sn5$h2p$2@alexander.INS.CWRU.Edu>

In article <Pine.GSO.3.95L.981121153014.19537F-100000@uststf1>,
	Ron <mkshanx@uxmail.ust.hk> writes:
> HI, 
> 
> I am a bit confused by the distinction/relation between mod_perl and
> cgi...i read apache.org's FAQ about this, but that tells me nothing much
> about it~
> 
> If I am using mod_perl, can I still use CGI.pm on it? (Because my book
> teaches me CGI programming and mod_perl seems to be entirely
> different..will I now need a new book? :))

I believe one w/Lincoln Stein is at least forthcoming. The following
is based on my limited knowledge.

mod_perl provides a wrapper for perl CGI called Registry.pm, but you
do not have to run your cgi scripts under mod_perl, the apache
server can still serve them up. If you really want to take
advantage of the speed of mod_perl then you probably want to
write new stuff for mod_perl and use Registry for old stuff that
you dont want to mess around with much. 

You might try the cgi groups for other opinions. Actually I have
no idea where the mod_perl experts hang out (its features seem
to span several interests), try dejanews to see if you can discover 
that.
-- 
	Perl Eclipses Rigid Languages
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


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

Date: Sat, 21 Nov 1998 13:07:44 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: PAGE WITH ERROR IF BLANKS
Message-Id: <023737.rg1.ln@flash.net>

Graham McMillan (jmcmilla@gettysburg.edu) wrote:

: Subject: Re: PAGE WITH ERROR IF BLANKS
               ^^^^^^^^^^^^^^^^^^^^^^^^^

   Please refrain from SHOUTING at us.

   It serves no useful purpose, and may just make folks ignore you.


: Does anyone now how to print an error page from a html submit?

print <<ENDHTML;
<HTML>
<BODY>
<P>Hey bonehead! You didn't fill in all the fields</P>
</BODY>
</HTML>
ENDHTML


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 21 Nov 1998 16:02:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Passing HASH as a parameter
Message-Id: <3656dede.191907@news.skynet.be>

PERL ROCKS! wrote:

>Gooday! I wonder can you point me to an example of someone who is
>passing an arbitrary-length hash, and subsequently using the hash  as an
>input parameter to a sub?

Basically, there are two (incompatible) ways.

A: You pass the hash as if it was an oridinary array. Since you can do
{ @array = %hash } and vice versa (as long as there's an even number of
elements in the array), this seems obvious to me:

	&test("Just testing", 1 => 'one', 3 => 'three', 2 => 'deux' );
	sub test {
		my($message,%hash) = @_;
		print "* $message *\n";
		foreach (sort keys %hash) {
			print " $_ => $hash{$_}\n";
		}
	}
Result:
	* Just testing *
	 1 => one
	 2 => deux
	 3 => three


B: Pass a hash by reference: either an anonymous hash, or a reference to
an existing hash. These are interchangable. 

The advantages are: you can pass more than one hash or array without
accidently mixing them in ther sub, and it might well be more efficient,
since you're not (well, not always) making a copy of the hash first.

There are basically two ways to process the hash reference:
 1) assign to a glob, therefore creating a local hash
 2) assign to a scalar, creating a local reference to the hash.
 2b) variation: create a local hash by dereferencing the hashref 

Note that in both cases, if you change something in the hash, you're
changing the original. That's what "pass by reference" always boils down
to.

Here are two ways to do the call:

	%test = ( 1 => 'one', 3 => 'three', 2 => 'deux');
	&test("Passing a ref", \%test);
or
	&test("Passing an anonymous hash", {1 => 'one', 3 => 'three',
	 2 => 'deux'});	# note the curlies.

or even this, which makes a copy of the hash first (thereore it should
be slower:

	&test("Passing an anonymous hash", { %test });


These are the two basic ways to deal with it:

	sub test { # assign hashref to glob; note: not "my"
		local($message,*hash) = @_;
		print "* $message *\n";
		foreach (sort keys %hash) {
			print " $_ => $hash{$_}\n";
		}
	}
or
	sub test { # hashref
		my($message,$hashref) = @_;
		print "* $message *\n";
		foreach (sort keys %{$hashref}) {
			print " $_ => $hashref->{$_}\n";
		}
	}

with this as a crossover:

	sub test { # dereferincing the hashref
		my($message,$hashref) = @_;
		my %hash = %{$hashref};
		print "* $message *\n";
		foreach (sort keys %hash) {
			print " $_ => $hash{$_}\n";
		}
	}

HTH,
Bart.


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

Date: 21 Nov 1998 17:07:01 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: Passing HASH as a parameter
Message-Id: <736rvl$h2p$1@alexander.INS.CWRU.Edu>

In article <3655BC32.F97B0A1A@harris.com>,
	"PERL ROCKS!" <emills@harris.com> writes:
> Gooday! I wonder can you point me to an example of someone who is
> passing an arbitrary-length hash, and subsequently using the hash  
> as an
> input parameter to a sub? I'm trying to do it by reference, using the
> Camel book illustrations, but I'm not having much sucesss yet. I don't
> necessarily want to make changes to the sub- a local copy should do
> fine.
> 
If perldoc perlref or the camel do not satisfy your thirst for
knowledge you might also try the panther book, i very much enjoyed
the discussion/examples of references therein.

mysub(\%h);
sub mysub {
  my $hashref = shift;
  for (keys %{$hashref}) { 
   print "$_: ${$hashref}{$_}\n";
  }
}

-- 
	Perl is an Excellent Raiding Language
open SIG, "<$ENV{HOME}/.sig"         or die       "sigless!     $!"; 
$sig = do {local $/; <SIG>};         close SIG && print<<"$sig SIG";
        Pete Kernan  CWRU Physics and Statistics Depts
        http://theory2.phys.cwru.edu/~pete
$sig SIG


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

Date: 18 Nov 1998 21:22:38 GMT
From: hdiwan@diwanh.stu.rpi.edu ()
Subject: Re: perl 5.005_02
Message-Id: <slrn756eh8.fu.hdiwan@diwanh.stu.rpi.edu>

In article <3652BBB4.3405C9BE@sprynet.com>, Balazs Rauznitz wrote:
>I've just compiled and installed  Perl 5.005_02 on my linux box. My
>qusetion is where can I find some docs on what's new in Perl 5.005. I
>know there are the Changes files in the distribution, but I don't think
>they are docs. Also why is there not a Changes5.005 which would list the
>deltas from 5.004 to 5.005 ?
perldoc perldelta will give you the list of changes from 5.004 to 5.005.

-- 
Hasan Diwan


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

Date: 21 Nov 1998 16:11:01 GMT
From: demas@sunspot.tiac.net (Charles Demas)
To: Ilya  <ilya@foothill.net> 
Subject: Re: Processing files applying exclusion criteria
Message-Id: <736oml$kem@news-central.tiac.net>

In article <736a8o$a4k$1@ns2.foothill.net>,
Ilya  <ilya@foothill.net> wrote:
>
>If I have a file composed of records with several fields and an exclusion
>file composed of one field, I want to eliminate all files that have a
>certain field match any field in the exclusion file. For instance,
>given input file
>
>
>aaa bbb ccc ddd eee ingres fff gggg 
>aaa bbb ccc ddd eee oracle fff gggg 
>aaa bbb ccc ddd eee solid fff gggg 
>
>and the exclusion file
>
>oracle
>
>I want just the lines that do not contain "oracle", in other words:
>
>aaa bbb ccc ddd eee ingres fff gggg 
>aaa bbb ccc ddd eee solid fff gggg 

fgrep -v -e `cat exclude_file` search_file

should do that for you.

man grep
man fgrep


Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,
  Stay Fit       |   @ @   | If a man waited to do it so well,
  Die Anyway     |    v    | That no one could find fault with it.
  demas@tiac.net |  \___/  | http://www.tiac.net/users/demas


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

Date: Sat, 21 Nov 1998 17:10:01 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: programing fun: trees: FlattenAt
Message-Id: <3656F599.AF6533D8@shaw.wave.ca>

[posted & mailed]

Xah wrote:
> 
> I thought that the line
>  my $ref_tree = [@{$_[0]}]
> should take care of the copying, but apparently that's not the case. 

That will only take care of copying the top level array.  All the
references contained therein will still point to the same arrays.

Look at it with named arrays:

@node0 = (1, 2);
@node1 = (3, 4);

$tree1 = [\@node0, \@node1];
$tree2 = [@$tree1];# this means $tree2 = [\@node0, \@node1]

If you now set $tree2->[0][1] = 5, you have actually set $node0[1] = 5.
So if you now print $tree1->[0][1] you get 5, since you are actually
printing $node0[1].

The situation is exactly the same using anonymous arrays, except that
they have no names so it's harder to visualize.

Because arrays can only have scalars as elements, they can only ever
contain *references* to other arrays.  Copying an array will make copies
of its elements, in this case copies of references, but a copy of a
reference will still refer to the exact same data structure.

If you want a copy of an entire data structure, you must make copies of
each and every data structure contained within it.  The recursive sub I
posted earlier in this thread does that.

Hope this helps.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: 21 Nov 1998 17:01:50 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Recommend Perl books?
Message-Id: <736rlu$amb$0@206.165.167.240>

OM wrote in message <736l08$lp2$1@eros.clara.net>...
>Can anyone please recommend a good Perl book.  I'm new to Perl and have
>never used it before.  But I do have programming experience.
>

In addition to Learning Perl and Programming Perl I also like Jon Orwant's
"Perl 5 Interactive Course" from Waite.  No ever mentions it but it is a
good introduction to Perl 5 IMHO.

AmD




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

Date: Sat, 21 Nov 1998 10:10:29 -0600
From: Dustin Puryear <dpuryear@usa.net>
To: Marty Landman <marty@catnmoose.com>
Subject: Re: shopping cart
Message-Id: <911664841.473896073@news.mindspring.com>

On Thu, 19 Nov 1998, Marty Landman wrote:
>Dustin Puryear <dpuryear@usa.net> wrote:
>I'm in the same boat and have picked up the (free) distribution of
>Commerce.cgi from http://www.dial411.com/, it's a good product imo, very
>well documented (in fact I removed the comments from the main pgm when
>starting to make changes because I didn't want to keep waiting for 90+K
>ftp transfers)!

I'm going to check it out. Thanks!

Regards, Dustin

--
Dustin Puryear, student, Louisiana State University 
dpuryear@usa.net * ICQ 6644253 
Help Crack Government Encryption: www.distributed.net


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

Date: Sat, 21 Nov 1998 01:14:16 -0500
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: should `-w' become the default? (was Re: How do I sort this list by "port" number?)
Message-Id: <19981121.011416.0y9.rnr.w164w_-_@locutus.ofB.ORG>

  [ what did this post have to do with `sorting a list'?! ]

Randal Schwartz <merlyn@stonehenge.com> quotes and writes:

>> I think it works very poorly, because it is not '-w' clean, and all 
>> programs should run with '-w' enabled at all times!
>
> No.  I disagree.  -w is to keep beginners from making beginner
> mistakes.  It's not enabled by default so that experts can make only
> expert mistakes. :)

so why not enable it by default, and have a separate switch the
experts can use (if they must) to disable it?

> There are many of my one-off programs that are not -w clean.  Some are
> not even "use strict" clean.  Perl is a tool to get the job done. Some
> parts of Perl prevent some kinds of debugging, and are therefore
> redundant with some parts of my 29+ years of programming experience.
> I don't need to put training wheels on my motorcycle, thank you.

how much grief would it cause you to have to add a switch to these
invocations to shut off the warnings?

if it's `not a lot', then:  is there any reason to not make this change?
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: Sat, 21 Nov 1998 09:32:03 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Claes Bjorklund <claes_no_spam@canit.se>
Subject: Re: Sum by group
Message-Id: <3656CEDB.AEC81109@email.sps.mot.com>

[posted to c.l.p.misc and copy emailed]

Claes Bjorklund wrote:
> 
> In article <3655BE4D.BDE0FADD@email.sps.mot.com>, Tk Soh
> <r28629@email.sps.mot.com> wrote:
> 
> >[posted to c.l.pm and copy emailed]
> >
> >c_b9209@my-dejanews.com wrote:
> >>
> >> Hi
> >>
> >> I want to sum by group in a data file were the first column has groups values
> >> and other has regular values. The data file is really huge
> >> here is a script for small file but it doesn't works for a big one,please can
> >> anyone help me this problem make me crazy
> >>
> >> \Claes
> >>
> >> sub test{
> >> open IN, "$utdata\\tabel.dat" or die "can't open in: $!";
> >> while (<IN>){

        next if /^\s*$/;    # skip blank (white space only) lines

> >> ($var,@DATS)=split(" ",$_);
> >>    $suml{$var}  = [  @DATS ];
> >>    $sum0{$var}+= $DATS[0];
> >>    $sum1{$var}+= $DATS[1];
> >>    $sum2{$var}+= $DATS[2];
> >>    $sum3{$var}+= $DATS[3];
> >>    $sum4{$var}+= $DATS[4];
        ^^^^^^^^^^^^^^^^^^^^^^
you input data shows only 5 fields. This line could be removed. Although it
shouldn't hurt), you will get some complains from the compiler if you turn on
-w switch. You should always -w. Actually, if you have use strict, you code
would probably complied failed.

> >>    $ant{$var}+=1;
> >> }
> >> foreach $key  (sort(keys %sum0)) {
> >>     print "$key =  $ant{$key} $sum0{$key} $sum1{$key} $sum2{$key}
> $sum3{$key}
> >> $sum4{$key}\n";
     ^^^^^^^^^^^
remove this too, reasons stated above.

> >>
> >> }
> >>
> >> }
> >

[...]
> indata
> 1 2 5 7 7
> 3 4 5 7 5
> 1 2 4 5 4
> 3 4 3 3 5
> 3 4 5 6 6
> 2 4 5 6 7
> 2 5 5 4 4
> and I want this
> outdata:
> 1 2 4 9 12 11
> 2 2 9 10 11 11
> 3 3 12 13 16 16
> 
> the second column is the number in each group
> Of course the data file has more rows and columns

You code looks fine for me. Well, almost (see code above). But I still don't
see why it would fail with larger input data file, even with you original
code. Perhaps with other part of you program? BTW, I still couldn't tell what
exactly the problem you were facing.

-TK


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

Date: Sat, 21 Nov 1998 10:03:13 -0500
From: Tk Soh <r28629@email.sps.mot.com>
To: Claes Bjorklund <claes_no_spam@canit.se>
Subject: Re: Sum by group
Message-Id: <3656D627.B73B0C1A@email.sps.mot.com>

[posted to c.l.p.m and copy emailed]

Claes Bjorklund wrote: 
[...]
> May be I were unclear, the problem is, I have lot of fields/columns
> and the script will be too long with my solution

Ah, now I could see what you problem is. A better (?) solution will be to make
use of Perl5's reference & data structure:

   perldoc perlref
   perldoc perldsc

But here a quick sample to get you started ('->' added for clarity),
regardless of how many row/col you have:

my %HoH;           # this is a hash of hashes

while (<DATA>){
   next if /^\s+$/;             #skip blank lines
   my ($var,@DATS) = split;

   # {data} is a ref to array
   foreach (my $i = 0; $i < @DATS; $i++) {  
       $HoH{$var}->{data}->[$i] += $DATS[$i];
   }

   $HoH{$var}->{count}++;
}

I will leave to you on how to access and & print the values of the data
structure. Have fun.

-TK


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

Date: 21 Nov 1998 19:41:00 GMT
From: richm@ucesucks.mulveyr.roc.servtech.com (Rich)
Subject: Re: system() executes at unexpected time in SunOS4, Perl5, seems to fork early
Message-Id: <slrn75e5nh.dr1.richm@ll.aa2ys.ampr.org>

On Sat, 21 Nov 1998 03:55:08 -0600, Michael Goodlett <goodlett@cyberramp.net> wrote:
( Message about problem deleted )

Sounds like a classic STDOUT buffering problem.  Turn the buffering on
STDOUT off, and try again.  :-)

- Rich

--
Rich Mulvey                                         
My return address is my last name, 
   followed by my first initial, @mulveyr.roc.servtech.com        
http://mulveyr.roc.servtech.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa


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

Date: Sun, 22 Nov 1998 00:59:30 -0800
From: Michael Hamilton <mikeham@samart.co.th>
Subject: The dumbest question ever - HELP!!!
Message-Id: <3657D272.DC81BE35@samart.co.th>

I thought I'd post this question before I put my fist through the
computer screen.

In the O'Reilly book on Perl for Win32 it gives the "Hello World"
example.

Its say to type  - print ("Hello World"/n); - into any text editor and
then invoke the proram. Easy right. Well I can't do it.

1. By "any text editor" does it mean something like WordPad or the
little black screen you get when you double-click Perl.exe

2. How do you invoke it. I have tried to associate .plx file with the
Perl.exe program, but I don't know if I have done it right.

Could some kind person take pity on an idiot like me and give me an
idiots step-by-step guide to where to write the code and how to run it.

Thanks



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

Date: Sat, 21 Nov 1998 13:53:44 -0500
From: "Kumar Sundaram" <softsci@eagle.ca>
Subject: Re: The dumbest question ever - HELP!!!
Message-Id: <7372d7$ess$1@mur2.odyssey.on.ca>

You may want to download PFE (Programmer's File Editor) from
www.lancs.ac.uk/people/cpaap/pfe
This is the one I use,  It does a nice job.
Michael Hamilton wrote in message <3657D272.DC81BE35@samart.co.th>...
>I thought I'd post this question before I put my fist through the
>computer screen.
>
>In the O'Reilly book on Perl for Win32 it gives the "Hello World"
>example.
>
>Its say to type  - print ("Hello World"/n); - into any text editor and
>then invoke the proram. Easy right. Well I can't do it.
>
>1. By "any text editor" does it mean something like WordPad or the
>little black screen you get when you double-click Perl.exe
>
>2. How do you invoke it. I have tried to associate .plx file with the
>Perl.exe program, but I don't know if I have done it right.
>
>Could some kind person take pity on an idiot like me and give me an
>idiots step-by-step guide to where to write the code and how to run it.
>
>Thanks
>




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

Date: 21 Nov 1998 19:25:09 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: The dumbest question ever - HELP!!!
Message-Id: <73742l$r3u$0@206.165.167.218>

Hi Michael,

Michael Hamilton wrote in message <3657D272.DC81BE35@samart.co.th>...
>I thought I'd post this question before I put my fist through the
>computer screen.
>In the O'Reilly book on Perl for Win32 it gives the "Hello World"
>example.
>Its say to type  - print ("Hello World"/n); - into any text editor and
>then invoke the proram. Easy right. Well I can't do it.
>1. By "any text editor" does it mean something like WordPad or the
>little black screen you get when you double-click Perl.exe

Wordpad, probably safer to use Notepad.

>2. How do you invoke it. I have tried to associate .plx file with the
>Perl.exe program, but I don't know if I have done it right.

You have if you get that "little black screen".  That means that perl is
being evoked and running as a dos program.  The "little black screen" is a
DOS shell opening and closing as perl runs.

>Could some kind person take pity on an idiot like me and give me an
>idiots step-by-step guide to where to write the code and how to run it.


Please-excuse-the-name-idiot's-step-by-step-guide-to-running-their-first
program:


Use your text editor of choice.  If you use Wordpad be sure to save it as a
a  text file.  Notepad is probably safer.  You might want to get a better
editor as well.  Some are listed at www.perl.com and I use Ultraedit as you
can execute perl from within the editor.

1) In the editor type:

#! -w
print ("Hello World, I am a idiot no longer\n");

The first line is not necessary but we might as well get your good habits
started early.  It provides error messages to help you when you make
mistakes.  Nice huh?.  Very soon you will also want to include
use strict;
as your second line but that will probably confuse the situation at first as
you copy the examples.

(Note you had a misplaced quote (") and a / in stead of a \ in your example.
Watch those typos.

2) Anyway, next save the file *as a text file*.  Call it hello.plx if you
like, or hello.pl.  Preferably, save it to a directory that does not have a
long filename (they are a pain when you are moving around in a DOS shell).
You might want to create a
c:\myperl
directory first and then save the file there.

3)  Now, we need a Dos shell.  If don't have a shortcut on your desktop,
select Programs and scroll all the way down to the bottom.  Somewhere at the
end your system probably has
MS-DOS prompt
Click that and you should get a DOS window and a prompt that looks like
c:\>.  (Note we do not want to exit to DOS.  We only want to start a DOS
shell.)

Ok, now we need to be in the same directory our file was saved to.  So, go
to the directory where you saved the file.  Now, on many systems you will
default to the windows subdirectory when you start the shell so you probably
want to type
cd \
then
cd c:\myperl
at the prompt to get to the directory.

3a)  Do a directory listing to make sure your file is there.
dir hello.plx

3b) Then lets make sure perl is in your path and set up ok.  Type
perl -v
and it should report the version of perl you are using.

4) Lastly type:

perl hello.plx

and the Gods should smile upon you.

HTH

AmD
[cc to author]





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

Date: Sat, 21 Nov 1998 01:08:55 -0500
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: valid chars in an email address, and reasonable chars (was Re: attaching a jpeg)
Message-Id: <19981121.010855.5I0.rnr.w164w_-_@locutus.ofB.ORG>

Randal Schwartz <merlyn@stonehenge.com> writes:

> [also stealth-cc'ed... DON'T DO THAT.]

Randal, does anyone need to tell you...

  pointlessly posted to c.l.perl.misc without followups set...
  DON'T DO THAT.

> Uh, legal addresses can contain [some unusual characters].  Are you
> telling me you want to tell your customers what they can have in their
> addresses?

I know I'm willing.

anyone who has something other than

  a-zA-Z
  0-9
  ._+-/=

is going to lose so much mail they'll give up on it before they ever
get to where I'm going to mail them.  they'll be happy, I'll be happy.

I will stop saying this if you stop using `merlyn' as your primary
address, and start using `fred&barney' exclusively.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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