AW: Date calculation help/suggestion please ... when there is no Date or Time module available

2010-04-07 Thread Thomas Bätzler
newbie01 perl wrote: > Problem 1: > - Is there a function to compare the two (2) dates so ensure that I > will always be doing -? At the moment, the > workaround that am doing is if I get a negative value, then that > means, I've done a - and need to change > the way I print the output. If you fa

Re: How to check modules ... ???

2010-04-07 Thread Shlomi Fish
Hi newbie01 perl, On Thursday 08 Apr 2010 04:28:10 newbie01 perl wrote: > Hi all, > > Running perl -V gives output below which is the path to the modules that > the default perl have access to. Is there any way to display the installed > modules that are available to use so that at least it will

Re: Decimal representation of binary file (unpack)

2010-04-07 Thread Raymond Wan
Hi Alan, Alan Haggai Alavi wrote: On 8 April 2010 11:00, Raymond Wan wrote: for (my $i = 0; $i < length ($buffer); $i += 4) { print unpack ('I', $buffer[$i].$buffer[$i + 1].$buffer[$i + 2].$buffer[$i + 3]), "\n"; } Hi Raymond, Wildcards can be used within the template in pack. There is no

Re: XML Parsing/Modules

2010-04-07 Thread Shlomi Fish
On Thursday 08 Apr 2010 02:52:38 Open Source wrote: > Thanks Shawn/Rob! I'll give a try now. one more thing, anyway to convert > these parsed output to html format directly with the help another module? > You can try using XSLT: http://search.cpan.org/dist/XML-LibXSLT/ I should note that given

Decimal representation of binary file (unpack)

2010-04-07 Thread Raymond Wan
Hi all, I would like to read in a binary file and extract the 4-byte ints from it. Under Linux, something like "od -t uI". I got it working as follows: my $buffer = ; my @buffer = split //, $buffer; for (my $i = 0; $i < length ($buffer); $i += 4) { print unpack ('I', $buffer[$i].$buffer[

How to check modules ... ???

2010-04-07 Thread newbie01 perl
Hi all, Running perl -V gives output below which is the path to the modules that the default perl have access to. Is there any way to display the installed modules that are available to use so that at least it will not be too late to find out? The main objective is being able to know what modules

Date calculation help/suggestion please ... when there is no Date or Time module available

2010-04-07 Thread newbie01 perl
Hi all, I have a Perl script on Windows that does date calculation and using Date::Calc, Decode_Month and Delta_YMDHMS functions Am using the script to calculate the difference between two dates, for example, for the two (2) dates below: 01/Jan/2010 04:01:27 01/Jan/2010 02:06:30 The script is wo

Re: Using References in Modules within threads

2010-04-07 Thread Steve Bertrand
On 2010.04.07 19:19, Rene Schickbauer wrote: > Shawn H Corey wrote: >> Rene Schickbauer wrote: >>> Shawn H Corey wrote: >>> Personally, I don't see why anyone would want to run Windows. It's like trying to run a marathon while dragging a bus. >>> >>> For me, its mainly because it pays th

Re: AW: about the various styles of `open'

2010-04-07 Thread Brandon McCaig
On Tue, Apr 6, 2010 at 12:52 PM, Brandon McCaig wrote: > The single quotes are necessary to prevent the '~' and '|' characters > from being interpreted by the shell. Essentially, you can never trust > the user when writing programs and always have to assume there will be > malicious users trying t

Re: XML Parsing/Modules

2010-04-07 Thread Open Source
Thanks Shawn/Rob! I'll give a try now. one more thing, anyway to convert these parsed output to html format directly with the help another module? > - Original Message - > From: Shawn H Corey > Sent: 04/08/10 04:00 AM > To: Robert Wohlfarth > Subject: Re: XML Parsing/Modules > Robert Woh

Re: Getting a subroutine reference from an object instance

2010-04-07 Thread Steve Bertrand
On 2010.04.07 16:39, Shlomi Fish wrote: > On Wednesday 07 Apr 2010 19:23:25 Eric Veith1 wrote: >> Hello Perlers, >> >> this is probably going to be quick one. I know how to get an subroutine >> reference under "normal" circumstances, but I don't know how to get one >> from an object instance. Like:

Fifo Queue Job Scheduler

2010-04-07 Thread Joseph L. Casale
I have been pointed to a ksh script called qjob that implements a fifo queue. As none of our servers use or have ksh, this presents a bit of a problem as it also leverages a ksh implementation of a counting semaphore which would take ages to rewrite. I figure this is a job for Perl, but before I e

Re: Using References in Modules within threads

2010-04-07 Thread Rene Schickbauer
Shawn H Corey wrote: Rene Schickbauer wrote: Shawn H Corey wrote: Personally, I don't see why anyone would want to run Windows. It's like trying to run a marathon while dragging a bus. For me, its mainly because it pays the rent. I did say, "want to" not "have to" :) Well, working on w

Re: XML Parsing/Modules

2010-04-07 Thread Shawn H Corey
Robert Wohlfarth wrote: On Wed, Apr 7, 2010 at 2:39 PM, Open Source wrote: I'm new to perl and I need to parse an file which contains both structured and unstructured XML messages. Can someone help me to understand how to parse XML files/data into either simple readable or html format? I'm not

Re: about beginner perl site and developing skill

2010-04-07 Thread Harry Putnam
Rene Schickbauer writes: > Would you be interested in helping out in the Maplat Web Framework? It may take me a while even to figure out what it is. The tiny little synopsis at: http://kobesearch.cpan.org/htdocs/Maplat/Maplat.html seems less than helpful other than pointing to other modules.

Re: XS linker

2010-04-07 Thread Paul Johnson
On Wed, Apr 07, 2010 at 05:06:17PM -0400, Uri Guttman wrote: > i haven't seen the faq in ages so i don't know > if it needs editing. I can help you there: http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=perl+beginners+list+faq -- Paul Johnson - p...@pjcj.ne

Re: AW: about the various styles of `open'

