[12715] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 125 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 13 19:37:25 1999

Date: Tue, 13 Jul 1999 16:32:40 -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           Tue, 13 Jul 1999     Volume: 9 Number: 125

Today's topics:
        Functions Parameters in Perl <nsuni@hotmail.com>
    Re: Functions Parameters in Perl <dgris@moiraine.dimensional.com>
    Re: Functions Parameters in Perl <jcreed@cyclone.jprc.com>
    Re: Functions Parameters in Perl <nsuni@hotmail.com>
        Garbage Collection Performance <jerbyr@my-deja.com>
    Re: Getting very irregular single 'name' field into fir (Martien Verbruggen)
    Re: Getting very irregular single 'name' field into fir (Sitaram Chamarty)
    Re: Help with formmail script <marshalc@americasm01.nt.com>
    Re: Help with formmail script (Abigail)
    Re: Help with formmail script (Abigail)
    Re: help: using qmail on NT (Ben Coleman)
        how do i convert a integer to string. cramey@my-deja.com
    Re: how do i convert a integer to string. (Larry Rosler)
    Re: how do i convert a integer to string. <thoren@csi.com>
        How do I include a hash is a regular expression? <alister2@csc.co.nz>
    Re: How do I include a hash is a regular expression? (Abigail)
    Re: How do I include a hash is a regular expression? (Abigail)
    Re: How do I include a hash is a regular expression? (Anno Siegel)
    Re: How do I include a hash is a regular expression? (Anno Siegel)
    Re: How do YOU format your << data? <iansmith@pepper.ncinter.net>
    Re: How do you get rid of a remainder in a number (Abigail)
    Re: How do you get rid of a remainder in a number <andrew.yuen@fujitsu.com.au>
        how to monitor other process'es input/output ? <gump_xu@sc.mcel.mot.com>
    Re: how to monitor other process'es input/output ? <dehon_olivier@jpmorgan.com>
    Re: how to pass variables to system commands (John Borwick)
    Re: how to pass variables to system commands <stampes@xilinx.com>
    Re: how to pass variables to system commands (Abigail)
        How to request an http doc? <hart@rohan.sdsu.edu>
    Re: How to request an http doc? <gellyfish@gellyfish.com>
    Re: How to request an http doc? <swiftkid@bigfoot.com>
    Re: How to request an http doc? (elephant)
        HTML template variable substition  (Ben Humphreys)
    Re: HTML template variable substition <cs2400@hotmail.com>
    Re: HTML template variable substition <cs2400@hotmail.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 13 Jul 1999 10:51:31 -0500
From: Suni <nsuni@hotmail.com>
Subject: Functions Parameters in Perl
Message-Id: <378B6082.95B81B2A@hotmail.com>

Hi:

I am trying to call a function compare with 2 filenames as the argument.

The 2 files $file1 and $file2 exist.  The function checks for common
words in both the files and returns them in a hashtable with the word as
the key and count of words as the value.

%hash = &compare($file1, $file22);

The compare function is written like this

sub compare() {

    my ($filename1 , $filename2) = $_;
    print "\n File1:  $filename1 and File2: $filename2";
 ....


%hash;
}

I am unable to get the correct values passed to the compare function.
When i print the values of the filenames, it gives me blank.

Could you please help me by telling what mistake am doing.

Thanks in advance
Sue.



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

Date: 13 Jul 1999 10:10:47 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Functions Parameters in Perl
Message-Id: <m3aet0sf7c.fsf@moiraine.dimensional.com>

Suni <nsuni@hotmail.com> writes:

