Re: How to append to a file in a Archive::Zip object ?

2016-10-24 Thread Vincent Lequertier
On 10/22/2016 06:56 PM, Eric de Hont wrote: > Op 21-10-16 om 14:13 schreef Vincent Lequertier: >> This code creates a zip file which contains several files, all named >> 'test'. The thing I'm trying to achieve is to have all the output of >> commands being app

How to append to a file in a Archive::Zip object ?

2016-10-21 Thread Vincent Lequertier
commands being appended to a 'test' file, into the zip. How can I do this properly ? I mean without having to create a temp file with a filehandle with all the output and adding the file to the zip after the for loop. Any help would be appreciated. Thanks -- Vincent Lequertier skysy

Re: Problems displaying Perl structures

2016-02-22 Thread Vincent Lequertier
Le 18/02/2016 08:24, $Bill a écrit : > On 2/17/2016 03:15, Vincent Lequertier wrote: >> > > I'd get rid of the '$'s in front of '$group1' etc to avoid the '$ip =~ > s/^\$//;' below. > >> How can I have the following out

Re: Problems displaying Perl structures

2016-02-17 Thread Vincent Lequertier
Didn't know about 2) and 5) thanks. Looping over the values makes sense as well. Regards, Le 17/02/2016 15:31, Shlomi Fish a écrit : > Hi Vincent, > > some comments on your code: > > On Wed, 17 Feb 2016 14:24:28 +0100 > Vincent Lequertier wrote: > >> Than

Re: Problems displaying Perl structures

2016-02-17 Thread Vincent Lequertier
$key, $value) = each %$VAR1) { # $key has group5 for intance, > and $value its value. > >$count += 1; > >$output = "\\,$value\n"; >print $output; > > } > > exit; > > Cheers, > > Miguel > > Este e-mail foi enviado a partir

Problems displaying Perl structures

2016-02-17 Thread Vincent Lequertier
] } ]; How can I have the following output? ,"10.100.29.0/24" ,10.100.27.52 ,10.100.27.53 ,10.100.27.54 ,10.100.27.55 ,10.100.27.56 ,10.100.27.57 Here is what I've tried: for my $table (@tables) { foreach my $entry ($table->{ips}) {

Re: Display a hash in the order of an array

2015-07-21 Thread Vincent Lequertier
Le 2015-07-20 16:49, Charles DeRykus a écrit : On Mon, Jul 20, 2015 at 6:19 AM, Vincent Lequertier wrote: Thank you for the help, Charles! Unfortunately, I'm not able to figure out how to access the element of %ordered, despite some diggings in the perldoc (http://perldoc.per

Re: Display a hash in the order of an array

2015-07-20 Thread Vincent Lequertier
t;{ip}}}, {$key, $value}; } #print Dumper \%ordered; my $i = 1; for my $key (keys %ordered) { print "ip number $i : $key\n"; for my $entry (@{$ordered{$key}}) { print $entry . "\n"; } ++$i; } But this module seems to be the way to go. -- Vincent

Re: Display a hash in the order of an array

2015-07-20 Thread Vincent Lequertier
Thank you, I thought about transforming my hash like your function transform_date_logs_to_ip_logs does but didn't found the way. I'm now trying to understand exactly how that works :-) -- Vincent Lequertier vincentlequertier.tk Le 2015-07-17 16:40, Brandon McCaig a écrit : Vincen

Re: Display a hash in the order of an array

2015-07-20 Thread Vincent Lequertier
$_->[0] } sort { $a->[1] <=> $b->[1] } map { [$_, int sprintf("%03.f%03.f%03.f%03.f", split(/\./, $_))] } @ip; } So I'm looking for a way to iterate through the hash in the order of my array. Regards -- Vincent Lequertier v

Display a hash in the order of an array

2015-07-17 Thread Vincent Lequertier
7; => 'xxx.xxx.xxx.xxx', 'action' => 'GET xxx' }; and an array of ip addresses, say @ip My question is how can I display the content of %hash in the order of @ip, assuming %hash has the same length as @ip ? Thank you -- Vincent Lequertier v

Re: How to check the index positions of an array element in perl in case of multiple occurance