2010-04-07 Thread Harry Putnam
Philip Potter writes: [...] > No, generally you should always use 3 arg open. Perl Best Practices > item #128 discusses this issue if you can beg borrow or steal a copy. > [...] Harry wrote: >> I can't really visualize what would happen there... wouldn't the open >> just fail?  Further do we n

Re: XS linker

2010-04-07 Thread Uri Guttman
> "PJ" == Paul Johnson writes: PJ> Casey and/or Ask (I think) used to post the FAQ here regularly. I PJ> presume it was automated. I don't think it would require major work to PJ> bring it up to date. Provided that you didn't want to make major PJ> changes to it. i can easily auto

Re: XS linker

2010-04-07 Thread Paul Johnson
On Wed, Apr 07, 2010 at 03:57:15PM -0400, Uri Guttman wrote: > > "PJ" == Paul Johnson writes: > > PJ> On Wed, Apr 07, 2010 at 01:56:38PM -0400, Uri Guttman wrote: > >> XS is anything BUT a beginner question. > > PJ> I don't know about that. > > PJ> Obviously fewer perl beginners now

Re: XML Parsing/Modules

2010-04-07 Thread Robert Wohlfarth
On Wed, Apr 7, 2010 at 2:39 PM, Open Source wrote: > I'm new to perl and I need to parse an file which contains both structured > and unstructured XML messages. Can someone help me to understand how to > parse XML files/data into either simple readable or html format? I'm not > sure how to procee

Re: Getting a subroutine reference from an object instance

2010-04-07 Thread Shlomi Fish
On Wednesday 07 Apr 2010 19:23:25 Eric Veith1 wrote: > Hello Perlers, > > this is probably going to be quick one. I know how to get an subroutine > reference under "normal" circumstances, but I don't know how to get one > from an object instance. Like: > > ---%<--- > my $foo = My::Foo->new("bleh"

Re: XS linker

2010-04-07 Thread Uri Guttman
> "PJ" == Paul Johnson writes: PJ> On Wed, Apr 07, 2010 at 01:56:38PM -0400, Uri Guttman wrote: >> XS is anything BUT a beginner question. PJ> I don't know about that. PJ> Obviously fewer perl beginners nowadays are familiar with C than used to PJ> be the case, but this list has t

XML Parsing/Modules

2010-04-07 Thread Open Source
I'm new to perl and I need to parse an file which contains both structured and unstructured XML messages. Can someone help me to understand how to parse XML files/data into either simple readable or html format? I'm not sure how to proceed like which module I've have to use etc. any pointers wou

Re: XS linker

2010-04-07 Thread Paul Johnson
On Wed, Apr 07, 2010 at 01:56:38PM -0400, Uri Guttman wrote: > XS is anything BUT a beginner question. I don't know about that. Obviously fewer perl beginners nowadays are familiar with C than used to be the case, but this list has traditionally been welcoming of questions that might be consider

Re: XS linker

2010-04-07 Thread Uri Guttman
> "PD" == Patrick Dupre writes: PD> I know, but I am still unable to subscribe to perl-xs PD> I submitted the issu to the computer service but it is not solved PD> yet ! create a free account on gmail or elsewhere and use that for the xs list. uri -- Uri Guttman -- u...@stems

Re: puzzle

