What am I doing wrong?

2005-11-04 Thread jean
figure out why. In the output all the lines are printed twice, where I expect them to appear only once. The totals are calculated correctly. So if anyone here can help me, that would be very much appreciated thanks, jean >

Re: What am I doing wrong?

2005-11-08 Thread jean
Op vrijdag 4 november 2005 16:24, schreef Jeff 'japhy' Pinyan: > > #!/usr/bin/perl > > # > > # webstore-rijselect-5-werkt.pl > > # > > use warnings; > > use strict; > > > > use integer;

Re: What am I doing wrong?

2005-11-08 Thread jean
column in my sql table to identify the each row. I'll take a look at this, because something in the back of my mind says there must be cleaner ways to to this you wrote: > > foreach (my @result = $sth->fetchrow_array) { > > That is certainly incorrect. I think you just want t

Re: What am I doing wrong?

2005-11-08 Thread jean
"$t_qty[$i]\n"; } else { print "$sku[$i-1]",', totaalaantal is ', "$t_qty[$i-1]\n"; } } } } } $sth->finish; $dbh->disconnect; __ regards, jean -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

help on how to split a string

2001-12-29 Thread Jean-Louis
I'd like: $val[0]="a", $val[1]="bcd, efg, h", $val[2]="c" (or equivalent). I cannot figure out how to use split when the delimiter is the double quote. Thanks for your help. Jean-Louis

RE: Problem using File::RsyncP module

2004-05-13 Thread BERTHOLD Jean
Hello José, Unfortunatel -Message d'origine- De : NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED] Envoyé : mardi, 11. mai 2004 16:27 À : BERTHOLD Jean; [EMAIL PROTECTED] Objet : RE: Problem using File::RsyncP module > -Original Message- > From: BERTHOLD Jean [ma

RE: Problem using File::RsyncP module

2004-05-13 Thread BERTHOLD Jean
Hello José, Unfortunately, these different syntax don't work ... Perhaps I will ask directly to the module's author to find what is wrong in my code. Thanks again for your help ! Jean -Message d'origine- De : NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED] Envoyé : mardi,

Problem using File::RsyncP module

2004-05-08 Thread BERTHOLD Jean
7   Then, the connection is established but no files transfered ...   My script is a copy-paste (adapted to my servers, of course...) from the source given in the perl documentation.   Of course, I could do this job using system('rsync...') command line but I would like to do this script multi - OS ...     Can you see what is wrong ?   Thanks for your help and have a nice day     EOS Holding Jean Berthold Administrateur Unix & Oracle Unité Gestion de l'infrastructure Team Systèmes Ch. de Mornex 10 Tél. +41(0)21 341 24 58 Fax +41(0)21 341 20 49 jean.berthold@eosholding.ch   <>

Manage Oracle Archivelogs

2004-06-20 Thread BERTHOLD Jean
with DBI/DBD modules ...   Below the sqlplus output when I apply archivelogs manually. I cannot use automatic recovery because I use Oracle Standard Edition   Thanks for your help and have a nice day !   Jean Berthold     [EMAIL PROTECTED] [PWJA] # sqlplus /nologSQL*Plus: Release 9.2.0.4.0 - Product

Extracting Upper case letter from a variable

2005-10-05 Thread BERTHOLD Jean
have a nice day ! E O S H o l d i n g Jean Berthold Administrateur Unix & Oracle Unité Gestion de l'infrastructure Team Systèmes Ch. de Mornex 10 Tel +41 21 341 24 58 Fax +41 21 341 20 46 [EMAIL PROTECTED]

RE: Extracting Upper case letter from a variable

2005-10-05 Thread BERTHOLD Jean
-- Nom du fichier: rman_APPEOS-archivelog-05-10-05-0100.log Instance Oracle: APPEOS Thanks for your help ! Jean -Message d'origine----- De : Muthukumar [mailto:[EMAIL PROTECTED] Envoyé : mercredi, 5. octobre 2005 12:21 À : BERTHOLD Jean Cc :

RE: Extracting Upper case letter from a variable

