Re: Bad display of accents in Subject

2017-03-23 Thread Gérard ROBIN
On Wed, Mar 22, 2017 at 08:34:32AM -0700, $Bill wrote: > Date: Wed, 22 Mar 2017 08:34:32 -0700 > From: $Bill > To: Gérard ROBIN > Subject: Re: Bad display of accents in Subject > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 > Thunderbird/45.8.

Bad display of accents in Subject

2017-03-18 Thread Gérard ROBIN
Hello, when I run this script: (it's an excerpt) --begin test1.pl- #!/usr/bin/perl use strict; # use warnings; use Getopt::Std; use Net::POP3; use Term::ANSIColor qw(:constants); binmode(STDOUT, ":utf8"); my %params = (); getopts('s:l:

Re: need to include and install CPAN modules as part of application stack

2011-02-01 Thread Robin Kenyon
On Tue, 01 Feb 2011 18:36 -0500, "Uri Guttman" wrote: > >>>>> "RK" == Robin Kenyon writes: > > RK> As a teacher, I'd disagree...My experience leads me to believe > bluntly > RK> shooting down beginners discourages them. I woul

Re: need to include and install CPAN modules as part of application stack

2011-02-01 Thread Robin Kenyon
On Tue, 01 Feb 2011 18:00 -0500, "Uri Guttman" wrote: > >>>>> "RK" == Robin Kenyon writes: > > RK> With all due respect Uri, you're not being particularly friendly. > RK> This is a list for beginners, people are going to say thin

Re: need to include and install CPAN modules as part of application stack

2011-02-01 Thread Robin Kenyon
n.perl.org/faq/beginners.html#2.6 is there anything i should keep in mind while answering Robin On 28 Jan 2011, at 05:45, Uri Guttman wrote: "BL" == Ben Lavery writes: BL> Personally, I'd like to see a way of executing a perl BL> script/application in such a way that

Re: Dividing in Perl

2007-03-20 Thread Robin Sheat
#x27;1'. Other languages do the same, or similar things, e.g. LISP: [1]> (/ 4 3) 4/3 -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpfCt7sMJMNV.pgp Description: PGP signature

Re: create symlinks to thousands of files using perl

2007-01-03 Thread Robin Sheat
ould do it, if I read you right. (i.e. without the ./, it should create a link in the current dir with the same name as the file you pointed to) -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B1

how to stop RPC::XML::Server blocking

2006-11-13 Thread Robin Sheat
fy an upper limit, after which it blocks to stop it getting hammered with thread creation). Is there a nice way to do this without writing my own RPC::XML::Server replacement? Cheers, Robin. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Hi, how to extract five texts on each side of an URI? I post my own perl script and its use.

2006-11-11 Thread Robin Sheat
w to look at make them run faster. See perldoc Devel::DProf for more information. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpIhJEoay9Ke

Re: how to print "\n" in the output file

2006-11-05 Thread Robin Norwood
"Mihir Kamdar" <[EMAIL PROTECTED]> writes: > 1. (*) text/plain > > hi, > > I am a beginner in Perl. I am trying to automatically generate a perl test > case file which, on executing, would return HTTP response code and response > time,etc. In the output file that I am getting I want the

Re: reg expression again

