[12659] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 68 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 7 18:17:53 1999

Date: Wed, 7 Jul 1999 15:11:34 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 7 Jul 1999     Volume: 9 Number: 68

Today's topics:
        Newbie:Help with pipes. <pcs26@cam.ac.uk>
    Re: Newbie:Help with pipes. (Anno Siegel)
    Re: NT DBI Install Problem <gellyfish@gellyfish.com>
        Out of Memory Error <vc13stu1@americasm01.nt.com>
    Re: Out of Memory Error (Anno Siegel)
    Re: Out of Memory Error <tchrist@mox.perl.com>
    Re: Passing an uploaded file to js string variable <webmaster@webmagic.n.se>
        Passing Environment Variable back to parent process <sweather@fastenal.com>
    Re: PERL for mainframe SMF data? <cassell@mail.cor.epa.gov>
    Re: PERL for mainframe SMF data? <gellyfish@gellyfish.com>
    Re: Perl Inetd based Daemon and Originating Client IP daniel_chalef@my-deja.com
    Re: Perl/CGI Combined file upload & e-mail <martin@adoma.se>
    Re: Polling sockets (Anno Siegel)
        Problems with derefrencing der_kommandant@my-deja.com
    Re: Problems with derefrencing ()
        Question: Good Project? <magoo10@prodigy.net>
    Re: Question: Good Project? (Jason Stapels)
    Re: Question: Good Project? <anonymous@web.remarq.com>
    Re: Question: Good Project? <magoo10@prodigy.net>
    Re: regex to eat all html tags (or check your faqs, Jac sethr@crocker.com
    Re: regex to eat all html tags (or check your faqs, Jac <revjack@radix.net>
    Re: regex to eat all html tags (or check your faqs, Jac <emschwar@rmi.net>
    Re: regex to eat all html tags (or just the faqs, maam) sethr@crocker.com
    Re: regex to eat all html tags (or just the faqs, maam) <emschwar@rmi.net>
        regular expressions in vi (Barry G Reville)
    Re: return value from inside foreach <spike_YYwhiteYY@YYdellYY.com>
    Re: s/// Bug/bad syntax?? (WAS:$scalars in s/// not wor <gellyfish@gellyfish.com>
    Re: Stability Question <martin@adoma.se>
        Summing Array to Hash elements wired2000@my-deja.com
    Re: sybperl help <myparu@yahoo.com>
    Re: Telnet Query <gellyfish@gellyfish.com>
        tie() handle and write() (Jenda Krynicky)
    Re: Unbelievably simple question <gellyfish@gellyfish.com>
    Re: Using BigFloat? (M.J.T. Guy)
        Virtual partners xjehan@hotmail.com
    Re: Webpages and Perl-Couple of Questions <uri@sysarch.com>
    Re: Website search using regular expression <akadakia@my-deja.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 7 Jul 1999 19:18:23 +0100
From: "Paul Scott" <pcs26@cam.ac.uk>
Subject: Newbie:Help with pipes.
Message-Id: <931371468.17049.0.nnrp-12.c2ded04b@news.demon.co.uk>

Hi all,
I am using the RDB scripts (if anyone knows them), and attempting to adapt
them for cgi stuff. My problem is that one of the scripts sorts by passing
$_ through a pipe to sort on the unix box, which then gives the output to
stdout, when I need it to go to a file. I have tried open(STDOUT,
">sorted.dat") at the start but the data still gets printed out to the
screen, not to the file.
What now? I have put the code for the pipe section at the end of this
message(and yes, the {} dont match as it is a subsection).
Any help appreciated,
Paul S
--snip--
open( SS, "| sort -t\"\t\" $sarg" ) || # UNIX sort
  die "\nCan't open pipe to sort\n" ;
               open(STDOUT, ">sorted.rdb");

 }
 next ;
    }
           print SS $_ ;
}
--snip--




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

Date: 7 Jul 1999 21:08:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Newbie:Help with pipes.
Message-Id: <7m0fkk$49l$1@lublin.zrz.tu-berlin.de>