> sub compare() {
> 
>     my ($filename1 , $filename2) = $_;
                                     ^^

You want @_.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 13 Jul 1999 12:14:25 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: Functions Parameters in Perl
Message-Id: <a1vhboh6hq.fsf@cyclone.jprc.com>

Suni <nsuni@hotmail.com> writes:

> The compare function is written like this
> 
> sub compare() {
             ^^
Do you know what putting those parens there does?
perldoc perlsub and search for 'Prototypes'

---Jason


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

Date: Tue, 13 Jul 1999 11:37:40 -0500
From: Sue <nsuni@hotmail.com>
Subject: Re: Functions Parameters in Perl
Message-Id: <378B6B54.8F64F03A@hotmail.com>

Hi:

I figured it out. The problem was i had overlooked  this
   my ($filename1 , $filename2) = $_;
It shuld have been
    my ($filename1 , $filename2) =@_;

The information available with discussions is very helpful to newbies like
me.
Thanks
Sue



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

Date: Tue, 13 Jul 1999 16:46:10 GMT
From: Jeremy Purdy <jerbyr@my-deja.com>
Subject: Garbage Collection Performance
Message-Id: <7mfqgd$ns4$1@nnrp1.deja.com>

I have a data-intensive application that I am writing in PERL.  It uses
a LARGE amount of memory while processing, but runs fairly efficiently.
I just noticed, however, that at the end of the process, after the last
line of the program, there is a pause of approx. 10 min where the
program is waiting.

I assume that the program is doing garbage collection at this point,
cleaning up all of the memory which had been allocated to variables
within subroutines and so forth.  This delay just about doubles the
processing time of the application, while processing a file of this
size.

Can anyone give me some tips on how to improve the performance of
garbage collection.  Possibly some better way to handle buffers and data
arrays that would enable PERL to free the memory easier?

Thanks
Jeremy Purdy


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


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

Date: Tue, 13 Jul 1999 02:49:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Getting very irregular single 'name' field into first/last name for credit card gateway -- what hit rate is possible?
Message-Id: <lPxi3.169$h35.7537@nsw.nnrp.telstra.net>

In article <7mcsmt$67$1@plutonium.compulink.co.uk>,
	"Stephen Benson" <stephenb@scribendum.win-uk.net> writes:
> Atcherlly I do snip/arrange the buggers, time allowing, but again, so what?
> This meant to be content-driven communication. no? And that last one I felt
> should be left complete in all its glory.

You seem to have a problem with your dictionary as well.

> Bandwidth -- jeez I don't add html, lil songs and piccies -- an
> anachronistic discussion, I feel. What about all the mails that are in there
> twice -- html/text? What about this ridiculous exchage?

You say it again. We're not talking about 'mails' (dictionary broken
again?). HTML in a usenet posting is not accepted here either. This is
not email. This is not the WWW. Posting too much is rude and
inconsiderate. On Usenet, even the length of your signature matters.

> Basically I don't think anything I've done in my posts deserves this
> extended display of (b)anality.

Yes, it does. It deserves more than it is getting. And your attitude
has just made it certain that your future questions about Perl will
not be seen, and therefore not answered, by exactly those people who
are most likely to have the best and most correct answers.

*plonk*

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | Can't say that it is, 'cause it ain't.
NSW, Australia                      | 


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

Date: Tue, 13 Jul 1999 21:28:52 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Getting very irregular single 'name' field into first/last name for credit card gateway -- what hit rate is possible?
Message-Id: <slrn7oms56.ppq.sitaram@diac.com>

On Mon, 12 Jul 1999 14:28:45 +0100, Stephen Benson
<stephenb@scribendum.win-uk.net> wrote:

>twice -- html/text? What about this ridiculous exchage?

It may have been a Freudian slip, but you're absolutely right, of
course!  "Exchange" is ridiculous :-)


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

Date: Mon, 12 Jul 1999 16:20:22 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: Help with formmail script
Message-Id: <378A5C16.A1E58D1C@americasm01.nt.com>


Single quotes? You may need to put double quote and delimit your @ sign like
"user\@domain"

> $ADDR = <my email addy here, but i removed it for this post> ; # Leave
> Single Quotes!
>

~marshall



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

Date: 12 Jul 1999 23:10:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with formmail script
Message-Id: <slrn7olf07.h7.abigail@alexandra.delanet.com>

Ebola (heinens@ghsp.com) wrote on MMCXLI September MCMXCIII in
<URL:news:7mdde2$7gn$0@205.138.138.3>:
?? 
?? #!/usr/bin/perl5

Where is the -w?
Where is the -T?
Where is the 'use strict;'?
Where is the 'use CGI;'?

?? open(MAIL, "| /usr/sbin/sendmail -t -oi");

Where is the 'or die' part?

?? close(MAIL);

Where is the 'or die' part?

??                                 So, does anyone see anything peculiar in the
?? script, or perhaps can think of something elsewhere that might be a problem?


You take every possible step to not have Perl tell you about bugs, or
potential problems, and now you are wondering why the script silently
fails?