2006-10-22 Thread Robin Sheat
On Monday 23 October 2006 12:37, chen li wrote: > my $file_name='OT-q1.001'; > > if ($file_name=~/(OT)*.(\d+$)/){ Maybe you mean: if ($file_name=~/^OT.*\.(\d+$)/){ -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui

Re: Database migration

2006-10-17 Thread Robin Norwood
updating the target db as you go. For large sets of data, option '1' can use up available memory, and option '2' can be very slow due to the number of 'round trips' to and from the databases. So a 'batching' solution might be a good idea. Of course, if t

Profiling threaded apps

2006-10-14 Thread Robin Sheat
ill I have to drop it into single thread mode to do that? -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgp1zxUgAcA1R.pgp Description: PGP signature

Re: Optimisation of loops

2006-10-12 Thread Robin Sheat
ons of the talk floating around somewhere. Hmm, when i started looking on the net, that was one of the first things that came up. Also this: http://www-128.ibm.com/developerworks/library/l-optperl.html They're helpful, but unfortunately not largely applicable. Although, I may need to read them c

Re: Optimisation of loops

2006-10-12 Thread Robin Sheat
t; *lot* less memory as it doesn't have to make a copy of the @$users array > like your version does. I don't follow. Where was my version copying @$users? -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpNIjONqJ4PL.pgp Description: PGP signature

Optimisation of loops

2006-10-12 Thread Robin Sheat
it'll be common to want both values, which is why I didn't do that. Anyone know any good resources for this kind of thing? -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB

Re: dbi ^C handling

2006-10-07 Thread Robin Sheat
that takes a long time (like 'create index' on a large table), then you pretty much have to wait until the database finishes up. Otherwise, I've not noted problems with hanging connections (not that I've used DB2). -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTEC

Re: Large DBI query filling up memory

2006-10-07 Thread Robin Sheat
at's really your problem. And do the same There is no 'after the execute' available :) > thing after you've set $dbh->{RowCacheSize} = 1 to disable row caching to > see if it makes the difference it should. When I print this, it comes back as undef, when I set it it

Re: Large DBI query filling up memory

2006-10-07 Thread Robin Sheat
paged. That also seems to be the point of the 'RowCacheSize' option. However, I may have to resort to this anyway. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpvGlqLv7uo4.pgp Description: PGP signature

Large DBI query filling up memory

2006-10-07 Thread Robin Sheat
put all the data into RAM, which causes issues. I've tried playing with $dbh->{RowCacheSize}, but it seems to be ignored. I'm using the MySQL driver. Is this expected behaviour, and what can I do about it? -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hos

Re: Non-technical question

2006-09-20 Thread Robin Sheat
On Thursday 21 September 2006 12:18, Ricardo SIGNES wrote: >   $;    - "dollar semicolon' In my head, I pronounce these ones as 'string-semicolon', but that's a throwback to when I was young, stupid, and coded in BASIC... -- Robin <[EMAIL PROTECTED]> Jab

Re: Downloading a file through a filehandle

2006-09-11 Thread Robin Sheat
On Tuesday 12 September 2006 10:27, Rob Dixon wrote: > I think so Robin, thanks. But I'm still not clear whether you really need > to retrieve the data through a filehandle; surely any suitable means of IPC > will do? Well yes, any IPC thing would do. However, I figured that han

Re: Downloading a file through a filehandle

2006-09-11 Thread Robin Sheat
so I'd really like to take advantage of all the LWP like stuff that's available, so that I don't have to write my own HTTP parser. In Java, using the commons-httpclient library, I would say: InputStream in = get.getResponseBodyAsStream(); I want some way of doing the equivalent in

Re: Downloading a file through a filehandle

2006-09-11 Thread Robin Sheat
ming from a file, naturally. But say I want to stream a 10Gb file into the restore method. Then I need a handle to pass, so that the restore method doesn't have to have the whole content in memory. Hopefully this explains what I'm after. -- Robin <[EMAIL PROTECTED]> JabberID: &

Downloading a file through a filehandle

2006-09-11 Thread Robin Sheat
loaded). I had a look through the LWP:: and WWW:: stuff, but couldn't find anything appropriate. Is there a way of doing this without resorting to direct socket access myself? Cheers, -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxeru

Re: subroutine in LWP - in order to get 700 forum threads

2006-08-26 Thread Robin Norwood
eParser->new(\$r->content) or die "Parse > error in $page: $!"; > # just printing what was collected > print Dumper get_thread($stream); > # would instead have database insert statement at this point >} else { &

Re: subroutine in LWP - in order to get 700 forum threads

