Query Online File Size

2009-11-26 Thread raphael()
Hi, I am writing a small script to download files of the web. How can I get the file size without downloading the file? use LWP::Simple; my $file = http://www.abc.com/file.mp3; my @array = head($file); print $array[1]\n; head() doesn't always returns all values? why?? Sometime there are all

Re: Query Online File Size

2009-11-26 Thread Giany
use LWP::UserAgent; sub GetFileSize{ my $url=shift; $ua = new LWP::UserAgent; $ua-agent(Mozilla/5.0); my $req = new HTTP::Request 'HEAD' = $url; $req-header('Accept' = 'text/html'); $res = $ua-request($req); if ($res-is_success) {

Assignment Operator

2009-11-26 Thread Marco Pacini
Hi All, I'm studying Perl since one week on Learning Perl written by L. Wall and in the paragraph Assignment Operators i don't understand why this: ($temp = $global) += $constant; is equivalent of: $tmp = $global + $constant; Instead, before i read it, i thought it was

Re: Assignment Operator

2009-11-26 Thread Philip Potter
2009/11/26 Marco Pacini i...@marcopacini.org: Hi All, I'm studying Perl since one week on Learning Perl written by L. Wall and in the paragraph Assignment Operators i don't understand why this:        ($temp = $global) += $constant; is equivalent of:        $tmp = $global + $constant;

udp server

2009-11-26 Thread cerr
Hi There, I need a server that's listening on UDP port 5000. I have successfully gotten a TCP client to listen on port 5000: [perl] #!/usr/bin/perl -w # serverfork.pl - a server that forks a child # process to handle client connections use strict; use IO::Socket; use Sys::Hostname; use POSIX

Perl - Read and Write Multi-Language text (Scandanavian,German)

2009-11-26 Thread CM
Deal all, INFO uname -a = Linux perlsrv 2.4.27 #1 Tue Sep 23 15:34:56 CEST 2008 i686 GNU/Linux INFO perl -v = This is perl, v5.8.4 built for i386-linux-thread- multi I am seeking advice on how to generate multi-language output in Perl. The task here is to generate a single page of HTML, PDF

Re: Perl - Read and Write Multi-Language text (Scandanavian,German)

2009-11-26 Thread Shlomi Fish
On Wednesday 25 Nov 2009 15:15:19 CM wrote: Deal all, INFO uname -a = Linux perlsrv 2.4.27 #1 Tue Sep 23 15:34:56 CEST 2008 i686 GNU/Linux INFO perl -v = This is perl, v5.8.4 built for i386-linux-thread- multi 1. Linux Kernel 2.4.27 is incredibly old:

Re: loading GD module on Solaris

2009-11-26 Thread Paul Johnson
On Thu, Nov 26, 2009 at 12:15:06AM +0100, Paul Johnson wrote: On Wed, Nov 25, 2009 at 03:41:27PM -0600, Aimee Cardenas wrote: Hi, All, I keep running into problems trying to load the GD perl module (http://search.cpan.org/~lds/GD-2.44/) onto a Solaris system (spac Sun Blade 2500).

Re: Perl - Read and Write Multi-Language text (Scandanavian,German)

2009-11-26 Thread Shlomi Fish
Hi Chandramohan! I'm CCing this list on this private reply. Next time please hit reply all or make it the default using the Google Labs interface. On Thursday 26 Nov 2009 16:29:36 Chandramohan Neelakantan wrote: Hi Schlomi, It's Shlomi (English spelling) - not Schlomi (German Spelling).

Re: Assignment Operator

2009-11-26 Thread Uri Guttman
MP == Marco Pacini i...@marcopacini.org writes: MP I'm studying Perl since one week on Learning Perl written by MP L. Wall and in the paragraph Assignment Operators i don't MP understand why this: it was written by randal schwartz. larry wall co-wrote programming perl. MP ($temp =

Separating DB operations out of program code

2009-11-26 Thread Steve Bertrand
Hi everyone, I'm looking to separate all of my MySQL logic (queries etc) out of my projects methods and into it's own class. Primarily, this is to provide me with the ability to change how the back-end is interacted with, without having to go through each module and make the changes there. For

Re: Separating DB operations out of program code

2009-11-26 Thread Scott Pham
Have you looked at DBIx::Class? Steve Bertrand wrote: Hi everyone, I'm looking to separate all of my MySQL logic (queries etc) out of my projects methods and into it's own class. Primarily, this is to provide me with the ability to change how the back-end is interacted with, without having to

Re: Separating DB operations out of program code

2009-11-26 Thread Dermot
2009/11/26 Scott Pham scott.p...@gmail.com: Have you looked at DBIx::Class? I'd 2nd that. DBIx is the way forward. You should be looking to stop writing SQL statements and moving towards ORM. Try the example at http://search.cpan.org/~frew/DBIx-Class-0.08114/lib/DBIx/Class/Manual/Example.pod

calc time elapsed in days

2009-11-26 Thread raphael()
Hi, I have to code a script to calc time elapsed in days as to calc the rent to be charged. The person would write an object number and date in a text file like db.txt OBJECT_NUM, DATE_GIVEN 2525,25.11.2008 2526,01.01.2009 2527,26.11.2009 Now when he enter OBJECT_NUM I have to tell him the