Re: HTTP Tiny Range Header

2012-05-28 Thread raphael()
On Mon, May 28, 2012 at 8:37 PM, Rob Dixon wrote: > On 28/05/2012 15:15, raphael() wrote: > > > > I am trying to use HTTP::Tiny module to download file with RANGE > attribute. > > However I cannot accomplish it. > > > > In WWW::Mechanize the code I use is simp

HTTP Tiny Range Header

2012-05-28 Thread raphael()
Hello, I am trying to use HTTP::Tiny module to download file with RANGE attribute. However I cannot accomplish it. In WWW::Mechanize the code I use is simple my $file_obj = $ua->get( $url, 'Range' => sprintf("bytes=%s-%s", $file_size, $content_length - 1), ) or die; But I want to use the Tiny Mo

Re: qmv (renameutils) for cygwin using perl

2011-01-22 Thread raphael()
On Sat, Jan 22, 2011 at 2:56 PM, Shlomi Fish wrote: > Hi Raphael, > > On Saturday 22 Jan 2011 11:03:28 raphael() wrote: > > Hello, > > > > qmv.exe (from renameutils) lets you edit multiple filenames in a text > > editor. > > I cannot get it to work in cygwi

qmv (renameutils) for cygwin using perl

2011-01-22 Thread raphael()
Hello, qmv.exe (from renameutils) lets you edit multiple filenames in a text editor. I cannot get it to work in cygwin 1.7x (gives fork + jump error ??). So I tried to write it in Perl. qmv's format is simple filename-1filename_1_to_be_edited filename 2filename_2_to_be_e

Re: fork, parallel and global values

2010-05-15 Thread raphael()
On Fri, May 14, 2010 at 3:07 PM, Dr.Ruud > wrote: > raphael() wrote: > > I want to do work on all elements of an array simultaneously. >> > > What kind of data/reality does your array represent? > > > > I tried Parallel::ForkManager. It works well when you

Re: fork, parallel and global values

2010-05-13 Thread raphael()
On Tue, May 11, 2010 at 1:23 AM, C.DeRykus wrote: > On May 10, 7:07 am, raphael.j...@gmail.com ("raphael()") wrote: > > Hello, > > > > -- CODE -- > > > > #!/usr/bin/env perl > > > > use strict; > > use warnings; &

Re: fork, parallel and global values

2010-05-10 Thread raphael()
On Tue, May 11, 2010 at 1:59 AM, Eric Veith1 wrote: > "raphael()" wrote on 05/10/2010 04:07:58 PM: > > I want to do work on all elements of an array simultaneously. > > To clarify: You want to access an hash defined in the parent process from > all N child processe

fork, parallel and global values

2010-05-10 Thread raphael()
Hello, -- CODE -- #!/usr/bin/env perl use strict; use warnings; use Parallel::ForkManager; # Parallel::ForkManager my $pfm = Parallel::ForkManager->new(5); my %hash; for my $num ( qw/ 1 2 3 4 5 1 / ) { $pfm->start and next; $hash{$num}++; $pfm->finish; } $pfm->wait_

Re: how to create a hash on the fly

2010-04-15 Thread raphael()
On Fri, Apr 16, 2010 at 7:47 AM, Steve Bertrand wrote: > On 2010.04.15 03:37, raphael() wrote: > > On Thu, Apr 15, 2010 at 10:55 AM, Uri Guttman > wrote: > > > >>>>>>> "r" == raphael() writes: > >> > >> r> # abc &l

Re: how to create a hash on the fly

2010-04-15 Thread raphael()
On Thu, Apr 15, 2010 at 10:55 AM, Uri Guttman wrote: > >>>>> "r" == raphael() writes: > > r> # abc <-- this_should_be_hash_name > > r> {space} "random_name_or_number" "date" "other_things_1" &g

how to create a hash on the fly

2010-04-14 Thread raphael()
Hello People, I am stuck on a minor problem. How can I create a hash? Data is as follow -- DATA -- # abc <-- this_should_be_hash_name {space} "random_name_or_number" "date" "other_things_1" "other_things_2" {space} "random_name_or_number" "date" "other_things_1" "other_