2006-08-26 Thread Robin Norwood
merlyn@stonehenge.com (Randal L. Schwartz) writes: >>>>>> "Robin" == Robin Norwood <[EMAIL PROTECTED]> writes: > > Robin> But Google does use the data in indexes for personal gain...it derives > Robin> significant revenue from the advertising don

Re: subroutine in LWP - in order to get 700 forum threads

2006-08-26 Thread Robin Norwood
merlyn@stonehenge.com (Randal L. Schwartz) writes: >>>>>> "Robin" == Robin Norwood <[EMAIL PROTECTED]> writes: > >>> DO NOT ATTEMPT TO DO THIS > > Robin> Really? If I understood the OP correctly, all he wants to do is > 'screen &

Re: subroutine in LWP - in order to get 700 forum threads

2006-08-26 Thread Robin Norwood
ing calls to sleep inside some of those loops. After he gets the data, he could do something unethical with it - like republish it. But just getting the data doesn't seem wrong to me. As I said above, I am not a lawyer! The above should not be taken to mean I think it is legal to do this. But it

Re: replace multiple tokens

2006-08-25 Thread Robin Norwood
gt; af = a...x name=taga_0 #...d name=tagb_0 f...r name=tagc_0 xxnn > b4 = h...e name=taga_4 t...g name=tagb_4 k name=tagc_4 nn > af = h...e name=taga_1 t...g name=tagb_1 k name=tagc_1 nn > > Any help will be greatly appreciated. > jwm -- Robin Norwood Red Hat, Inc. "The

Re: line command in perl

2006-08-23 Thread Robin Norwood
e of a specific function such > as splice. Which line code am I supposed to issue? I > tried perldoc splice or perldoc perlfunc splice but it > didn't work. -- Robin Norwood Red Hat, Inc. "The Sage does nothing, yet nothing remains undone." -Lao Tzu, Te Tao Ching --

Re: Statistics::R not always working

2006-08-14 Thread Robin Sheat
OK, I figured it out. For anyone interested, the solution is to change: $R->send(qq`x <- c(1,2,3) \n shapiro.test (x)`); to $R->send(qq`x <- c(1,2,3) \n out <- shapiro.test (x) \n print (out)`); Which then gives you the result as it should. -- Robin <[EMAIL PROTECTED]&

Statistics::R not always working

2006-08-12 Thread Robin
th another test, eg. wilcox.test, the same thing happens. Does anyone know why this is and what I can do to fix it? It makes Statistics::R somewhat less useful if you can't use it to do statistics... -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni

Re: Writing to XML using XML::Writer

