[28793] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 37 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 16 14:06:09 2007

Date: Tue, 16 Jan 2007 11:05:05 -0800 (PST)
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, 16 Jan 2007     Volume: 11 Number: 37

Today's topics:
    Re: convert Vbscript to Perl code <vronans@nowheresville.spamwall>
    Re: launch simple perl script from browser <m@remove.this.part.rtij.nl>
    Re: LWP::UserAgent and proxy <glex_no-spam@qwest-spam-no.invalid>
    Re: Map Windows from Unix anno4000@radom.zrz.tu-berlin.de
    Re: Map Windows from Unix <spamtrap@dot-app.org>
    Re: Map Windows from Unix <spamtrap@dot-app.org>
    Re: Map Windows from Unix <jurgenex@hotmail.com>
    Re: Map Windows from Unix anno4000@radom.zrz.tu-berlin.de
    Re: Map Windows from Unix <minhaztuhin@hotmail.com>
    Re: Map Windows from Unix <m@remove.this.part.rtij.nl>
        new CPAN modules on Tue Jan 16 2007 (Randal Schwartz)
        Piping from perl to C <ignleotta@gmail.com>
    Re: Piping from perl to C xhoster@gmail.com
        Postscript-Wizzards? How to set the background for each <mic01@uni-muenster.de>
        Question on SIGTERM wing328hk@gmail.com
    Re: Question on SIGTERM xhoster@gmail.com
    Re: substituting words and maintaining case? <art@example.com>
    Re: the => operator <bik.mido@tiscalinet.it>
    Re: the => operator <louisREMOVE@REMOVEh4h.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 16 Jan 2007 09:00:52 -0800
From: "Vronans" <vronans@nowheresville.spamwall>
Subject: Re: convert Vbscript to Perl code
Message-Id: <07Odncsw3eRVmTDYnZ2dnUVZ_v6tnZ2d@wavecable.com>

Tad McClellan wrote:
> Boris Skoblo <borsk@technion.ac.il> wrote:
>
> > please help me convert following VBscript code to Perl code
>         ^^^^^^^
>
> [snip VB code ]
>
>
> > Can anyone help?
>
>
> Sure! What part are you stuck on?

Your assuming he tried already, when it seems clear that he doesnt know 
where to start, but I think you knew that but had to be 'witty' any how.

> Can anyone write it for you? No, only some people can write it for
  ^^^^^^^^^^                   ^^^      ^^^^^^^^^^^^^^^
> you.

Why do you ask if 'anyone can', answer 'No', then say 'some people can' 
? Self contractiction if I ever saw one, or purposely messing with 
someone who is just seeking help. But I guess you deservse to smack 
people silly because you otherwise help, right?

> Will anyone write it for you? Probably not.
>
> Show us the Perl code you have so far, we cannot "help" with your
> Perl code if you do not show us your Perl code.

He didnt post any code, and you knew that, so why are you kicking this 
guy around in the dirt? Maybe if you didnt waste time thinking up half 
wit replies to new people youre writing would make more sense and you 
wouldnt look like a pompus ass school yard bully, mate.

My $0.02, canadian 




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

Date: Tue, 16 Jan 2007 19:36:52 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: launch simple perl script from browser
Message-Id: <pan.2007.01.16.18.36.52.458763@remove.this.part.rtij.nl>

On Tue, 16 Jan 2007 00:22:16 -0800, usenet wrote:

> Bob Walton wrote:
> 
>> Well, one way would be to install a web server on your system.  Modify
>> the Perl script to function as a CGI program.
> 
> A webserver is not necessary if you want to run the script on the same
> machine that it resides on.  You may "run" anything on the localhost
> with the file://whatever syntax in the browser address bar.
> 
> Of course, it won't display output to the browser... but the program
> WILL run.

No it won't.

