[15661] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3074 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 17 09:05:26 2000

Date: Wed, 17 May 2000 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <958568709-v9-i3074@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 17 May 2000     Volume: 9 Number: 3074

Today's topics:
    Re: "If" Not Being Evaluated - Vars Are Being Subsitute <bill.kemp@wire2.com>
    Re: *Beginner help with HASHES plantzy@uamail.albany.edu
    Re: [Hash] Is the key always double-quoted? (Bart Lateur)
    Re: Accurate IP return? <GBloke@actiongames.co.uk>
    Re: Accurate IP return? <flavell@mail.cern.ch>
    Re: Accurate IP return? (Sam Holden)
    Re: cpan errors <elaine@chaos.wustl.edu>
    Re: How to COPY a website <user0201@vjeran.com>
        how to parse HTMLish name="value" pairs <StefanRieken@SoftHome.net>
    Re: Interfacing With Parallel Port in PERL <maustin@nc.prestige.net>
        IPC: 1 to n communication <gernot@cat.at>
    Re: my cgi script <maustin@nc.prestige.net>
    Re: Passing variables to O/S command <billy@arnis-bsl.com>
    Re: Perl On Netscape Enterprise Server <maustin@nc.prestige.net>
    Re: Problem or normal?? <skfreeman@my-deja.com>
    Re: Simple question about parsing HTML <gellyfish@gellyfish.com>
    Re: What's this line which Perl added to AUTOEXEC.BAT? <sue@pennine.com>
    Re: Why does the contents of my file dissapear in an FT <bmb@dataserv.libs.uga.edu>
        write and read to a process at the same time jbrzezi@my-deja.com
    Re: write and read to a process at the same time <bmb@dataserv.libs.uga.edu>
    Re: write and read to a process at the same time <billy@arnis-bsl.com>
    Re: zen and the art of trolling [OT] <peckert@epicrealm.com>
    Re: zen and the art of trolling [OT] <bmb@dataserv.libs.uga.edu>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 17 May 2000 12:38:23 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: "If" Not Being Evaluated - Vars Are Being Subsituted?
Message-Id: <958563589.18205.0.nnrp-09.c3ad6973@news.demon.co.uk>

>
>Which means that you are outputting code as a double-quoted string. You
>didn't stick this in the middle of a multi-line print(), did you?

whenever I see such messages I think I've missed out something like a
semi-colon or a quote mark.
But as it is printing out " the above answer seems more likely




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

Date: Wed, 17 May 2000 08:12:53 -0400
From: plantzy@uamail.albany.edu
Subject: Re: *Beginner help with HASHES
Message-Id: <39228CC5.8DAC1276@nycap.rr.com>

Thanks for your response, but I dont know if this will work.  I am pulling all
the data out of a database so the name of the groups and operators could
change so I cant hard code anything.


Brad Baxter wrote:

> On Wed, 17 May 2000 neysa@nycap.rr.com wrote:
> ...
> > Now I need to change the report and replace the heading GROUPS with all
> > the unique group names and then below list the operators with X to
> > represent the groups they are in
> >
> > Example:
> > OPRID       NAME          GROUP1   GROUP2   GROUP3   GROUP4
> > -----------------------------------------------------------
> > 123         TEST123       X                  X
> > ABC         DUMMYA                   X
> > XYZ         TESTX         X                          X
> ...
>
> Here's one approach:
>
>      1  #!/usr/local/bin/perl -w
>      2  use strict;
>      3
>      4  my %hash = (
>      5      123 => {
>      6        name   => 'TEST123',
>      7        groups => {
>      8          GROUP1 => 1,
>      9          GROUP3 => 1,
>     10          },
>     11        },
>     12      ABC => {
>     13        name   => 'DUMMYA',
>     14        groups => {
>     15          GROUP2 => 1,
>     16          },
>     17        },
>     18      XYZ => {
>     19        name   => 'TESTX',
>     20        groups => {
>     21          GROUP1 => 1,
>     22          GROUP4 => 1,
>     23          },
>     24        },
>     25      );
>     26
>     27  my $fmt = "%-10s";
>     28
>     29  printf $fmt x 6, qw( OPRID NAME GROUP1 GROUP2 GROUP3 GROUP4 );
>     30  print "\n", '-' x 60, "\n";
>     31
>     32  foreach my $oprid ( sort keys %hash ) {
>     33    my $name = $hash{ $oprid }{name};
>     34    printf $fmt x 2, $oprid, $name;
>     35
>     36    foreach my $group ( qw ( GROUP1 GROUP2 GROUP3 GROUP4 ) ) {
>     37      printf $fmt, $hash{ $oprid }{groups}{ $group } ? 'X' : '';
>     38    }  # foreach group
>     39    print "\n";
>     40
>     41  }  # foreach oprid
>
> Output:
>
> OPRID     NAME      GROUP1    GROUP2    GROUP3    GROUP4
> ------------------------------------------------------------
> 123       TEST123   X                   X
> ABC       DUMMYA              X
> XYZ       TESTX     X                             X
>
> --
> Brad



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

