[10697] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4289 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 24 18:07:33 1998

Date: Tue, 24 Nov 98 15:00:31 -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           Tue, 24 Nov 1998     Volume: 8 Number: 4289

Today's topics:
    Re: A little problem with Perl code <gellyfish@btinternet.com>
    Re: Any ideas? <gellyfish@btinternet.com>
    Re: CGI-Scripts <lin@wdg.mot.com>
        chop newline... <david.r.barden@PSS.boeing.com>
    Re: Closing a program running with Perl <rootbeer@teleport.com>
    Re: copy a file - How? (Larry Rosler)
    Re: creating pop account <gellyfish@btinternet.com>
    Re: Dangerous Commands (Martien Verbruggen)
    Re: Dangerous Commands (Ilya Zakharevich)
    Re: Dangerous Commands (Martien Verbruggen)
        Help! (Ralph Forsythe)
    Re: How can I run a shell script on Perl program ? (Martien Verbruggen)
    Re: How do you distribute Perl programs? <gellyfish@btinternet.com>
    Re: inconsistent quoted expressions ? <rootbeer@teleport.com>
    Re: Launching two subroutines at the same time <gellyfish@btinternet.com>
    Re: Mailprog (Martien Verbruggen)
    Re: mkDir Question (I R A Aggie)
    Re: More Problems with "Rename()" <rootbeer@teleport.com>
    Re: Net::Ping <gellyfish@btinternet.com>
        Parse File Upload.. <bellears@deakin.edu.au>
    Re: Please help me locate Perl Style Guide (Martien Verbruggen)
    Re: Please help me locate Perl Style Guide (Martien Verbruggen)
    Re: Please help me locate Perl Style Guide (Larry Rosler)
    Re: Q: bulk-assign associative array? <rootbeer@teleport.com>
    Re: Question about $_ (Larry Rosler)
    Re: Question about $_ (Martien Verbruggen)
    Re: question on inode number to file name (Martien Verbruggen)
    Re: question on system limit <rootbeer@teleport.com>
    Re: Range operator (Larry Rosler)
    Re: regexp on multiple lines, etc. (john joergensen)
    Re: regexp on multiple lines, etc. <gellyfish@btinternet.com>
        SSLeay and RSA bbrelin@dnai.com
    Re: strange SEGV with sort or some sort of such thing <rootbeer@teleport.com>
    Re: Trying to write perl script that zips file (BenJamin Prater)
    Re: Trying to write perl script that zips file (Martien Verbruggen)
    Re: Why doesn't something work? (Martien Verbruggen)
    Re: wierd perl5.04004 behaviour <rootbeer@teleport.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 24 Nov 1998 20:13:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: A little problem with Perl code
Message-Id: <73f422$dm$1@gellyfish.btinternet.com>

On Mon, 23 Nov 1998 23:28:09 GMT nguyen.van@imvi.bls.com wrote:
> I wanted to print out Key & Value by using following code, but it give me a
> duplicated copies:
> 

Erm yes it would do that.

> ____________________________________________________________________________
> 
>  @proc_files = ("aol_out", "msie_out", "netscape_out");
> foreach $out_file (<@proc_files>)

I dont understand what the < & > are for here - they imply an operation
that is not wanted and I am actually surprised it works could be a typo I
guess.

> {
>     $ALL_IN = new IO::File "<$out_file";
>     $ALL_OUT = new IO::File ">>all_out";

Using IO::File doesnt release you from the need to check the result of the
open however abstracted that open might be.

>     hash_sort($ALL_IN);
> }
> 
> sub hash_sort
> {

You appear to be passing $ALL_IN as an argument to the function but you are
using a global copy anyway.

>    while (<$ALL_IN>)
>    {
>        chomp;
>        $count{$_}++;
>    }
>    foreach (keys %count)
>    {
>          printf $ALL_OUT ("%s\t%s\n" ,$_, $count{$_});
> 
>    }

You are print the contents of the hash everytime you call the function which
in this case is three times.

> }

<snipped expected results>

I'll re-render that in a form that would work.

#!/usr/bin/perl -w

use IO::File;

@proc_files = ("aol_out", "msie_out", "netscape_out");

my %count = ();

$ALL_OUT = new IO::File ">>all_out";

if ( defined $ALL_OUT )
  {
    foreach $out_file (@proc_files)
      {
         my $ALL_IN = new IO::File "<$out_file";
         if (defined $ALL_IN )
           {
              hash_sort($ALL_IN);
              $ALL_IN->close;
           }
         else
           {
              warn "Couldnt open - $out_file\";
           }       
       }

     foreach (keys %count)
       {
          printf $ALL_OUT ("%s\t%s\n" ,$_, $count{$_});
       }

     $ALL_OUT->close;
   }
else
   {
     die "Cant open output file\n";
   }

 
sub hash_sort
  {
     my $ALL_IN = shift;

     while (<$ALL_IN>)
       {
          chomp;
          $count{$_}++;
       }
  }
__END__

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: 24 Nov 1998 19:04:36 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Any ideas?
Message-Id: <73f004$cc$1@gellyfish.btinternet.com>

On Tue, 24 Nov 1998 09:27:56 -0800 Brandon Lin <lin@wdg.mot.com> wrote:
> Hi all,
> 
> I want to create a perl script which extracts a data
> from a webpage everyday.  Can anyone please help
> me on this?
> 
> I am thinking calling `telnet www.microsoft.com 80`,
> then inputing a HTTP request. But this doesn't work.
> Or do I need to use a module?
> 