+------------------------------------------------------------------+
| You have chosen to open                                          |
|                                                                  |
|  test.pl                                                         |
|                                                                  |
| which is a: Perl script                                          |
| from: /home/martijn                                              |
|                                                                  |
| +- What should firefox do with this file? -------------------+   |
| |               +---------------------------------------+    |   |
| | (*) Open with |OpenOffice.org Writer (default)      |x|    |   |
| |               +---------------------------------------+    |   |
| | ( ) Save to Disk                                           |   |
| |                                                            |   |
| | [ ] Do this automatically for files like this from now on. |   |
| +------------------------------------------------------------+   |
|                                     [ X Cancel ] [ V OK ]        |
+------------------------------------------------------------------+

M4
-- 
Redundancy is a great way to introduce more single points of failure.



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

Date: Tue, 16 Jan 2007 10:09:13 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: LWP::UserAgent and proxy
Message-Id: <45acf80a$0$707$815e3792@news.qwest.net>

avlee wrote:
> Hello
> 
> I use WWW::Mechanize but it's based on LWP::UserAgent, so everything 
> should be the same.
> 
> my $proxy = "http://127.0.0.1:8118";
> my $mech = WWW::Mechanize->new();
> $mech->proxy(['http'],$proxy);
> my $urlsearch = "http://myserver.com";
> $mech->get($urlsearch);
> print $mech->content;
> 
> Without proxy - everything works fine.
> With proxy i receive:
> 500 Chunked must be last Transfer-Encoding 'identity'
> 
> Proxy is working correctly (webbrowsers works fine with them)
> What's wrong ?

Try upgrading libwww-perl.


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

Date: 16 Jan 2007 14:17:34 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Map Windows from Unix
Message-Id: <51453uF1ibig2U1@mid.dfncis.de>

Andrew DeFaria  <Andrew@DeFaria.com> wrote in comp.lang.perl.misc:
> -=-=-=-=-=-
> 
> anno4000@radom.zrz.tu-berlin.de wrote:
> > Continue posting HTML and be ignored by those with a clue who don't 
> > flame you. It's a free country, you know.
> >
> > Anno
> Yes, fine Mr. Anno. You assume that all those "in the know" hate this. I 
> don't believe that's true and I'll takes my chances. People with such 
> petty rules tend to be annoying and have their heads up their asses 
> anyway. Not the kind of people I wish to associate with to start with. YMMV.

Have fun.

Anno


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

Date: Tue, 16 Jan 2007 10:22:31 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Map Windows from Unix
Message-Id: <m2sleb6loo.fsf@Sherm-Pendleys-Computer.local>

Andrew DeFaria <Andrew@DeFaria.com> writes:

> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
>
>   
>   
>
>
> Sherm Pendley wrote:
> Andrew DeFaria mailto:Andrew@DeFaria.com writes:
>   
>   <!DOCTYPE html PUBLIC "-//W3C//DTD HTML
> 4.01 Transitional//EN">
>     
> Tuhin wrote:
> <blockquote
> cite=mailto:mid1168914587.000083.127320@a75g2000cwd.googlegroups.com
>   
> Please stop posting HTML gibberish. This is not the web, and your
> posting style is very annoying to those of us who actually know what
> we're doing.
>
> Last time I checked this was a free country (well at least where I'm
> posting from). Please stop telling me how to post.

"Please stop posting HTML" is not telling you how to post, it's asking
you to stop posting something most people find highly annoying.

Yes, it's a free country. You're free to be as rude as you'd like to be.
And the rest of us are free to think you're acting like a spoiled brat
when you do.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Tue, 16 Jan 2007 10:36:57 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Map Windows from Unix
Message-Id: <m2odoz6l0m.fsf@Sherm-Pendleys-Computer.local>

Andrew DeFaria <Andrew@DeFaria.com> writes:

> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
>
>   
>   
>
>
> mailto:anno4000@radom.zrz.tu-berlin.de wrote:
> Continue
> posting HTML and be ignored by those with a clue who don't flame you.
> It's a free country, you know.
>   
> Anno
>
> Yes, fine Mr. Anno. You assume that all those "in the know" hate this.