Re: Save to memory temporarily

2010-03-22 Thread raphael()
any one here?

Re: Save to memory temporarily

2010-03-22 Thread raphael()
On Thu, Mar 18, 2010 at 7:30 PM, Peter Scott wrote: > On Wed, 17 Mar 2010 20:19:01 +0530, raphael() wrote: > > > Hello, > > > > Is there a way to save/store downloaded data (using WWW::Mechanize) in > > memory (temporarily) > > rather than writing it to disk

Re: Save to memory temporarily

2010-03-20 Thread raphael()
On Thu, Mar 18, 2010 at 11:17 PM, Linux Expert wrote: > > > > > > Not easily. WWW::Mechanize is a LWP::UserAgent; look at the > > documentation for that module and see the :content_cb hook. Write a > > handler to concatenate data in memory until you reach 10MB and then flush > > to disk, writing

Re: Save to memory temporarily

2010-03-17 Thread raphael()
On Wed, Mar 17, 2010 at 10:09 PM, Shlomi Fish wrote: > Hi raphael()! > > I'll comment on your code below. > > On Wednesday 17 Mar 2010 18:23:29 raphael() wrote: > > On Wed, Mar 17, 2010 at 9:05 PM, Shlomi Fish > wrote: > > > On Wednesday 17 Mar 2010 1

Re: Save to memory temporarily

2010-03-17 Thread raphael()
On Wed, Mar 17, 2010 at 9:05 PM, Shlomi Fish wrote: > On Wednesday 17 Mar 2010 16:49:01 raphael() wrote: > > Hello, > > > > Is there a way to save/store downloaded data (using WWW::Mechanize) in > > memory (temporarily) > > rather than writing it to disk. Like st

Save to memory temporarily