Paul Scott <pcs26@cam.ac.uk> wrote in comp.lang.perl.misc:
>Hi all,
>I am using the RDB scripts (if anyone knows them), and attempting to adapt
>them for cgi stuff. My problem is that one of the scripts sorts by passing
>$_ through a pipe to sort on the unix box, which then gives the output to
>stdout, when I need it to go to a file. I have tried open(STDOUT,
>">sorted.dat") at the start but the data still gets printed out to the
>screen, not to the file.
>What now? I have put the code for the pipe section at the end of this
>message(and yes, the {} dont match as it is a subsection).
>Any help appreciated,
>Paul S
>--snip--
>open( SS, "| sort -t\"\t\" $sarg" ) || # UNIX sort

Not a perl question.  Just do

open( SS, "| sort -t\"\t\" $sarg >sorted.dat" ) || # UNIX sort
  die "\nCan't open pipe to sort\n" ;

Anno


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

Date: 7 Jul 1999 20:46:31 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NT DBI Install Problem
Message-Id: <7m0eb7$u9$1@gellyfish.btinternet.com>

On Wed, 07 Jul 1999 13:21:26 GMT gene158@my-deja.com wrote:
> You said "ppm install DBI" but what directory do you write this?
> 

If Perl is properly installed it shouldnt matter whay directory you
are in ...

And hey can you guys sort out your quoting.  I just snipped the lot
because it was too much work.  The attribution and the quoted material
should come *first* and you should cut out the quoting of signatures.

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


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

Date: Wed, 07 Jul 1999 14:19:49 -0400
From: "Chaudhry, Asad [CAR:VC13:EXCH]" <vc13stu1@americasm01.nt.com>
Subject: Out of Memory Error
Message-Id: <37839A45.D76A0F4@americasm01.nt.com>

Hi,

When I try to parse a file larger than 5 MB into a collection of perl
data structures I get an 'out of memory' error. Is there a physical
limitation within perl on the amount of data that can be read in or
processed? I am running perl 5.004 on a HP (BOX) with 96 MB RAM and
plenty of disk space.

Thanks in advance
Asad.





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

Date: 7 Jul 1999 21:14:19 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Out of Memory Error
Message-Id: <7m0fvb$4b5$1@lublin.zrz.tu-berlin.de>

Chaudhry, Asad [CAR:VC13:EXCH] <vc13stu1@americasm01.nt.com> wrote in comp.lang.perl.misc:
>Hi,
>
>When I try to parse a file larger than 5 MB into a collection of perl
>data structures I get an 'out of memory' error. Is there a physical
>limitation within perl on the amount of data that can be read in or
>processed?

You're touching one of Perl's points of honor.  No, there isn't such
a limitation.

>           I am running perl 5.004 on a HP (BOX) with 96 MB RAM and
>plenty of disk space.

What else is running?

Anno


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

Date: 7 Jul 1999 15:47:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Out of Memory Error
Message-Id: <3783cae5@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Chaudhry, Asad [CAR:VC13:EXCH]" <vc13stu1@americasm01.nt.com> writes:
:When I try to parse a file larger than 5 MB into a collection of perl
:data structures I get an 'out of memory' error. Is there a physical
:limitation within perl on the amount of data that can be read in or
:processed? I am running perl 5.004 on a HP (BOX) with 96 MB RAM and
:plenty of disk space.

And disk space has to do with what exactly?  The question is one of
virtual memory, not physical memory.  Perhaps you're thinking of swap
space, but you never mention that.  Certainly you could invent a data
structure that were so huge that you'd run out.  Or you could have an
overly recursive algorithm that's eating everything in sight.  Or you
could have set your process's resource limits (type limit or ulimit in
your shell) too low for the problem at hand.  Try running "top" in another
xterm, or if that fails, system("ps v$$") from perl now and then to
watch yourself grow.   (Or whatever ps flags your HP-hosed system expects)

--tom
-- 
Basically, avoid comments.  If your code needs a comment to be understood,
it would be better to rewrite it so it's easier to understand.  --Rob Pike


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

Date: Wed, 07 Jul 1999 23:51:24 +0200
From: WebMaster <webmaster@webmagic.n.se>
Subject: Re: Passing an uploaded file to js string variable
Message-Id: <3783CBDC.51ECAB88@webmagic.n.se>