It's not an assumption. You're not the first arrogant brat to post here
who believes he's so much better than the rest of us that the normal rules
don't apply to him. You're not the first such child to be spanked, and you
won't be the last, I'm sure.

> I don't believe that's true and I'll takes my chances.

Your loss.

> People with such
> petty rules tend to be annoying

Yeah, rules do tend to be annoying to the children who don't understand the
reason for them.

The other 99% of us understand that not everyone here is using an HTML-capable
news reader, and find annoying the children who insist on being rude just to
prove that they're free to do so.

> and have their heads up their asses

Physically impossible. You do have an active imagination for a child though.
What do you want to be when you grow up?

> anyway. Not the kind of people I wish to associate with to start with.

This group is for adults. If you don't like that, find a group for children
your own age. Or grow up and stay here. Or stay here and throw tantrums, if
you don't mind being laughed at and thought of as a spoiled child. It's a
free country, as you've pointed out before.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Tue, 16 Jan 2007 15:59:04 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Map Windows from Unix
Message-Id: <cD6rh.3140$Ld.2716@trndny08>

anno4000@radom.zrz.tu-berlin.de wrote:
> Andrew DeFaria  <Andrew@DeFaria.com> wrote in comp.lang.perl.misc:
>> -=-=-=-=-=-
>>
>> Sherm Pendley wrote:
>>> Andrew DeFaria <Andrew@DeFaria.com> writes:
>>>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>>>>
>>>> Tuhin wrote:
>>>> <blockquote
>>>> cite="mid1168914587.000083.127320@a75g2000cwd.googlegroups.com"
>>> Please stop posting HTML gibberish. This is not the web, and your
>>> posting style is very annoying to those of us who actually know what
>>> we're doing.
>> Last time I checked this was a free country (well at least where I'm
>> posting from). Please stop telling me how to post. You might wish to
>> get out of your holier then fucking thou chair while your at it...
>
> Continue posting HTML and be ignored by those with a clue who don't
> flame you.  It's a free country, you know.

Is Mr. Clueless still going at it and vigorously defending his idiocy? I 
guess my public plonk was very much justified.

jue 




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

Date: 16 Jan 2007 17:22:20 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Map Windows from Unix
Message-Id: <514fucF1hmcn1U1@mid.dfncis.de>

Andrew DeFaria  <Andrew@DeFaria.com> wrote in comp.lang.perl.misc:
> -=-=-=-=-=-
> 
> anno4000@radom.zrz.tu-berlin.de wrote:
> > Andrew DeFaria <Andrew@DeFaria.com> wrote in comp.lang.perl.misc:
> >> -=-=-=-=-=-
> >>
> >> anno4000@radom.zrz.tu-berlin.de wrote:
> >>> Continue posting HTML and be ignored by those with a clue who don't 
> >>> flame you. It's a free country, you know.
> >>>
> >>> Anno
> >> Yes, fine Mr. Anno. You assume that all those "in the know" hate 
> >> this. I don't believe that's true and I'll takes my chances. People 
> >> with such petty rules tend to be annoying and have their heads up 
> >> their asses anyway. Not the kind of people I wish to associate with 
> >> to start with. YMMV.
> > Have fun.
> >
> > Anno
> I always do!

You expressed too much displeasure in your contributions for that
to be true.

Anno


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

Date: 16 Jan 2007 09:23:33 -0800
From: "Tuhin" <minhaztuhin@hotmail.com>
Subject: Re: Map Windows from Unix
Message-Id: <1168968213.244322.299770@51g2000cwl.googlegroups.com>

Hi Sherm,

I clicked on "Start a new topic", filled out the message area and
clicked on post message. I don't know what I did wrong. But I found
that the way you replied my topic initiates fighting using slang words
which is unfortunate. I subscribed in this group with the intention of
learning some thing because I believed that you guys are expart. But
unfortunately your reply discouraged me to continue in this group. You
are expert, but dont pretend that every one is in your level. Please
stop fighting. I am unsubcsribing now.