Date: Wed, 17 May 2000 10:11:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: [Hash] Is the key always double-quoted?
Message-Id: <392368e4.2095992@news.skynet.be>

Villy Kruse wrote:

>Would it be correct to interpret 01 as a octal number and not a
>bareword that would be treated as a string between {} or before => ?
>
>It looks like a number, therefore it is a number, or is this wrong?

	%hash = (  0x123 => 'oh yeah!' );
	print keys %hash;
-->
	291

Indeed, and it's not just "octal" numbers. "Bareword" is only applicable
to those names that can be used as is as variable names -- apart from
the '$' prefix; as sub names, in short: as identifiers. A number is not
a valid identifier.

This too, may surprise you:

	%hash = (  ready'to'go => 'from the rooftop');
	print keys %hash;
-->
	ready::to::go

Apparently, the LHS of '=>' is interpreted, massaged, before being
quoted.

-- 
	Bart.


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

Date: Tue, 16 May 2000 20:01:06 +0100
From: "[TNN]G.Bloke" <GBloke@actiongames.co.uk>
Subject: Re: Accurate IP return?
Message-Id: <8fs5ts$1co$1@uranium.btinternet.com>


"Abigail" <abigail@foad.org> wrote in message
news:slrn8i307a.p3i.abigail@ucan.foad.org...
> ++ Is there a reliable method to return a users IP address?
>
> No. It's not even well defined. IP addresses aren't associated with
> users - IP addresses are associated with interfaces.
<SNIP>

Now you are just being picky....can't anyone on this NG be sensible? Please
grow up...

I want to establish the IP address given by the ISP to a user when they log
on. I WOULD LIKE to know if this can be done with PERL. Forget why I want to
know....just give me a good answer.

Perldoc states something like this for remote_host :
"Returns either the hostname or the IP address of the system that requested
the page."

Unfortunatly this runs into problems when the page is fetched by the ISP's
cache and not directly by the user.

--
G.Bloke




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

Date: Wed, 17 May 2000 14:31:18 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Accurate IP return?
Message-Id: <Pine.GHP.4.21.0005171424310.3970-100000@hpplus03.cern.ch>

On Tue, 16 May 2000, [TNN]G.Bloke wrote:

> Now you are just being picky....can't anyone on this NG be sensible? Please
> grow up...

You have been given a serious answer, several times.  Please go and
read the CGI FAQs as you have been advised, and stop wasting the Perl
group's time.

> I want to establish the IP address given by the ISP to a user when they log
> on. I WOULD LIKE to know if this can be done with PERL. Forget why I want to
> know....just give me a good answer.

You already _got_ a good answer.  You already made the group keenly
aware that it isn't the answer you were hoping for, but yelling at us
isn't going to get you a better one, because you already got the best
answer there is.  So cope with it. Your choice of programming language
is not relevant to the question.  As for "growing up": pot, kettle.



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

Date: 17 May 2000 12:52:16 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Accurate IP return?
Message-Id: <slrn8i55g0.ffv.sholden@pgrad.cs.usyd.edu.au>

On Tue, 16 May 2000 20:01:06 +0100,
	[TNN]G.Bloke <GBloke@actiongames.co.uk> wrote:
>
>"Abigail" <abigail@foad.org> wrote in message
>news:slrn8i307a.p3i.abigail@ucan.foad.org...
>> ++ Is there a reliable method to return a users IP address?
>>
>> No. It's not even well defined. IP addresses aren't associated with
>> users - IP addresses are associated with interfaces.
><SNIP>
>
>Now you are just being picky....can't anyone on this NG be sensible? Please
>grow up...
>
>I want to establish the IP address given by the ISP to a user when they log
>on. I WOULD LIKE to know if this can be done with PERL. Forget why I want to
>know....just give me a good answer.
>
>Perldoc states something like this for remote_host :
>"Returns either the hostname or the IP address of the system that requested
>the page."
>
>Unfortunatly this runs into problems when the page is fetched by the ISP's
>cache and not directly by the user.

You could try reading the answers you have been given or even doing some
research yourself. 

My machine at home doesn't have an address on the internet, but I browse the 
web from it. At uni my I often use a proxy that doesn't pass on my IP so you
can't get it then either.

You can't do what you want to do.

You have been told this numerous times.

REMOTE_HOST will work sometimes.

HTTP_X_FORWARDED_FOR will work sometimes.

OTHER_PROXY_SPECIFIC_JUNK will work sometimes.

Other times nothing will work because of an anonymising proxy server in the
chain, or because the user has no internet IP address.

This has nothing to do with perl, so please take your complaints about the
way the internet works to a FAQ somewhere in some other group.

-- 
Sam

I guess I really am an optimist. A paranoid optimist, true, but an
optimist nonetheless. 
	-- Larry Wall


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

Date: Wed, 17 May 2000 10:54:44 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: cpan errors
Message-Id: <B547F2B7.42FB%elaine@chaos.wustl.edu>

in article 39222165.A909456D@nall.com, Joe Nall at joe@nall.com quoth:

> perl -MCPAN -e shell
> 
> cpan shell -- CPAN exploration and modules installation (v1.52)
> ReadLine support enabled

http://search.cpan.org/search?dist=CPAN

It looks like you may be experiencing network difficulties since it's
telling you that it cannot fetch a file known to exist.

Check your intstallation of LWP as well as CPAN and try again.

e.



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

Date: Wed, 17 May 2000 13:20:10 +0200
From: "Vjeran" <user0201@vjeran.com>
Subject: Re: How to COPY a website
Message-Id: <8ftvch$7le$1@as102.tel.hr>


Paul Eckert <peckert@epicrealm.com> wrote in message
news:392155FA.65F1F7F8@epicrealm.com...
> Vjeran:
>   The website you supplied is bogus.  Try http://www.tenmax.com/
>   This being said, don't use teleport--it doesn't respect robot exclusion
> as Randal Schwartz mentioned in his prior email.  If I can quote:
> "Which is blocked on my website because it has been shown not to
> respect robots.txt.  Evil Product.  Do not buy.  Do not promote."
>    Paul

Thnx man :-)
Im sorry for hat sex site, I was sure that was the link.

nevermind.. guy needs to transfer whole site, even with robot excluded pages

v.





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

Date: Wed, 17 May 2000 14:48:24 +0200
From: Stefan Rieken <StefanRieken@SoftHome.net>
Subject: how to parse HTMLish name="value" pairs
Message-Id: <39229517.E41D7022@SoftHome.net>

Hello,

I am making a cgi script that should allow people of average
intelligence to (design and) set up a website so that people who are not
necessarilly intelligent at all can manage the contens.

Good, skip intro. I have to parse this kind of things:

<!--xxx NAME="foo" VALUE="bar" HEIGHT="33"--> ..etc.

Currently, I do it like this (e.g. to get the NAME param):

($nothing, $seperator, $name, $seperator) = split
(/(<!--xxx.*?name.*?=.*?"|".*?-->)/i, $lineoftext);

It works, but it's far from aestethic; I only need the $name, and I have
to repeat it for each name/ value pair I want. Anyone has good
suggestions?

(This my first dive into Perl, so spare me a little, OK? :-)

Thanks in advance,

Stefan
-- 
"We don't have the time to sit and cry,
or to wonder why" -- Tindersticks


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

Date: Wed, 17 May 2000 07:45:49 -0400
From: Michael Austin <maustin@nc.prestige.net>
Subject: Re: Interfacing With Parallel Port in PERL
Message-Id: <3922866D.F325365D@nc.prestige.net>