Jordan,

thanks for your help!

After some homework on reg expr in Perl I finally found out how to clean up the
variable to an understandable format in JavaScript, and the script is now
successfully called from the Perl generated HTML page.

Per Wennman



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

Date: Wed, 7 Jul 1999 11:10:06 -0500
From: "Sam Weatherhead" <sweather@fastenal.com>
Subject: Passing Environment Variable back to parent process
Message-Id: <7lvu4n$t9@enews3.newsguy.com>

When my perl script gets called from within a batch file, or
from within the NT shell, it sets an environment variable. However,
the environment variable set isn't reflected in the parent process that
called it. Is there a way to have the changes made in the script get
reflected back to the process that called it? I can't find anything except
a brief mention of this in perlfaq8.

Environment:
NT 4.0 Workstation SP3
ActiveState Build 517
Local Admin on my PC

Sam Weatherhead
Fastenal Company




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

Date: Wed, 07 Jul 1999 10:48:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: PERL for mainframe SMF data?
Message-Id: <378392E0.D76FE08B@mail.cor.epa.gov>

Abigail wrote:
> 
> David Cassell (cassell@mail.cor.epa.gov) wrote on MMCXXXVI September
> MCMXCIII in <URL:news:378298C9.D4F8FB40@mail.cor.epa.gov>:
> {}
> {} As far as I know, there is not a port for MVS.  VMS, yes.
> {} MVS?  Haven't seen it.
> 
> According to 'man perl', perl runs on OS390 - formerly known as MVS.

D'oh!  I checked perlfaq2, and it's not mentioned there.  I
did run 'man perl', but that's pulling our old 5.004_04
manpages and didn't show it.  Mea culpa.

My comments on SAS still stand.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 7 Jul 1999 20:14:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PERL for mainframe SMF data?
Message-Id: <7m0cfo$tf$1@gellyfish.btinternet.com>

On Wed, 07 Jul 1999 10:48:16 -0700 David Cassell wrote:
> 
> My comments on SAS still stand.
> 

'Who dares wins' - eh ?

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


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

Date: Wed, 07 Jul 1999 18:54:50 GMT
From: daniel_chalef@my-deja.com
Subject: Re: Perl Inetd based Daemon and Originating Client IP
Message-Id: <7m07pj$l1g$1@nnrp1.deja.com>


> > I've written a Inetd-based Perl daemon and would liek to log client
> > addresses - not using Socket.pm and the normal methods of socket
> > manipulation, how do I determine the client IP address?
>
> What do you mean by 'the normal methods of socket manipulation' ?

Using something like:

$paddr = accept(Client,Server);

my($port,$iaddr) = sockaddr_in($paddr);

to determine the remote IP...


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


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

Date: Wed, 07 Jul 1999 19:12:02 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: Perl/CGI Combined file upload & e-mail
Message-Id: <37839872.6669B7B4@adoma.se>



ameldridge@gecapital.com wrote:
> 
> Hello to all,
> 
> I need to be able to have a HTML form/Perl/CGI script that will enable
> customers to upload a file from their PC & then will automatically send
> me an e-mail inform me of this action (complete with the file details,
> size, name etc..).
> 
> I have been able to perform both these tasks separately but I need
> desperately to combine these scripts.
> 
> I’m using cgi-lib (kinda hacked around by myself) for the File Upload &
> a mailform script (again hacked about) from Bignosebird.com
> 
> Thanks in advance
> 
what is your question then??
is it:
is anyone here intrested in doing it for me??
or maybee:
how do i learn perl, so i can do it myself??

Best regards
Martin Quensel


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

Date: 7 Jul 1999 19:26:59 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Polling sockets
Message-Id: <7m09m3$43n$1@lublin.zrz.tu-berlin.de>

R.Joseph  <streaking_pyro@my-deja.com> wrote in comp.lang.perl.misc:
>I am trying to write a socket-based server using IO::Select and
>IO::Socket.  It was suggested by someone who is more advanced than me
>and has done what I am doing to poll the sockets to allow multiple
>connections.  This I don't fully understand; what does he mean when he
>says this?  Any help is great! Thanks!

