list-parsing problem

2003-09-18 Thread Marcus Claesson
Hi People, I have a silly little list-parsing problem that I can't get my head around, and I'm sure some of you have come across it before. I have a list like this: 1 a 2 b 2 c 3 a 4 d 4 d 4 e 4 f 5 g and I want to make the first column non-

RE: list-parsing problem

2003-09-18 Thread Stephen Hardisty
Two dimensional hash perhaps? Where the first column is the first dimension and the second is, well, the second. E.g. while() { ($col1, $col2) = split(/$delimeter/, chomp($_)); $blah{$col1}{$col2} = 1; } Hope this helps. _

Re: problems with DBD::mysql

2003-09-18 Thread Ramprasad A Padmanabhan
Erwin Van Kouteren wrote: Hi there, I'm having problems with th einstallation of the module DBD::mysql. When giving the command: perl Makefile.PL the script gives error messages about de mysql_config file. (no such file). Can anyone help me any further on this matter? Thanks, Erwin This

RE: list-parsing problem

2003-09-18 Thread Marcus Claesson
Thanks Michel, I found it! But I just have one question before trying it out. Isn't the key order in a hash randomised, which in this case means I wouldn't get first column in numerical order as I wanted? Marcus On Thu, 2003-09-18 at 10:31, EUROSPACE SZARINDAR wrote: > Hi Marcus > > Just look

RE: list-parsing problem

2003-09-18 Thread Charles K. Clarkson
Marcus Claesson <[EMAIL PROTECTED]> wrote : : I have a silly little list-parsing problem that I can't get : my head around, and I'm sure some of you have come across : it before. : : I have a list like this: : : 1 a : 2 b : 2 c : 3 a : 4 d : 4 d : 4 e : 4 f : 5

RE: list-parsing problem

2003-09-18 Thread Marcus Claesson
Homework's sorted ;)! Thanks a lot Thomas, it worked fine! Marcus On Thu, 2003-09-18 at 10:41, Thomas Bätzler wrote: > Marcus Claesson [mailto:[EMAIL PROTECTED] asked: > > I have a silly little list-parsing problem that I can't get my head > > around, and I'm sure some of you have come across it b

RE: list-parsing problem

2003-09-18 Thread Charles K. Clarkson
Marcus Claesson <[EMAIL PROTECTED]> : : But I just have one question before trying it out. : Isn't the key order in a hash randomised, which in : this case means I wouldn't get first column in : numerical order as I wanted? You didn't state what order in the problem not did you say that the f

Re: list-parsing problem

2003-09-18 Thread Gary Stainburn
On Thursday 18 Sep 2003 10:26 am, Marcus Claesson wrote: > Hi People, > > I have a silly little list-parsing problem that I can't get my head > around, and I'm sure some of you have come across it before. > > I have a list like this: > > 1 a > 2 b > 2 c > 3 a > 4 d > 4 d > 4

Re: Two dimensional associative arrays?

2003-09-18 Thread Jenda Krynicky
From: "Airman" <[EMAIL PROTECTED]> > Is there any special way to do row/col (two dimensional) based > associative arrays? > > Something like: > > $array{1.1}="line one column one"; > $array{1.2}="line one column two"; > > or > > @names(Bob,John,Jeff); > @info=(Age,Zip,Phone); > > $data{Bob.Age

Recursively scanning a directory on Mac OS X for size & Timestap

2003-09-18 Thread Shishir Saxena
Hi, I'm doing the following and the purpose is to genrate a HTML log file. But the script says "Can not apply stat : No such file or directory found" Can someone plz tell me where I'm going wrong ? use File::Find; use File::stat; open (OUT,">./out.html"); $Root = $ARGV[0]; print $Root; my $v

recursively finding file size/timestamp on a Mac / Solaris

2003-09-18 Thread Shishir Saxena
Hi, This is wat I'm doing... but its not working :-( find (\&wanted,"$Root"); print OUT '   '; sub wanted() { if (-d $File::Find::name) { return; } $file = $File::Find::name; $file =~ s/\//\\/g; $st = stat($file); $size = $st->size; $size = ($size/1024)."KB (

assign new letter to drive in Win32?

2003-09-18 Thread Chris McMahon
Hi... I was hoping to use Perl to invoke the MS utility "diskpart" to script some disk management, especially in order to rename drives and partitions. Unfortunately, diskpart is an XP utility-- on Win2K, I can use diskpart to strip the letter from the drive, but attempting to a

Re: assign new letter to drive in Win32?

2003-09-18 Thread Jenda Krynicky
From: Chris McMahon <[EMAIL PROTECTED]> > Hi... > I was hoping to use Perl to invoke the MS utility "diskpart" to > script some disk management, especially in order to rename drives and > partitions. > Unfortunately, diskpart is an XP utility-- on Win2K, I can use > diskpart to strip the lette

DBD:Pg place holder errors

2003-09-18 Thread Johnson, Shaunn
Howdy: I have a script where I connect from Oracle 9 to PostgreSQL 7.2.x and insert new records. It seems to work for about 200 or so records, but, fails (I was able to capture this message) [error] Uncaught exception from user code: Placeholder :0 invalid, placeholders must be >= 1 at /

MIME::LITE question

2003-09-18 Thread Perl
I would like to have a display name present in the FROM field of messages I send. Example: Reporting Agent < [EMAIL PROTECTED] > All the documentation I see involves an SMTP address only. Is there an easy way to do this? --Paul

instance variables?

2003-09-18 Thread Kevin Pfeiffer
Hi all, I stumbled across something called BlueJ which provides a user-friendly graphical environment in which to learn OO-programming, Java-style. I think this is a great "parallel universe" to go along with the Perl Objects book. I started re-writing one of the first exercises as a Perl package

RE: Split based on length

2003-09-18 Thread Bob Showalter
NYIMI Jose (BMB) wrote: > ... > I was thinking about unpack function but how to make it dynamic ? > > I mean writing : > my @items = unpack('A2 A2', $str); > Will work for $str='abdc'; > Not for $str='abcdef'; How about something like: my $s = 'abcdefghij'; my @x; ([EMAIL PROTECTED],$s)

RE: Split based on length

2003-09-18 Thread Bob Showalter
Stephen Hardisty wrote: > > for(split(/(..)/, $string)) { print "*$_" if $_; } > > Gorgeous :o) or, @parts = grep length, split /(..)/, $string; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Net::SSH::Perl