2010-04-07 Thread Paul Johnson
On Mon, Apr 05, 2010 at 08:55:39AM -0700, ubuntu wrote: > Hi > > I am new in perl script. Does anyone know how to implement this puzzle > in perl? > > [ 0 ]= 0 > [ 1 ]= 1 > [ 0, 1 ] = 1 > [ 1, 1 ] = 2 > [

Re: XS linker

2010-04-07 Thread Patrick Dupre
Sorry, I know, but I am still unable to subscribe to perl-xs I submitted the issu to the computer service but it is not solved yet ! Sorry for the inconvenient ! XS is anything BUT a beginner question. there is an xs mailing list you can post to or use some other forum like usenet or perlmon

Re: XS linker

2010-04-07 Thread Uri Guttman
XS is anything BUT a beginner question. there is an xs mailing list you can post to or use some other forum like usenet or perlmonks. thanx, uri -- Uri Guttman -- u...@stemsystems.com http://www.sysarch.com -- - Perl Code Review , Architecture, Development, Training, Supp

XS linker

2010-04-07 Thread Patrick Dupre
Hello, I created a library .so by using XS. I need to dynamically link this library to another library (size 12822538). How can I do ? I get an error message: Can't load '/home/pdupre/perl_lib/x86_64-linux-thread-multi/auto/Fitter_XAS/Fitter_XAS.so' for module Fitter_XAS: /home/pdupre/perl_lib

Getting a subroutine reference from an object instance

2010-04-07 Thread Eric Veith1
Hello Perlers, this is probably going to be quick one. I know how to get an subroutine reference under "normal" circumstances, but I don't know how to get one from an object instance. Like: ---%<--- my $foo = My::Foo->new("bleh"); # Calling the sub: $foo->quux; # How would I get the reference

RE: Using References in Modules within threads

2010-04-07 Thread Bob McConnell
From: Shawn H Corey >Shlomi Fish wrote: >> Nevertheless, if you are going to run Perl on UNIX systems exclusively, you >> shouldn't use threads. And if you're planning to do such multi-tasking on >> Windows using Perl - please reconsider. > > Personally, I don't see why anyone would want to run

Re: Using References in Modules within threads

2010-04-07 Thread Shawn H Corey
Rene Schickbauer wrote: Shawn H Corey wrote: Personally, I don't see why anyone would want to run Windows. It's like trying to run a marathon while dragging a bus. For me, its mainly because it pays the rent. I did say, "want to" not "have to" :) -- Just my 0.0002 million dollars wo

Re: Using References in Modules within threads

2010-04-07 Thread Rene Schickbauer
Shawn H Corey wrote: Personally, I don't see why anyone would want to run Windows. It's like trying to run a marathon while dragging a bus. For me, its mainly because it pays the rent. You know, girls sell their body, boys sell their soul. Or something like that. LG Rene -- To unsubscrib

Re: Using References in Modules within threads

2010-04-07 Thread Shawn H Corey
Shlomi Fish wrote: Nevertheless, if you are going to run Perl on UNIX systems exclusively, you shouldn't use threads. And if you're planning to do such multi-tasking on Windows using Perl - please reconsider. Personally, I don't see why anyone would want to run Windows. It's like trying to r

Re: Using References in Modules within threads

2010-04-07 Thread Shlomi Fish
Hi Shawn, On Wednesday 07 Apr 2010 16:05:24 Shawn H Corey wrote: > Shlomi Fish wrote: > > I would really recommend against using threads: > > > > * http://perldoc.perl.org/perlthrtut.html > > > > * http://www.perlmonks.org/index.pl?node_id=288022 > > > > They don't work as expected in Perl (tho

Re: Using References in Modules within threads

2010-04-07 Thread Shawn H Corey
Shlomi Fish wrote: I would really recommend against using threads: * http://perldoc.perl.org/perlthrtut.html * http://www.perlmonks.org/index.pl?node_id=288022 They don't work as expected in Perl (though in C/C++, .NET and/or Java, they may be an option[Thr]), and cause too many problems. If

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread Rob Coops
On Wed, Apr 7, 2010 at 2:50 PM, newbie01 perl wrote: > Thanks Shlomi, > > Will test your suggestion as soon as I get to the office in let's say > 9 hours time ... it is 0050 now and got one more script to finish ... g > > BTW, like the fish on your site ... :-) > > On Thu, Apr 8, 2010 at

AW: Converting 12 hour time format to 24 hour format ... a bit urgent