Look, what select does for you is described in perldoc -f select.
In short, you give it a number of file descriptors to watch.  It
gives you back which file descriptor is ready for input or for
output.  The way you react to this information depends entirely
on what your server is supposed to do, so there will be not much
help from here (there can't).

Anno


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

Date: Wed, 07 Jul 1999 16:43:21 GMT
From: der_kommandant@my-deja.com
Subject: Problems with derefrencing
Message-Id: <7m0034$hnl$1@nnrp1.deja.com>

Hi;

I cannot seem to figure this out even after reading perldoc perlref.
Any ideas are appreciated:


my $warning = "WARNING LOW DISK SPACE!";
open (DFOUTPUT, "df -I \| grep dev|") or die "cannot access df!";
while(<DFOUTPUT>){
   ($filesystem, $total_kb, $used, $free, $percent_used, $mount_point)
= split;
   push( @{$df_output{$mount_point}}, $percent_used);
}



basically when i try to do a

print $df_output{$mount_point};

it returns a value like ARRAY(hex_code).  I need it to return
the actual value sourced in there.

when i try to do something like

print $df_output{$mount_point}->[1];
I get the following error:
Use of uninitialized value at ./space_check.pl line 36, <DFOUTPUT>
chunk 12.

any ideas what i am doing wrong?  i do not understand this topic
completely. :(

Thanks,



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


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

Date: 7 Jul 1999 20:15:41 GMT
From: redmondm@yahoo.com ()
Subject: Re: Problems with derefrencing
Message-Id: <slrn7o7dod.58t.redmondm@kells.kells>

In article <7m0034$hnl$1@nnrp1.deja.com>, der_kommandant@my-deja.com wrote:

>open (DFOUTPUT, "df -I \| grep dev|") or die "cannot access df!";
>while(<DFOUTPUT>){
>   ($filesystem, $total_kb, $used, $free, $percent_used, $mount_point)
>= split;
>   push( @{$df_output{$mount_point}}, $percent_used);
>}
>

>any ideas what i am doing wrong?  i do not understand this topic
>completely. :(
>

Your making it more complicated than it needs to be :) 
$df_output{$mount_point} is a scalar so you can store the information
you need by simply assigning to it:

          $df_output{$mount_point} = $percent_used;

$mount_point should be unique. You will end up with a hash of the
values you want.

>Thanks,

Martin


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

Date: Wed, 7 Jul 1999 13:45:37 -0000
From: "MacInnes" <magoo10@prodigy.net>
Subject: Question: Good Project?
Message-Id: <7m03i5$2sv4$1@newssvr04-int.news.prodigy.com>

Hello All,
            I've been trying to teach myself the basics of perl through the
book Learning Perl. I've read the first 6 chapters or so and before going
any further I want to make sure I completely understand all that has been
taught so far. There is no better way to learn how to program than to
actually program, right :) ? So my question is what do you guys think would
be a good project for me to undertake? I've done the exercises at the end of
the chapters, but they only focus on that chapters material. So far I have
learned about the following:

scalar variables
arrays
hashes
sub routines
regular expressions
and control structures

Any ideas? Id like a project where I might be able to incorporate everything
I know.

Thanks in advance for any contributions..

Jason
Perl Newbie




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

Date: 7 Jul 1999 18:13:48 GMT
From: jmstapel_n0spam@mtu.edu (Jason Stapels)
Subject: Re: Question: Good Project?
Message-Id: <7m05cs$kem$1@campus1.mtu.edu>

Write Windows2001



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

Date: Wed, 07 Jul 1999 10:36:30 -0800
From: Ashish Kadakia <anonymous@web.remarq.com>
Subject: Re: Question: Good Project?
Message-Id: <931372592.10367@www2.remarq.com>

I am going to give a good project..

See if you can come up with good answer.

I have a table with fields A, B, C
Table goes like this

A B C

a x b

b y c

c x d

d z a

b u e

etc..
Now I have to find out the chain..
ie.. if I enter a and d, then the answer will be
a->x->b->y->c->d
If I enter a and e, then the answer will be
a->x->b->u->e

I hope you did understand.

ANK




**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****


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

Date: Wed, 7 Jul 1999 16:16:12 -0000
From: "MacInnes" <magoo10@prodigy.net>
Subject: Re: Question: Good Project?
Message-Id: <7m0ccg$18mk$1@newssvr03-int.news.prodigy.com>


Ashish Kadakia <anonymous@web.remarq.com> wrote in message
news:931372592.10367@www2.remarq.com...
> I am going to give a good project..
>
> See if you can come up with good answer.
>
> I have a table with fields A, B, C
> Table goes like this
>
> A B C
>
> a x b
>
> b y c
>
> c x d
>
> d z a
>
> b u e
>
> etc..
> Now I have to find out the chain..
> ie.. if I enter a and d, then the answer will be
> a->x->b->y->c->d
> If I enter a and e, then the answer will be
> a->x->b->u->e
>
> I hope you did understand.
>
> ANK
>
>
>
>
> **** Posted from RemarQ - http://www.remarq.com - Discussions Start Here
(tm) ****

hmmm...  what do you mean by the chain? Please clarify.

Jason




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

Date: Wed, 07 Jul 1999 20:32:45 GMT
From: sethr@crocker.com
Subject: Re: regex to eat all html tags (or check your faqs, Jack.)
Message-Id: <7m0dhd$nnh$1@nnrp1.deja.com>

Back from perl.com. Couldn't find the faq there either. Seth


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


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

Date: 7 Jul 1999 21:07:21 GMT
From: revjack <revjack@radix.net>
Subject: Re: regex to eat all html tags (or check your faqs, Jack.)
Message-Id: <7m0fi9$r2o$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

sethr@crocker.com explains it all:

:Back from perl.com. Couldn't find the faq there either. Seth

Go back to www.perl.com

Click on "FAQs"

Click on part 0 (zero)

Search that page for "HTML"

Scroll up a bit to see what part it's in (9 in your case)

Go back one page to the FAQ page

Click on 9


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

Date: 07 Jul 1999 15:22:11 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: regex to eat all html tags (or check your faqs, Jack.)
Message-Id: <xkfr9mkf94s.fsf@valdemar.col.hp.com>

sethr@crocker.com writes:
> Back from perl.com. Couldn't find the faq there either. Seth

Then, I beg of you, leave Perl alone, and go back to whatever job you had 
before you tried to start programming.  If your reading comprehension
really is poor enough that you can't determine that a hypertext link
clearly labeled "FAQs" will take you to the FAQ, then you are surely
unable to profit from any help anyone here could possibly give you.

-=Eric


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

Date: Wed, 07 Jul 1999 19:24:21 GMT
From: sethr@crocker.com
Subject: Re: regex to eat all html tags (or just the faqs, maam)
Message-Id: <7m09gl$lsf$1@nnrp1.deja.com>

Read the faq? What a great idea. Wish I had thought of it, but never
mind. I thought I'd do just what you suggested and check out the one on
my hard drive. The one that came with a my version of Active State Perl.
But,oh, no! That faq wasn't included.

Now I'm off to <http://www.perl.com>. I had never heard of it. Or if I
had, I forgot. Thanks for suggesting that I go there.

Seth

In article <xkfu2rhgwdv.fsf@valdemar.col.hp.com>,
  Eric The Read <emschwar@rmi.net> wrote:
> "dave shaffer" <shaffer2@ptd.net> writes:
> > I need a regular expression to match/remove html tags -actually
anything in
> > greater/lessthan brackets "<all characters >" and on multiple lines.
> >
> > I want to remove all html stuff and then search the remaining text
for
> > certain words.
>
> So what was unclear about the FAQ entry on your hard drive, entitled
>
>       How do I remove HTML from a string?
>
> If you tell us how to make it clearer, others who were similarly
confused
> might be helped, and the FAQ will thereby be made better for
everybody.
>
> Um... you *did* read the FAQ, didn't you?  The one that's on your hard
> drive?  The one that's included with every "modern" distribution of
Perl?
> The one that's also available on <URL:http://www.perl.com/>?  The one
> that USENET etiquette says should be consulted before posting a
question
> to any newsgroup?
>
> Right?
>
> -=Eric, optimist par excellence
>


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


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

Date: 07 Jul 1999 14:59:06 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: regex to eat all html tags (or just the faqs, maam)
Message-Id: <xkfyagsfa79.fsf@valdemar.col.hp.com>

sethr@crocker.com writes:
> Read the faq? What a great idea. Wish I had thought of it, but never
> mind. I thought I'd do just what you suggested and check out the one on
> my hard drive. The one that came with a my version of Active State Perl.
> But,oh, no! That faq wasn't included.

Eh?  You must have a seriously obsolete version of ActivePerl, then.  Or
else your installation's broken.  Perl includes the documentation-- if
you don't have it, you don't have Perl, just the executable parts of it.

I've got build 517 on my NT box, and it's right there, in the massive
list of documentation it installed.  You can look at the HTML version
that ActivePerl makes available from your Start menu, or you can use the
venerable (and deprecated by Tom Christiansen) perldoc to read the FAQ.

> Now I'm off to <http://www.perl.com>. I had never heard of it. Or if I
> had, I forgot. Thanks for suggesting that I go there.

It's much slower than using the docs that are (or should be) installed on 
your hard drive.  Take another look-- if they really aren't there, then
you should fix your broken installation of Perl soon, and save yourself
time and connection charges.

-=Eric


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

Date: 7 Jul 1999 18:04:14 GMT
From: breville@uoguelph.ca (Barry G Reville)
Subject: regular expressions in vi
Message-Id: <7m04qu$dqq$1@testinfo.uoguelph.ca>

	I use vi and I know PERL - is there any way to use perl's regular expressions within the vi editor?

PS - When I copy and paste from one vi session into another each line is one more tab in than the previous - I actually have 
to resort to PICO! - whats the solution to this?  I use the CRT session emulator.

Thanks in advance,

Barry Reville 
University of Guelph
Computing and Communications Services
breville@uoguelph.ca


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

Date: Wed, 7 Jul 1999 13:00:48 -0500
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: return value from inside foreach
Message-Id: <7m04g1$jp6$1@galaxy.us.dell.com>

Your exact code works fine on Perl 5.004_04 on Solaris 2.6.

Spike

TK Soh wrote in message <377BD409.7C9C5463@email.sps.mot.com>...
>I have found this strange (?) behaviour of foreach() when putting it
>inside a sub. Wonder if there is something I did wrong. I tried it with
>Perl 5.005_01 on HPUX 10.20 and Solaris 2.5.1.





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

Date: 7 Jul 1999 21:35:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: s/// Bug/bad syntax?? (WAS:$scalars in s/// not working - anyone have any ideas?)
Message-Id: <7m0h7e$us$1@gellyfish.btinternet.com>

On 06 Jul 1999 23:19:28 -0400 Uri Guttman wrote:
>>>>>> "DM" == Dude Man <dudeman@dude.com> writes:
> 
>   DM> if ( open(CATBODYFILE, $CATBODY) )
> 
> what if the open fails? it is more common to do
> 	open( HANDLE, $file ) || die "can't open $file $!" ;
> then the rest of the code without the extra indents.
> 

<snip>

> 
>   DM> }
> 
> no need for that brace since there should be no if block.
> 