Turn *on* all the bells and whistles, and Perl will tell you want goes wrong.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 12 Jul 1999 23:10:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with formmail script
Message-Id: <slrn7olf1f.h7.abigail@alexandra.delanet.com>

Marshall Culpepper (marshalc@americasm01.nt.com) wrote on MMCXLI
September MCMXCIII in <URL:news:378A5C16.A1E58D1C@americasm01.nt.com>:
 .. 
 .. Single quotes? You may need to put double quote and delimit your @ sign like
 .. "user\@domain"

Single quotes is just fine. Then you don't have to backwack the @!



Abigail
-- 
perl -wlpe '}$_=$.;{' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 13 Jul 1999 04:37:14 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: help: using qmail on NT
Message-Id: <378ac1db.29913683@news.mindspring.com>

On Sat, 10 Jul 1999 12:21:52 +0530, "Ashish Jain" <ashishkjain@hotpop.com>
wrote:

>I am having problems using qmail on NT. Or if there are any altenative.
>Please suggest.

What?  Has DJB-ness been foisted upon the POBs?  Doesn't that amount to
cruel and unusual punishment, even for POBs?

Ben
-- 
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA


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

Date: Tue, 13 Jul 1999 19:38:58 GMT
From: cramey@my-deja.com
Subject: how do i convert a integer to string.
Message-Id: <7mg4kg$scg$1@nnrp1.deja.com>

i want to convert an integer

specifically

1111111 to a string with

str[0] == 1
 .
 .
 .
str[6] == 1

is there an easy way to do this ?


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


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

Date: Tue, 13 Jul 1999 13:48:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how do i convert a integer to string.
Message-Id: <MPG.11f54602a0238351989cbf@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7mg4kg$scg$1@nnrp1.deja.com> on Tue, 13 Jul 1999 19:38:58 
GMT, cramey@my-deja.com <cramey@my-deja.com> says...
> i want to convert an integer
> 
> specifically
> 
> 1111111 to a string with
> 
> str[0] == 1
> .
> .
> .
> str[6] == 1
> 
> is there an easy way to do this ?

Easier than you think.  Use it as a string, and it will be one.

Isn't Perl wonderful?

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


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

Date: Tue, 13 Jul 1999 23:45:10 +0200
From: "Thoren Johne" <thoren@csi.com>
Subject: Re: how do i convert a integer to string.
Message-Id: <#SD6SkXz#GA.131@nih2naaf.prod2.compuserve.com>

<cramey@my-deja.com> wrote in message
news:7mg4kg$scg$1@nnrp1.deja.com...
> i want to convert an integer
> specifically
> 1111111 to a string with
> str[0] == 1
> .
> .
> .
> str[6] == 1
>
> is there an easy way to do this ?

$zahl = 1111111;
@str = split //, $zahl;

gruß
thoren

--
8#X








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

Date: Mon, 12 Jul 1999 18:04:16 -0800
From: Aaron Lister <alister2@csc.co.nz>
Subject: How do I include a hash is a regular expression?
Message-Id: <931831458.28349@www.remarq.com>

I am trying to do something along the lines of:

m/([^\s]+)\s\1/;

but with $1 being a part of a hash

i.e.

m/([^\s]+)\s$job{\1}/;

but is obviously substituting $job to "" then a { then \1
followed by a }.

Does anyone know if it is possible to substitute the hash
correctly within a Regular Expression?

Aaron



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


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

Date: 13 Jul 1999 01:26:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do I include a hash is a regular expression?
Message-Id: <slrn7oln0i.h7.abigail@alexandra.delanet.com>

Aaron Lister (alister2@csc.co.nz) wrote on MMCXLII September MCMXCIII in
<URL:news:931831458.28349@www.remarq.com>:
__ I am trying to do something along the lines of:
__ 
__ m/([^\s]+)\s\1/;
__ 
__ but with $1 being a part of a hash
__ 
__ i.e.
__ 
__ m/([^\s]+)\s$job{\1}/;
__ 
__ but is obviously substituting $job to "" then a { then \1
__ followed by a }.
__ 
__ Does anyone know if it is possible to substitute the hash
__ correctly within a Regular Expression?


Well /m([^\s]+)\s$hash{$key}/ works. But what you want, can't be done.
At least, not that way. Variable interpolation is done before the regex
machine starts working, while \1 changes during the process, depending
on what is currently backreferenced. Neat concept you want to have 
working though. ;)