Tuhin

Sherm Pendley wrote:
> Andrew DeFaria <Andrew@DeFaria.com> writes:
>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> >
> >
> >
> >
> >
> >
> > Tuhin wrote:
> > <blockquote
> >  cite="mid1168914587.000083.127320@a75g2000cwd.googlegroups.com"
>
> Please stop posting HTML gibberish. This is not the web, and your posting
> style is very annoying to those of us who actually know what we're doing.
>
> sherm--
>
> --
> Web Hosting by West Virginians, for West Virginians: http://wv-www.net
> Cocoa programming in Perl: http://camelbones.sourceforge.net



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

Date: Tue, 16 Jan 2007 19:25:32 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: Map Windows from Unix
Message-Id: <pan.2007.01.16.18.25.32.744147@remove.this.part.rtij.nl>

On Mon, 15 Jan 2007 21:46:43 -0600, Andrew DeFaria wrote:

> Tuhin wrote:
>> Since I am new in the Perl world, my idea is, sitting on the Unix 
>> server if I can open the Windows Explorer (or any file selection 
>> dialog box that will display the directory structure of the PC), then 
>> I will be able to copy the data from the CD using my Perl script.
> How about setting up Samba such that you can mount shares from the PC to 
> the Unix server. Then share the CD on the PC and mount it to the Unix 
> system. Then just point your Perl script to the "mounted from the PC" CD.

Mister DeFarias advice is about as good as his posting style. What you
might do instead is install a CIFS (aka SMB) capable kernel and mount the
CDROM directly from the PC to the Unixbox.

M4
-- 
Redundancy is a great way to introduce more single points of failure.



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

Date: Tue, 16 Jan 2007 16:35:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Jan 16 2007
Message-Id: <JByzF0.146G@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