I think that judgement might be a little harsh as there are may be many
reasons why simply die()ing might not be the best thing to do - he might
want to print a more informative message, cleanup, try to fix the reason
the open failed if possible or simply switch to plan B: the important
thing is not carrying on regardless when the open() fails.  Of course
one could implement a __DIE__ handler but that does throw you out of
the usual flow of control.

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


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

Date: Wed, 07 Jul 1999 19:00:08 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: Stability Question
Message-Id: <378395A7.E67CA506@adoma.se>



Ron Arquilevich wrote:
> 
> I'm looking for a server to host our website and was wondering if anyone
> 
> has experience with MacPerl. People have told me it's not very stable
> but I want some second opinions. Also, how much if any script
> modification will be needed to run MacPerl?

running MacPerl as a webserver is that what you want? or....??
I dont understand your question..

MacPerl isent something you use as a webserver...you can write a
webserver with it though.

since your second question doesent make sense to me, ill give you a
ansver that doesent make sense either
hfdaklöfhdlkhfaiodfhklöskd

Best regards
Martin Quensel


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

Date: Wed, 07 Jul 1999 20:17:09 GMT
From: wired2000@my-deja.com
Subject: Summing Array to Hash elements
Message-Id: <7m0cjo$n9r$1@nnrp1.deja.com>