You might be able to do something tricky with (?{ code }) though, but 
I don't have enough experience with (?{}) yet to be sure.

BTW, instead of [^\s], one can write \S.



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Jul 1999 08:41:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do I include a hash is a regular expression?
Message-Id: <slrn7omgfe.h7.abigail@alexandra.delanet.com>

Eugene van der Pijll (pijll@phys.uu.nl) wrote on MMCXLII September
MCMXCIII in <URL:news:pijll.931849229@ruunat.phys.uu.nl>:
{} In <931831458.28349@www.remarq.com> Aaron Lister <alister2@csc.co.nz> writes:
{} 
{} >I am trying to do something along the lines of:
{} 
{} <snip>
{} 
{} >m/([^\s]+)\s$job{\1}/;
{} 
{} >but is obviously substituting $job to "" then a { then \1
{} >followed by a }.
{} 
{} Try ${job{\1}}. This is discussed in perlop, in the section 'Gory
{} details of parsing quoted constructs', subsection '?RE?, ...':


No, it's not discussed in that section. The point is not the interpretation
of \1, the problem is that \1 is variable, while interpolation happens
before hand.

Someone emailed me that this works:

    m/(\S+)\s(?p{$job{$1}})/



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Jul 1999 22:18:23 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I include a hash is a regular expression?
Message-Id: <7mgdvf$dg0$1@lublin.zrz.tu-berlin.de>

Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:

>Someone emailed me that this works:
>
>    m/(\S+)\s(?p{$job{$1}})/

Would that someone have said which version supports the (?p...)
sequence?

Anno


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

Date: 13 Jul 1999 22:28:13 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I include a hash is a regular expression?
Message-Id: <7mgeht$di5$1@lublin.zrz.tu-berlin.de>

Abigail <abigail@delanet.com> wrote in comp.lang.perl.misc:

[...]

>on what is currently backreferenced. Neat concept you want to have 
>working though. ;)

Indeed.  Just imagine the japh possibilities this would open up.

>You might be able to do something tricky with (?{ code }) though, but 
>I don't have enough experience with (?{}) yet to be sure.

Looks unlikely at first sight, since the (?{}) assertion always
succeeds.

Anno


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

Date: Tue, 13 Jul 1999 18:16:41 GMT
From: Ian Smith <iansmith@pepper.ncinter.net>
Subject: Re: How do YOU format your << data?
Message-Id: <doLi3.2150$8c3.107751@typ41.nn.bcandid.com>

In comp.lang.perl.misc Abigail <abigail@delanet.com> wrote:
> Ian Smith (iansmith@pepper.ncinter.net) wrote on MMCXXXVII September
> $$ print <<EOF;
> $$   <BLINK><HR>This is my first wuh-wuh-wuh page.</HR>
> $$   <A HREF="LINK">LINK</A>
> $$ EOF
>
> Blink is in invention from the devil. Even one the devil isn't proud
> of. But you need to close it. And HR doesn't take content.

But you don't need to close it if you just want to annoy Netscape users
and make their whole page blink. (I close it later on in the code anyway)
The HR was a typo, I meant H1.  

> $$   if ($browser =~ /mozilla/) 
>
> User agent dependent HTML? You obviously don't know the purpose of HTML.

You obviously don't know the purpose of example code to demonstrate
a (it was in the FAQ it turns out) formatting question.  The code
was never meant to do anything or represent good programming
practices.  I suppose I could have used /MegaBrowser2001GoldDeluxe/
to make it clearer that the code was not pulled out of a working
page...

I have been writing non-browser dependent web pages for years and 
it makes my skin crawl when Netscape and Microsoft added custom
tags to HTML like BLINK.  HTML tags are supposed to describe what
is inside.  <P>This is a paragraph</P>  <H1>This is a header</H1>
<PRE>This  is  pre-formatted  text</PRE>  

<BLINK>This is a blink. Huh?</BLINK>  What the heck is a blink?

I *hate* the "This page best viewed with IE/Netscape" buttons.  
HTML is supposed to make it so anyone can view a page.. with any 
browser.  I used Lynx a fair amount.  Not as much as I used to 
since most pages just like like [IMAGE] [IMAGE] [IMAGE] nowdays.

End Rant.

> $$ So... anyone as picky as me have a nice-looking solution to this
> $$ terrible monster?  Anyone else use Perl to brute-force solutions
> $$ to the Discover magazine puzzles? :-)
>
> I can't of fail to see your problem. What do you mean with nested code?