You would certainly be advised to use a module, yes:

A)  LWP::UserAgent  - to retrieve the HTML
B)  HTML::Parser    - to extract data from the retrieved HTML

check CPAN if they are not on your system already.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Tue, 24 Nov 1998 13:33:42 -0800
From: Brandon Lin <lin@wdg.mot.com>
Subject: Re: CGI-Scripts
Message-Id: <365B2636.EA1A6F83@wdg.mot.com>

Try  http://www.hypermart.net

Brandon

Heiko wrote:

> Hi there!
>
> I4m working on my own CGI-Scripts but I can4t find a server on which I can
> freely execute my own scripts. So, are there any servers like that
> available?
>
> Bye bye,
>       Heiko





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

Date: Tue, 24 Nov 1998 18:33:19 GMT
From: Dave Barden <david.r.barden@PSS.boeing.com>
Subject: chop newline...
Message-Id: <365AFBEF.27B01D09@PSS.boeing.com>

I'm using chop to join two lines if a line contains less than the 11
fields I know it should contain.  I can't allow more than one space to
separate each field.  Not knowing if my current line ends with a space
or not and not knowing whether the next line which I've now joined by
removing the newline, starts with a space or not leaves me puzzled about 
ensuring there is one and only one space between the fields where I
removed the newline character with chop.   I know I'm missing something
here.  There must be a better way to do what I'm trying to do.  Help!

thanks,
	Dave Barden


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

Date: Tue, 24 Nov 1998 22:28:30 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Closing a program running with Perl
Message-Id: <Pine.GSO.4.02A.9811241427220.4375-100000@user2.teleport.com>

On Thu, 19 Nov 1998, Hawkwynd wrote:

> I need my script to stop a program running, 

Maybe you want to send a signal like HUP or INT; see your system's docs
about signals and Perl's docs about them in perlipc and perlfunc. Hope
this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 12:58:42 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: copy a file - How?
Message-Id: <MPG.10c4bdd989f19297989890@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <365AF97F.A878AFE7@inreach.com> on Tue, 24 Nov 1998 18:20:18 
GMT, L. Birdwell <airman@inreach.com> says...
> I am trying to copy a .gif file from one directory on my server to a new
> one I am creating. I can create the directory fine, but I don't know how
> to copy a file to it???
> I am trying:
> 
> open (FILE, ">$path/images/main_bnr.gif");

Where, oh where, is the check that the file opened as requested (though 
judging by the symptoms you report later, it probably did)?

  open (FILE, ">$path/images/main_bnr.gif")
      or die "Couldn't open ... for writing. $!\n";

> print FILE main_bnr.gif;  (Where main_bnr.gif is in same dir as cgi
> program)

This doesn't mean much, as main_bnr.gif is a bareword.  I assume some 
other code that you haven't shown has opened a file with that name and 
read its contents into a scalar:

  open (IN, "<.../main_bnr.gif")
      or die "Couldn't open ... for reading. $!\n";
  { local $/; binmode IN; $main_bnr_gif = <IN>; }

Note the 'binmode' on the read.  It will show up again soon...

> close (FILE);
> 
> This seems to create a file in the /images directory, but is only a very
> small file and not the whole graphics file I am trying to transfer.

It sounds like you are using a system that interprets certain binary 
characters as signalling end-of-file.  You can override that behavior by 
inluding immediately after the 'open' statement:

  binmode FILE;

See perlfaq4:  "How do I handle binary data correctly?" 

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


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

Date: 24 Nov 1998 19:14:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: creating pop account
Message-Id: <73f0je$d0$1@gellyfish.btinternet.com>

On Tue, 24 Nov 1998 00:27:55 -0500 vincent <vpaquin@toile-sherbrooke.com> wrote:
> Please excuse my english
> 
> How could I create a new pop account by the way of a perl script?
> 

If there is no module available on CPAN to do this stuff then you may have to
work with an external application.  On some systems it is sufficient to
merely create a new user to create a new pop account - you will need to
look at the documentation for your system to find out how you would achieve
this.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Tue, 24 Nov 1998 21:10:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Dangerous Commands
Message-Id: <NgF62.40$Zw2.208@nsw.nnrp.telstra.net>

In article <73dhik$f6s$1@mathserv.mps.ohio-state.edu>,
	ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> [A complimentary Cc of this posting was sent to Martien Verbruggen
> <mgjv@comdyn.com.au>],
> who wrote in article <7jo62.72$Jo2.294@nsw.nnrp.telstra.net>:
>> Shell metacharacters are only dangerous when you invoke a shell. The
>> solution is simple: Never ever pass a user supplied string to anything
>> that invokes a shell. Use exec and system with a list argument. Use
>> sysopen. Use modules for redirected output.
> 
> You cannot.  Perl is horrible in this respect: you may ask it to do
> something, but it will call shell behind your back.

This is not true however for sysopen (since that just calls the
system's open() function), or calling exec and/or system with a list
(since that calls execvp() in this situation), right?  Of course there
are a few functions that always call a shell, like glob (or has that
changed).  Maybe it would be useful to have a list of functions
somewhere that are marked as potentially dangerous in this respect.

> We are still waiting on Larry's verdict on "magic open considered
> harmful" discussion from the last fall.  (There were some ideas how to
> protect most-frequently used constructs from magic-open.)

Maybe we need some entry in the FAQ somewhere, talking about which
functions may be considered harmful.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd.       | population.
NSW, Australia                      | 


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

Date: 24 Nov 1998 21:30:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Dangerous Commands
Message-Id: <73f8h8$kv$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Martien Verbruggen
<mgjv@comdyn.com.au>],
who wrote in article <NgF62.40$Zw2.208@nsw.nnrp.telstra.net>:
> > You cannot.  Perl is horrible in this respect: you may ask it to do
> > something, but it will call shell behind your back.
> 
> This is not true however for sysopen (since that just calls the
> system's open() function),

But you cannot use sysopen() from Perl: AFAIU, it would not accept "r"
and "w" arguments, only symbolic non-portable constants.  Thus you
need additional modules to get to these constants, which is another
can of worms.

Ilya


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

Date: Tue, 24 Nov 1998 21:47:52 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Dangerous Commands
Message-Id: <cQF62.50$Zw2.208@nsw.nnrp.telstra.net>

In article <73f8h8$kv$1@mathserv.mps.ohio-state.edu>,
	ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> [A complimentary Cc of this posting was sent to Martien Verbruggen
> <mgjv@comdyn.com.au>],
> who wrote in article <NgF62.40$Zw2.208@nsw.nnrp.telstra.net>:
>> > You cannot.  Perl is horrible in this respect: you may ask it to do
>> > something, but it will call shell behind your back.
>> 
>> This is not true however for sysopen (since that just calls the
>> system's open() function),
> 
> But you cannot use sysopen() from Perl: 

I'm confused... 

# perldoc -f sysopen

Or do you mean that you cannot use it in the same way as you use open?
I can understand that one.

> AFAIU, it would not accept "r"
> and "w" arguments, only symbolic non-portable constants.  Thus you
> need additional modules to get to these constants, which is another
> can of worms.

Wouldn't an inclusion of the relevant .ph files provide you with those?

Not trying to be difficult. I've never had the need for sysopen
myself, and only know what I see in the documentation.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd.       | great height, over water.
NSW, Australia                      | 


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

Date: 24 Nov 1998 21:28:08 GMT
From: ralph@contact-paging.com (Ralph Forsythe)
Subject: Help!
Message-Id: <73f8d9$u0k$1@news-2.csn.net>

Ok, here's the dilemma:  I am trying to read data from an analog to digital 
converter, and am missing something.  The way it works is I send a command 
(which is working fine) to it telling it how many channels I want returned 
(1-11), and it sends back 2 bytes for each channel, MSB and LSB.  I need to 
read the bytes one-at-a-time and do ord() conversions on them - but when I try 
this it just hangs the program.  The only way I can do it so far is to read it 
all at once into a string, which doesn't work very well.

Here is the Basic code sample they sent with it:

Step 1:  Constructing the command string

   channel = 1   (chan #'s start at 0, 0-10 for ch. 1-11 repectively)
   Command$ = "!0RA"+CHR$(channel)

Step 2:  Transmit the command string (which tells it to read the ports)

   Print #1, Command$;

Step 3:  Receive the data

   MSB$ = INPUT$ (1, #1)
   LSB$ = INPUT$ (1, #1)
   reading1 = (ASC(MSB$)*256) + ASC(LSB$)

   MSB$ ...
   LSB$ ...
   reading0 = ...


The idea is to get a value fro 0 to 4095, which will tell me the voltage.  Can 
someone *please* tell me the Perl equivalent to this code fragment?  
Unfortunately I'm a but rusty in this area, but I need to know how to do this 
ASAP.

Thanks a bunch!!
- Ralph Forsythe
ralph*spam*@contact-paging.com   (remove *spam* from address)



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

Date: Tue, 24 Nov 1998 21:29:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How can I run a shell script on Perl program ?
Message-Id: <AyF62.42$Zw2.208@nsw.nnrp.telstra.net>

In article <01be17c6$08473380$5d68b9a3@wtang-sgl.sugar-land.geco-prakla.slb.com>,
	"William Tang" <wtang@flash.net> writes:
> Hello,
> I have two questions:
> 1) I try to run a shell script in my Perl program. which is:
> source $SMS/path_complete.csh

You try to run this shell script how? If you use system() or something
like that, perl will by default invoke the _bourne_ shell. It looks
like what you want is csh. You'll have to explicitly run csh.

> 2) Also I try to write a perl script to automatically run some commands (C
> exe program), and some of them require STDIN inputs during the process. Is
> there a way I can redirect the STDIN inputs to the process in my perl
> scripts ?

Open a pipe to the stdin of the C program.

open(PIPETHINGY, "| /path/to/c/program") || die "Couldn't open this: $!"

# perldoc -f open
# perldoc perlfaq8
     Why doesn't open() return an error when a pipe open fails?

If you also need to capture output:

# perldoc perlfaq8
     How can I open a pipe both to and from a command?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd.       | reflects this.
NSW, Australia                      | 


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

Date: 24 Nov 1998 21:42:15 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How do you distribute Perl programs?
Message-Id: <73f97n$fb$1@gellyfish.btinternet.com>

On Mon, 23 Nov 1998 18:45:11 -0500 Larry Kasoff <larkas@eden.rutgers.edu> wrote:
> I know this may be a stupid question, but how do I give my program to
> other people who may or may not have perl? Can I legally distribute Perl
> with my program?
> 

Short:

  Yes

Longer:

You should read perlfaq1   and the documents README and Artistic or Copying
(as you see fit) that come with the Perl distribution.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Tue, 24 Nov 1998 22:16:23 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: inconsistent quoted expressions ?
Message-Id: <Pine.GSO.4.02A.9811241414010.4375-100000@user2.teleport.com>

On Wed, 18 Nov 1998, tommy wrote:

>     $output = qx/ $perl_binary -d $distance_program $inputfile $outputfile
> $method /;
>     print $output;  <---------------- this doesn't work

Well, maybe that's not working because you never set $inputfile to
anything. But I question whether you really want to do what you seem to be
trying to do. The debugger is meant for interactive use, and I'm not sure
that it will do anything useful when invoked this way. But you can always
step through _this_ program in the debugger to see what it's doing. Good
luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 24 Nov 1998 21:29:33 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Launching two subroutines at the same time
Message-Id: <73f8ft$dv$1@gellyfish.btinternet.com>

On Mon, 23 Nov 1998 17:35:22 -0800 Larry Rosler <lr@hpl.hp.com> wrote:
> In article <911863842.219707@thrush.omix.com> on 23 Nov 1998 23:35:27 
> GMT, Zenin <zenin@bawdycaste.org> says...
>> Jim Mamay <jim.mamay@uchsc.edu> wrote:
>> : --------------36E68C84FB56DC65CF18AC5B
>> : Content-Type: text/html; charset=us-ascii
>> : Content-Transfer-Encoding: 7bit
>> 
>> 
>> 	Please don't post in HTML, *ever*.  Thanks.
> 
> Hmmm.  My newsreader, a nifty number called MicroPlanet Gravity 2.10, 
> has a checkbox option that reads, "Don't show HTML source", so I never 
> notice these things.  Of course, it runs only on PoB systems.  :-)
> 
> Now if I could only get it to ignore those nasty 'vcard's, everything 
> would be great!
> 

Mine just ignores the crap from most properly behaved clients and it runs
on Unix.  Unfortunately it might ignore the whole content of an article
on occasions if the alternate part is not properly constructed.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Tue, 24 Nov 1998 21:36:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Mailprog
Message-Id: <EFF62.45$Zw2.208@nsw.nnrp.telstra.net>

In article <3659F256.2406@digi-q.com>,
	Alex Guberman <alex@digi-q.com> writes:

> Does anybody know how to make "undeliverable" messages to come back to
> the reply-to address and not to the server admin, when sending e-mails
> through mailprog?

And what exactly is your perl question?

Questions about mail and stuff should probably be asked in a newsgroup
that has 'mail' somewhere in its name.

> Thank you.

Pleasure.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: Tue, 24 Nov 1998 17:40:19 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: mkDir Question
Message-Id: <fl_aggie-2411981740190001@aggie.coaps.fsu.edu>

In article <v6F62.39$Zw2.208@nsw.nnrp.telstra.net>, mgjv@comdyn.com.au
(Martien Verbruggen) wrote:

+  A perl distribution without its documentation is not a complete perl 
+ distribution.

Worse than that: it's a broken distribution.

James


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

Date: Tue, 24 Nov 1998 21:55:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: More Problems with "Rename()"
Message-Id: <Pine.GSO.4.02A.9811241349540.4375-100000@user2.teleport.com>

On Tue, 24 Nov 1998, William Case wrote:

> Newsgroups: comp.lang.perl, comp.lang.perl.misc, comp.lang.perl.moderated

If your news server still lists comp.lang.perl as an active newsgroup,
replace your news admin. That group is defunct. When it was active,
Kevin Costner was still thought of as a promising film director.
 
> I am still, however having problems with the "rename()" function (I
> added a 'die' clause to the rename() as suggested by another helpful
> person).
> 
> When I send "rename ( $cgi_sfn{'upfile'}, $tempvar1)" it does not rename
> the file, nor does it return an error, nor does it continue running
> anything below that statement.

That's not how Perl works. If it stops unexpectedly, it's normally going
to give you a diagnostic message. (Or, if it can't give a message, it
dumps core.) If that message is hidden or discarded by you (or by, say,
your webserver) there's nothing Perl can (or should!) do about that.

>   $extension = substr( $cgi_cfn{'upfile'}, -4, 3);

As I said in my previous message, I don't think that's what you want. Have
you tried stepping through your code in the debugger? Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: 24 Nov 1998 22:12:25 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Net::Ping
Message-Id: <73fb09$fs$1@gellyfish.btinternet.com>

On Tue, 24 Nov 1998 15:44:22 GMT bobs614@my-dejanews.com wrote:
> Could someone send me and example of Net::Ping, I have written a small
> piece of code that every time I run it, it reports an Unsupported Function
> Alarm.
> 

pingecho or a "tcp" ping will use alarm which is indeed unsupported on
platforms such as Win32 you should use udp or icmp ping - read the docs
again if you are unsure how.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Wed, 25 Nov 1998 08:39:41 +1100
From: Mick <bellears@deakin.edu.au>
Subject: Parse File Upload..
Message-Id: <365B279D.AF94A114@deakin.edu.au>

When uploading files via a web page, how can I ensure that only a
specifically named file is allowed to be uploaded. I know this is a
fairly broad question, but I'm fairly new to Perl and do not know where
to start.
So eg. file to be uploaded must be called file.txt and if the user tries
to upload anything else they get an appropriate message?

Thanks for any replies,
Mick



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

Date: Tue, 24 Nov 1998 21:12:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please help me locate Perl Style Guide
Message-Id: <ljF62.41$Zw2.208@nsw.nnrp.telstra.net>

In article <365A567B.EA4DEC60@slip.net>,
	Kosan Koh <kosan@slip.net> writes:

> I would greatly appreciate it if anyone who knows the whereabouts of
> this Perl Style Guide could kindly inform me.

On any system where perl is correctly installed:

# perldoc perlstyle

or

# man perlstyle

For win32 systems: I just heard that ActiveState doesn't ship the
documentation with their distribution. Complain to them.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Advertising:  The science of arresting
Commercial Dynamics Pty. Ltd.       | the human intelligence long enough to
NSW, Australia                      | get money from it.


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

Date: Tue, 24 Nov 1998 21:50:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please help me locate Perl Style Guide
Message-Id: <LSF62.51$Zw2.208@nsw.nnrp.telstra.net>

In article <MPG.10c4c588c7c77d64989893@nntp.hpl.hp.com>,
	lr@hpl.hp.com (Larry Rosler) writes:
> [Posted to comp.lang.perl.misc and a copy mailed.]
> 
> In article <ljF62.41$Zw2.208@nsw.nnrp.telstra.net> on Tue, 24 Nov 1998 
> 21:12:49 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> ... 
>> For win32 systems: I just heard that ActiveState doesn't ship the
>> documentation with their distribution. Complain to them.
> 
> You heard wrong.
> 
> D:\perl\html\lib\Pod\perlstyle.html

That's HTML. Not pod. perldoc doesn't read HTML. IOW, the standard
tools that everyone has become used to are not working correctly.

I still feel that this is deficient behaviour. The more because it can
easily be fixed.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd.       | reflects this.
NSW, Australia                      | 


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

Date: Tue, 24 Nov 1998 13:31:30 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Please help me locate Perl Style Guide
Message-Id: <MPG.10c4c588c7c77d64989893@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <ljF62.41$Zw2.208@nsw.nnrp.telstra.net> on Tue, 24 Nov 1998 
21:12:49 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
 ... 
> For win32 systems: I just heard that ActiveState doesn't ship the
> documentation with their distribution. Complain to them.

You heard wrong.

D:\perl\html\lib\Pod\perlstyle.html

in my (quite vanilla) installation.

I:\>perl -v

This is perl, version 5.005_02 built for MSWin32-x86-object

Copyright 1987-1998, Larry Wall

Binary build 506 provided by ActiveState Tool Corp. 
http://www.ActiveState.com
Built 15:40:37 Oct 27 1998

 ...

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


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

Date: Tue, 24 Nov 1998 22:08:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Q: bulk-assign associative array?
Message-Id: <Pine.GSO.4.02A.9811241403560.4375-100000@user2.teleport.com>

On Wed, 18 Nov 1998, Chris Reickenbacker wrote:

> local(@STAT_RESULTS{dev, ino, mode, nlink,
>                         uid, gid, rdev, size,
>                         atime, mtime, ctime,
>                         blksize, blocks}) = lstat($file);
> 
> Hash of file stats using element name as key. You can do this with
> anything that returns a list.

It's not a bad technique, but it can be modernized (and made safer, since
barewords can be hazardous).

    my %stat_results;
    @stat_results{ qw{
	dev ino mode nlink uid gid rdev size
	atime mtime ctime blksize blocks
    } } =
		lstat $file;

Or you could simply use File::stat. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 13:20:17 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Question about $_
Message-Id: <MPG.10c4c2f151e4e26a989892@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <365B19BA.15DFF31D@axe.humboldt.edu> on Tue, 24 Nov 1998 
12:40:27 -0800, Greg Coit <gbc1@axe.humboldt.edu> says...
 ...
> ... I would have thought that
> the <FILE> statement would have replaced $_ with the text on the first
> line of the file.
 ...
>           open (FILE, "text.html") || die ("Can't open: $!\n");
>           <FILE>;

That simply discards the line that is read from the file.

>From perlop:

Evaluating a filehandle in angle brackets yields the next line from that 
file (newline, if any, included), or undef at end of file. Ordinarily 
you must assign that value to a variable, but there is one situation 
where an automatic assignment happens. If and ONLY if the input symbol 
is the only thing inside the conditional of a while or for(;;) loop, the 
value is automatically assigned to the variable $_.
 
-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 24 Nov 1998 21:43:04 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Question about $_
Message-Id: <ILF62.49$Zw2.208@nsw.nnrp.telstra.net>

In article <365B19BA.15DFF31D@axe.humboldt.edu>,
	Greg Coit <gbc1@axe.humboldt.edu> writes:

> for every text.html file found.  That's what I expect.  But the second
> print statement also prints a "text.html", but I would have thought that
> the <FILE> statement would have replaced $_ with the text on the first
> line of the file.

I don't know why you would expect that:

# perldoc perlop
[snip]
     I/O Operators
[snip]
     Evaluating a filehandle in angle brackets yields the next
     line from that file (newline, if any, included), or undef at
     end of file.  Ordinarily you must assign that value to a
     variable, but there is one situation where an automatic
     assignment happens.  If and ONLY if the input symbol is the
     only thing inside the conditional of a while or for(;;)
     loop, the value is automatically assigned to the variable
     $_.
[snip]

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Tue, 24 Nov 1998 21:29:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: question on inode number to file name
Message-Id: <pzF62.43$Zw2.208@nsw.nnrp.telstra.net>

In article <73emdp$mes@ds2.acs.ucalgary.ca>,
	Kin Yee Lee <leeky@ucalgary.ca> writes:
> Hello everyone,
> 
>      Given an inode number, is it possible to find the file name from it?   

No. Not without ambiguity.

To find out why, you should ask on one of the unix groups.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


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

Date: Tue, 24 Nov 1998 22:40:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: question on system limit
Message-Id: <Pine.GSO.4.02A.9811241438430.4375-100000@user2.teleport.com>

On Thu, 19 Nov 1998, Hui Tang wrote:

> In one of my script I want to change the limits set systemwide, for
> example the maximum number of files could be opened. At the shell
> prompt, command "unlimit" would do it. 

I am not sure that the word "systemwide" means what you seem to think it
means. 

> But if I put it in a "system" function call in my Perl script, it
> doeen't work.

It's probably working, but only within the sub-process that you created
with system. But I think you want to see whether the BSD::Resource module
works on your system. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 24 Nov 1998 13:13:35 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Range operator
Message-Id: <MPG.10c4c157cb714444989891@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <365b0a3a.537381653@newshost.unx.sas.com> on Tue, 24 Nov 1998 
19:41:41 GMT, Kathy Passarella <kapass@wnt.sas.com> says...
> The following example is from  Learning Perl, page 49:
>      (1.2 .. 5.2)   # same as (1.2, 2.2, 3.2, 4.2, 5.2)
> but when I use 
>     @list = (1.2 .. 5.2);    
> @list gets ( 1, 2, 3, 4, 5)
> 
> Can someone explain why?

Because the book is wrong.  :-(

<URL:http://www.oreilly.com/catalog/lperl2/errata/lperl2.unconfirmed>


{49} 2nd code block, 2nd line:

(1.2 .. 5.2)    # Same as (1.2, 2.2, 3.2, 4.2, 5.2)

It's actually the same as (1, 2, 3, 4, 5).


{49} 3rd code example: same error as above.

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


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

Date: Tue, 24 Nov 1998 21:05:10 GMT
From: jjoerg@camlaw.rutgers.edu (john joergensen)
Subject: Re: regexp on multiple lines, etc.
Message-Id: <73f73u$g60$2@newsmonger.rutgers.edu>

In article <sarg1b99b80.fsf@camel.fastserv.com>, Uri Guttman <uri@fastengines.com> wrote:
>>>>>> "JJ" == John Joergensen <jjoerg@crab.rutgers.edu> writes:
>
>  JJ> I have the regexp set to global (ie. m/regexp/g), and I set the $/
>  JJ> parameter to null (so I can slurp paragraphs, but not the whole
>  JJ> file.  I also set the expression to accept return chrarcters in
>  JJ> all the where the expression may be wrapped. So far, so good.
>
>  JJ> The problem is, when I set the $/ to null, I am only getting one
>  JJ> match per paragraph.
>
>$/ has nothing to do with regexes, only reading files.
>
>  JJ> What am I doing wrong?
>
>what is wrong is you didn't post any of your broken code, so we can't
>figure how to fix it. post code and example data and show the results.
>
>hth,
>
>uri
>
Sorry.  Here is the code:
*******************************
#!/usr/bin/perl -w

 while(defined($filename = glob("*.html"))) {
$/ = '';
open (IN, "test.html");
open (OUT, ">result.html");
while(<IN>){if(m/[\d]{1,3}[\s\n<]{1,2}[A-W<][A-Za-z234<>\.
\s\/\&\;]*[\s\n]{1,2}[\d]{1,4}/g) { 
$cite = $&;
$saveorig = $&;
        print "Found a cite: $cite\n";
        @parts = split(/\s/, $cite); 
              foreach $b (@parts) {
                        if ($b ne "at") {                                      
                            @parts2 = (@parts2, $b);
                        } 
                } 
         $search = join("\%20", @parts2);
        undef @parts2;
} # close the else
@fixthecite = split(/<[u\/]{1,2}>/, $search);
$ready = join("", @fixthecite);
if ($ready =~ /term/i) {
        print "Whoa! Leave this one out: $saveorig!\n";
} else {
s/$saveorig/<ahref=\"http:\/\/lawlibrary.rutgers.edu\/cgi-bin\/getlink.        
        cgi?cite=$ready\">$saveorig<\/a>\n/;

} 
} 
 print OUT $_;
} 
}
*************************
The text it is looking through is like this:
***************************
<p><p>&nbsp;&nbsp;&nbsp;&nbsp;The U.S. Supreme Court formerly resorted to 
various fictions, such as implied consent.  <u>E.g.</u>, <u>Hess v. 
Pawloski</u>, 274<u>U.S.</u> 352,  47 <u>S. Ct.</u> 632, 71 <u>L. Ed.</u> 1091 
(1927).  Eventually, in<u>International Shoe Co. v. Washington</u>, 326 
<u>U.S.</u> 310, 66 <u>S. Ct.</u>154, 90 <u>L. Ed.</u> 95 (1945), the Court 
cast those fictions aside andheld that a state court's assertion of personal 
jurisdiction doesnot violate the Due Process Clause if the defendant has 
&quot;certainminimum contacts with it such that the maintenance of the 
suitdoes not offend `traditional notions of fair play and 
substantialjustice.'&quot;  326 <u>U.S.</u> at 316, 66 <u>S. Ct.</u> at 158, 
90 <u>L. Ed.</u> at 102(quoting <u>Milliken v. Meyer</u>, 311 <u>U.S.</u> 457, 
463, 61 <u>S. Ct.</u> 339,343, 85 <u>L. Ed.</u> 278, 283 (1940)).  The 
concomitant understandingof legislative jurisdiction was similarly modified.  
<br><p><p>
**************************
The results I am getting looks like this:
*************************
p><p>&nbsp;&nbsp;&nbsp;&nbsp;The U.S. Supreme Court formerly resorted to 
variousfictions, such as implied consent.  <u>E.g.</u>, <u>Hess v. 
Pawloski</u>, 274<u>U.S.</u> 352,  47 <u>S. Ct.</u> 632, 71 <u>L. Ed.</u> 1091 
(1927).  Eventually, in<u>International Shoe Co. v. Washington</u>, 326 
<u>U.S.</u> 310, 66 <u>S. Ct.</u>154, 90 <u>L. Ed.</u> 95 (1945), the Court 
cast those fictions aside andheld that a state court's assertion of personal 
jurisdiction doesnot violate the Due Process Clause if the defendant has 
&quot;certainminimum contacts with it such that the maintenance of the 
suitdoes not offend `traditional notions of fair play and 
substantialjustice.'&quot;  326 <u>U.S.</u> at 316, 66 <u>S. Ct.</u> at 158, 
90 <u>L. Ed.</u> at 102(quoting <u>Milliken v. Meyer</u>, 311 <u>U.S.</u> 457, 
463, 61 <u>S. Ct.</u> 339,343, 85 <u>L. Ed.</u> 278, 283 (1940)).  The 
concomitant understandingof legislative jurisdiction was similarly modified.  
<br><p><p>
******************************
The problem is that the citations, such as "47 <u>S.Ct.</u>632", and all the 
similar cites in the above example should be getting substituted.  When $/ is 
not set to null, most of the cites are recognized and substituted, except for 
the ones that are wrapped onto two lines.  

Here is the result of the sample text when $/ is not modified:

*********************************************
<p><p>&nbsp;&nbsp;&nbsp;&nbsp;The U.S. Supreme Court formerly resorted to 
variousfictions, such as implied consent.  <u>E.g.</u>, <u>Hess v. 
Pawloski</u>, 274<u>U.S.</u> 352,  
<ahref="http://lawlibrary.rutgers.edu/cgi-bin/getlink.cgi?cite=47%20S.%20Ct.
%20632">47 <u>S. Ct.</u> 632</a>, 71 <u>L. Ed.</u> 1091 (1927).  Eventually, 
in<u>International Shoe Co. v. Washington</u>, 
<ahref="http://lawlibrary.rutgers.edu/cgi-bin/getlink.cgi?cite=326%20U.S.
%20310">326 <u>U.S.</u> 310</a>, 66 <u>S. Ct.</u>154, 
<ahref="http://lawlibrary.rutgers.edu/cgi-bin/getlink.cgi?cite=90%20L.%20Ed.
%2095">90 <u>L. Ed.</u> 95</a> (1945), the Court cast those fictions aside 
andheld that a state court's assertion of personal jurisdiction doesnot 
violate the Due Process Clause if the defendant has &quot;certainminimum 
contacts with it such that the maintenance of the suitdoes not offend 
`traditional notions of fair play and substantialjustice.'&quot;  
<ahref="http://lawlibrary.rutgers.edu/cgi-bin/getlink.cgi?cite=326%20U.S.
%20316">326 <u>U.S.</u> at 316</a>, 66 <u>S. Ct.</u> at 158, 90 <u>L. Ed.</u> 
at 102(quoting <u>Milliken v. Meyer</u>, 
<ahref="http://lawlibrary.rutgers.edu/cgi-bin/getlink.cgi?cite=311%20U.S.
%20457">311 <u>U.S.</u> 457</a>, 463, 61 <u>S. Ct.</u> 339,343, 
<ahref="http://lawlibrary.rutgers.edu/cgi-bin/getlink.cgi?cite=85%20L.%20Ed.
%20278">85 <u>L. Ed.</u> 278</a>, 283 (1940)).  The concomitant 
understandingof legislative jurisdiction was similarly modified.  <br><p><p>
*********************************************

Again, thanks for any ideas.

John Joergensen


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

Date: 24 Nov 1998 22:18:05 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: regexp on multiple lines, etc.
Message-Id: <73fbat$gc$1@gellyfish.btinternet.com>

On Tue, 24 Nov 98 17:45:50 GMT John Joergensen <jjoerg@crab.rutgers.edu> wrote:
> Hi.  I hope someone can help with this.
> 
> Here's the situation:  I have documents where I have to do many find 
> operations.  I will be getting multiple matches on some lines, and, there are 
> several instances where the expression will span two lines.
> 
> I have the regexp set to global  (ie. m/regexp/g), and I set the $/ parameter 
> to null (so I can slurp paragraphs, but not the whole file.  I also set the 
> expression to accept return chrarcters in all the where the expression may be 
> wrapped. So far, so good.
> 
> The problem is, when I set the $/ to null, I am only getting one match per 
> paragraph.  
> 
> What am I doing wrong?
> 

local $/;

$blah = <INHANDLE>;

while ($blah =~ /(<pattern>)/msg )
  {
     #do something with $1 or whatever
  }


/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Tue, 24 Nov 1998 22:33:31 GMT
From: bbrelin@dnai.com
Subject: SSLeay and RSA
Message-Id: <73fc7q$bs4$1@nnrp1.dejanews.com>

Hello,

I am writing a non-web Secure Socket Layer based application in Perl
using SSLeay and the Net::SSLeay.pm module.   I'm trying
to find out if it is possible to use SSLeay without using
the RSA encryption algorithm.  I'm trying to avoid having to buy the
BSAFE package from RSA and I'm also trying to avoid
using the RSA algorithm illegally.  The package is for
"commercial" use although it isn't revenue-generating.

I know about the RSAREF package but I don't believe that it solves
the problem due to the quasi-commercial usage for this app.

I checked both the sci.crypt FAQ and the SSLeay docs but with
no luck.  There doesn't seem to be a misc.computer.legal FAQ
that covers this issue.

Has anyone run into this?  If so, have they been able to solve it
without having to fork $$ over to RSA?

Thanks,

Braun Brelin
bbrelin@dnai.com

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


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

Date: Tue, 24 Nov 1998 22:21:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: strange SEGV with sort or some sort of such thing
Message-Id: <Pine.GSO.4.02A.9811241418520.4375-100000@user2.teleport.com>

On Thu, 19 Nov 1998 leroy@mpi.com wrote:

> Is this the place to report such fancy bugs ?

Not really. You should make a small stand-alone program which demonstrates
the behavior you're seeing, so that others can easily see what's going on.
The smaller the better. If you're sure you've found a bug, use the perlbug
program to report it. If you're not completely sure that it's a problem in
perl, post your program here (or to c.l.p.moderated) first. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 24 Nov 1998 15:28:01 -0600
From: ben@sofnet.com (BenJamin Prater)
Subject: Re: Trying to write perl script that zips file
Message-Id: <365b2399.6891406@news.sofnet.com>


To use strict, you are going to have to define your variables with my,
such as my @args = (); my $rc = ... etc.

Ben

On Tue, 24 Nov 1998 15:35:40 -0500, "Abukar Mohamed"
<abukar@insidewire.com> wrote:

>Hi.
>
>I am trying to write a perl script that zips a file that resides on my
>server. Someone tried to help me and suggest to include this code:
>
>use strict;
>
>#To make sure multiple tests dont infulence each other
>unclink($outfile);
>
>@args = ("$program","$outfile","$infile");
>$rc = system(@args);
>
>print "return value = $rc\n";
>print " file $outfile exists" if (-f $outfile);
>
>Yet, I got these errors!
>
>Global symbol "infile" requires explicit package name at
>/u/web/roomm1/cgi-local/zipfile.cgi line 18.
>Global symbol "outfile" requires explicit package name at
>/u/web/roomm1/cgi-local/zipfile.cgi line 19.
>Variable "$outfile" is not imported at /u/web/roomm1/cgi-local/zipfile.cgi
>line 21.
>Global symbol "outfile" requires explicit package name at
>/u/web/roomm1/cgi-local/zipfile
>
>Any Help would be greatly appretiated.
>
>Abukar
>
>
>
>
>



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

Date: Tue, 24 Nov 1998 21:40:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Trying to write perl script that zips file
Message-Id: <zJF62.48$Zw2.208@nsw.nnrp.telstra.net>

In article <365b187e.0@diana.idirect.com>,
	"Abukar Mohamed" <abukar@insidewire.com> writes:
> use strict;

If you use strict, you will have to use my on your variables.

# perldoc strict
# perldoc -f my

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In the fight between you and the world,
Commercial Dynamics Pty. Ltd.       | back the world - Franz Kafka
NSW, Australia                      | 


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

Date: Tue, 24 Nov 1998 21:31:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Why doesn't something work?
Message-Id: <WAF62.44$Zw2.208@nsw.nnrp.telstra.net>

In article <365c0a88.1036215@news.skynet.be>,
	bart.lateur@skynet.be (Bart Lateur) writes:

> You can MAKE it work by doing it this way:
> 
> 	%totals_info = ( %totals_info, $1 => $2 );
> 
> but I bet it's a very inefficient way to do it.

Yep, it is. It has to make copies of the hash.

$totals_info{$1} = $2;

will work just fine.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.       | password?
NSW, Australia                      | 


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

Date: Tue, 24 Nov 1998 22:51:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: wierd perl5.04004 behaviour
Message-Id: <Pine.GSO.4.02A.9811241448140.4375-100000@user2.teleport.com>

On 20 Nov 1998, Mathias Koerber wrote:

> @ARGV;

What does this line do for you? It doesn't do anything for me! Since it's
not the last line being executed in a subroutine, it's not a return value.

>         local($qid);

Probably you wanted my() instead.

> Why is it executing line 25 before going into the while loop at like 18?

It's not, but the debugger sometimes shows lines being executed
out-of-order. Or, at least, it used to do that; it gets updated about
every six hours. :-)  Don't let it bother you, unless you're interested in
debugging the debugger....

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

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

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