2006-08-09 Thread Robin Norwood
uot;)->children("guy")) > { > print " User: " . $element->child("user")->value . "\n"; > > print " Date of Birth: " . > $element->child("date-of-birth")->value . "\n"; > > p

Re: How to manage around 1000 entries which will constantly be changing

2006-04-01 Thread Robin Sheat
y sorted list. Basically, what you need to do is exploit the fact that your list is sorted, and you're adding something to it. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16

Re: How to split a string read from the file?

2006-03-30 Thread Gerard Robin
I am off topic regarding your question about split, but with a one-liner like this perl does the work for you: perl -pi~ -e 's/^\d+ *: *//' file.txt hth -- Gérard -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

how to save a value ?

2006-03-22 Thread Gerard Robin
Hello, this script does what is expected : #!/usr/bin/perl use warnings; # use strict; &matrix_read_file; print "@$_\n" foreach @MAT1; print "@$_\n" foreach @$matrix_name; sub matrix_read_file { while (my $line = ) { chomp $line; next if $line =~ /^\s*$/; if ($l

Re: Padded 3 digit numeric series

2006-03-12 Thread Robin Sheat
00'; $a++; print "$a\n"; This will print '001'. To have it go to 4 digits, well, that's as easy as you might expect: my $a = '999'; $a++; print "$a\n"; This will print '1000'. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PR

Re: file test

2006-01-24 Thread Gerard Robin
On Mon, Jan 23, 2006 at 09:47:40PM +0100, hien wrote: > i am trying to check if there are any files named file* (e.g. > file_001.txt file1.doc) in my directory. #!/usr/bin/perl use warnings; use strict; my $i = 0; while () { if (-e $_) { print "$_ exists\n"; $i++; } } print "there are $i f

Re: negative match

2006-01-20 Thread Gerard Robin
On Fri, Jan 20, 2006 at 04:22:28PM +0100, Adriano Allora wrote: From: Adriano Allora <[EMAIL PROTECTED]> I've got this four rows (for instance): arabaADJ arabo araboADJ arabo araboNOM arabo aranoVER:presarare and, with this regular expression, I would extr

dprofpp

2006-01-13 Thread Gerard Robin
Hello, I am runing an example (in Debbugging Perl of Martin Brown) there are two scripts which product the same output but one contains three subroutines and the other only one subroutine. The outputs: "3 subroutines" ~~ Total Elapsed Time = 0.199198 Seconds User+System Time = 0.02

Re: pack an array

2006-01-02 Thread Gerard Robin
On Mon, Jan 02, 2006 at 10:07:44AM -0800, Tom Phoenix wrote: my @pack; my $empties = 0; foreach my $item (@array) { if ($item eq '') {# empty string $empties++; } else { push @pack, $item; } } Thanks, very nice. It's difficult (for me ;-)) to think in P

pack an array

2006-01-02 Thread Gerard Robin
Hello, I guess that one can write in more perlish fashion that I did: the part between the of this script to pack the array @array. Please, can someone give me some hint ? #!/usr/bin/perl # pack_array.pl use strict; use warnings; my $string = "[EMAIL PROTECTED] n??e#w [?! \$ \% y]e{?]a#

Re: getting a time diff from strings

2005-12-29 Thread Gerard Robin
On Wed, Dec 28, 2005 at 09:18:55PM -0500, Robert wrote: From: Robert <[EMAIL PROTECTED]> To: beginners@perl.org Subject: getting a time diff from strings I have a log that I am parsing and I can get the login and logout time string parsed out. It looks like this: 13:50:01# this is the w

Re: From column to row?

2005-11-28 Thread Gerard Robin
On Mon, Nov 28, 2005 at 08:45:14PM +0100 Andrej Kastrin wrote: > Hi, I am totally NOOB in Perl and here is my first problem, which I > couldn't solve... > I have column data in file xy.txt, which looks like: > A > B > C > ABCDD > .. > . > > Now I have to transform this to row data fil

Re: How recognize strange subject in a mail ?

2005-11-25 Thread Gerard Robin
On Thu, Nov 24, 2005 at 09:32:41PM -0500 Chris Devers wrote: > On Fri, 25 Nov 2005, Gerard Robin wrote: > > > Can someone give me some advices to recognize such subject if it's > > possible. > > Yes, it's possible. The solution is already available, it'

How recognize strange subject in a mail ?

2005-11-24 Thread Gerard Robin
Hello, I wrote an amateurish script perl (I use Net::POP3) to block the spam which (the script) runs fairly fine. But I got a mail with that header: (in gnome-terminal) From: [EMAIL PROTECTED] Subject: To: [EMAIL PROTECTED] And my script did not work, while currently it worked fine with an emp

Re: regex

2005-11-17 Thread Gerard Robin
On Wed, Nov 16, 2005 at 04:57:30PM -0500 Jay Savage wrote: > On 11/16/05, Gerard Robin <[EMAIL PROTECTED]> wrote: > > On Wed, Nov 16, 2005 at 05:17:29AM -0800 John W. Krahn wrote: > > > > > The first one should be faster. Of course you could use the Benchmark >

Re: regex

2005-11-16 Thread Gerard Robin
On Wed, Nov 16, 2005 at 05:17:29AM -0800 John W. Krahn wrote: > The first one should be faster. Of course you could use the Benchmark module > to find out for sure. Thanks for your help. I tried Benchmark but the results seem not reliable: cmpthese( -5, { a => sub{$x*$x}, b => sub{$x**2} } )

regex

2005-11-16 Thread Gerard Robin
Hello, in a script I can write: if ( $subject =~ /phar/i or $subject =~ /phfar/i or $subject =~ /phhar/i or $subject =~ /phya/i or $subject =~ /photo/i ){..} "or" if ( $subject =~ /ph(ar|far|har|ya|oto)/i ){...} "or" if ( $subject =~ qr(ph(ar|far|har|ya|oto))i )

print main:: ....

2005-10-13 Thread Gerard Robin
Hello, when I run this script I get the results: #!/usr/bin/perl #obj1.pl # package Useless; use warnings; sub method { return "sometimes I don't understand Perl and often I am wrong" } my $obj = bless []; print main::method, "\n"; print main::, "\n"; print $obj, "\n"; print $obj->method, "\n"

Re: how to find missing value.

2005-10-10 Thread Robin
ave the sum of the numbers in the list. Clearly, the difference between this value and the actual sum must be the missing number. So you can get your solution in O(n) time rather than O(n^2). Cool huh? :) (BTW: my "not knowing the above" solution would have been to sort the list, the

Re: Test for integer

2005-10-03 Thread Robin
#x27;t numbers\n"; } More detail at: perldoc -q "whether a scalar is a number" -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgp0B3GxxoWoM.pgp Description: PGP signature

Re: use strict, aliases, local

2005-10-02 Thread Gerard Robin
On Sun, Oct 02, 2005 at 08:49:30AM -0400 Jeff 'japhy' Pinyan wrote: ... > > If you REALLY want to use package variables instead of lexicals, then you > need to follow the instructions in the 'strict' documentation for > declaring your global variables: > > use strict; > our

use strict, aliases, local

2005-10-02 Thread Gerard Robin
Hello, when I try this example for aliases: use warnings; # use strict; $foo = 26; @foo = ("here's", "a", "list"); &testsub (*foo); print ("The value of \$foo is now $foo\n"); sub testsub { local (*printarray) = @_; foreach $element ( @printarray) { print ("$element\n"); } $printarray = 61;

Re: generating a wordlist from an array of arrays

2005-09-29 Thread Gerard Robin
On Thu, Sep 29, 2005 at 07:26:51PM +0200 mark berger wrote: > hey list. i stuck with gererating a wordlist from a changing > multidimensional array. each entry in the array contains a list with the > possible values. > > fe: > > @wordlayout = ((a, b),# possible values for 1st char

Re: File Existance

2005-09-28 Thread Robin
t; } yes, it must include the full path: foreach ('ls', '/bin/ls') { if (-e $_) { print "$_ exists\n"; } else { print "$_ doesn't exist\n"; } } Prints: ls doesn't exist /bin/ls exists -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROT

Re: File Existance

2005-09-28 Thread Robin
int "File! :)\n"; } else { print "No file! :(\n"; } -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D -- To unsubscribe, e

Re: Camel book relevance

2005-09-25 Thread Robin
you need to look deeper into the language than that to create your own solutions to things. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgp0XRAmnRQDe.pgp Description: PGP signature

Re: problems with getpwent

2005-09-17 Thread Gerard Robin
On Sat, Sep 17, 2005 at 08:20:55PM +0530 Binish A R wrote: > Hello, > > I've a doubt with getpwent function. > The following code [ getpwent in list context ] is getting into an infinite > loop: > #!/usr/bin/perl -l > > > while ($ref = [ getpwent() ]) { > last unless @$ref;

Re: Threads and data sharing

2005-09-10 Thread Robin
p as much of your code as > possible, but you could do without your @data:shared since you pass > the data in. Cheers. It's not quite as elegant as I hoped was possible, but it works which is a major step forward. I'll look into the changes you made, they should help me understan

Threads and data sharing

2005-09-10 Thread Robin
my %struct = %{ shift() }; $struct{res} = $struct{d1} + $struct{d2}; print "Thread: $struct{d1} + $struct{d2} = $struct{res}\n"; } # Line 35 Cheers, -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me

array or hash ?

2005-09-08 Thread Gerard Robin
hello, In a array @tab I get $tab[n], but I don't know n. I want to get $tab[n + 1]. I found two ways (there are probably better ways;-)) 1: @tab = qw/bar tabou island mong turlut foo perl/; ($mot1) = grep /tu/, @tab; print $mot1, "\n"; $index = 0; foreach (@tab) { last if $tab[$index] eq $mot1

Re: catchDate

2005-09-08 Thread Gerard Robin
On Thu, Sep 08, 2005 at 01:25:18AM -0700 Christopher Spears wrote: > I want to catch the various parts of the output of the > date command. Here is my script: > > #!/usr/bin/perl -w > use strict; > > my $date = system("date"); with: my $date = localtime; woks fine. > What is going on? Does

Net::POP3

2005-09-07 Thread Gerard Robin
Hello, I use Net::POP3 for donwload the header of my messages. . $pop = Net::POP3->new($server); ... $top = $pop->top($msgnum); ... my ($from) = grep /^From:/i, @lines; my ($to) = grep /^To:/i, @lines; my ($subject) = grep /^Subject:/i, @lines; ... When To is: To: beginners@perl.or

Re: Perl examples

2005-08-24 Thread Gerard Robin
On Tue, Aug 23, 2005 at 02:14:25PM -0700 anu p wrote: > > It would be great if any one can suggest me some nice > websites which have good practical perl examples. http://www.sthomas.net/oldpages/roberts-perl-tutorial.htm http://www.netcat.co.uk/rob/perl/win32perltut.html http://www.cclabs.misso

Re: Regular expression not working as expected

2005-08-11 Thread Robin
h other somewhere", with no other restrictions. In this example, you could use: /^fo{2}$/ which would only match "foo". Or perhaps: /[^o]o{2}[^o]/ which would only return true if there were two 'o' surrounded by anything other than 'o'. Hope that helps you se

Re: slices of hashes

2005-07-21 Thread Gerard Robin
On Thu, Jul 21, 2005 at 04:04:36PM -0400 Scott R. Godin wrote: > Gerard Robin wrote: > >Hello, > >the slices of hashes work strangely ... > > > > >PS > >if I write: > >@h3{"Mamadoo".."Lulu"} = (30, 40, 50 ); > >the script hangs

slices of hashes

2005-07-21 Thread Gerard Robin
Hello, the slices of hashes work strangely ... The parts 1, 2 and 4 work fine; but the part 3 doesn't do what I expect. What is wrong in what I do in part 3 ? #!/usr/bin/perl #slice3.pl use warnings; use strict; # 1 my %h1 = (a => 1, b => 2, c => 3, d => 4, e => 5, f => 6); print sort {$a <=>

Re: Limit memory used by perl

2005-07-14 Thread Robin
haven't really gotten into it) limits on things like memory and CPU. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpSKVlrQwuTU.pgp Description: PGP signature

Re: each

2005-07-13 Thread Gerard Robin
On Wed, Jul 13, 2005 at 11:53:33AM -0700 John W. Krahn wrote: .. .. > You have two keys in the hash and you are calling each() twice which does > not > reset the iterator. You need to reset the iterator by either calling each() > until it returns nothing (undef) or by calling keys() or v

each

2005-07-13 Thread Gerard Robin
Hello, with perl 5.8 with this script: #!/usr/bin/perl #hash2.pl use warnings; use strict; my %where=( London => "England", Madrid => "Spain", ); print "-"x20, "\n"; my ($a, $b) = each %where; my ($c, $d) = each %where; print "$a $b\n"; print "$c $d\n"; pr

Re: array list

2005-07-11 Thread Robin
On Monday 11 July 2005 23:08, bclark1 wrote: > print @array[0..6], "Some text", @rray[7..10]; Off the top of my head: print "@array[0..6] Some text @rray[7..10]"; (untested, but should do the job) When inside double-quotes, Perl will expand the array for you. --

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: Having Module::Pluggable find plugins at runtime

2005-04-20 Thread Robin
ch is a version or two behind. To see if that was the problem, I copied Pluggable.pm from the latest tarball, and then specified 'use Pluggable ...', but the same thing results. Any thoughts? -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgptjQIj6NylP.pgp Description: PGP signature

Re: Having Module::Pluggable find plugins at runtime

2005-04-19 Thread Robin
n /var/lib/..., but someone running it in their home dir might be happy with a relative './plugins'. And so I want it to be specified in a config file. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpGSN00MIClR.pgp Description: PGP signature

Re: Programming exercises

2005-04-19 Thread Gerard Robin
On Mon, Apr 18, 2005 at 06:47:44PM +0100 Stephen Day wrote: > > Hello, > > Does anyone know of a website that lists some programming exercises to help in > learning perl? > > I find it a lot easier to learning a language if I have exercises to apply it > to. I don't know if I reply exactly to

Having Module::Pluggable find plugins at runtime

2005-04-19 Thread Robin
them all up for me. How can I do this? Or perhaps do it in a different way by manually running through the directory and "require'ing" each file. The problem I have with that method is that I don't know how to get the class name out so that I can then inst

Re: pushing to an array reference

2005-04-19 Thread Robin
ereferences the hash element and turns it back into the array that it points to. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D pgpw7TcFRef0A.pgp Description: PGP signature

Re: system trouble

2005-04-11 Thread Robin
ia the -c parameter). Try: system ("webalizer", "-c", "./webalizer.conf", "/Users/jan/Sites/apache_logs/$file"); } (all one line) As I understand it, each argument to system is a separate parameter, whereas what you had was as though you'd group

