Re: Yet another question on perl modules

2005-07-06 Thread Peter Rabbitson
On Thu, Jul 07, 2005 at 02:22:34AM -0400, Casey West wrote: > This is a confusing question, but I think the answer is that a BEGIN > block would come into play before any of these things are executed. > > -- > Casey West > > Sorry :) Question is: why would I want to use a BEGIN block in the

Yet another question on perl modules

2005-07-06 Thread Peter Rabbitson
Hello everyone, Most modules I run across have a BEGIN block containing some variable declarations, module loaders etc. Although I understand what BEGIN is (code being evaluated immediately after it is parsed), I miss the point of the excercise. For example: package csv_generator; use Text::C

Query on File::Find

2005-07-06 Thread Shobha Deepthi
Hi, Am using find method in File::Find module. Right now this method is being used as follows: find({wanted => \&find_and_instantiate_commav_file, no_chdir => 0}, $spec_entry); But I want to pass another parameter to find_and_instantiate_commav_file subro

Re: Form / CGI error

2005-07-06 Thread Chris Devers
On Wed, 6 Jul 2005, Ron Smith wrote: I'm getting an error when I submit the following html form to a CGI script. Let's focus on the script, not the HTML. Once you've verified that the script works, at least on a basic level -- i.e. you can go to http://your-site/cgi-bin/your-script.cgi and g

Atmoic operations in Multi-threaded Perl?

2005-07-06 Thread Siegfried Heintze
Can I assume that an auto-increment operation on an integer value is atomic (that is, cannot be interrupted by another thread)? This is a common assumption in C/C++. The perl debugger I use leads me to believe that perl stores all integers as strings however, in spite of my efforts to force them t

Form / CGI error

2005-07-06 Thread Ron Smith
Hi all, I'm getting an error when I submit the following html form to a CGI script. I'm too inexperienced to spot the error. So, I'm looking for help from the list. I've already made the changes as suggested from the error log, but I get the same error again. Does anyone have any suggestions for m

Re: Problems Creating Temporary File

2005-07-06 Thread Graeme St.Clair
Not to be rude, but as JWK said, "What doesn't work?" Also, mentioning the Operating System would have been good. Anyway, on the off-chance it's M$, I tried your script on this my Windows XP Pro system, and got (with extra new lines):- FILENAME: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\KGxxRpbcuU

Re: Intelligent Sorting

2005-07-06 Thread Jeff 'japhy' Pinyan
On Jul 6, Ryan Frantz said: I'm working on a script that will generate a listing of files on a regular basis so that I can create hyperlinks to each respective file. As you see from the sorted output below, though it is in ASCIIbetical order, it is not in chronological order: /2005Jul01-2005Jul

RE: Intelligent Sorting

2005-07-06 Thread Ryan Frantz
> > Is there any decent documentation available that I could study so > > that I can sort this better? > > As soon as I hit Send on this email I checked my 'Learning Perl' book and found some information (Ch. 15, not that far yet ;^)). Prior to implementing anything, I want to understand what's g

RE: Intelligent Sorting

2005-07-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ryan Frantz wrote: > Perlers, > > I'm working on a script that will generate a listing of files on a > regular basis so that I can create hyperlinks to each respective file. > As you see from the sorted output below, though it is in ASCIIbetical > order, it is not in chronological order: > > /200

application flow question

2005-07-06 Thread chad smith
Hello, When writing a web-based application, what's the best way to structure your perl scripts? Currently I have scripts written by function (add/delete/update). However, the navigation between scripts after an action has occured (i.e. deleting a record) could be better. I wrote a script be

Intelligent Sorting

2005-07-06 Thread Ryan Frantz
Perlers, I'm working on a script that will generate a listing of files on a regular basis so that I can create hyperlinks to each respective file. As you see from the sorted output below, though it is in ASCIIbetical order, it is not in chronological order: /2005Jul01-2005Jul02/foo/bar.html /2005

RE: Emptying Arrays