2003-09-18 Thread Gupta, Sharad
Hi All, I remember i read somewhere about some limitations of Net::SSH::Perl on windows systems particularly something about 5.8 but can't find the link now. Can anybody point me to it without much effort.?? Thanx, -Sharad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

RE: instance variables?

2003-09-18 Thread Hanson, Rob
> But I'm wondering if there is another way > (like the Java "private variable") to say > "all class variables declared here are unique > to each instance"? It sounds like you are trying to link how OO-Perl works with OO-Java... and that is only going to make your head spin. What you really need

RE: Problems with CPAN

2003-09-18 Thread Bob Showalter
John Birkhead wrote: > Hi, > I'm a perl newbie and I'm having problems getting CPAN connecting > and downloading on SuSE 8.2. I start with 'perl -MCPAN -e shell' but > the urlist is undefined. The default of 'ftp.perl.org' doesn't work. > > If I 'o conf urlist push > ftp://cpan.nas.nasa.gov/

RE: instance variables?

2003-09-18 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Rob Hanson wrote: >> But I'm wondering if there is another way >> (like the Java "private variable") to say >> "all class variables declared here are unique >> to each instance"? > > It sounds like you are trying to link how OO-Perl works with OO-Java... > and > th

Re: instance variables?

2003-09-18 Thread Rob Dixon
Not quite right Rob :) Rob Hanson wrote: > > > But I'm wondering if there is another way > > (like the Java "private variable") to say > > "all class variables declared here are unique > > to each instance"? > > It sounds like you are trying to link how OO-Perl works with OO-Java... and > that is

RE: Split based on length

2003-09-18 Thread Jeff 'japhy' Pinyan
On Sep 18, Bob Showalter said: >Stephen Hardisty wrote: >> > for(split(/(..)/, $string)) { print "*$_" if $_; } >> >> Gorgeous :o) > >@parts = grep length, split /(..)/, $string; WHY are we using split() for this? Why are we using a method that returns a list twice the size that we want, that we

Single and Double quotes in SQL

2003-09-18 Thread Pablo Fischer
Hi! I need to save some HTML text in a DataBase (MySql, using DBI). However some HTML text will have single and double quotes, so.. how can I save them?, for example: It's so funny Thanks! Pablo -- Pablo Fischer Sandoval (pablo -arroba- pablo.com.mx) http://www.pablo.com.mx http://www.debianmex

Re: Single and Double quotes in SQL

2003-09-18 Thread Oliver Schnarchendorf
On Sat, 20 Sep 2003 21:34:58 +, Pablo Fischer wrote: > I need to save some HTML text in a DataBase (MySql, using DBI). However > some HTML text will have single and double quotes, so.. how can I save > them?, for example: > It's so funny $html_text =~ s/'/''/g; $html_text =~ s/"/""/g; Use the

perl modules in java

2003-09-18 Thread Hari Fajri
Hi All, Is it possible to use module perl modules (let say DBD::Xbase) in java? i'm sorry posting this java question to this perl forum, because no body (able to) answer this question in java forum.

Re: perl modules in java

2003-09-18 Thread simran
Try something like JPL: * http://www.jepstone.net/papers/PerlInside/slide33.html * http://www.jepstone.net/papers/PerlInside/slide34.html the slides are dated 1999 though, which is when i last experimented with it too... i don't know if JPL is supported any more... On Fri, 2003-09-19 at 13:42,

Re: Single and Double quotes in SQL

2003-09-18 Thread simran
It sounds like you are not using placeholders in your SQL. See: http://www.stupidfool.org/perl/docs/perltut/dbi/dbiplace.html for more information... Using placeholders will take care of the correct escaping of characters automatically, and also will save you program becoming a security nightma