Re: how would you write a spell checker?

2005-03-19 Thread Robin
0; if ($word =~ /^$single_word$/i) { $flag = 1; } print "$word not found\n" if (!$flag); -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB

Re: Input a password from STDIN

2005-02-06 Thread Gerard Robin
On Sun, Feb 06, 2005 at 10:33:05PM +0800 Xiaofang Zhou wrote: > Anyone can help me in this?. When running > > $password = ; > > the password will show on the console windows as user > type in. Is it possible for perl to read from keyboard > directly, without echo to the console window? there is

Re: remove a file ?

2005-01-30 Thread Gerard Robin
On Mon, Jan 31, 2005 at 05:02:32AM +1000 Alfred Vahau wrote: > Hi, > > perldoc -f unlink > > alfred > > > Gerard Robin wrote: > > > >Can someone tell me how to remove a file in Perl ? Oops ... Sorry Thanks to all who replied to me. -- Gérard

remove a file ?

2005-01-30 Thread Gerard Robin
Hello, I am new on the list and I am sorry if my question is irrelevant with the list. In a program I have to remove a file. I did "perdoc perlfunc" and I found Functions for filehandles, files, or directories "-X", "chdir", "chmod", "chown", "chroot", "fcntl", "glob", "ioctl", "link", "

Re: Can perl produce a huge-sized file for download testing?