Hi,

I have an array that stores a list of unknown keywords (see below) and
I would like to convert this array to a hash table which stores the
total number of occurances in the array.

Ex:

Sample Data Stored in the array @data
hello
world
hi
hello
this is a
sample
world

I want this to be represented into a hash table as such:
hello     2
world     2
hi        1
this is a 1
sample    1

As well, after the new data structure has been done, I need an easy way
to go through all keys in the hash and report them to the user.

I'm not quite sure how to do the unique scan, especially because I
don't know what the keywords are at runtime. Normally I would do a
foreach, but the problem is I don't know how to insert data into the
hash when I don't know what the keys are upfront. Anyone have any
suggestions or sample code would be greatly appreciated.

Thanks
Charles


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


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

Date: Wed, 07 Jul 1999 13:18:13 -0400
From: Murali Ravipudi <myparu@yahoo.com>
To: jessica.qing.wang@bankerstrust.com
Subject: Re: sybperl help
Message-Id: <37838BD5.8E7A22ED@yahoo.com>

I guess you wanted to write ...

while($dbh->dbresults != NO_MORE_RESULTS)
{
      @dat = $dbh->dbnextrow)
      ($ae_id, $ae_code, $ae_name) = @dat;
      print DB "$ae_id, $ae_code, $ae_name\n";
}