AI-FuzzyLogic-0.06
http://search.cpan.org/~swalters/AI-FuzzyLogic-0.06/
Fuzzy Set Operations and Tools
----
Acme-MorningMusume-0.08
http://search.cpan.org/~kentaro/Acme-MorningMusume-0.08/
All about Japanese pop star "Morning Musume"
----
Business-Tax-VAT-Validation-0.13
http://search.cpan.org/~bpgn/Business-Tax-VAT-Validation-0.13/
A class for european VAT numbers validation.
----
CA-AutoSys-0.99
http://search.cpan.org/~sini/CA-AutoSys-0.99/
----
CA-AutoSys-1.00
http://search.cpan.org/~sini/CA-AutoSys-1.00/
----
CA-AutoSys-1.01
http://search.cpan.org/~sini/CA-AutoSys-1.01/
Interface to CA's AutoSys job control.
----
CGI-Application-Dispatch-2.10
http://search.cpan.org/~wonko/CGI-Application-Dispatch-2.10/
Dispatch requests to CGI::Application based objects
----
CORBA-Python-0.31
http://search.cpan.org/~perrad/CORBA-Python-0.31/
----
Catalyst-View-TT-0.25
http://search.cpan.org/~mramberg/Catalyst-View-TT-0.25/
Template View Class
----
Crypt-PBC-0.7.20.0-0.4.3
http://search.cpan.org/~jettero/Crypt-PBC-0.7.20.0-0.4.3/
OO interface for the Stanford PBC library
----
DBIC-Dumper-0.1
http://search.cpan.org/~victori/DBIC-Dumper-0.1/
The great new DBIC::Dumper!
----
DBIx-InsertHash-0.001
http://search.cpan.org/~uvoelker/DBIx-InsertHash-0.001/
insert/update a database record with a hash
----
DBIx-MyParse-0.80
http://search.cpan.org/~philips/DBIx-MyParse-0.80/
Perl API for MySQL's SQL Parser
----
DateTime-Format-Natural-0.22
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.22/
Create machine readable date/time with natural parsing logic
----
EasyDBAccess-3.1.1
http://search.cpan.org/~foolfish/EasyDBAccess-3.1.1/
Perl Database Access Interface
----
EasySession-2.0.0
http://search.cpan.org/~foolfish/EasySession-2.0.0/
Perl Session Interface
----
EasyTool-1.0.4
http://search.cpan.org/~foolfish/EasyTool-1.0.4/
The Library of Perl Functions in Common Usage
----
File-Find-Repository-0.01
http://search.cpan.org/~nkh/File-Find-Repository-0.01/
Find files in your repositories.
----
Geo-Constants-0.06
http://search.cpan.org/~mrdvt/Geo-Constants-0.06/
Package for standard Geo:: constants.
----
Geo-Functions-0.06
http://search.cpan.org/~mrdvt/Geo-Functions-0.06/
Package for standard Geo:: functions.
----
Getopt-Mixed-Help-0.17
http://search.cpan.org/~dorner/Getopt-Mixed-Help-0.17/
combine Getopt::Mixed with usage and help
----
LWP-Online-0.02
http://search.cpan.org/~adamk/LWP-Online-0.02/
Does your process have access to the web
----
Mac-Apps-Seasonality-Constants-v0.0.4
http://search.cpan.org/~elliotjs/Mac-Apps-Seasonality-Constants-v0.0.4/
Static definitions of aspects of Seasonality.
----
Module-AutoINC-0.02
http://search.cpan.org/~mackenzie/Module-AutoINC-0.02/
Download and install CPAN/PPM modules upon first use.
----
Mollie-Micropayment-0.01
http://search.cpan.org/~ckras/Mollie-Micropayment-0.01/
Perl API for Mollie's Micropayment service
----
Net-Bluetooth-0.39
http://search.cpan.org/~iguthrie/Net-Bluetooth-0.39/
Perl Bluetooth Interface
----
Net-GPSD-0.35
http://search.cpan.org/~mrdvt/Net-GPSD-0.35/
Provides an object client interface to the gpsd server daemon.
----
Net-SIP-0.14
http://search.cpan.org/~sullr/Net-SIP-0.14/
Framework SIP (Voice Over IP, RFC3261)
----
Net-Z3950-ZOOM-1.16
http://search.cpan.org/~mirk/Net-Z3950-ZOOM-1.16/
Perl extension for invoking the ZOOM-C API.
----
Object-Declare-0.20
http://search.cpan.org/~audreyt/Object-Declare-0.20/
Declarative object constructor
----
OpenOffice-OODoc-2.031
http://search.cpan.org/~jmgdoc/OpenOffice-OODoc-2.031/
The Perl Open OpenDocument Connector
----
PAR-Dist-InstallPPD-GUI-0.05
http://search.cpan.org/~smueller/PAR-Dist-InstallPPD-GUI-0.05/
GUI frontend for PAR::Dist::InstallPPD
----
Parallel-Mpich-MPD-0.3.0
http://search.cpan.org/~alexmass/Parallel-Mpich-MPD-0.3.0/
Mpich MPD wrapper
----
Pod-POM-View-HTML-Filter-0.06
http://search.cpan.org/~book/Pod-POM-View-HTML-Filter-0.06/
Use filters on sections of your pod documents
----
Rose-DB-0.732
http://search.cpan.org/~jsiracusa/Rose-DB-0.732/
A DBI wrapper and abstraction layer.
----
Rose-DB-Object-0.759
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.759/
Extensible, high performance RDBMS-OO mapper.
----
Rose-HTML-Objects-0.546
http://search.cpan.org/~jsiracusa/Rose-HTML-Objects-0.546/
Object-oriented interfaces for HTML.
----
Rsync-Config-0.3
http://search.cpan.org/~diablo/Rsync-Config-0.3/
rsync configuration generator
----
Rsync-Config-0.3.1
http://search.cpan.org/~diablo/Rsync-Config-0.3.1/
rsync configuration generator
----
SMS_API_4.01.1
http://search.cpan.org/~goyali/SMS_API_4.01.1/
----
SVN-Web-0.51
http://search.cpan.org/~nikc/SVN-Web-0.51/
Subversion repository web frontend
----
Set-IntSpan-Fast-v0.0.4
http://search.cpan.org/~andya/Set-IntSpan-Fast-v0.0.4/
Fast handling of sets containing integer spans.
----
Set-IntSpan-Fast-v0.0.5
http://search.cpan.org/~andya/Set-IntSpan-Fast-v0.0.5/
Fast handling of sets containing integer spans.
----
TAPx-Parser-0.50_04
http://search.cpan.org/~ovid/TAPx-Parser-0.50_04/
Parse TAP output
----
TAPx-Parser-0.50_05
http://search.cpan.org/~ovid/TAPx-Parser-0.50_05/
Parse TAP output
----
Test-Inline-2.201
http://search.cpan.org/~adamk/Test-Inline-2.201/
Lets you put tests in your modules, next to tested code
----
Test-Script-1.02
http://search.cpan.org/~adamk/Test-Script-1.02/
Cross-platform basic tests for scripts
----
Text-Diff-Parser-0.06
http://search.cpan.org/~gwyn/Text-Diff-Parser-0.06/
Parse patch files containing unified and standard diffs
----
Time-Interval-1.21
http://search.cpan.org/~ahicox/Time-Interval-1.21/
Converts time intervals of days, hours, minutes, and seconds
----
URI-Template-0.01
http://search.cpan.org/~bricas/URI-Template-0.01/
Object for handle URI templates
----
Unicode-Japanese-0.39
http://search.cpan.org/~hio/Unicode-Japanese-0.39/
Japanese Character Encoding Handler
----
Unicode-Japanese-0.40
http://search.cpan.org/~hio/Unicode-Japanese-0.40/
Japanese Character Encoding Handler
----
XML-Table2XML-0.03
http://search.cpan.org/~rkapl/XML-Table2XML-0.03/
Generic conversion of tabular data to XML by reverting Excel's flattener methodology.
----
XML-Table2XML-1.0
http://search.cpan.org/~rkapl/XML-Table2XML-1.0/
Generic conversion of tabular data to XML by reverting Excel's flattener methodology.
----
p5-Palm-1.007
http://search.cpan.org/~bdfoy/p5-Palm-1.007/
----
pip-0.08
http://search.cpan.org/~adamk/pip-0.08/
Console application for running Perl 5 Installer (P5I) files


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 16 Jan 2007 08:02:29 -0800
From: "Igna" <ignleotta@gmail.com>
Subject: Piping from perl to C
Message-Id: <1168963346.806080.219270@11g2000cwr.googlegroups.com>