2005-01-16 Thread Robin
gt; begin. Any idea?? I'd pull a long string of bytes from /dev/urandom (say, several 10s of Kb worth) and just send that block over and over. (random so that you get the information of the line without any interim compression happening) Doing this as a Perl CGI probably wouldn'

Re: Transforming a space-separated string to an array for words.

2005-01-12 Thread Robin
hat to gain robustness, e.g. /[ \t]+/ will split on any number of spaces and tabs) - -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0x776DB663 = DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663 -B

Re: Is GOTO evil?

2005-01-06 Thread Robin
by programming exclusively in BASIC when I started coding, so I am now of the school that "GOTO considered harmful (unless you really really need it, and if you think you do, there is probably a better way to do what you are trying to do)" - -- Robin <[EMAIL PROTECTED]>

Re: xml

2005-01-04 Thread Robin
hash/array data structure that you can walk through. - -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175 14D3 6485 A99C EB6D -BEGIN PGP SIGNATURE- Vers

Re: Using variables in replacement in substitutions

2004-11-20 Thread Robin
ng today, so I cheated and turned off strict where the config file is read, but nowhere else: if (...) { no strict 'vars'; [eval/require the config] } as I understand it, strict is active everywhere else other than that block. -- Robin <[EMAIL PROTECTED]>