2010-03-17 Thread raphael()
Hello, Is there a way to save/store downloaded data (using WWW::Mechanize) in memory (temporarily) rather than writing it to disk. Like store 10MB in memory and then flush it to the hard disk when data reaches 10MB. Its just a curiosity since utorrent and jdownloader (Java) do this (though I cann

Re: New on http://perl-begin.org/ - more topical pages and pages for Perl uses

2010-03-17 Thread raphael()
On Tue, Mar 16, 2010 at 6:49 PM, Shlomi Fish wrote: > Hi all! > > There are new additions to http://perl-begin.org/ , the site for Perl > Beginners. Here is a summary of them: > > <<< > > ==16-March-2010: Topical and Uses Pages== > > We added a [http://perl-begin.org/uses/email/ a page about usin

Re: ':content_cb' give what to subroutine?

2010-03-13 Thread raphael()
On Sat, Mar 13, 2010 at 12:31 AM, Uri Guttman wrote: > >>>>> "r" == raphael() writes: > > r> Hi, > r> -- CODE -- > > r> use strict; > r> use warnings; > r> use WWW::Mechanize; > r> use File::Basename; >

':content_cb' give what to subroutine?

2010-03-12 Thread raphael()
Hi, -- CODE -- use strict; use warnings; use WWW::Mechanize; use File::Basename; use Number::Bytes::Human qw(format_bytes); # CODE GOES ON HERE TILL open( my $file2write, '>', "$base" ); binmode $file2write; my $b; $wmc->get( "$link", ':content_cb' => sub { my ($c, $r) = @_;#

assign s/// value to a scalar

2010-03-11 Thread raphael()
#!/usr/bin/env perl use strict; use warnings; my @array = qw ( http://abc.com/files/randomthings/A/1.html http://abc.com/files/randomthings/A/2.html ); for ( @array ) { # This works # s!/A/\d+.html$!!; $url = $_; # Doesn't work ~ gives "1" ( my $url ) = ( $_ ) =~ s!/A/\d+.html$!!;

Re: mech->content match regex howto

2010-03-03 Thread raphael()
On Wed, Mar 3, 2010 at 4:17 AM, Dr.Ruud > wrote: > raphael() wrote: > > ( my $ip ) = $last_page =~ m/[\d.]+/g >> > > The \d matches 200+ codepoints, so if you want to match only 0-9, then use > [0-9.]. > > -- > Ruud > > > -- > To unsubscri

Re: regular expression - ?(foo.*)?

2010-03-02 Thread raphael()
On Tue, Mar 2, 2010 at 5:45 PM, Durairaj Muthusamy wrote: > Hi, > > I am a newbie and need your help. The following script doesn't > display the first print statement like the second one. > Why? > > @str = qw(NEW food foosball newstr foobasefoot); > > $\ = "\n"; > > foreach(@str) > { >pr

Re: mech->content match regex howto

2010-03-02 Thread raphael()
On Tue, Mar 2, 2010 at 1:46 PM, John W. Krahn wrote: > raphael() wrote: > >> >> Cool! I have to admit that is a "detailed" answer. >> Also thanks for clearing out the differences between these two.. >> >> ( my $ip = $last_page ) =~ m/([\d+\.

Re: mech->content match regex howto

2010-03-01 Thread raphael()
On Mon, Mar 1, 2010 at 11:27 PM, John W. Krahn wrote: > raphael() wrote: > >> Hi, >> > > Hello, > > > I am trying to understand WWW::Mechanize >> > > Did you also look at these pages: > > > http://search.cpan.org/~petdance/WWW-Mechanize-1.60

Re: mech->content match regex howto

2010-03-01 Thread raphael()
On Mon, Mar 1, 2010 at 6:06 PM, Shawn H Corey wrote: > raphael() wrote: > > Hi, > > > > I am trying to understand WWW::Mechanize > > > > I understand that the downloaded content is stored in content(). > > Why am I not able to use a regex o

Re: File::Find NO RECURSION Howto

2010-03-01 Thread raphael()
On Mon, Mar 1, 2010 at 6:18 PM, Shawn H Corey wrote: > raphael() wrote: > > Hi, > > > > How can I stop File::Find to go below current dir? i.e. no recursion. > > > > Although I can use glob or <*> to get file names in current dir. > > But I wanted to

File::Find NO RECURSION Howto

2010-03-01 Thread raphael()
Hi, How can I stop File::Find to go below current dir? i.e. no recursion. Although I can use glob or <*> to get file names in current dir. But I wanted to know if File::Find has a maxdepth limit like linux "find". The script I created uses a switch which decides if recursion is allowed or not. I

mech->content match regex howto

2010-03-01 Thread raphael()
Hi, I am trying to understand WWW::Mechanize I understand that the downloaded content is stored in content(). Why am I not able to use a regex on it in scalar form? --code-- use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get("http://checkip.dyndn

array of anonymous hash?

2010-02-25 Thread raphael()
My BAD :( THERE IS NO FIRST ELEMENT IN A HASH!! PLEASE FORGIVE ME. I AM IN A THICK OF EVERYTHING TODAY. LET ME REPHRASE -- HOW DO I LOOP OVER THE ANONYMOUS HASH WHICH IS INSIDE AN ARRAY? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@

array of anonymous hash?

2010-02-25 Thread raphael()
use strict; use warnings; use Data::Dumper; my @links = ({ name1 => 'http://www.abc.com/data/a/000/name1.txt', name2 => 'http://www.abc.com/data/a/000/name2.txt', }); for my $element ( @links ) { for my $name ( sort keys %$element ) { print "$name --> ${$element}{name1}\n";

Re: die unless match is successful

2009-11-29 Thread raphael()
On Sun, Nov 29, 2009 at 3:58 PM, John W. Krahn wrote: > raphael() wrote: > >> Hi, >> > > Hello, > > > I want the below if loop to end if it cannot find any match & print the >> die >> message. >> However it just exit without hitting my &q

die unless match is successful

2009-11-29 Thread raphael()
Hi, I want the below if loop to end if it cannot find any match & print the die message. However it just exit without hitting my "die" As you can see in the code below I have tried many foolish ways to make the script say that it cannot find the number searched in while loop. while ( my $lin

PRINT LAST ENTRY IN A FILE

2009-11-28 Thread raphael()
Hi, I want to print the last entry by record "" in this file "records.txt" The file is read in a subroutine and prints last line by the number in this example. # records.txt 25.11.2009 NAME_0 15.12.2006 NAME_3 20.10.2007 NAME_1 01.01.2008 NAME_3<-- This whole line sho

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 nu

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 a

Learning Perl Student Workbook

2009-10-31 Thread raphael()
Hi, I just finished reading 'Learning Perl' & I was wondering if someone could point me to the book "Perl Study Guide", also called "Learning Perl Student Workbook". It's a companion book to "Learning Perl" but is not available in my country. I was hoping if someone could give me a link to a

match pattern

2009-09-18 Thread raphael()
Hi How do I pick out matching words if there are more than one on the same line? Example INFILE.TXT www.site01.com www.site02.com www.site03.com www.site04.com -- while (<>) { if ( m!(www.\S+.com)!s ) { # print "$1\n"; # print "$&\n"; print; }; } -- I wan

better way to write this

2009-06-10 Thread raphael()
Hi, It is actually very enlightening to read all the post on this list. Most of the stuff actually goes over my head as I have no need/knowledge of CGI or dbase. Just some text processing. I am new to Programming/Perl (chapter 5 "Learning Perl"). I also read a little about 'system() & exec().

imlib2: draw special-chars

2007-05-02 Thread Raphael
. but if the text is 10°/17° (10 degree / 17 degree) then the text is only 10 and after it's finish... what can I do to draw the degree-sign... I don't like to draw a circle the graphic way... Google don't show me a solution... Thanks a lot for any help. have nice evening... Ra

How to "source" another perl-file into one

2007-04-08 Thread Raphael
and help. Greetings Raphael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Problems with installing WWW::Mechanize::Shell

2006-12-24 Thread Raphael Brunner
p and ideas... Greetings Raphael what I input: #> perl -MCPAN -e 'install WWW::Mechanize::Shell' the output: CPAN: File::HomeDir loaded ok CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Mon, 04 Dec 2006 01:25:25 GMT Running install for mod

Problems with installing WWW::Mechanize::Shell

2006-12-05 Thread Raphael Brunner
Dear Users... I want to install WWW::Mechanize::Shell on a debian-testing linux-box. But, I have errors during the process and don't know how to solve it btw. what the problem is... Thanks for any help and ideas... Greetings Raphael #> perl -MCPAN -e 'install WWW::Mechanize::

Re: use strict and local variables

2006-10-16 Thread Raphael Brunner
nside my parent-routine (in the example: the programm, but by me: the parent-sub)). Thanks for all, Raphael eg: use strict; my $var = 20; print "before: $var\n"; &routine; print "after: $var\n"; exit; sub routine { $var += 1; > >} On Mon, Oct 16, 2006 at 07

use strict and local variables

2006-10-16 Thread Raphael Brunner
all ideas and help. Greetings Raphael eg: use strict; my $var = 20; print "$var\n"; &routine; exit; sub routine { print "$var\n"; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

HTML to Image Module?

2006-10-06 Thread Raphael Brunner
Dear Users does anyone know a perl-Module which can make a image (png/jpg/...) from a website? Thanks a lot for all ideas... Greetings, Raphael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.

Re: Imlib2 Module install failure problem

2006-10-05 Thread Raphael Brunner
Thanks for your tip, but how can i reinstall this module? in the perl-shell show the command "help" only install etc, but nothing to reinstall. And if I choose install, then it says: it is always on the newest version... Sorry this question. :-( Thanks a lot! Raphael On Wed, Oct 04,

Imlib2 Module install failure problem

2006-10-03 Thread Raphael Brunner
LBROCARD/Image-Imlib2-1.12.tar.gz: make NO - Does anyone have any idea, what the problem could be? And how to solve this? Thanks a lot for all help and ideas... Greetings Raphael -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL