Re: How to get all the files under the webdir?

2007-02-13 Thread Tom Phoenix
On 2/13/07, Jm lists <[EMAIL PROTECTED]> wrote: I want to get all the files on some a webdir.For example: What do you mean by "some a webdir"? http://www.foo.com/bar/ But that dir has a default page "index.htm".So when I accessed the url I only got the default page. Can you tell me is ther

How to get all the files under the webdir?

2007-02-13 Thread Jm lists
Hello lists, I want to get all the files on some a webdir.For example: http://www.foo.com/bar/ But that dir has a default page "index.htm".So when I accessed the url I only got the default page. Can you tell me is there a way to fetch all the files in that dir?Thanks a lot. -- To unsubscribe,

Re: What is a good placeholder character

2007-02-13 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > I decided to try 122 but it doesn't work.. > > Any ideas? > > speach () { cat $1 | > perl -n00e'tr/\n\n/\122/s; # this is experimental tr/// translates characters so tr/\n/\122/s; does the same thing as tr/\n\n/\122/s; The character "\122" is the same a

share semaphore across threads

2007-02-13 Thread Nathan Vander Wilt
I have a list of data that I want to operate concurrently on, as many threads as I have processors. So I wrote a bit of code that uses a semaphore to halt spawning of new threads when the limit are already running. I have two problems with the following code. First of all, it "dead"blocks on '$ava

sharing semaphore with/between threads

2007-02-13 Thread n
I have a list of data that I want to operate concurrently on, as many threads as I have processors. So I wrote a bit of code that uses a semaphore to halt spawning of new threads when the limit are already running. I have two problems with the following code. First of all, it "dead"blocks on

Re: DOS to Windows format tr/\n\r\t/ /

2007-02-13 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > I had tried it. What? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

What is a good placeholder character

2007-02-13 Thread vjp2
I decided to try 122 but it doesn't work.. Any ideas? speach () { cat $1 | perl -n00e'tr/\n\n/\122/s; # this is experimental tr/\t\r\n/ /s; tr/\122/\n/s;# this is experimental print qq($1\n) while s/^(.{0

Re: Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
On 13/02/07, Igor Sutton <[EMAIL PROTECTED]> wrote: Ana, 2007/2/13, Ana Saiz García <[EMAIL PROTECTED]>: > Thank you all for your answers, they have been very helpful :o) > It would be nice if you post the solution you picked. It is useful for another user like you to search in archives :-)

Re: HTTP Post using IO::Socket

2007-02-13 Thread David Moreno Garza
On Mon, 2007-02-12 at 18:30 -0500, Sumit Shah wrote: > All, > > I would appreciate if someone could tell me how to do an HTTP Post using > IO::Socket. I cannot use LWP. I have to manage it with plain Sockets. > > I am new to this and any help would be appreciated. This will save your ass, just

Re: Dynamically calling a subroutine

2007-02-13 Thread Igor Sutton
Ana, 2007/2/13, Ana Saiz García <[EMAIL PROTECTED]>: Thank you all for your answers, they have been very helpful :o) It would be nice if you post the solution you picked. It is useful for another user like you to search in archives :-) -- Igor Sutton Lopes <[EMAIL PROTECTED]> -- To unsubscr

Re: Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
Thank you all for your answers, they have been very helpful :o) Regards Ana -- "El más baldío de todos los días es aquél en que no hemos reído" (de Chamfort)

perl6::form simple reporting

2007-02-13 Thread Ken Foskey
I have a script that takes an sql and formats into a report, simple stuff. I have a product that when it changes I want a sub heading. I have coded this. if( $prior_product ne $sql_product ) { print form... $prior_product = $sql_product; } Is there a better way to code this sort of rep

Re: HTTP Post using IO::Socket

2007-02-13 Thread Sumit Shah
Thanks Zentara. I have understood it. I am doing something similar. I need to invoke a SOAP service using HTTP POST. I have gotten to a point where it invokes the SOAP service but apparently my XML is not well formed or I am not sending the right info in the header. For example I am not sending

Re: HTTP Post using IO::Socket

2007-02-13 Thread Sumit Shah
Hello, Thanks for the replies. I am using Perl provided by Oracle's Application Server. I am bound to it. LWP does not come standard with it. LWP requires some pre-req libraries/packages which I am unable to install on the platforms we are using. I felt may be I could achieve it with plain s

Re: Filesys::DiskUsage vs shell du

2007-02-13 Thread Ed
Many thanks for the info John. I knew I was missing something obvious. Enjoying learning Perl immensely! -Ed On Tuesday 13 February 2007 00:39, John W. Krahn wrote: > Ed wrote: > > Hi all, > > Hello, > > > I am having problems with the difference in output between du from bash and > > du > > f

Re: DOS to Windows format tr/\n\r\t/ /

2007-02-13 Thread vjp2
I had tried it. It gave me an error on the "use" line already. It also doesn't like the "split". I can dig up my GNU DJGPP CD and install version 5, but the problem is v5 is an entire system, while v4 is just a one-file program, so there are computers (not mine, heck those machines don't even all

Re: Dynamically calling a subroutine