Re: Regular expression generator/creator

2004-08-28 Thread Robin
section, creating a regex for that will be easy. - -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0x776DB663 = DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663 -BEGIN PGP SIGNA

Need help to sort data

2004-08-23 Thread Robin Smith
Hi, I have a flat file data in the form of user and groups. The user always come first follow by the groups. Now I need to arrange then by groups. This is the code I have been working with. the groups are listing but the users are not. I am still fairly new to perl so I need someone with s

Re: Another Perl datatype headache ( scalars $, hashes %, and arrays @ )

2004-07-19 Thread Robin
yle script written in perl PHP works with them quite differently. In that, a variable starts with $ and may contain an array. It also doesn't have hashes like Perl (or rather, it doesn't have arrays like Perl, they are kind of like a mix of the two, similar to as if you didn'

Re: $^T inconsistant?

2004-07-14 Thread Robin
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 15 July 2004 07:08, Randal L. Schwartz wrote: > Yes. Don't use prototypes. Why not? And is there another way to ensure things like lists are passed as references? - -- Robin <[EMAIL PROTECTED]> JabberID: <

Permutations (and optimisations)

2004-07-13 Thread Robin
/"[EMAIL PROTECTED]"\n"; } my $value = pop(@srcCopy); # Make another copy of srcList, and remove only the one that # we are moving. This copy will be passed on to the next # iteration. my @srcCopy2 = @srcList;