This is a multi-part message in MIME format.
--------------40CACD7715C58C97489714B9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

oO_RoB_Oo wrote:

> Hiya,
>     I am currently working on a project to output informatgion to an 20x4
> LCD on a parallel port, but i cannot seem to find any modules or
> documentation, on how to interface the port, i am newish to perl, and all i
> have used it for before is CGI stuff, but i have decided to use perl for
> this project, as i find it such an easy language to work with
>
>     Any help, or pointers will be greatly appreciated
>
>     Thanx
>
>     oO_RoB_Oo

If I understand the question, the only folks that reference a parallel port any

more are those using a browser on a PC therefore limiting the OS's to
W95/W98/WNT/W2K or Linux.  Being able to select the Parallel Port on
a Windoze PC would be nice, but I would also like to spool to the default or a
selected
Windoze PC user-defined printer.  Leave it to auditors to come up with this
sort
of requirement.

So,  is there a module or plug-in available such that when a user clicks on a
file link, it spools directly to a user selected printer without first being
displayed. The auditors theory is that if you can display if first, you can
save it, alter it, then print it. Unfortunately he is correct.  So, now I need
to come up with a way to achieve this.  One other problem is that the files
reside on a central server (Sun SunOS) and the users that need this
functionality are on opposite sides of the country us Wxx PC's.

SunOS 5.6
Netscape (iPlanet) Server V4.1
Browsers: IE 4, 5 and Netscape 4.0-4.7

Any ideas,

Michael Austin
Oracle DBA Consultant


--------------40CACD7715C58C97489714B9
Content-Type: text/x-vcard; charset=us-ascii;
 name="maustin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Michael Austin
Content-Disposition: attachment;
 filename="maustin.vcf"

begin:vcard 
n:Austin;Michael 
tel;work:704-947-1089
x-mozilla-html:FALSE
org:Michael Austin, Inc
adr:;;;;;;
version:2.1
email;internet:michaelaustininc@hotmail.com
title:President
x-mozilla-cpt:;0
fn:Michael E. Austin
end:vcard

--------------40CACD7715C58C97489714B9--





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

Date: Wed, 17 May 2000 14:40:47 +0200
From: Gernot Homma <gernot@cat.at>
Subject: IPC: 1 to n communication
Message-Id: <3922934F.68ADE599@cat.at>

This is a multi-part message in MIME format.
--------------76D412D701CFBDA4AF6D9545
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

i have a process that should pass some data to n other processes, which
do something with the data. which mechanism is the best to this.

named pipes:
   don't work (afaik), because one reader process gets the information,
the other's not


--------------76D412D701CFBDA4AF6D9545
Content-Type: text/x-vcard; charset=us-ascii;
 name="gernot.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Gernot Homma
Content-Disposition: attachment;
 filename="gernot.vcf"

begin:vcard 
n:Homma;Gernot
x-mozilla-html:FALSE
org:Cyber-Atelier
adr:;;;Vienna ;;1210;Austria
version:2.1
email;internet:gernot@cat.at
tel;fax:+43 1 272 92 51 9
tel;work:+43 1 272 92 51
x-mozilla-cpt:;0
fn:Homma, Gernot
end:vcard

--------------76D412D701CFBDA4AF6D9545--



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

Date: Wed, 17 May 2000 08:23:43 -0400
From: Michael Austin <maustin@nc.prestige.net>
Subject: Re: my cgi script
Message-Id: <39228F4E.A7D6F847@nc.prestige.net>

This is a multi-part message in MIME format.
--------------C4CD798AD09D0710A2B84814
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Try looking in any PERL Book on CGI.  If you want to be a webmaster you
need to learn perl and CGI first. Then if you need help post the relevant
parts of your problem code with a description and you might get some help.
Help is one thing, but this gimme attitude probably won't get you very far.

M.Austin

Andrew McGuigan wrote:

> All is going well so far with my web Form. I just need the code that
> collects the information on the Form and sends it to the server. That’s
> all for the moment.
>
> Thanks
>
> Andrew

--------------C4CD798AD09D0710A2B84814
Content-Type: text/x-vcard; charset=us-ascii;
 name="maustin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Michael Austin
Content-Disposition: attachment;
 filename="maustin.vcf"

begin:vcard 
n:Austin;Michael 
tel;work:704-947-1089
x-mozilla-html:FALSE
org:Michael Austin, Inc
adr:;;;;;;
version:2.1
email;internet:michaelaustininc@hotmail.com
title:President
x-mozilla-cpt:;0
fn:Michael E. Austin
end:vcard

--------------C4CD798AD09D0710A2B84814--





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

Date: Wed, 17 May 2000 10:30:26 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Passing variables to O/S command
Message-Id: <8ftsc2$mi9$1@nnrp1.deja.com>

In article <8ftk8v$eai$1@nnrp1.deja.com>,
  itsaw@my-deja.com wrote:
> I have problem regarding backticks . Part of the code that i wrote is
> here :
>
> $var = '111111';
> `useradd -u 500 -d /home/user -p $var username`;
>
> The problem is i want to pass the value's of the $var into the command
> , but this code that i wrote doesn't seems to work . The reason i am
> doing this is that $var is not a constant and it changes according to
> user's input . So i have no choice but to insert a variable into the
> command eventhough putting the string directly into the command will
> solve the problem . Can anyone please advice on how to work around this
> problem .
>

1. First, you are using backticks in a void context. Consider system() or
open() function instead. Read 'perldoc perlfaq8', it contains the FAQ:
"What's wrong with using backticks in a void context?" (or
http://www.cpan.org/doc/manual/html/pod/perlfaq8.html)

2. Use full path for useradd.

3. In any case, IMHO the problem is with your command-line useradd syntax,
PATH settings or permissions (useradd requires root privileges AFAIK).
BTW, when useradd fails, it prints a message to srderr.
What does it say when you run your script from commad line ?
Or you run it only as CGI ? If so, sure you have permission problems,
check your server's error log.

4. And to your question: variable interpolation *is* done inside backticks,
it isn't your problem's source.
If still in doubt, try the following simple script from commad line:

#!/usr/bin/perl -w

use strict;

my $arg = 'command_line_argument';
my $result = `echo $arg`;
print $result;

# that's all

Hope this helps.
Ilja.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 08:09:52 -0400
From: Michael Austin <maustin@nc.prestige.net>
Subject: Re: Perl On Netscape Enterprise Server
Message-Id: <39228C10.CA08685C@nc.prestige.net>

This is a multi-part message in MIME format.
--------------193566ACA01134EE3911C6A4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



Tpk1972 wrote:

> I am having trouble getting my perl5 to load and run from a remote browser. I
> am using Enterprise server and have set my paths to the recommended
> destinations but the interpreter does not load properly. It loads from the
> command line in Netware but gives an error saying that the "Cgi2perl.nlm"
> cannot be loaded properly. What is the purpose of the "Cgi2perl.nlm" file and
> do I need to reconfigure my Netware or Enterprise server to properly load the
> perl5 interpreter(Calls a Cgi script with the assumption that the association
> exists between the .pl attribute and the perl5 interpreter)?
> I am using the example files they supply to make sure the connection works
> properly before I supply my own. I tested them at the "shell" command prompt
> and they return the Html data fine.
> Any help would be greatly appreciated.

"Clinton A. Pierce" wrote:

> [Posted and mailed]
>
> In article <20000416222616.21262.00000707@ng-cb1.aol.com>,
>         tpk1972@aol.com (Tpk1972) writes:
> > I am having trouble getting my perl5 to load and run from a remote browser. I

> > am using Enterprise server and have set my paths to the recommended
> > destinations but the interpreter does not load properly. [...]
>
> This has nothing to do with Perl.  Please take this to an appropriate
> newsgroup to discuss your server configuration issues.  I suggest
> comp.infosystems.www.servers and followups have been adjusted.  You
> may want to further adjust and post to ciws.unix if appropriate.
>
> > I tested them at the "shell" command prompt
> > and they return the Html data fine.
>
> If this is the case, stop blaming perl.  Get a better web server, and learn
> how to configure it.
>
> --
>     Clinton A. Pierce              Teach Yourself Perl in 24 Hours!
>   clintp@geeksalad.org         for details see http://www.geeksalad.org
> "If you rush a Miracle Man,
>         you get rotten Miracles." --Miracle Max, The Princess Bride

One other thing... when posting to a newsgroup and you are having this sort of
problem, it is nice if you include the OS, OS version, Server version.  All of
these are crucial if you want to get the right answer.

Go to you ADMIN web page for the server, MANAGE the server in question, STATUS,
VIEW ERROR LOG.  This should tell you what you missed.  Probably a protection
problem.

Michael Austin
Oracle DBA, Web Admin, OpenVMS Sys Admin, Unix Sys Admin Consultant

--------------193566ACA01134EE3911C6A4
Content-Type: text/x-vcard; charset=us-ascii;
 name="maustin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Michael Austin
Content-Disposition: attachment;
 filename="maustin.vcf"

begin:vcard 
n:Austin;Michael 
tel;work:704-947-1089
x-mozilla-html:FALSE
org:Michael Austin, Inc
adr:;;;;;;
version:2.1
email;internet:michaelaustininc@hotmail.com
title:President
x-mozilla-cpt:;0
fn:Michael E. Austin
end:vcard

--------------193566ACA01134EE3911C6A4--





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

Date: Wed, 17 May 2000 11:12:39 GMT
From: Stan Freeman <skfreeman@my-deja.com>
Subject: Re: Problem or normal??
Message-Id: <8ftuqu$p77$1@nnrp1.deja.com>

Thanks guys!  The 'local $_' did the trick.  Also, thanks for the
coding tips.

Stan

In article <3921E3B9.F88615E6@ce.mediaone.net>,
  "Andrew N. McGuire" <anmcguire@ce.mediaone.net> wrote:
> Michael Carman wrote:
> >
> > "Andrew N. McGuire" wrote:
> > >
> > > If you comment out the 'print while <INFILE>;' it works
> > > just fine.  There is something here that I too am missing. :-)
> >
> > Which is that for() and foreach() set the loop variable ($_ here, by
> > default) to an alias for the data in the original list. So if you
change
> > $_, you also change its value in the @filelist array, which is what
is
> > happening here: $_ is being clobbered by the while(). I suppose the
> > print() is actually spitting out EOF chars in place of the original
> > filenames. Try inserting 'local $_' at the beginning of the sub and
> > you'll have better results.
>
> Thank you, I still have much to learn, and now a little less.
>
> Regards,
>
> anm
> --
> /*-------------------------------------------------------.
> | Andrew N. McGuire                                      |
> | anmcguire@ce.mediaone.net                              |
> `-------------------------------------------------------*/
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 11:24:04 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Simple question about parsing HTML
Message-Id: <ojvU4.1626$Kc1.225660@news.dircon.co.uk>