> while($dbh->dbresults != NO_MORE_RESULTS)

> {

>   while (@dat = $dbh->dbnextrow)
>   {
>     ($ae_id, $ae_code, $ae_name) = @dat;
>     print DB "$ae_id, $ae_code, $ae_name\n";
>   }
> }
>





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

Date: 7 Jul 1999 21:51:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Telnet Query
Message-Id: <7m0i50$vs$1@gellyfish.btinternet.com>

On Wed, 7 Jul 1999 09:39:28 +0200 Rainer Kraly wrote:
> I try to establish a Telnet connection with perl using socket (don't want to
> use Comm.pl) but i only get undefined pattern back.
> Queries to FTP, SMTP Ports work fine. I guess the problem is Telnet using a
> TTY VT100 .
> Can anybody show me how to define the TTY in Perl for Telnet
> 

You will almost certainly want to use Net::Telnet to do this - the telnet
protocol is not as simple as the other two you mention - if you really
want to persist without using the module then you will want to look
inside it at least and/or read the relevant RFC's

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


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

Date: Wed, 07 Jul 1999 19:09:22 GMT
From: Jenda@McCann.cz (Jenda Krynicky)
Subject: tie() handle and write()
Message-Id: <1103_931374562@prague_main>

Is it possible to overload the write() function?

I have been playing with tie()d FILEHANDLES.

print TIEDHANDLE ... calls Modulename::PRINT.
printf TIEDHANDLE ... calls Modulename::PRINTF.
but what with write()?

It doesn't seem to call Modulename::WRITE. Nor Modulename::PRINT.
I tried even SYSWRITE just in case ... nothing.

So how, if at all, is this possible?

Thanks, Jenda http://Jenda.Krynicky.cz
P.S.: Please CC: me, it's hard to keep up with the load both here and on the perl-win32-xxx lists.


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

Date: 7 Jul 1999 20:12:13 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Unbelievably simple question
Message-Id: <7m0cat$tc$1@gellyfish.btinternet.com>

On Tue, 6 Jul 1999 23:35:37 +0100 Tony Lloyd wrote:
> I really, really, don't want to have to learn PERL.  

I'd really recommend learning Perl if you are going to play with it.
Or hire a programmer of course.

<snip>