2005-10-05 Thread BERTHOLD Jean
Yes, It's working now ! I didn't find any example like your's in the documentation. Thanks again to everybody for your help ! Jean -Message d'origine- De : Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Envoyé : mercredi, 5. octobre 2005 13:13 À :

How to reconfigure MCPAN ?

2003-12-22 Thread BERTHOLD Jean
ind the configuration file ... Thanks for your help EOS Holding Jean Berthold Administrateur Unix & Oracle Unité Gestion de l'infrastructure Team Systèmes Ch. de Mornex 10 Tél. +41(0)21 341 24 58 Fax +41(0)21 341 20 49 [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTE

RE: How to reconfigure MCPAN ?

2003-12-22 Thread BERTHOLD Jean
the field blank the '-j3' parameter is the default ... My machine is bi-processor under Solaris 9. I tried to edit by hand the file: /usr/perl5/5.6.1/lib/CPAN/Config.pm But unsuccessful. An idea ? Thanks again Jean Berthold -Message d'origine- De : Wiggins d Ancon

Re: bad interpreter

2002-10-31 Thread Jean Padilla
Hi, try: which perl at the command prompt, it will reply something like /usr/bin/perl (the path to perl executable) then get sure the first line in checkit.pl is #!/usr/bin/perl -w or whatever the which command reply. Regards. Karin Friberg a écrit : > > Hi there! > > When I run my perl program

PDF to PS

2002-11-04 Thread Jean Padilla
Hi, all Do someone knows about a perl module to convert PDF files to postscript ? I'm working on several UNIX (AIX) boxes and want to 'automagically' print PDF files. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: The basics of SWITCH

2002-11-04 Thread Jean Padilla
Hi, when you get $s from STDIN, it comes along with a newline, so try something like: chomp($s = ); A+ Gajo Csaba a écrit : > > Hi, I have a problem with SWITCH. I wrote this, I think > it's clear to anzone what it should do: > > print "Type in a number 1-5: "; > $s = ; > SWITCH; > { > if ($s

Re: checking input syntax

2002-11-05 Thread Jean Padilla
Hi, try this : #!/usr/bin/perl -w use strict; sub Usage() { die "Usage: $0 \n"; } $_ = shift; Usage unless ((defined $_) && (/^server(\d+)\.(\w+)$/)); print "param is $_\n"; --- take a look at perlre. A+ Jose Malacara a écrit : > > I would like to be able to verify the presence and syntax of

Re: Understanding list creation...

2002-11-05 Thread Jean Padilla
Hi, the second line is simply declaring two variables: 1 - the scalar $itemtype 2 - the hash %symbol just another way to say my $itemtype; my %symbol; no magic here, *NOT* a list or data structure. A+ David Buddrige a écrit : > > Hi all, > > I am reading through a collegue's perl script. In it

Re: Extracting email adresses from a flat text file

2002-11-14 Thread Jean Padilla
try this: #!/usr/bin/perl -w use strict; my $if = "path_to_input_file"; my $of = ">path_to_output_file"; my ($name, $addr); open(IF, $if) or die "Can't open file $if for reading\n"; open(OF, $of) or die "Can't open file $of for writing\n"; while () { chomp; (undef,$name,undef,undef,undef,unde

Re: Repeating Regexp

2002-11-28 Thread Jean Padilla
Hello, I suggest this: #!/usr/bin/perl -w use strict; my $var1 = "23456789"; my $var2; ($var2 = $var1) =~ s/(\d)/$1 /g; # only add 'g' for global substitution print "var1 = '$var1', var2 = '$var2'\n"; Regards. Paul Murphy a écrit : > > Hello, this is a two part question: a how to, and a how

Re: sasdata set

2003-02-06 Thread Jean Roth
I would suggest Stat/Transfer, www.stattransfer.com or DBMS/Copy. Best, Jean Roth National Bureau of Economic Research www.nber.org/data Date: Thu, 6 Feb 2003 11:30:19 -0500 (EST) From: Benjamin Jurado <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: sasdata set can anyone point

Interaction whith the OS: System command or better ?

2002-07-25 Thread Jean Berthold
on't know where is the benefice to use perl instead of shell scripts for theses tasks... Thank for your help and have a nice day ! -- Jean Berthold EOS - energie ouest suisse Chemin de Mornex 10 , CP 570 CH-1001 Lausanne , Switzerland Tel. : +41 (0)21 341 24 58 Fax : +41 (0)21 341 20 49 E-Mail : [EMAIL PROTECTED]

How initialize hash inside a while loop ?

2002-07-29 Thread Jean Berthold
e key and in a second loop the backup path. Is it possible ? for example, second loop : while ($key) = each %Slice ) { $Slice{$value} = `fssnap -i $key | grep /dev/fssnap | cut -c 33-45` ; } What is wrong ? Thanks for your help -- Jean Berthold EOS - energie

Re: How initialize hash inside a while loop ?

2002-07-30 Thread Jean Berthold
:-) All theses information will be used later to generate reports and alarm by email. Is it possible to implement this idea in a perl script ? Thanks again for your help and have a nice day. Jean Berthold Jeff 'japhy' Pinyan a écrit : > On Jul 29, Jean Berthold said: > > &

Re: Passing values through 2 different CGI scripts

2002-10-08 Thread Jean Padilla
If you are generating the email CGI form on the fly, you can pass the number as a hidden INPUT field : eg: ... INPUT fields as needed Hope it helps. Ben Crane a écrit : > > Hi List, > > I have an online web map created through mapinfo-when > you click on a part of the JPEG image it lo

Re: I need help for handling text log file

2002-10-09 Thread Jean Padilla
Not an expert in perl (nor in english), but let's try ;-) if your output file is not supposed to get too big, consider 'writing' first your output lines in a hash ... $hash{1} = "line 1"; and so on (later, writing line 10 for eg.) if (whatever) { $hash{5} .= " these few words"; } when finished,

Re: file handles!

2002-10-09 Thread Jean Padilla
Hi, pravesh 1 - You are saying "mv < > HI > I define a file the following way: > > $FILE_HANDLE = "< > then I openit > > open(FILEHANDLE); > > i perform some operations.. > > and then I want to transfer this "somefile" to some other directory > > but I am not able to use mv comand to do i

Re: I need help for handling text log file

2002-10-09 Thread Jean Padilla
Hi, I've downloaded Tie::File module from http://search.cpan.org/author/MJD/Tie-File-0.93/ and given it a little try : works fine. (even for me : Just Another Perl Newbie). Thanks, José. "NYIMI Jose (BMB)" a écrit : > > Why not just use Tie::File module ? > > http://search.cpan.org/author/JHI

Re: Odd and even numbers

2002-10-09 Thread Jean Padilla
Hi, $num += $num % 2; this increments $num if $num modulo 2 is 1 (ie. if $num was odd) regards. "Zielfelder, Robert" a écrit : > > Greetings, > > I am trying to write a script that at one point needs to look at a number > and divide it by two. The results must always be an integer, but the

Re: Newbie Question

2002-10-10 Thread Jean Padilla
Hi, James Can you post some examples ? - what do you call the header in your files, - what string(s) are supposed to match what, - what is the data to write to output file(s) and so on... Rgds. James Parsons a écrit : > > Hi all > > Perl Is extremely new to me and I'm having a problem were to s

Re: how to get the last line of a file

2002-10-11 Thread Jean Padilla
Hi, Alex i suggest the following: #!/usr/local/bin/perl -w my $filename = "Your_file_name"; # if you are so lucky to work on Unix my $lastline = `tail -1 $filename`; print $lastline; # if file is small enough to hold in an array open(FILE, $filename) or die "Can't open $filename.\n"; my @array

Re: file to file copy

2002-10-16 Thread Jean Padilla
Hi, Christophe I suggest the following (see attached file: modcfg) Hope this helps. folschette a écrit : > > hi again, > and which i forgot to say: while merging file1 into file2 , no key should be > double, the right key is the one in file1!! > > so in fact it is a replacement of some lines i

Re: Getting A File Name

