RE: the Database is not updated

2007-06-21 Thread Andrew Curry
Do you check for the number of rows updated? An update will not throw an error even if no rows are updated, have you tried your values by hand? -Original Message- From: Aruna Goke [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 19:33 To: beginners@perl.org Subject: the Database is not upda

Re: the Database is not updated

2007-06-21 Thread Dr.Ruud
Aruna Goke schreef: Missing: #!/usr/bin/perl use strict; use warnings; > open FH, '<', $fn or die "The File $fn Could not be opened: $! \n"; > while() > { > #split the file into variables It is not about the file but about the (or each) row. Maybe something more like: # each row con

change directory help in perl

2007-06-21 Thread Sayed, Irfan (Irfan)
Hi , I have written following script. Problem with the script is that it is not changing the directory as per the foreach loop and because of that cleartool command is failing. can somebody please help. Here is the script. #!/usr/bin/perl -w @arr = `cleartool lsvob -s`; foreach(@arr) { `cd

Re: Problems with arrays

2007-06-21 Thread [EMAIL PROTECTED]
On 20 Jun., 15:58, [EMAIL PROTECTED] (Andrew Curry) wrote: > You could do it a couple of ways the way I would go about it is > > My(@arr1,@arr2,@arr3); > mol2_read($opts{m},[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]); > > sub mol2_read { > My($opt_m,$arr1,$arr2,$arr3)[EMAIL PROTECTED]; >

Re: change directory help in perl

2007-06-21 Thread Jeff Pang
Sayed, Irfan (Irfan) 写道: Hi , I have written following script. Problem with the script is that it is not changing the directory as per the foreach loop and because of that cleartool command is failing. can somebody please help. Here is the script. #!/usr/bin/perl -w @arr = `cleartool lsvo

read a list of subdirectories

2007-06-21 Thread Luba Pardo
Dear list, I want to parse through some files of a list of directories. Every directory have the same files, which means that I can make a loop and repeat the process for each directory. I managed to write the code to process the files of a single directory but I do not exaclty how to read a list

Re: read a list of subdirectories

2007-06-21 Thread Steve Bertrand
Luba Pardo wrote: > Dear list, > I want to parse through some files of a list of directories. Every > directory > have the same files, which means that I can make a loop and repeat the > process for each directory. I managed to write the code to process the > files > of a single directory but I do

Re: read a list of subdirectories

2007-06-21 Thread John W. Krahn
Luba Pardo wrote: Dear list, Hello, I want to parse through some files of a list of directories. Every directory have the same files, which means that I can make a loop and repeat the process for each directory. I managed to write the code to process the files of a single directory but I do

Re: read a list of subdirectories

2007-06-21 Thread Luba Pardo
hi, Thank you very much for your sugestions. L.Pardo

Re: read a list of subdirectories

2007-06-21 Thread Paul Lalli
On Jun 21, 8:15 am, [EMAIL PROTECTED] (Luba Pardo) wrote: > I want to parse through some files of a list of directories. Every directory > have the same files, which means that I can make a loop and repeat the > process for each directory. I managed to write the code to process the files > of a si

Regarding file handling

2007-06-21 Thread Dharshana Eswaran
Hi All, I am reading a certain data from one file and writing to another file. In the original file, there are few lines, which occur more than once in different lines. When i am writing it to the second file, i don't want it to be written more than once. I mean, it should not be repetitive. The

Re: Regarding file handling

2007-06-21 Thread Paul Lalli
On Jun 21, 9:31 am, [EMAIL PROTECTED] (Dharshana Eswaran) wrote: > Hi All, > > I am reading a certain data from one file and writing to another file. In > the original file, there are few lines, which occur more than once in > different lines. When i am writing it to the second file, i don't want i

Re: Simple Encryption - what function/module could I use?

2007-06-21 Thread oryann9
So you are using the binary ^ to encrypt with XORED together bit by bit? Please explain? thank you. $/etc/skel $ perl -le 'print "hello" ^ "X";' 0=447 $ perl encrypt.plx file2 plaintext: hello encryptedtext: 0=447R decryptedtext: hello Also noticed I could use binary &

Re: Alternatives to highly nested hashes

2007-06-21 Thread Brad Baxter
On Jun 20, 7:33 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > Well, sort of. Objects are simply intelligent data structures - structures > with > code as well as data that know how to perform operations on themselves. Not to put too fine a point on it, but early on when I was learning OOP, I often r

Re: Simple Encryption - what function/module could I use?

2007-06-21 Thread oryann9
ok must of missed it. sorry. Got a little couch potato? Check out fun summer activities for kids. http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz -- To unsubscribe, e

Gtk2::GladeXML and TreeView

2007-06-21 Thread tannhauser
Hello, for a few days i try to get into Glade. So far it looks very interesting and promising to me. But it seems i'm too stupid to understand how GtkTreeView is working. Can someone provide me an easy to understand example or point me to some howto? I've read a few c- and python howtos, none of

writung to file

2007-06-21 Thread Vahid Moghaddasi
Hi all, I wrote the following simple code to sort UNIX's password file, it works fine but I can only display the ouput on the stdout. How can I make it write the output to a file? Thanks, #!/bin/perl -w # use strict; open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!; open(passwdFH, "passwd")

Re: writung to file

2007-06-21 Thread Chas Owens
On 6/21/07, Vahid Moghaddasi <[EMAIL PROTECTED]> wrote: Hi all, I wrote the following simple code to sort UNIX's password file, it works fine but I can only display the ouput on the stdout. How can I make it write the output to a file? Thanks, #!/bin/perl -w # use strict; open(myFILE, '|-','awk'

Re: writung to file

2007-06-21 Thread Vahid Moghaddasi
On 6/21/07, Chas Owens <[EMAIL PROTECTED]> wrote: Well, first you don't use awk inside of Perl. This is about as useful as riding a bike on a bus. Thanks, that worked very well for me. Beside the force of habit, awk was the only way I could get the password file sorted unique and always keep

writing to file

2007-06-21 Thread Vahid
Hi all, I have the following code to sort UNIX's password file, it works fine but can only display on stdout. How can I make it write the output to a file? Thanks, #!/bin/perl -w # use strict; open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!; open(passwdFH, "passwd"); while () { print myFILE

Re: writung to file

2007-06-21 Thread usenet
On Jun 21, 1:10 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > print $out $_ unless $h{(split ':')[0]}++; Just curious - why are you coding around possible duplicates? Can a passwd file have duplicate entries? -- The best way to get a good answer is to ask a good question. David Filmer (ht

Re: writung to file

2007-06-21 Thread yitzle
You can get only the first unique occurance of UID's with a hash. Untested code below. I'm assuming the file has a UID followed by a home path seperated by whitespace. my %data; while(<$fileHandle>) { my($UID, $home) = split /\s/; $data[$UID] = $home if ( ! defined $data[$UID] ); } -- To unsub

still working with utf8

2007-06-21 Thread Tom Allison
OK, I sorted out what the deal is with charsets, Encode, utf8 and other goodies. Now I have something I'm just not sure exactly how it is supposet to operate. I have a string: =?iso-2022-jp?B?Rlc6IBskQjxkJDckNSRHJE8kSiQvJEYzWiQ3JF8kPyQkGyhC?= That is a MIME::Base64 encoded string of iso-202

Re: still working with utf8

2007-06-21 Thread Tom Phoenix
On 6/21/07, Tom Allison <[EMAIL PROTECTED]> wrote: I guess my question is, for CJK languages, should I expect the notion of using a regex like \w+ to pick up entire strings of text instead of discrete words like latin based languages? Once you've enabled what the perlunicode manpage calls "Cha

Re: writung to file

2007-06-21 Thread Vahid Moghaddasi
On 6/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jun 21, 1:10 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > print $out $_ unless $h{(split ':')[0]}++; Just curious - why are you coding around possible duplicates? Can a passwd file have duplicate entries? This is a part of a l

Re: Regarding file handling

2007-06-21 Thread Dharshana Eswaran
On 6/21/07, Paul Lalli <[EMAIL PROTECTED]> wrote: On Jun 21, 9:31 am, [EMAIL PROTECTED] (Dharshana Eswaran) wrote: > Hi All, > > I am reading a certain data from one file and writing to another file. In > the original file, there are few lines, which occur more than once in > different lines. Wh

Re: Gtk2::GladeXML and TreeView

2007-06-21 Thread Daniel Kasak
On Thu, 2007-06-21 at 20:21 +0200, tannhauser wrote: > Hello, > > for a few days i try to get into Glade. So far it looks very interesting > and promising to me. But it seems i'm too stupid to understand how > GtkTreeView is working. > Can someone provide me an easy to understand example or poin

Re: Regarding file handling

2007-06-21 Thread Tom Phoenix
On 6/21/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: I am unable to get the desired result. Its printing all the instances of the block. Please post the smallest self-contained example program which other people can use to see what you're doing, with what data. Ideally, narrow things down

Re: Regarding file handling

2007-06-21 Thread Dharshana Eswaran
Actually my work is from the text file, i need to consider each entry in every structure, and find its data type, to which its typedefed to and then assign the values according to the value of the datatype. For eg: A sample of the text file is shown below: STACK_CC_SS_COMMON_TYPE_REFERENCE_ID_T {

Re: Regarding file handling

2007-06-21 Thread Prabu Ayyappan
Hope this helps you. use strict; use warnings; open my $fh, '<', "infile.txt" or die $!; open my $ofh, '>', "outfile.txt" or die $!; local $/ = "};"; my %printed; my @a = <$fh>; my @b = (); foreach(@a){ if ($_ =~ m/(.*?)\_T\n/){ my $tomatch = $1; my $cnt = grep /$toma

Re: Regarding file handling

2007-06-21 Thread Dharshana Eswaran
My outfile should look like this: STACK_CC_SS_COMMON_TYPE_REFERENCE_PROTOCOL_DIS_T => "UINT8", STACK_CC_SS_COMMON_TYPE_REFERENCE_TRANSACTION_ID_T => "UINT8", STACK_CC_SS_COMMON_TYPE_REFERENCE_TRANSACTION_ID_T => "UINT8", STACK_CC_SS_COMMON_TYPE_CHANNEL_TYPE_T => "UINT8", STACK_CC_SS_C

Re: still working with utf8

2007-06-21 Thread Mumia W.
On 06/21/2007 09:42 PM, Tom Allison wrote: OK, I sorted out what the deal is with charsets, Encode, utf8 and other goodies. Now I have something I'm just not sure exactly how it is supposet to operate. I have a string: =?iso-2022-jp?B?Rlc6IBskQjxkJDckNSRHJE8kSiQvJEYzWiQ3JF8kPyQkGyhC?= That i