2007-02-13 Thread Igor Sutton
Erm. Sorry :-) I have done everything and I don't get anything when doing $ perl module-pluggable-sample.pm, would you know why? First of all I made a type there. It is $ perl module-pluggable-sample.pl The code has an error too. New version below: use strict; use warnings; package Applic

Re: FW: Array manipulation

2007-02-13 Thread Jeff Pang
-Original Message- >From: "Sayed, Irfan (Irfan)" <[EMAIL PROTECTED]> >Sent: Feb 13, 2007 7:12 PM >To: beginners@perl.org >Subject: FW: Array manipulation > > >Hi All, > >I have one array having values as follows > >User [EMAIL PROTECTED] >User [EMAIL PROTECTED] >User [EMAIL PROTECTED] > >

Re: Dynamically calling a subroutine

2007-02-13 Thread D. Bolliger
Ana Saiz García am Dienstag, 13. Februar 2007 13:02: > On 12/02/07, D. Bolliger <[EMAIL PROTECTED]> wrote: > > Ana Saiz García am Montag, 12. Februar 2007 22:26: [snipp and following code stripped] > > #!/usr/bin/perl > > > > # don't forget: > > # > > use strict; > > use warnings; > > > > package

Re: FW: Array manipulation

2007-02-13 Thread Jeff Pang
> >@a = (1,2,3,4,2,3,5); > >print "---> @a\n"; >my %b = undef; >foreach (@a){ > >print "--- $_"; > $b{$_} =undef; >} > >@a = keys(%b); > >print "\n### @a"; > Hmm,that will break the order of the original array. -- Jeff Pang EMAIL: [EMAIL PROTECTED] AIM: jeffpang -- To unsubscribe, e-mai

Re: Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
Hi again and thank you On 13/02/07, Igor Sutton <[EMAIL PROTECTED]> wrote: Hi Ana, > Don't I have to put "use" and the name of packages A and B anywhere on the > main program? I advice you to use Module::Pluggable for that (as I think you're designing a pluggable system or whatever): Yes,

Re: FW: Array manipulation

2007-02-13 Thread kilaru rajeev
I got the output like .. P:\>"C:\Documents and Settings\rkilaru\Desktop\prog.pl" ---> 1 2 3 4 2 3 5 --- 1--- 2--- 3--- 4--- 2--- 3--- 5 ### 4 1 3 2 5 P:\> Rajeev On 2/13/07, kilaru rajeev <[EMAIL PROTECTED]> wrote: Hi Irfan, Please find the following way. @a = (1,2,3,4,2,3,5); prin

Re: Dynamically calling a subroutine

2007-02-13 Thread Igor Sutton
Hi Ana, Don't I have to put "use" and the name of packages A and B anywhere on the main program? I advice you to use Module::Pluggable for that (as I think you're designing a pluggable system or whatever): $ cat > module-pluggable-sample.pl use strict; use warnings; package Application; use

Re: FW: Array manipulation

2007-02-13 Thread kilaru rajeev
Hi Irfan, Please find the following way. @a = (1,2,3,4,2,3,5); print "---> @a\n"; my %b = undef; foreach (@a){ print "--- $_"; $b{$_} =undef; } @a = keys(%b); print "\n### @a"; rgds, Rajeev Kilaru On 2/13/07, Sayed, Irfan (Irfan) <[EMAIL PROTECTED]> wrote: Hi All, I have

Re: Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
Hi again and thanks for your help On 12/02/07, D. Bolliger <[EMAIL PROTECTED]> wrote: Ana Saiz García am Montag, 12. Februar 2007 22:26: > Hello Hello Ana > First of all, I apologize if this is not the right list to ask my question, > but as I am a perl beginner, I think it is the most suitab

Re: Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
On 13/02/07, Igor Sutton <[EMAIL PROTECTED]> wrote: > Thank you for your idea, but I think this doesn't solve my problem, because > what I don't know a priori is the module's name (in your example, M), not > the function's name. package M; sub my_routine { print "my_routine()\n"; } packag

Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
On 13/02/07, Chad Perrin <[EMAIL PROTECTED]> wrote: > The specific module that will be used at a given moment is supposed to be > given by a configuration file, that's why the main program doesn't know its > name a priori (but it does know the name of the subroutine, that must be the > same for

Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
Hi again On 12/02/07, Igor Sutton Lopes <[EMAIL PROTECTED]> wrote: You can use the UNIVERSAL's can() method. Assuming you have a module called "M"; package M; sub some_function { print "some_function()", "\n"; } package main; my $function_name = "some_function"; if (my $coderef = M->can($f

Re: Dynamically calling a subroutine

2007-02-13 Thread Ana Saiz García
Hello again and thanks for your answers You all have been very kind with your fast answers, and I have read a lot of good ideas. Tomorrow (I must go to bed *right* now ;o)) I will try them in order to find which one best fits my needs. Many thanks again. Regards Ana -- "El más baldío de tod

FW: Array manipulation

2007-02-13 Thread Sayed, Irfan \(Irfan\)
Hi All, I have one array having values as follows User [EMAIL PROTECTED] User [EMAIL PROTECTED] User [EMAIL PROTECTED] Now I formatted above array as per your suggession as follows in order to remove duplicate value "User" @test = grep { ++$hash{$_} < 2 } @test; but output is as follows which