Must... resist... grammar correction...

--
$p=3;do{print substr('t"scha
krtrJ,hree" uo a nlPe',$p-1,1);$p=27*$p%58;}until $p==3;


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

Date: 12 Jul 1999 20:50:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do you get rid of a remainder in a number
Message-Id: <slrn7ol6qd.h7.abigail@alexandra.delanet.com>

Andreas Fehr (backwards.saerdna@srm.hc) wrote on MMCXLI September
MCMXCIII in <URL:news:3789f058.30042779@news.uniplus.ch>:
() On 12 Jul 1999 08:35:40 -0500, abigail@delanet.com (Abigail) wrote:
() 
() >?? >But Abigail originates from Europe!
() >?? 
() >?? The name or the person?
() 
() Hmm, I'm not good in geography, but I think I heard, the
() region is called near east, that means Asia.
() Europe ends between the Turkey (between Thanksgiving?) ;) 


Good boy! Have cigar. Now, which conclusion can you draw from that?



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 13 Jul 1999 15:23:50 +1000
From: "Fujitsu Australia Limited" <andrew.yuen@fujitsu.com.au>
Subject: Re: How do you get rid of a remainder in a number
Message-Id: <7meicc$6bs@newshost.fujitsu.com.au>

>: I'm afraid Abigail can't get over how fun it is to harass newbies or
>: anyone with questions.


I'd just like to say that Abigail gave me an excellent response recently.
Not only did [s]?he give me a five line answer to a problem with which I had
been struggling, [s]?he also went to all the trouble to obfuscate it so it
took me ages to figure out how it worked. I was profoundly touched with the
trouble [s]?he'd taken. Thank you again, Abigail.





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

Date: Tue, 13 Jul 1999 16:54:16 +0800
From: "Gump Xu" <gump_xu@sc.mcel.mot.com>
Subject: how to monitor other process'es input/output ?
Message-Id: <7meunk$gn6$1@schbbs.mot.com>

Hi,
   Under Unix, in a Perl program, I invoked another program.
Then I need to send something to that program just as STDIN,
and I need to check the STDOUT of that program.

How can I do that ?

thanks,
Gump




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

Date: 13 Jul 1999 10:40:21 +0100
From: Olivier Dehon <dehon_olivier@jpmorgan.com>
Subject: Re: how to monitor other process'es input/output ?
Message-Id: <iux7lo4vqey.fsf@in-csg58.uk.jpmorgan.com>

"Gump Xu" <gump_xu@sc.mcel.mot.com> writes:

>    Under Unix, in a Perl program, I invoked another program.
> Then I need to send something to that program just as STDIN,
> and I need to check the STDOUT of that program.

perldoc perlipc

-Olivier


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

Date: Mon, 12 Jul 1999 19:27:47 GMT
From: John.Borwick@sas.com (John Borwick)
Subject: Re: how to pass variables to system commands
Message-Id: <379340e2.27322948@newshost.unx.sas.com>

On Mon, 12 Jul 1999 14:00:36 -0400, Tom Kralidis
<tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:

>Is there a better way to copy files from arguments on the command line?

Please trim your .sig

#!/usr/local/bin/perl5 -w
use strict;
use File::Copy;

my ($in, $out) = @ARGV;
defined $in && defined $out or die("usage: filecopy in out");
copy($in, $out) or die("Couldn't copy from $in to $out");

__END__

-- 
John Borwick


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

Date: 12 Jul 1999 18:59:56 GMT
From: Jeff Stampes <stampes@xilinx.com>
Subject: Re: how to pass variables to system commands
Message-Id: <7mddvc$9p1@courier.xilinx.com>

Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:
: Is there a way to do this? Eg.

: $block=<STDIN>;
: system("cp /home/tom/$block .");

: ..gets me no such file or directory.

Of course not.  $block will have a newline at the end of it.

Try a chomp $block in there.


-- 
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: 12 Jul 1999 23:14:50 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to pass variables to system commands
Message-Id: <slrn7olf92.h7.abigail@alexandra.delanet.com>

Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote on MMCXLI September
MCMXCIII in <URL:news:378A2D44.8C9D4350@ccrs.nrcanDOTgc.ca>:
== Is there a way to do this? Eg.
== 
== $block=<STDIN>;
== system("cp /home/tom/$block .");
== 
== ..gets me no such file or directory.

Here's a tip:  if system() fails with an unexpected error messages, and
arguments to system() contain interpolated variables, print out the
arguments to system() and see whether they really contain what you think
they contain. [1]

I guess that if you do that, you will see where you went wrong.

== Is there a better way to copy files from arguments on the command line?


That depends on your definition of 'better'. There is for instance
File::Copy. Some people will find that the 'better' solution, other
find 'using the toolbox' the 'better' solution.

It's up to you.


[1] And for the debugger freaks under us, use the debugger and see what
    the value of the string is.


Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 12 Jul 1999 23:53:40 -0700
From: George hart <hart@rohan.sdsu.edu>
Subject: How to request an http doc?
Message-Id: <378AE274.4CBDF153@rohan.sdsu.edu>

Does anybody have any examples to get an http document from a server?
I can't figure this out.

Thanks in advance.  George Hart hart@rohan.sdsu.edu



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

Date: 13 Jul 1999 09:34:19 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to request an http doc?
Message-Id: <378afa0b@newsread3.dircon.co.uk>

George hart <hart@rohan.sdsu.edu> wrote:
> Does anybody have any examples to get an http document from a server?
> I can't figure this out.
> 

perl -MLWP::Simple -egetprint('http://www.gellyfish.com')

If you download and install the LWP bundle of modules from CPAN then you
will find that there is a document called lwpcook that has plenty of examples.


/J\
-- 
"When the boys in the playground found out that I had a potentially
fatal peanut alergy they would shove me up against a wall and make me
play Russian roulette with a bag of Revels" - Milton Jones


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

Date: Tue, 13 Jul 1999 13:19:16 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to request an http doc?
Message-Id: <7mg03j$2a02@news.cyber.net.pk>

: Does anybody have any examples to get an http document from a server?
: I can't figure this out.

perldoc LWP

use LWP::Simple;

$page = get 'http://www.intel.com';

:
: Thanks in advance.  George Hart hart@rohan.sdsu.edu
:




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

Date: Tue, 13 Jul 1999 18:25:40 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: How to request an http doc?
Message-Id: <MPG.11f5a310d4546924989b30@news-server>

George hart writes ..
>Does anybody have any examples to get an http document from a server?
>I can't figure this out.

use the LWP::Simple module .. it's very simple

-- 
 jason - remove all hyphens for email reply -


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

Date: Mon, 12 Jul 1999 23:26:30 GMT
From: brh@bhent.com (Ben Humphreys)
Subject: HTML template variable substition 
Message-Id: <378a77c5.424508864@news.uswest.net>

There are plenty of modules to do Perl variable substitution in
template files.  All of them require that I recode the content of my
here documents when changing to templates.  In other words:

	Hello $name

must become:

	Hello %name%

and the Perl code changes from:

	$name = "Ben"

to 

	%hash{"name"} = "Ben"

Perl is supposed to make easy things easy but in this case, all of
this reformatting and re-coding is going to be a real pain.  Are there
any modules that do what I want or do I really have to learn about the
evils of symbolic referencing?  If I wanted to write Perfect Code, I
would be using Java :)

Thanks in advance





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

Date: Mon, 12 Jul 1999 21:00:37 -0400
From: "c.s." <cs2400@hotmail.com>
Subject: Re: HTML template variable substition
Message-Id: <931827694.755.31@news.remarQ.com>

hello,

Have you tried CPAN's Text::Template ?

Template format is like so:
(here using a brace for a delimiter... not a real good idea... read
docs..)

<!-- HTML Template for Text::Template  -->
<html><head>
<title>  { $doctitle } </title>
<body>
<h1> Here is some stuff: { &return_stuff } </h1>
<p>
or any old code you like..... <br>
{
##
## Any old Perl code goes here..
##

foreach (@list) {

&whatever()

}

}

</p></body></html>

<!-- End of Template -->

Does this help?






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

Date: Mon, 12 Jul 1999 21:23:29 -0400
From: "c.s." <cs2400@hotmail.com>
Subject: Re: HTML template variable substition
Message-Id: <931829066.109.67@news.remarQ.com>

you can also use CGI.pm "Sticky Wigets" is that template...

like:

<form action="cgi.pl">

{$query->textfield(-name=>"yourname") }

<input type="submit>
</form>




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

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


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