Hello. I have to write a pipe to joint a GUI in perl and a simulation
program in c. I have read  all the docs found in perl.com and now I am
trying to make a test with this simple program. It seems working but it
does not write "bonjour" at the end. Can anybody tell me where my
mistake is? I will be happy for any sample of code for a pipe between c
and perl sent to me too.
Thanks in advance,
                            Ignazio



#include <stdio.h>
#include <memory.h>
#include <unistd.h>

char chaine[7];
int status;

int main( int argc, char ** argv )
{
/* create the pipe */
int pfd[2];


 int pid;
 if ((pid = fork()) < 0)
{
  printf("fork failed\n");
  return 2;
}

if (pid == 0)
{
  /* child */
  close(pfd[0]);
write(pfd[1],"bonjour",7);
  dup2(pfd[1], 1); /* connect the write side with stdout */

  close(pfd[1]); /* close the write side */
  printf("CHAINE FILS %s\n",chaine);
  //return 3;
  exit(0);
}
else
{
  /* parent */
  close(pfd[1]); /* close the unused write side */
  dup2(pfd[0], 0); /* connect the read side with stdin */
  read (pfd[0],chaine,7);

   close(pfd[0]); /* close the read side */
  printf("CHAINE PARENT %s\n",chaine);
   wait(&status);
}
}



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