2002-10-18 Thread Jean Padilla
Hi, try this : my $last = (glob("fred.*"))[-1]; --- - $last gets the last item in the array returned by glob() - glob() returns file names sorted alphabetically ;-) Regards. Ken Cole a écrit : > > Hi, > > I have a directory in which there are files such as: > > fred.1 > fred.2 > fred.3 > > T

Re: system

2001-06-07 Thread Jean-Matthieu Guerin
gt; Could anyone please give in any suggestions. > > Thanks, > Prachi -- Jean-Matthieu Guerin Brime Ingenierie [EMAIL PROTECTED]

Re: the ENV command? parameter?

2001-06-07 Thread Jean-Matthieu Guerin
> Systems Engineer > McGraw-Hill Education > McGraw-Hill Companies > 860-409-2603 > [EMAIL PROTECTED] -- Jean-Matthieu Guerin Brime Ingenierie phone: 33-1-4898 8230 [EMAIL PROTECTED]

Re: directory listing to array

2001-06-07 Thread Jean-Matthieu Guerin
AIL PROTECTED] > http://www.mcnabbs.org/evan > -- Jean-Matthieu Guerin Brime Ingenierie [EMAIL PROTECTED]

Re: Doubt in understanding

2001-06-08 Thread Jean-Matthieu Guerin
t; understanding this? > > -- > Thanks and Regards, > D.Rajanikanth -- Jean-Matthieu Guerin Brime Ingenierie phone: 33-1-4898 8230 [EMAIL PROTECTED]

Re: converting standard input to an upper or lower case