Re: Piping output mutt perl

2004-05-10 Thread Robin Sheat
On Mon, May 10, 2004 at 12:23:44PM -0400, Paul D. Kraus wrote: > The only problem is thats kind of lengthy i would like to have a > script wrap my script that would have the mutt command built into it. Or just bind a button to it in ~/.muttrc, so that mutt does all the hard work. --

Re: File Monitoring

2004-05-10 Thread Robin Sheat
On Mon, May 10, 2004 at 08:35:53AM -0600, Wiggins d Anconia wrote: > There is a directory watching component in POE or you could grow your There is also the FAM daemon, which taps into the kernel to do it. I'm sure that there is a perl module to talk to that. -- Robin <[EMAI

Re: question

2004-04-27 Thread Robin Sheat
string at ./test.pl line 7, line 3. c = -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0x776DB663 Fingerprint=DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663 pgp0.pgp Description: PGP signature

Re: Can Perl be faster than C ?

2004-04-26 Thread Robin Sheat
tuff with hashs. Whether this is realistic or not, I don't know. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alienigeni me abduxerunt. Qui annus est? PGP Key 0x776DB663 Fingerprint=DD10 5C62 1E29 A385 9866 0853 CD38 E07A 776D B663 pgp0.pgp Description: PGP signature

Re: Process folder structure into new structure

2004-04-26 Thread Robin Sheat
On Mon, Apr 26, 2004 at 09:32:47PM -0700, Bryan Harris wrote: > It does, Rob, thanks! This belongs on a "very helpful perl code" page > somewhere. I've begun one at http://www.kallisti.net.nz/PerlTips feel free to add it (it's a wiki). -- Robin <[EMAIL PROTECT

Re: Antwort: Re: book suggestion for atypical beginner ['securiQ.Watchdog': ?berpr?ft]

2004-04-07 Thread Robin Sheat
least unusual and prone to bugs. I always make a point of ferreting out all the strict errors. You can also 'use diagnostics' for more information, but I don't always find it helpful. -- Robin <[EMAIL PROTECTED]> JabberID: <[EMAIL PROTECTED]> Hostes alien

  1   2   3   >