Date: 16 Jan 2007 16:30:34 GMT
From: xhoster@gmail.com
Subject: Re: Piping from perl to C
Message-Id: <20070116113109.370$83@newsreader.com>

"Igna" <ignleotta@gmail.com> wrote:
> Hello. I have to write a pipe to joint a GUI in perl and a simulation
> program in c. I have read  all the docs found in perl.com and now I am
> trying to make a test with this simple program.

It isn't clear from your description (or your code) exactly what it is
you want to do.  Write from Perl to C program?  Write from C program to
Perl program?  Both?

> It seems working but it
> does not write "bonjour" at the end.

I don't really understand that.  It seems to work, except that it doesn't
do the main thing that would indicate that it is working?

> Can anybody tell me where my
> mistake is? I will be happy for any sample of code for a pipe between c
> and perl sent to me too.

Your main mistake is asking a C question in Perl group.

What I would do is open a pipe to or from the C program (or both, using
IPC::Open2) and have the C program just read from stdin and/or write to
stdout.  But that is because I'm a better Perl programmer than C
programmer.

<Snip code which is exclusively C, no Perl in sight, and which seems to
close and write to files descriptors that are undefined and thus have never
been opened, except maybe by accident.>

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Tue, 16 Jan 2007 19:08:43 +0100
From: Michael Hagedorn <mic01@uni-muenster.de>
Subject: Postscript-Wizzards? How to set the background for each letter?
Message-Id: <eoj4bd$tv0$1@sagnix.uni-muenster.de>

Hi,
I found this little script
http://www.codebunny.org/coding/index.html#graphics
--> Shanty: Generates an PostScript file representing an image using 
coloured text.

It works fine. You can take any text and any picture you want and get a 
poster "a la Matrix" or like this
http://www.codebunny.org/coding/shanty/download/openbsd_a4.pdf

One problem occurs when I tried to print a poster in DinA1 or DinA0 
format. The poster doesnt have bright contrasts and it's not very bright.
To change this it should be possible to change the perl-Script.
Does anyone know how to realise a setting like this: When i.e. a red 
letter appears the background of this letter should also set to a darker 
red. This should increase contrast and brightness?

In other words: how to change the background color of a letter in 
dependency of its foreground-color?
Any ideas? Thank you,
M.


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

Date: 16 Jan 2007 08:34:28 -0800
From: wing328hk@gmail.com
Subject: Question on SIGTERM
Message-Id: <1168965264.768240.102430@v45g2000cwv.googlegroups.com>

Hi,

I need to pipe a data stream to STDIN and I'm only interesting in the
first line so I do

my $header = <STDIN>;

To read the rest of the data stream, I do

    do {
        my $buf = "";
        1 while (read(STDIN, $buf, 1024));
    };

Would I get SIGPIPE if I don't use the do loop to get the rest of the
message?

Basically, how can I discard the rest of the message from STDIN? The
data stream can be huge (30MB...) and that's why I don't want to waste
CPU time in reading something I don't need.

Would it make a different to above questions if the above code is part
of a child process and there will be several child processes running
simultaneously reading from different data stream from pipe??

Thanks,
wing328hk



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

Date: 16 Jan 2007 16:54:28 GMT
From: xhoster@gmail.com
Subject: Re: Question on SIGTERM
Message-Id: <20070116115503.839$dG@newsreader.com>

wing328hk@gmail.com wrote:
> Hi,
>
> I need to pipe a data stream to STDIN and I'm only interesting in the
> first line so I do
>
> my $header = <STDIN>;
>
> To read the rest of the data stream, I do
>
>     do {
>         my $buf = "";
>         1 while (read(STDIN, $buf, 1024));
>     };
>
> Would I get SIGPIPE if I don't use the do loop to get the rest of the
> message?

"You" (i.e. the process (not) doing the reading) wouldn't get a SIGPIPE.
The process writing to "you" might get a SIGPIPE.