2001-06-12 Thread Jean-Matthieu Guerin
> chomp $ans; >if ($ans eq "y"||$ans eq "Y") { > > > Anyone got a quick example before I start digging into the sites? I am sure > I could do the whole thing more efficiently, but for now I'd like to stick > with my baby steps. I am

Last page

2001-06-21 Thread Stéphane JEAN BAPTISTE
How can I get the URL which was calling my script (like document.referrer in Javascript) tks

Re: Last page - That's OK

2001-06-21 Thread Stéphane JEAN BAPTISTE
It was all I need Thank you Stéphane JEAN BAPTISTE a écrit : > How can I get the URL which was calling my script (like > document.referrer in Javascript) > > tks

to delete a file

2001-06-21 Thread Stéphane JEAN BAPTISTE
How can I delete a file ? thanks

Re: to delete a file - That's OK

2001-06-21 Thread Stéphane JEAN BAPTISTE
It's allright! thank you Stéphane JEAN BAPTISTE a écrit : > How can I delete a file ? > > thanks

to delete only one line

2001-06-22 Thread Stéphane JEAN BAPTISTE
HI. I'm looking for a method to delete the line number x into a file. Is it simply possible ? tks

to copy a file (with perl)

2001-06-25 Thread Stéphane JEAN BAPTISTE
Hi. Hw could I copy a file in Perl tks

types of datas

2001-06-25 Thread Stéphane JEAN BAPTISTE
Hi! I get a value from a URL and I put it into a variable. I have a loop (while) with a value which have different values. The problem is that when I compare the first and the second value: If they're really equals, the program say they are'nt. Is ther a function to convert a value into an inte

Re: to copy a file (with perl)

2001-06-25 Thread Stéphane JEAN BAPTISTE
This is my code : /^valeur=/ && do { $val=$_; $val=~s/valeur=//; }; open(IN,"actualite.txt"); open(OUT,">>tamp.tmp"); $i=1; while ( $line = ) { if ( $i != $valeur ) { print OUT $line; }; $i++; } close IN; close OUT;

chomp ?

2001-06-26 Thread Stéphane JEAN BAPTISTE
What is chomp ? tks

To replace a string with another

2001-06-27 Thread Stéphane JEAN BAPTISTE
Hi. I want to replace the String %0A by nothing. I'm using this line: $description=~tr/%0A//; But nothing change. What is my problem ? tks

Re: To replace a string with another

2001-06-27 Thread Stéphane JEAN BAPTISTE
Stéphane JEAN BAPTISTE a écrit : > Hi. > I want to replace the String %0A by nothing. I'm using this line: >$description=~tr/%0A//; > > But nothing change. > > What is my problem ? > > tks PS: There is'nt only 1 string but a lot.

to delete the trailing newline

2001-06-27 Thread Stéphane JEAN BAPTISTE
I have a variable and I want to write it into a textarea (HTML). The problem is when I look at the textarea in my HTML page, there is the text I want, plus a trailing newline. How can I delete this. My variable: "$texte="wazaa";" In textarea: "wazza " tks Sorry for my english steph

Re: to delete the trailing newline

2001-06-27 Thread Stéphane JEAN BAPTISTE
"Brett W. McCoy" a écrit : > On Wed, 27 Jun 2001, Stéphane JEAN BAPTISTE wrote: > > > I have a variable and I want to write it into a textarea (HTML). The > > problem is when I look at the textarea in my HTML page, there is the > > text I want, plus a trailing

delete the last string

2001-06-28 Thread Stéphane JEAN BAPTISTE
Hi I want to delete a string but only the last. Example/ I am the titi last human on titi earth. -> I want to erase the last "titi" nut not the other. How can I do this thanks

trailing newline

2001-06-29 Thread Stéphane JEAN BAPTISTE
Hi I need the (hexa?) code for trailing newline, but not "\n". I need a code like (é or é for é) tks

conversion Perl<->HTML

2001-07-02 Thread Stéphane JEAN BAPTISTE
HI. On the first side, I have a line of text into a file. On the other side, I want to write this text in a "textarea" Tag. In the text which is coming from the file, I have "\n", to have a trailing newline.EX: "First line \n Second Line". I get the text from the file and I put it into the variab

How to convert hexadecimal number in decimal ?

2001-07-04 Thread Jean-Paul Miéville
Hi, Can you explain me how can I convert an hexadecimal number in decimal ? For converting decimal in hexadecimal, I can use the function hex, but I didn't find a function for converting hex in dec. Thanks in advance, Jean

FTP perl script

2001-07-10 Thread Jean-Pascal Dezalay
I wrote a perl script to make a FTP connection to a remote machine like this # #!/usr/local/bin/perl open (FTP, " | ftp -v -n remote.comp.fr"); print FTP, "user username passwd\n"; print FTP, "bin\n"; print FTP, "prompt\n"; print FTP

Locale error starting Perl

2001-07-13 Thread Jean-Christian Imbeault
I'm trying to get my apache web server up and running but everytime I try I get a perl error about locale settings. I have tried a few things to get it to work but none worked. I'm using RH7.1, and have setup japanese language support (japanese kb, sometimes I input japanese) with: Apache/1.3

Local error starting Perl

2001-07-13 Thread Jean-Christian Imbeault
I'm trying to get my apache web server up and running but everytime I try I get a perl error about locale settings. I have tried a few things to get it to work but none effective. I'm using RH7.1, and have setup japanese language support (japanese kb, sometimes I input japanese) with the folow

return 0;

2001-05-03 Thread Stéphane JEAN BAPTISTE
What's the equivalent command for "return 0" in C/C++. This command allow you to stop your program immediately. tks

to have URL's call

2001-05-03 Thread Stéphane JEAN BAPTISTE
How can I have the URL which is calling my script? ex: the name of my script is : "script.cgi" URL is : http://www.computer.com/script.cgi?toto=12&titi=25 I want to have $var=toto=12&titi=25 or $var=http://iti=25 . tks

to reach an URL

2001-05-07 Thread Stéphane JEAN BAPTISTE
I'm looking for a command which permit to reach an URL from the script. tks PS: sorry for my english :-)

File::Find

2001-11-19 Thread Jean-Paul Miéville
I don't understand the difference between these two functions: find and finddepth in module File::Find. I don't understand the explanation in perldoc. My experience shows that finddepth is about 50% faster than find. Why ? Thanks in advance,

Hotline Module

2001-11-29 Thread Trefois Jean-Claude
Hi, I found a simple perl hotline bot, and when I try to launch it, it says that the system command stty is not found! I know it is a shell util under linux, but what is the equavalant system utility under win2k? Thanks for your answer -- Christophe Tréfois ([EMAIL PROTECTED]) Web-Development

RE: Confirmation...

2001-12-06 Thread Messier, Jean-Francois
y the digits from on the left as well as the periods. More complex question: If I have something like "src=206.48.16.3/12345", how can I do the same as bove, but also removing the "src=" at the beginning ? Thanks :-) Jean-Francois Messier Ottawa, CANADA -Origina

perldoc under HPUX

2001-12-19 Thread Messier, Jean-Francois
could run Perl under Windows, but that sounds like a non-sense to me. Since I have a Linux station, I might as well take advantage of it. I think this command can be very useful, but I first need it to run properly. Thanks :-) Jean-Francois Messier Ottawa, CANADA -- To unsubscribe,

Compressing multiple columns into one

2008-06-19 Thread Jean-Rene David
Hi, A little problem I encountered recently. I have an array of integers and two indexes within that array. I need to get another array identical to the first one, except that all cells between the two indexes (inclusive) must be compressed to one column which is the sum of the originals cells.

Re: Compressing multiple columns into one

2008-06-19 Thread Jean-Rene David
* Paul Lalli [2008.06.19 13:52]: > On Jun 19, 11:41 am, [EMAIL PROTECTED] (Jean-Rene David) wrote: > > I have an array of integers and two indexes within > > that array. I need to get another array identical > > to the first one, except that all cells between > > the t

Compressing multiple columns into one

2008-06-19 Thread Jean-Rene David
Hi, A little problem I encountered recently. I have an array of integers and two indexes within that array. I need to get another array identical to the first one, except that all cells between the two indexes (inclusive) must be compressed to one column which is the sum of the originals cells.

Re: variable in perl

2008-10-16 Thread Jean-Rene David
* Telemachus [2008.10.15 12:35]: > In Debian (and so probably many of its > children), perl-doc is a distinct package and > not installed automatically when you install the > perl package. > > Stupid, but true. Well, not to drift off-topic but it is my understanding that it is general Debian poli

RE: iterating through hash of hash references

2004-03-03 Thread Guay Jean-Sébastien
Hello, > It looks like not all of the fields have something in them. Perl is taking blanks for > undefined for some reason. An empty field in a database is not a "blank", as you say, but a NULL. Meaning it's not just blank, but effectively inexistant - there is no value, not even the empty strin

RE: Some java some perl

2004-03-11 Thread Guay Jean-Sébastien
Hello Joseph, >> String[] aStr = {"-e", "'print(\"Ola\n\") foreach (1..100);'"}; >> >> Process p = r.exec("perl", aStr); > > You told the system to open the perl compiler here. You may also have Offered > it 100 lines like this: > "Ola > ""Ola > Which Perl would have a ver

RE: nested while loops using DBI

