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

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: 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

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: 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

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

"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: 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>

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
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;

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: 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 À :

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 :

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: sprintf is now working

2005-05-18 Thread Jean-Sébastien Guay
tf( ... ); or printf( ... ); Damn that TIMTOWTDI! :-) 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/&

Re: Password

2005-04-28 Thread Jean-Sébastien Guay
t that's another topic... :-) HTH, 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.308 / Virus Database: 266.10.4 - Release Date: 2005/04/27 -- To unsubscr

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 -- _____

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

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

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: 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,

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

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   <>

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: 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: 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: 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: 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
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-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-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, > 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Could I put commands in a variable

2004-02-20 Thread Guay Jean-Sébastien
> On Feb 20, 2004, at 2:02 PM, Joel wrote: >> Thanks, can you give me some examples of loops like that? >Here's one: Nice code James, nicely reusable. Just need to add world file loading and maybe support for items... ;) But then all you have is a world in which you can move. What about actual ga

RE: WinXP copy-paste, was RE: A little help please?

2004-02-03 Thread Guay Jean-Sébastien
> Not quite. There seems to be at least one extra step. With XP, you have to > call up a menu and select 'mark' before selecting. I can't recall at the > moment whether you have to do menu selctions to paste at the insertion point. > In 2K, you can select text by dragging. If there is text sele

WinXP copy-paste, was RE: A little help please?

2004-02-02 Thread Guay Jean-Sébastien
> [...] inclding copy-and-paste [though the XP version is > intentionally more of a pain-in-the-ass than the > W2K version, as with almost every professional > aspect of the OS]. Err, not really sure what you mean by this. I have found it's precisely the same in WinXP as in Win2k. Care to expl

RE: Upgrading Perl linux 5.6 rpm to 5.8.2 source

2004-01-14 Thread Guay Jean-Sébastien
te understood the subtleties of... Thanks drieux, __ Jean-Sébastien Guay Conseiller > Service des cartes de débit et guichets > Services électroniques - Direction 499 > Banque Laurentienne du Canada > Tél: 514.522.9800 poste 4840 > Utilisez nos

RE: Upgrading Perl linux 5.6 rpm to 5.8.2 source

2004-01-14 Thread Guay Jean-Sébastien
k that simply upgrading Perl and not all the other modules you have installed would seriously bork the install... Honestly, I didn't know that was just an ActiveState thing. J-S __ Jean-Sébastien Guay Conseiller > Service des cartes de débit e

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

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: Ending a compound statement

2003-12-18 Thread Guay Jean-Sébastien
Hello Kenton, It depends on what you want to do. There is not really a "right way", since the two series of statements you mention will lead to different results. (I added numbers to the different parts of your examples, makes them a bit easier to follow) > if (expression1) { > statement1;

RE: Server Errors

2003-12-15 Thread Guay Jean-Sébastien
> I've got the below script saved on my server - but every time I use it I > get an Internel Server Error! I've set the permission to 755 but still no > luck. Any ideas folks? First of all, make your life easier with use strict; use warnings; right after the shebang line. Second of all, the si

RE: Question for this Group ... dont flame me :)

2003-12-12 Thread Guay Jean-Sébastien
> I don't know if this [specific] module is "standard" > or not, but it was already installed on the servers, > so I am guessing it is. I don't think it is, or at least it wasn't installed by doing a full install of ActiveState Perl 5.8 in my case. Perhaps the "real" Perl distribution differs fr

RE: Question for this Group ... dont flame me :)

2003-12-12 Thread Guay Jean-Sébastien
Hello Jeff, These answers are of course my own experience, but may be significant to understand the bigger picture. I reorder your points a bit in my reply :-) > So, why is it that most of the solutions represented > in this group tend to point to a CPAN module when > the code for it isn't that

RE: Beta Testing a Robot

2003-12-04 Thread Guay Jean-Sébastien
> and may very quickly become > outdated, then the amount of crud someone must wade through if they are > one of the few that actually check the archive first has gone up greatly. You've got a good point there. I didn't see it from that point of view, but now that I do, I agree that this is not re

RE: Beta Testing a Robot

2003-12-04 Thread Guay Jean-Sébastien
> I don't quite understand why the first response is sent back to the list > rather than just the OP though? Why do you send your responses (answers to questions) to the list instead of to the OP? So that others can benefit, and so that it will be in the list archives when someone else has the sam

RE: PPM3 Activestate Perl (and CPAN on Win32)

2003-11-25 Thread Guay Jean-Sébastien
7;t for everyone, because it has some pretty wide-sweeping implications on your machine. Hope that helps! 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: pagination of dbi results on html browser

2003-11-17 Thread Guay Jean-Sébastien
te::Toolkit, etc) will help greatly, with the added benefit of separating code and interface, which will make your Perl/web project easier to maintain. Hope that helps. Good luck, J-S _____ Jean-Sébastien Guay -- Conseiller technique - Administrat

RE: Playing with Numbers

2003-11-10 Thread Guay Jean-Sébastien
my $integer = 432; my $string = sprintf("%05d", $integer); Yay! J-S -Message d'origine- De: SilverFox [mailto:[EMAIL PROTECTED] Date: 10 novembre, 2003 16:14 À: [EMAIL PROTECTED] Objet: Playing with Numbers Hi all, i'm trying to figure out how to test if a number is five digits and if

RE: Died on open command

2003-11-10 Thread Guay Jean-Sébastien
> That's exactly what John said. ;) I realized that 5 seconds after I sent the mail... <:-( -- 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
#x27;t do anything to go against what ends up being a great benefit for us multiplatform Perl coders. :-) J-S _ Jean-Sébastien Guay -- Conseiller technique - Administration -- (514) 522-9800 #4840 -- [EMAIL PROTECTED] -- To unsubscribe, e-mail

RE: Died on open command

2003-11-10 Thread Guay Jean-Sébastien
ouldn't have read so quick... Still, since cmd.exe goes to great lengths to prevent us from using the slash, forcing the backslash onto us, I thank ActiveState for not going the same way. :-) Thanks for rectifying things. J-S _ J

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,

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: 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

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: 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: 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: 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: 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

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: 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

learning...

2002-10-23 Thread Jean-Marie de Crozals
Hi... I'm really new on perl and wanna know if there is a good website with some tutoials and explanations about perl... I just wanna have flexible rename for many files in my shell...(; i'm using macosx10.2.1 thanks... -- Jean-Marie de Crozals -- To unsubscribe, e-mail: [EMAIL

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: 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: 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: 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: 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: 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: 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
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: 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

check process state

2002-09-30 Thread Sylvanie, Jean-Pierre
Hi guys, I want to do a sub that check if a process is sleeping or not... I wrote the following sub, but I was wondering if it was possible to to it without shell calls... Thanks, jp. sub isSleeping{ # get PID of process to check my

Re: how to release memory

2002-09-11 Thread Jean-Luc BEAUDET
Paul Johnson wrote: > On Tue, Sep 10, 2002 at 10:33:34AM -0400, Chad Kellerman wrote: > > > Hello, > >I have a subroutine that declares a variable from standard out. If I > > just undef that variable will that free up the memory that it used? Or > > is there another command that frees up m

RE: How do you put a delay/pause/wait in Perl?

2002-08-13 Thread Sylvanie, Jean-Pierre
this could help : perldoc -f sleep jp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 12:41 PM To: [EMAIL PROTECTED] Subject: How do you put a delay/pause/wait in Perl? I've searched online, but it's difficult when I have no idea

RE: getting STDERR output...

2002-08-09 Thread Sylvanie, Jean-Pierre
Thanks to you all for your answers ! jp. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 08, 2002 6:36 PM To: [EMAIL PROTECTED] Subject: Re: getting STDERR output... Jean-Pierre Sylvanie wrote: > > Hi guys, Hello, > Actually I wa

getting STDERR output...

2002-08-08 Thread Sylvanie, Jean-Pierre
t;; ",@err)."]"); } #... bla bla bla ... # jp. --- Jean-Pierre Sylvanie Microcell Telecom - IT Dev (o_ Assurance des Revenus & Fraudes //\ Revenue Assurance & Fraud v_/

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: > > &

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

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]

Re: open() function

2002-07-22 Thread Jean-Luc BEAUDET
ter some investigations, i found the trick for the idea i had . Treat the file in as i twas a big array, each line would have been a complete record... The great Module Tie::File does the trick for you ! Try it and yu'll love it ! HTH :O) Jean-Luc B. -- To unsubscribe, e-mail: [EMAIL PRO

Pb with deleting lines inside a file...

2002-07-15 Thread Jean-Luc BEAUDET
he selection on, previously. That is keep only date(n-1) and daten refered blocks... So my question is : HOW CAN I DELETE LINES IN A FILE ? Any help welcome; i'm stuck ! Regards. Jean-Luc :O) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

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

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

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,

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

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

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,

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

  1   2   >