2010-04-07 Thread Thomas Bätzler
newbie01 perl asked: > Unfortunately, I suddenly have to to deal with an input file where the > datetime format is 02-Apr-2010 3:41:23 p.m., i.e. DD-MON- HH:MI:SS > a.m./p.m., so now my Delta_YMDHMS does not work as expected. You can convert from a.m./p.m. to standard 24 hours using a simple

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread newbie01 perl
Thanks Shlomi, Will test your suggestion as soon as I get to the office in let's say 9 hours time ... it is 0050 now and got one more script to finish ... g BTW, like the fish on your site ... :-) On Thu, Apr 8, 2010 at 12:38 AM, Shlomi Fish wrote: > On Wednesday 07 Apr 2010 15:17:15

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread Shlomi Fish
On Wednesday 07 Apr 2010 15:17:15 newbie01 perl wrote: > Hi Rob and all, > > Thanks for all your response. They are all very helpful. Unfortunately, am > not in the office at the moment. > > I agree with your suggestion about hacking one of the OEM Perl script but > that will be my last option in

Re: Perl: Subroutines and use of the "GD::Graph::bars;" Module

2010-04-07 Thread alekto
Hi, Thanks for helping! The ting is that my age file only contain age values like this: 22 22 23 24 26 26 26 26 28 28 30 30, and I have no input for a second array! I want these age values to be the bars(x-values), and a want the number of times each of these are represented, to be the y-values.

Re: Using References in Modules within threads

2010-04-07 Thread Shlomi Fish
Hi, On Wednesday 07 Apr 2010 14:59:08 Frenzel, Joerg (ext) wrote: > Hello, > > I need help by using threads in combination with external packages > (modules). I would really recommend against using threads: * http://perldoc.perl.org/perlthrtut.html * http://www.perlmonks.org/index.pl?node_id=2

Re: Any Oracle DBA Around ???? - Perl DBI of Oracle Enterprise Manager (OEM) Install

2010-04-07 Thread newbie01 perl
Hi Rob and all, Thanks for all your response. They are all very helpful. Unfortunately, am not in the office at the moment. I agree with your suggestion about hacking one of the OEM Perl script but that will be my last option in case I really want to use OEM's Perl install. Let me re-phrase my

Converting 12 hour time format to 24 hour format ... a bit urgent

2010-04-07 Thread newbie01 perl
Hi all, I have a Perl script that uses Date::Calc to calculate difference between two datetime variables using Decode_Month and Delta_YMDHMS. ( $yy, $mm, $dd, $hh, $mi, $ss ) = Delta_YMDHMS( $logical_yy, $logical_mm, $logical_dd, $logical_hh, $

Using References in Modules within threads

2010-04-07 Thread Frenzel, Joerg (ext)
Hello, I need help by using threads in combination with external packages (modules). At main script threads were created and within these threads an database-handler was defined. My Intention is to use this database-handler within a method of the external module. The paramlist of my method c

Re: about beginner perl site and developing skill

2010-04-07 Thread Rene Schickbauer
Hi! So, I'm wondering where one might find a place to use whatever small amount of programming they have and be expected to learn enough to be a real asset over the course of a yr or two. A place where one would be expected to produce programs regularly. This doesn't actually have to be a p

Re: puzzle

2010-04-07 Thread Rafal Czlonka
Shlomi Fish wrote: > > [ 0 ]= 0 > > [ 1 ]= 1 > > [ 0, 1 ] = 1 > > [ 1, 1 ] = 2 > > [ 1, [ 1, 2 ] ] = -2 > > [ 1, 2, [ 8 ] ] = -5 > > [ 1, [ 2 ], [ 3 ] ] = -4 > > [ 9, [ 3,

Re: puzzle

2010-04-07 Thread Dr.Ruud
Harinatha Reddy M wrote: For example: [ 9, [ 3, 4, [ [ 2 ] ] ] ] = 0 In this case we need to fnid the sum of 9, [3,4, [[2]]] So if we look at it in the equation format 9+ (-(3+4+ -(-(2 i.e 9+ (-(3+4+2)) = 9+ (-(9)) = 9-9 = 0 echo "[ 1, [ 2 ], [ 3 ] ]" | perl -ne' chomp; print;

Re: AW: Working with files of different character encodings

2010-04-07 Thread Uri Guttman
> "R" == Ruud writes: R> Thomas Bätzler wrote: >> my $data = do { >> local $/ = undef; >> <$fh>; >> }; R> Especially for big files, that is better written as: define big. most files are still text or similar and not big by today's ram sizes. slurping in a megabyte is nothing to

Re: AW: Working with files of different character encodings

2010-04-07 Thread Dr.Ruud
Thomas Bätzler wrote: my $data = do { local $/ = undef; <$fh>; }; Especially for big files, that is better written as: my $data; { local $/; $data = <$fh>; } -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http

Re: Perl: Subroutines and use of the "GD::Graph::bars;" Module

2010-04-07 Thread alekto
Hi guys! Tnx for answering! Of course it was the /misplacing of the \ that caused my error;) But after changing this error I still get an other error msg like this: Invalid data set: 1 at ./bars.pl line 90, line 1. which is referring to this line in my script: my $gd = $graph->plot(\...@array)