2004-03-22 Thread Guay Jean-Sébastien
Hello Mike, > $row=$dbh->prepare("SELECT contact_id,first_name,last_name,organisation > FROM tb_contacts WHERE organisation ILIKE ?"); [...] > while(($id,$first_name,$last_name,$organisation) = $row->fetchrow_array()) { [...] > $row=$dbh->prepare("SELECT id,contact_id,type_of_contact,priority

RE: QUERY_STRING

2004-03-24 Thread Guay Jean-Sébastien
Hello Mike, > Do we know where I can get a clear definition > of "query_string"? [and in another message...] > Is there any place we can look up the definition > of these such as "CONTENT_LENGTH" & query_string. I'm not sure why you're asking here for something like that. You can use Google t

RE: references

2004-03-24 Thread Guay Jean-Sébastien
Hello Joe, > i have the following code: > > $sth = $mysql_dbh->prepare("select subroutine_pointer from > $database.equipment_manufacturer where > manufacturer=\"$remedy_eqpt_mfgr\""); > $sth->execute(); > $subroutine_pointer = $sth->fetchrow_array(); > no strict "refs"; >

RE: Question about cgi forms (slightly OT)

2004-03-25 Thread Guay Jean-Sébastien
Hello, > mike wrote: > > > When I do Search in the web-browser, is there any way to get it to > > search the values in the fileds of the form? > > > > Currently all the values show up, but they dont seem to > appear to be in > > scope for searching > > > Show some code -- likely your logic is

RE: Hash Help Needed !

2004-03-25 Thread Guay Jean-Sébastien
Hello Jason, > $VAR1 = { > 'oids' => '%response_values', > 'time' => '03/25/2004 03:16:39' > }; ... > If so, what is wrong with my assignment statement ? > > push @{$response_hash{$request_id}},{time => "$time",oids => > "%response_values"}; That is exactly what Charl

RE: determing number of records returned with DBI

2004-03-30 Thread Guay Jean-Sébastien
Hello Andrew, > Is there a way to find out how many records were returned > with a DBI query? There's the > obvious counting each record as you fetch it, but I need the > count before I start going > through them. I was looking through the DBI documentation (perldoc DBI) not long ago and this

RE: determing number of records returned with DBI

2004-03-30 Thread Guay Jean-Sébastien
Hi again Andrew, > With the mysql driver, it does return the number of fetched > rows before you start > iterating through them. It does what I need it to do. Thanks. Ok, but that behaviour is probably specific to DBD::MySQL, and can't be relied upon if you change to another DBD... I would use

RE: using strict

2004-04-01 Thread Guay Jean-Sébastien
come from the relatively new school of programming. As I understand, they are features of the language that are dangerous to use in some contexts, so use strict disallows them knowing that if you really want to use them, you'll disable strict for the block of code where you use it, and then re

RE: using strict

2004-04-02 Thread Guay Jean-Sébastien
Hello Derek, > Guay, Err, my first name is Jean-Sebastien. My last name is Guay. French-language people have a bad habit to put the last name first, as in "Guay, Jean-Sebastien"... So I understand why this is a bit confusing. > What do you mean when you say "Just use $

RE: using strict

2004-04-02 Thread Guay Jean-Sébastien
> Guay Jean-SÃbastien wrote: >> >>> open (CRITICALSERVERS, "$crout") || die "can't open file \n: $!"; >> >> As I said, you should replace || by or in the above line. See the >> precedence rules in "perldoc perlop" for de

RE: using strict

2004-04-02 Thread Guay Jean-Sébastien
Hello Derek, > can I email you from know on??? : ) You are so through! Thank you! No, I would prefer that you always reply to the list. First reason is that other beginners can benefit from our exchange (and the mails end up in a searchable archive), second is that if I'm not there (or for th

RE: using strict

2004-04-05 Thread Guay Jean-Sébastien
I am sorry David, it just seems like I am having trouble communicating clearly. We are apparently in a disagreement, but your points are not at all what I wanted to explain... I'll try again. > you should test it yourself. i am not sure how good you are > with Perl and i > don't want to sound lik

RE: using strict

2004-04-05 Thread Guay Jean-Sébastien
Hello Joseph, > One thing I would request is that you trim off any material to which you are not > responding from old posts. This helps keep bandwidth and storage needs down. I'll keep that in mind. I usually don't keep all the thread of replies that Outlook ( grrr) keeps at the bottom, seems l

RE: using strict

2004-04-05 Thread Guay Jean-Sébastien
Hello Joseph, David, > A stronger argument has to do with mindset. The || operator is an > expression evaluation operator, appropriate to mathematical or paramathematical > expressions. The context really calls for a flow-control operator, or. Thanks for making my point better than I could, Jos

RE: I don't get it ... array

2004-04-14 Thread Guay Jean-Sébastien
Hello Romain, > sub n_list { > > my($a)[EMAIL PROTECTED]; > > ...sql query... > > my $sth=$dbh->prepare($sql); > $sth->execute(); > > my node_l; As others have noted, this should be @node_l, but you say it's that way in your code (why didn't you just paste your code btw? Would have avoided su

RE: guessing script

2004-04-15 Thread Guay Jean-Sébastien
Hello Greg, > Thanks for you comments. Is this the best way then? Seems to work, but I'm > curious what could be any better.. Your version is fine. Here's mine, just so you have another take on how to do some things. Among a few other things, I added checking for so that the guess has to be a

RE: Flag for script

2004-04-15 Thread Guay Jean-Sébastien
Hello Jakob, > I'm trying to create a script with where you can put a flag to the script or > not > fx run it like: > > script -h > or just > script I would use one of the Getopt::* modules, because parsing command line options is something very standard, and as you add more and more options, th

RE: Perl::Optomizer

2004-05-13 Thread Jean-Sébastien Guay
uld get the right page, as I did. J-S ___ Jean-Sébastien Guay [EMAIL PROTECTED] http://whitestar02.webhop.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: any perl project ideas

2004-12-15 Thread Jean-Sébastien Guay
ils. Good luck, J-S -- __ Jean-Sébastien Guay [EMAIL PROTECTED] http://whitestar02.webhop.org/ -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 2004/12/15 -- To u

Re: spaces in filenames on winXX

2005-02-21 Thread Jean-Sébastien Guay
scape sequence.') Or, use slashes instead of backslashes. That works great. Or you can also use a single-quoted string instead of double-quotes, which means Perl won't try to interpolate anything in the string. Once you do that, it will work fine. J-S -- _____

"Misses" in a loop

2006-06-30 Thread Jean-Charles Ripault
mically launched on the target system. I also get logs on the target that prove this. Any idea, the "core" of the script is attached below (some meaningless instruction about local or remote network interfaces activation/configuration/de-activation have been left aside, as well as de

Re: Perl versus other scripting language

2007-03-30 Thread Jean-Rene David
* Rob Dixon [2007.03.30 08:30]: > - You could add Lua to the list. But then remove > it - it's awful. FYI, I have read much harsher comments about perl on the lua mailing list. I ignored them at the time and will do the same here, though I wouldn't mind hearing more substantive criticisms. That i

Re: Beginning to use the stricts and warnings

2007-04-09 Thread Jean-Rene David
* Chas Owens [2007.04.09 11:00]: > > for (my $i = 0; $i < @banks; $i++) > > If you must loop this way at least do it like this: > > for my $i (0 .. $#banks) {} > > But most likely you don't need to loop that way and it is better to > loop this way: > > for my $bank (@banks) {} I've been

rsh hangs when used to launch a perl script.

2002-03-08 Thread Bertrand, Jean-Francois
Hi, I launch a script through rsh (or ssh) and it hangs. The script runs properly, but the rsh never ends. I tried closing STDOUT, STDERR and STDIN, to no avail. Is there a solution to this problem? Jean-François Bertrand -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Looping through lines stored in a scalar

2008-01-01 Thread Jean-Rene David
Hi, I wonder what idioms are available to loop through the lines stored in a scalar variable. I guess I'm looking for something analogous to these idioms for files and arrays respectively: while() { # do stuff } foreach (@array) { # do stuff } When I had to do this I split the scalar in an arra

Re: Looping through lines stored in a scalar

2008-01-03 Thread Jean-Rene David
* Paul Johnson [2008.01.01 22:10]: > The most direct analogy would be to use an > in-memory file: > > open my $fh, "<", \$scalar; > print while <$fh>; Very nice. Thanks. I didn't understand what John and Chas were trying to say until I saw the term "in-memory file". Exactly the kind of stuff I

RE: Died on open command

2003-11-10 Thread Guay Jean-Sébastien
-) So the solution proposed will work fine on Unix, Windows, MacOSX, etc. Just FYI. J-S _ Jean-Sébastien Guay -- Conseiller technique - Administration -- (514) 522-9800 #4840 -- [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Died on open command

2003-11-10 Thread Guay Jean-Sébastien
, it's irrelevant, it works, so let's just use it, regardless of who's to blame (err, thank). J-S _ Jean-Sébastien Guay -- Conseiller technique - Administration -- (514) 522-9800 #4840 -- [EMAIL PROTECTED] -- To unsubscribe,

  1   2   >