On Wed, 17 May 2000 14:41:53 +0800, Frankie Wrote:
> Hello, I have the following case: I have the content of a HTML file
> stored in a string(whole file in 1 string) , and I just wanted to cut
> out the link and the text of it, eg if the string have something like
> :"... <a href=abc.html>This is abc</a> ...", then the script will return
> "abc.html" and "This is abc" to me. I have implemented the first
> part(the link) of it by HTML::LinkExtor, but dunno how to implement the
> second part(the text), can anyone tell me how?
> 

Look at <http://www.gellyfish.com/htexamples/> and especially the example
geturls.pl linked at the bottom ...

/J\


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

Date: 17 May 2000 02:59:10 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: What's this line which Perl added to AUTOEXEC.BAT?
Message-Id: <8ftqhe$17re@drn.newsguy.com>

In article <173e8bff.2d0804e0@usw-ex0106-047.remarq.com>, bjanko says...
>
>  scorched earth...

Have you fixed the problem?  If so, what was it?



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

Date: Wed, 17 May 2000 08:38:16 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: Why does the contents of my file dissapear in an FTP?
Message-Id: <Pine.GSO.4.21.0005170837180.29100-100000@dataserv.libs.uga.edu>

On Tue, 16 May 2000, Andrew N. McGuire wrote:

> Abigail wrote:
> > 
> > On Wed, 17 May 2000 09:59:14 +1000,
> > Amri, Kuross [WOLL:4009-I:EXCH] <kamri@asiapacificm01.nt.com> wrote:
> > ++
> > ++ I have this file that I've FTP'd across to another computer. Upon arrival,
> > ++ it is missing it's contents. Any idea why?
> > 
> > Bitrot.
> 
> Please, stop, I'm not sure I can take anymore. :-)
> ROTFLMAO

use Net::FTP::Bitrot;

-- 
Brad



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

Date: Wed, 17 May 2000 12:17:22 GMT
From: jbrzezi@my-deja.com
Subject: write and read to a process at the same time
Message-Id: <8fu2k4$t73$1@nnrp1.deja.com>

I have some script (called "smalltool") that I want to use from other
script.
When the "smalltool is silent I do:

open (PROC, "| perl smalltool");
print (PROC $xmlText);
close(PROC);

The problem is that sometimes "smalltool" may return value after it
take input xmlText.
I tried

open (PROC, "| perl smalltool");
$return_value = `print (PROC $xmlText);`;
close(PROC);

but it does not work.
How can I write to and read from a process at the same time ?

Thanks,

Jerzy


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 08:43:17 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: write and read to a process at the same time
Message-Id: <Pine.GSO.4.21.0005170841430.29100-100000@dataserv.libs.uga.edu>

On Wed, 17 May 2000 jbrzezi@my-deja.com wrote:

> I have some script (called "smalltool") that I want to use from other
> script.
> When the "smalltool is silent I do:
> 
> open (PROC, "| perl smalltool");
> print (PROC $xmlText);
> close(PROC);
> 
> The problem is that sometimes "smalltool" may return value after it
> take input xmlText.
> I tried
> 
> open (PROC, "| perl smalltool");
> $return_value = `print (PROC $xmlText);`;
> close(PROC);
> 
> but it does not work.
> How can I write to and read from a process at the same time ?
> 

If I understand you correctly, the faq may have your answer:

perldoc -q 'How can I open a pipe both to and from a command?'

-- 
Brad



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

Date: Wed, 17 May 2000 12:38:51 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: write and read to a process at the same time
Message-Id: <8fu3so$ui8$1@nnrp1.deja.com>

In article <8fu2k4$t73$1@nnrp1.deja.com>,
  jbrzezi@my-deja.com wrote:
> I have some script (called "smalltool") that I want to use from other
> script.
> When the "smalltool is silent I do:
>
> open (PROC, "| perl smalltool");
> print (PROC $xmlText);
> close(PROC);
>
> The problem is that sometimes "smalltool" may return value after it
> take input xmlText.
> I tried
>
> open (PROC, "| perl smalltool");
> $return_value = `print (PROC $xmlText);`;
> close(PROC);
>
> but it does not work.
> How can I write to and read from a process at the same time ?
>

Search perldoc perlipc for "Bidirectional Communication with Another Process".
(or http://www.cpan.org/doc/manual/html/pod/perlipc.html)

Also check perldoc perlfaq8 for "How can I open a pipe both to and from a
command?" and related topics. (or
http://www.cpan.org/doc/manual/html/pod/perlfaq8.html)

Hope this helps.
Ilja.

P.S. And pls always check return values from system calls (open() etc...).



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 17 May 2000 11:49:06 GMT
From: Paul Eckert <peckert@epicrealm.com>
Subject: Re: zen and the art of trolling [OT]
Message-Id: <3922861B.C655D06B@epicrealm.com>



Xah wrote:
> 
> Dear Paul:
> 
> This is a technical newsgroup.
> Please shove your asinine moralization back in your ass.
> 
> <<foolish drivel deleted>>
> 

Great...  Now there's two trolls in this newsgroup...


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

Date: Wed, 17 May 2000 08:36:30 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: zen and the art of trolling [OT]
Message-Id: <Pine.GSO.4.21.0005170834590.29100-100000@dataserv.libs.uga.edu>

On Wed, 17 May 2000, Xah wrote:

> Dear Paul:
 ...
> Tell your class of Perl cronies to shut their fucking beer-holes, and you
> will immediately save 80% of the most worthless posts in this group.

Dear Xah,

You hate Perl and you hate Americans.  Why don't you get a new job and
move?

-- 
Brad



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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

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

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


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


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