2015-06-16 Thread Vincent Lequertier
tn_2 tn_3 tn_4 tn_5 tn_6 tn_7 > tn7bcch tnbcch tsc userdata ch_group_15 chgr_tg chgr_state band bccd > bspwrt cbch ccch dchno_0 dchno_1 dchno_2 dchno_3 dchno_4 dchno_5 dchno_6 > dchno_7 dchno_8 dchno_9 dchno_10 dchno_11 dchno_12 dchno_13 dchno_14 > dchno_15 dchno_16 dchno_17 dchno_18 dchn

Re: last statement in a package

2015-05-21 Thread Vincent Lequertier
From http://perldoc.perl.org/perlmod.html#Perl-Modules, "1;" is used to end with a true value --- Vincent Lequertier s...@riseup.net Le 2015-05-21 08:13, Sunita Pradhan a écrit : Hi Why a perl programmer use 1 or any number as last statement in module or package (like : 1;)?I check

Re: Perl array question

2015-05-06 Thread Vincent Lequertier
Thank you for the review, I'm learning and didn't know about this way of using hashes :-) --- Vincent Lequertier s...@riseup.net Le 2015-05-06 11:09, Shlomi Fish a écrit : Hi Vincent, On Wed, 06 May 2015 10:07:41 +0200 Vincent Lequertier wrote: It's a bit ugly, but here i

Re: Perl array question

2015-05-06 Thread Vincent Lequertier
$num1900 = 'EARFCN=1900, PCID='; my $num1902 = 'EARFCN=1902, PCID='; for (@array) { # print $_ . "\n"; $num1900 .= (split '-', $_)[1] . '&' if $_ =~ /1900/; $num1902 .= (split '-', $_)[1] . '&' if $_ =~

Re: Not working example - from Mastering Perl book

2015-05-03 Thread Vincent Lequertier
it gave the following result: > > I'm from package main > My name is glob > I'm from package main > My name is glob > > So it doesn't print the original name of the typeglob (foo or bar). > Is the code above working for you as wrote in the book? > > --Octavian > > -- Vincent Lequertier s...@riseup.net -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to create a LO spreadsheet

2015-04-29 Thread Vincent Lequertier
Le 28/04/2015 21:23, lee a écrit : > Vincent Lequertier writes: > >> Le 2015-04-26 14:27, lee a écrit : >>> Hi, >>> >>> how can I create a libreoffice spreadsheet with perl? There seem to be >>> two modules for it, yet none of them seems to let

Re: how to create a LO spreadsheet

2015-04-27 Thread Vincent Lequertier
that helps. -- Vincent Lequertier s...@riseup.net -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: How to filter out { } block in text file

2010-11-17 Thread Vincent Li
On Wed, Nov 17, 2010 at 3:26 AM, Rob Dixon wrote: > On 16/11/2010 17:01, Vincent Li wrote: >> >> Hi List, >> >> I have a text test.txt file looks like below: >> >> stp instance 0 { >>    interfaces 1.1 { >>          external p

Re: How to filter out { } block in text file

2010-11-17 Thread Vincent Li
On Wed, Nov 17, 2010 at 3:26 AM, Rob Dixon wrote: > On 16/11/2010 17:01, Vincent Li wrote: >> >> Hi List, >> >> I have a text test.txt file looks like below: >> >> stp instance 0 { >>    interfaces 1.1 { >>          external p

Re: How to filter out { } block in text file

2010-11-16 Thread Vincent Li
On Tue, Nov 16, 2010 at 2:14 PM, Jim Gibson wrote: > On 11/16/10 Tue  Nov 16, 2010  1:07 PM, "Vincent Li" > scribbled: > >> On Tue, Nov 16, 2010 at 9:38 AM, Jim Gibson wrote: > >>> >>> You need a parser to do this right. You might have some luc

Re: How to filter out { } block in text file

2010-11-16 Thread Vincent Li
On Tue, Nov 16, 2010 at 1:11 PM, Shawn H Corey wrote: > On 10-11-16 04:07 PM, Vincent Li wrote: >> >> My aim is to remove specific profile.*{} block from that file > > Yes, but if the {} blocks are nestable, then you can't do it with regular > expressions alone. &g

Re: How to filter out { } block in text file

2010-11-16 Thread Vincent Li
On Tue, Nov 16, 2010 at 9:38 AM, Jim Gibson wrote: > On 11/16/10 Tue  Nov 16, 2010  9:01 AM, "Vincent Li" > scribbled: > >> Hi List, >> >> I have a text test.txt file looks like below: >> >> stp instance 0 { >>    interfaces 1.1 { >>

How to filter out { } block in text file

2010-11-16 Thread Vincent Li
ofile, any tips/sample codes would be very much apprecaited. Thanks Vincent -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

What is the error in this code

2010-03-31 Thread Vincent Cannavale
#open a text file for reading, since opening for writing wipes the file open(INFILE, ", "\n"); close(INFILE); open(OUTFILE, ">perlfile.txt"); $variable =~ s/0/zero/g ; $variable =~ s/1/one/g ; $variable =~ s/2/two/g ; $variable =~ s/3/three/g ; $variable =~ s/4/four/g ; $variable =~ s/5/five/g ;

Re: Simple perl math caculation question

2007-07-10 Thread Vincent Li
On Tue, 10 Jul 2007, Chas Owens wrote: On 7/10/07, Vincent Li <[EMAIL PROTECTED]> wrote: I am trying to experiment a simple perl math caculation script I wrote: #!/usr/bin/perl use strict; use warnings; my %operator = ( minus => '-', add =&g

Simple perl math caculation question

2007-07-10 Thread Vincent Li
me. I guess there is other way around, I am just not aware of. Thanks in advance Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: [SPAM] Re: perl 5.8.8 install problem

2007-05-08 Thread Vincent Li
it running while I figure out what to do. I think spamd can run on seperate box, maybe it is easier/quicker to setup fresh SA on fresh box than fixing the broken perl on the production email server. Vincent Li http://bl0g.blogdns.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: [SPAM] perl 5.8.8 install problem

2007-05-08 Thread Vincent Li
as wrong. So, now I don't have a mod_perl for apache and my spamassassin won't run because of some strange perl error. Can someone shed some light on this for me... What should I do now? Why don't you get rid of all current perl and perl libraries and build from tarball source,

Re: [SPAM] Re: Accessing packed data structures

2007-03-14 Thread Vincent Li
need to pack and unpack to these elements are in hex format(0x0B 0x1C 0x34 etc). It is a string of hex bytes. I kindly request anyone to guide me in this. Thanks and Regards, Dharshana What about this one: http://search.cpan.org/~mhx/Convert-Binary-C-0.67/lib/Convert/Binary/C.pm I once used it to

P0fq.pl and pack/unpack

2007-02-20 Thread Vincent Li
e . "\n"; print "Details : " . $detail . "\n"; print "Distance : " . $dist . " hops\n"; print "Link : " . $link . "\n"; print "Uptime : " . $uptime . " hrs\n"; Thanks Vincent Li Bloghttp://bl0g.blogdns.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: finding matches in multiple arrays

2006-09-18 Thread Vincent Li
you asked, then I am dump :) -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> Vincent Li http://mcli.home

Add comment to a pattern matched file line

2006-01-10 Thread Vincent Li
Hi List: I have two files like this: file1: score CN_SUBJ_PROMOTE3.100 # [0.000..3.100] score CN_SUBJ_PROMOTION 3.600 # [0.000..3.600] score CN_SUBJ_PROVIDE3.000 # [0.000..3.000] file2: CN_SUBJ_PROMOTE CN_SUBJ_PROMOTION If string CN_SUBJ_PROMOTE exi

regular expression question

2005-01-17 Thread Vincent
Hi all, I am new to perl, I receive some spam email with subject like "st0ck, 0pportunities, gr0wth...", how can I match those words with number "0" in Thanks in advance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

mech-dump...

2003-11-15 Thread Vincent A. Primavera
Hello, Using the mech-dump utility I get the error listed below when trying to access this page. I do have the login information. Does anybody know how I can supply it and get around this? -- Thank you, Vincent A. Primavera. M.I.S. Manager. Ralph Pill

Get the Architecture type

2003-07-07 Thread BUFFERNE,VINCENT (HP-France,ex1)
Hi, Within a perl script, I would like to get the architecture type of the machine (ia32, ia64, pa-risc...). Is there an equivalent routine to the shell call "uname -a" in Perl? Thanks, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: How to measure Array or Hash's byte size ?

2003-04-04 Thread BUFFERNE,VINCENT (HP-France,ex1)
What's about: my @foo = ( '1', '2' ,'3' ); my $size = $#foo + 1; print "table size $size\n"; Ouput: table size 3 Vincent -Original Message- From: Li Ngok Lam [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 5:14 PM To: [EMAIL PROTE

RegExp and XML

2003-02-21 Thread Vincent O' Keeffe
gn the body to a variable like so? $msgbody = $pop->Body($i) # $pop being the instantiated POP connection object Thanks, Vincent

RE: Join problem

2002-10-20 Thread Vincent Lee
ow join on @clean_array... Aloha => Beau. -Original Message- From: Vincent Lee [mailto:vjlee_us@;yahoo.com] Sent: Thursday, October 17, 2002 1:48 AM To: [EMAIL PROTECTED] Subject: Join problem Hello All, I've got a problem with the JOIN function I've got a list of columns that

Join problem

2002-10-18 Thread Vincent Lee
the first value? Is the database returning a null field in the first columns, is that why it's returning a comma? join (",",@columns); = Regards, Vincent __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More h

Re: creating a string on the fly

2002-10-16 Thread Vincent Lee
or die "Select error. Check the syntax\n"; $s-> execute() or die "error here."; $s->bind_columns(\$colname); while ($s->fetch()){ push (@columns, $colname); } return @columns

Re: creating a string on the fly

2002-10-16 Thread Vincent Lee
--- Rob <[EMAIL PROTECTED]> wrote: > Sorry Vincent I'm not sure what you're meaning. > > You've written GetColumns ($table). Does it return > an array of column names > as it should? > - Original Message - > From: "Vincent Lee" <

RE: creating a string on the fly

2002-10-15 Thread Vincent Lee
t;, " if $n++; print $column; } print ") FROM $table;\n"; } Which may be enough for you. GetTables() and GetColumns() are the first part, and I can't say any more about what these might do without knowing more about what interface you have with the database

Re: creating a string on the fly

2002-10-15 Thread Vincent Lee
M $table;\n"; >} > >Which may be enough for you. > > >GetTables() and GetColumns() are the first part, and I can't say any more >about what these might do without knowing more about what interface you have >with the database. > >HTH > >Rob > >---

Re: creating a string on the fly

2002-10-15 Thread Vincent Lee
I'm starting with data in the database. It's SQL statements and I'm populating arrays in perl. I don't need to build a hash but the statement. I thought an array or hash would be the easiest. [EMAIL PROTECTED] wrote: > >Vincent > >I will have several suggestio

creating a string on the fly

2002-10-15 Thread Vincent Lee
o loops one for the tables but then I want to test if the $table_name=keys (%col_hash) then print the columns... Anyone iwth some idea? Best regards, Vincent _______ Vincent J. Lee EMAIL: [EMAIL PROTECTED] | [EMAIL PROTECTED] MOBILE: 917.318.8251 -- To unsubscribe,

Help with Hash Arrays

2002-10-14 Thread Vincent Lee
, Vincent __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Creating string on the fly

2002-10-14 Thread Vincent Lee
o loops one for the tables but then I want to test if the $table_name=keys (%col_hash) then print the columns... Anyone iwth some idea? = Regards, Vincent __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://fait

RE: Regexp

2002-09-19 Thread Panel Vincent - A53
Thank you all for your very accurate answers. Vincent. > -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 18, 2002 7:08 PM > To: [EMAIL PROTECTED] > Subject: Re: Regexp > > > Sudarshan Raghavan wrote: > >

RE: Regexp

2002-09-18 Thread Panel Vincent - A53
> Why not splitting on whitespaces and joining the pieces together ? E.g. Because it won't work : "michael mac douglas" will give "[EMAIL PROTECTED]" not "[EMAIL PROTECTED]" Vincent. > -Original Message- > From: Thorsten Dieckhoff [mailto:[EM

Regexp

2002-09-18 Thread Panel Vincent - A53
he second expression with $s which is wrong) Vincent Panel. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Really newbie question

2002-08-30 Thread Panel Vincent - A53
I've made a script that looks like this " #!/usr/bin/perl -w use Net::LDAP::LDIF; use Net::LDAP::Entry; $file= $ARGV[0]; open(LDIF, $file) || die "Failed to open file $ARGV[0] : $!"; $ldif = Net::LDAP::LDIF->new(LDIF); while (not $ldif->eof()) { $entry = $ldif->read_entry(); }; " Perl is

LDIF file parsing

2002-08-27 Thread Panel Vincent - A53
chard address: in your dreams name: brad surname: pitt adress: there " What should be the structure of my loop ? Do you know a complete script already written to parse such a file (can't find any on the net) ? Thanx, Vincent. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

64 bits and perl 5.6.1

2002-08-21 Thread BUFFERNE,VINCENT (Non-HP-France,ex1)
perl (compiled in 64 bits): do you know if it is possible ? Regards, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

32 and 64 bits

2002-08-13 Thread BUFFERNE,VINCENT (Non-HP-France,ex1)
I want to write something like: if (64 bits platform) . else . Where the code has a different behaviour depending on the targeted platform (32 or 64 bits). Do you know a simple method to perform this test in Perl ? Thanks, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

XS and Shared Libraries

2002-07-17 Thread BUFFERNE,VINCENT (Non-HP-France,ex1)
ed statically with "C Lib" (As you will do for an executable) => Is it possible to link statically a Shared Lib with another one just as you will do for an exectable ? Does somebody has already face this case ? What do you advice ? Thanks, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

XS and Shared Lib

2002-07-05 Thread BUFFERNE,VINCENT (Non-HP-France,ex1)
er does not give more details. I am working on HP-UX, but it should not make any deference. Do you have any idea what could be wrong ? Regards, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

select and BIG FDS

2002-05-21 Thread VINCENT BUFFERNE
Does "select" support big FDS (File Descriptor). This means can we use handle larger than 2056 with select. For example: vec($rin,0,65536) = 1; select($rin, undef, undef, undef); Thanks, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

using vec

2002-05-17 Thread VINCENT BUFFERNE
I am using vec($foo1, $foo2, $foo3). It seems that the value of $foo3 is limited to 2048 (with perl 5.004 or perl 5.6.1). Is it possible to use wider values: up to 60,000 ??? Thanks, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

XS and Perl version

2002-04-25 Thread VINCENT BUFFERNE
I am using a XS wrapper with Perl 5.004. I am planning to go for Perl 5.6.1. Do I have to plan modifications within the XS code ? Thanks, Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Access MS SQL using DBI / DBD

2001-10-31 Thread Vincent Bouttier-Deslandes
space >details.(MS SQL 7.0 & 2000) > > Can someone help...Thanks in advance. > > Pathi > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Vincent Bouttier-Deslandes ([EMAIL PROTECTED]) Responsable du pôle Outil

Re: Perl script editor for NT/2000

2001-08-20 Thread Vincent Bouttier-Deslandes
> To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Vincent Bouttier-Deslandes ([EMAIL PROTECTED]) Responsable du pôle Outils/Sécurité Tel: +33.3.28.37.78.47 - Fax : +33.3.20.67.58.43 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: I have a list of Directories and FIles, how do I sort them out

2001-08-16 Thread Vincent Lim
Thanks Steven, Sorry about the missing code and program exposition. Please see my "A Variant on the Recursive Copy - Funny Problem thread". Best regards. Vincent Lim Steve Howard wrote: > It might be helpful if you posted at least the part of the code that is > having trouble

A Variant on the Recursive Copy - Funny Problem

2001-08-16 Thread Vincent Lim
Hello All, I am currently developing a script on Perl 5.001 in Windows 2000 but targeted for WIndows NT 4.0. I have scan through the list and seen the answer on File::*. Unfortunately, the perl version I have does not have the FIle::Path module (or is it?). Here's the purpose of my script. Th

I have a list of Directories and FIles, how do I sort them out

2001-08-15 Thread Vincent Lim
. Something is jinking the test and the -f does not work, so all my files always end up as directories in the target. What's wrong? Or is there a better way? TIA. Vincent -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to retrieve filesystem size ?

2001-08-03 Thread Vincent Bouttier-Deslandes
Hi, Does anybody know how I can get a filesystem (or drive) size and free space ? I haven't see any module with a function to do that. Thanks. -- Vincent Bouttier-Deslandes ([EMAIL PROTECTED]) Responsable du pôle Outils/Sécurité Tel: +33.3.28.37.78.47 - Fax : +33.3.20.67.58.43 -

Function Prototypes

2001-07-12 Thread Vincent
I'm reading the chapter on Subroutines in the camel book and have a question about the prototypes described on page 226. At first my understanding was, there should be a $ or @ for each parameter expected. Or a \@ or \$ for each reference expected. But one of the examples reads: sub mysplice (\