2005-07-06 Thread Jeff 'japhy' Pinyan
On Jun 28, Ryan Frantz said: for my $host (@hosts) { my %freq; $freq{$_}++ for grep /$host/i, @logfile; # open file for (sort keys %freq) { print "$_: $freq{$_}\n"; } # close file } I noticed that you use the default '$_'; as a matter of style/progr

Re: How to find out what are modules included in perl

2005-07-06 Thread Scott R. Godin
John W. Krahn wrote: Muthukumar wrote: Hi, Hello, How to find out the modules included in perl? perldoc perlmodlib perldoc perltoc perl -le' use File::Find; find sub { $mods{ $File::Find::name } = () if /\.pm$/ }, grep !/^\.$/, @INC; print for sort map { my $key = $_; map {

Re: modifying a file

2005-07-06 Thread Scott R. Godin
Eliyah Kilada wrote: Hi, is there a method to _/directly/_ make: while (< FIN>) { $_ =~ s//x/g; } modify FIN?! i.e., I need to make modifications in the same file I read from. Thanks And Regards, Eliyah yeah, I do this often right at the command line: perl -pi.bak -e 's//x/g

Re: threads

2005-07-06 Thread Chris Devers
On Wed, 6 Jul 2005, Patricio Bruna V wrote: does perl support threads? Yes. Five seconds on Google would have answered this question. http://www.google.com/search?q=perl+threads -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

RE: threads

2005-07-06 Thread Tim Johnson
Yes. -Original Message- From: Patricio Bruna V [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 06, 2005 12:01 PM To: Perl Subject: threads does perl support threads? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

threads

2005-07-06 Thread Patricio Bruna V
does perl support threads? -- Patricio Bruna V. RHCE/RHCI Jefe Soporte y Operaciones LinuxCenter S.A. Mariano Sanchez Fontecilla 310 Las Condes, Chile Fono:(+56-2) 4834000/4834042 http://www.linuxcenterla.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Use of uninitialized value... --> quit!

2005-07-06 Thread Bryan R Harris
> Bryan R Harris wrote: > [snip] >> >> >> So if I understand right, all I need to do is put this at the top of my >> script? >> >> use warnings FATAL => 'all'; >> >> Is that doing what I want? >> >> - B >> > > You tell us, based on my understanding of it and what you want it > should, but p

Re: Multitasking

2005-07-06 Thread Chris Devers
On Wed, 6 Jul 2005 [EMAIL PROTECTED] wrote: I am making an IRC bot to bridge 2 channels on different networks. Super. Considered using a CPAN module to save reinventing wheels?

Re: Multitasking

2005-07-06 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: > Hey, > > I am making an IRC bot to bridge 2 channels on different networks. > For this I need to scan 2 sockets for data. How do I do this? This > is how I do 1 socket: > > while(my $input = <$sock>) > { > . > } > Ah, a whole 'nother level... So in ge

Multitasking

2005-07-06 Thread dave.w.turner
Hey, I am making an IRC bot to bridge 2 channels on different networks. For this I need to scan 2 sockets for data. How do I do this? This is how I do 1 socket: while(my $input = <$sock>) { . } -- Dave All us base are belong to you. -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: FAQ

2005-07-06 Thread Jay Savage
On 7/6/05, Chris Devers <[EMAIL PROTECTED]> wrote: > On Wed, 6 Jul 2005, madhurima das wrote: > > > Kindly tell the pseudocode to solve the following > > problem: > > > > An user input is provided to a perl program by > > STDIN. This input is utilised by a fortran program to > > perform some fun

Re: make output redirect not working - pl help

2005-07-06 Thread John Doe
MEENA SELVAM am Mittwoch, 6. Juli 2005 17.03: > Hi, > In Fedora Linux, when i give > > $make > makeoutput 2>&1 > > i get the error "Ambiguous redirect .." [snip] No problems on gentoo linux with $ perl -le 'print "hallo"' > test1.txt 2>&1 maybe the "$make" is the problem, but it is definitely n

make output redirect not working - pl help

2005-07-06 Thread MEENA SELVAM
Hi, In Fedora Linux, when i give $make > makeoutput 2>&1 i get the error "Ambiguous redirect .." anyone knows why the error appears? to me the above command looks right, asking make output including errors to the file named makeoutput meena __ Do

RE: How to find out what are modules included in perl

2005-07-06 Thread Jason Sullivan
Short script to find modules installed #!/usr/local/bin/perl use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; } -Original Message- From:

Re: Shortest iteration of an array?

2005-07-06 Thread Jay Savage
On 7/6/05, Angerstein <[EMAIL PROTECTED]> wrote: > > > for ($y = 1; $y <= $thrc; $y++){ > $ary[$y] = threads->new(\&net1, $proto, $time); > $ary[$y]->detach; > } > > #or > > @ary[1..150] = 0; > foreach $element (@ary) { > $element = threads->new(\&net1, $proto, $time); > $element = deta

Shortest iteration of an array?

2005-07-06 Thread Angerstein
for ($y = 1; $y <= $thrc; $y++){ $ary[$y] = threads->new(\&net1, $proto, $time); $ary[$y]->detach; } #or @ary[1..150] = 0; foreach $element (@ary) { $element = threads->new(\&net1, $proto, $time); $element = detach; } something short like or similar possible? #this don´t work... @ary[

RE: FAQ

2005-07-06 Thread Thomas Bätzler
madhurima das <[EMAIL PROTECTED]> asked: >An user input is provided to a perl program by STDIN. This > input is utilised by a fortran program to perform some > function. How do i connect both the programs & get the output > from the fortran program to the user via the perl program itself. >

Re: How to find out what are modules included in perl

2005-07-06 Thread Xavier Noria
On Jul 6, 2005, at 13:48, Muthukumar wrote: How to find out the modules included in perl? That depends on the version. For example the list in perl 5.6.1 is different from the one in 5.8.7. The standard modules in each core Perl distribution are listed in the corresponding perlmodlib pag

RE: How to find out what are modules included in perl

2005-07-06 Thread Bob Showalter
Muthukumar wrote: > Hi, > > How to find out the modules included in perl? To show the "core" modules included with a given Perl version: perldoc perlmodlib To show locally installed additional modules: perldoc perllocal -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: Problems Creating Temporary File

2005-07-06 Thread John W. Krahn
Dave Adams wrote: This code should work but it does not, any suggestions? Yes. Please explain in more detail what exactly "does not work". John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to find out what are modules included in perl

2005-07-06 Thread John W. Krahn
Muthukumar wrote: Hi, Hello, How to find out the modules included in perl? perldoc perlmodlib perldoc perltoc perl -le' use File::Find; find sub { $mods{ $File::Find::name } = () if /\.pm$/ }, grep !/^\.$/, @INC; print for sort map { my $key = $_; map { $key =~ s!^\Q$_\E/!! ?

Re: FAQ

2005-07-06 Thread Chris Devers
On Wed, 6 Jul 2005, madhurima das wrote: Kindly tell the pseudocode to solve the following problem: An user input is provided to a perl program by STDIN. This input is utilised by a fortran program to perform some function. How do i connect both the programs & get the output from the fortran

FAQ

2005-07-06 Thread madhurima das
Kindly tell the pseudocode to solve the following problem: An user input is provided to a perl program by STDIN. This input is utilised by a fortran program to perform some function. How do i connect both the programs & get the output from the fortran program to the user via the perl program i

How to find out what are modules included in perl

2005-07-06 Thread Muthukumar
Hi, How to find out the modules included in perl? Thanks, -Muthu -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: "sort" usage in arrays

2005-07-06 Thread Gerard Robin
On Mon, Jul 04, 2005 at 08:34:26PM + Vineet Pande wrote: > Hello! > In the following code: > > ** > #!/usr/bin/perl > use warnings; > use strict; > my @unsorted = (1, 2, 11, 24, 3, 36, 40, 4); > my @number = sort { $a <=> $b } @unsorted; > print

Re: modifying a file

2005-07-06 Thread Eliyah Kilada
Thanks Tim.. Tim Johnson wrote: There are some ways to do this, but they don't apply to all instances. Really, you're usually better off just writing your changes to a temp file and then replacing your original file. Most methods that seem to accomplish what you are asking for really just do t

RE: modifying a file

2005-07-06 Thread Tim Johnson
There are some ways to do this, but they don't apply to all instances. Really, you're usually better off just writing your changes to a temp file and then replacing your original file. Most methods that seem to accomplish what you are asking for really just do this in the background anyway. ---

modifying a file

2005-07-06 Thread Eliyah Kilada
Hi, is there a method to _/directly/_ make: while (< FIN>) { $_ =~ s//x/g; } modify FIN?! i.e., I need to make modifications in the same file I read from. Thanks And Regards, Eliyah -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]