> Basically, how can I discard the rest of the message from STDIN?

Don't read it.  Either close the filehandle without reading the rest, or
just exit the program without reading the rest.

> The
> data stream can be huge (30MB...) and that's why I don't want to waste
> CPU time in reading something I don't need.

Why waste time *writing* something you don't need?  If you have control
over the writing process (which it seems you do, as you call the
reading process a child), fix it.

> Would it make a different to above questions if the above code is part
> of a child process and there will be several child processes running
> simultaneously reading from different data stream from pipe??

Where do they get these different data streams from?  Do you care whether
the writing process gets a SIGPIPE?  If so, why?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: 16 Jan 2007 14:29:02 -0000
From: Art Merkel <art@example.com>
Subject: Re: substituting words and maintaining case?
Message-Id: <CUH5MBCX39098.3534953704@anonymous.poster>

"John W. Krahn" <someone@example.com> wrote:

> Art Merkel wrote:
> > I'd appreciate any suggestions for writing a function for substituting
> > words in a string but keeping the case the same, so for example,
> > starting with 
> > 
> >   Cats are furry. I like cats. Do you like CATS?
> > 
> > and the substitution cats -> kittens I'd like to get
> > 
> >   Kittens are furry. I like kittens. Do you like KITTENS?
> 
> perldoc -q "How do I substitute case insensitively on the LHS while preserving
> case on the RHS"

I thought my question was really weird, so it didn't occur to me
that it would be documented!

Thanks for the very polite RTFM.








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

Date: Tue, 16 Jan 2007 15:05:04 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: the => operator
Message-Id: <djmpq292vvhbloar7jbjj1k87ccg012bmt@4ax.com>

On 16 Jan 2007 03:56:56 -0800, "perlguru" <manojkumargupta@gmail.com>
wrote:

> Yes; it is a operator, used to specify Key-Value pair of a hash.
                        ^
                        ^

"Idiomatically, but not necessarily". (Also used whenever one wants to
stress that the lhs is mapped to the rhs.)

>As my friend said, you can even use comma replacing '=>'
>
>Hence the line
>                 my $xp = XML::XPath->new(xml => $xml);
>can be changed to
>                 my $xp = XML::XPath->new(xml , $xml);

                  my $xp = XML::XPath->new('xml' , $xml);

if under strict (subs), as it should.

>Abigail wrote:
[snip full quoted content]

*PLEASE* do not top post.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Tue, 16 Jan 2007 09:13:44 -0800
From: "Wayne M. Poe" <louisREMOVE@REMOVEh4h.com>
Subject: Re: the => operator
Message-Id: <514fedF1h7359U1@mid.individual.net>

Abigail wrote:
> fatwallet961@yahoo.com (fatwallet961@yahoo.com) wrote on MMMMDCCCLXXXV
> September MCMXCIII in
> <URL:news:l7unq2h7kj8flbbk01juqhcegnpaubmcg1@4ax.com>:
> --  in the following code
> --
> --  what's =>  means?
>
> It's a comma which quotes a bareword on its left hand side.

And is normally used with hashes (an associative array, like std::map in 
the C++ STL, or Object in JavaScript & VBScript.)

> --  is it an operator in perl?
>
> Yes.
>
> --  any document on this opeartor?

$ perldoc perlop

> Of course. In the same document that documents all the other
> operators: perlop.
>
>
>
> Abigail
> --
> #!/opt/perl/bin/perl -w

Abigail, why in the name of Larry Wall are you using a sig delimiter for 
a quote-char ? You do realize you breaking any processor that does 
things like color coding quote levels and re-wrapping as necessary. I 
know this isn't the first time someone has asked you to fix your 
quoting, even if it's not always a problem, but being as random as it 
is, you're just run the risk of breaking things for other people.

Could you please explain why you cannot just use one quoting style 
instead of changing it every time you post, like everyone seems to be 
able to do? Seriously, there is a good reason why the majority use 
standard quoting. 




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 37
*************************************


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