> this script works fine but if I try to add (using DOS "Edit"):-
> 
> print MAIL "Cc: rtlloyd@easynet.co.uk\n;
> 
> the whole thing collapses (HTTP 500 - Internal server error).  What can I be
> doing wrong?
> 

Of course because you dont want to learn Perl and thus have none of the
wonderful documentation associated with it you will have missed this in
the perldiag manpage:

       In string, @%s now must be written as \@%s
           (F) It used to be that Perl would try to guess whether
           you wanted an array interpolated or a literal @.  It
           did this when the string was first used at runtime.
           Now strings are parsed at compile time, and ambiguous
           instances of @ must be disambiguated, either by
           prepending a backslash to indicate a literal, or by
           declaring (or using) the array within the program
           before the string (lexically).  (Someday it will
           simply assume that an unbackslashed @ interpolates an
           array.)

I'll leave you to figure out what you need to do - it'll be a learning
experience for you.

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


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

Date: 7 Jul 1999 18:11:38 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Using BigFloat?
Message-Id: <7m058q$imt$1@pegasus.csx.cam.ac.uk>

In article <3774069B.90597ECC@sirius.com>, artlore  <artlore@sirius.com> wrote:
>I'm getting spurious (to me) error messages from the BigFloat module
>such as as use of an unititialized value on line 78, in the middle of
>the package's regexp stringify routine...

Yup.   That code isn't -w clean.   The attached patch should fix it.
Reported to perlbug.


Mike Guy


--- ./lib/Math/BigFloat.pm.orig	Thu Jan  7 04:41:53 1999
+++ ./lib/Math/BigFloat.pm	Wed Jul  7 16:05:05 1999
@@ -76,8 +76,10 @@
 sub fnorm { #(string) return fnum_str
     local($_) = @_;
     s/\s+//g;                               # strip white space
-    if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ && "$2$4" ne '') {
-	&norm(($1 ? "$1$2$4" : "+$2$4"),(($4 ne '') ? $6-length($4) : $6));
+    if (/^([+-]?)(\d*)(\.(\d*))?([Ee]([+-]?\d+))?$/ &&
+           (length $2 || defined $4) {
+        my $x = defined $4 ? $4 : '';
+	&norm(($1||'+') . "$2$x", ($6||0)-length($x));
     } else {
 	'NaN';
     }

End of patch


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

Date: Wed, 07 Jul 1999 17:10:12 GMT
From: xjehan@hotmail.com
Subject: Virtual partners
Message-Id: <7m01l7$ied$1@nnrp1.deja.com>

Hello

Did you see that the open source concept is setting up new standards ?

Apache, Linux, PHP ...
The real difficult thing about an open projects is to find partners to
work with you.
That's why the free web site www.e-quantum.com has been created.

Participate in this project, and become a virtual team leader in a
creative project of your
own. Working for other's projects, you will earn credits. With enough
credits, you will be
able to build your own team.

Understand the virtual team principles that will help building open
source projects
on www.e-quantum.com


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


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

Date: 07 Jul 1999 13:50:55 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Webpages and Perl-Couple of Questions
Message-Id: <x7pv24tklc.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> BTDTDNGTTS.

ok, i give up. what does that mean? i think it starts with "but that
doesn't". 

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Wed, 07 Jul 1999 18:27:03 GMT
From: ANK <akadakia@my-deja.com>
Subject: Re: Website search using regular expression
Message-Id: <7m0657$kc0$1@nnrp1.deja.com>

In article <slrn7o563a.tch.abigail@alexandra.delanet.com>,
  abigail@delanet.com wrote:
> Ashish Kadakia (anonymous@web.remarq.com) wrote on MMCXXXV September
> MCMXCIII in <URL:news:931295422.2959@www.remarq.com>:
> ~~ Hi, is there anysearch engine, anyone knows it, or how I
> ~~ can make it which searches the URLs via regular expression.
> ~~ ie... .* will match all the sites
> ~~ but .*?com will match websites ending com
> ~~ .*?/download will match all website having download
> ~~ directory.
>
> And your Perl question is ?
If it doesn't exist, I would like to make one and need some pointers
Thanks..

> Abigail
> --


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


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V9 Issue 68
************************************


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