Re: insert in perl tk

2012-08-24 Thread Shekar
gt; > > { > > > $c = localtime(); > > > return $c; > > > } > > > > > > so whenever i call insert method , it shud call function gettime > > > and print the latest time in the text box > > > please suggest > > > > > > re

Re: insert in perl tk

2012-08-24 Thread Shlomi Fish
o whenever i call insert method , it shud call function gettime > > and print the latest time in the text box > > please suggest > > > > regards > > irfan > > > > > > > > > > > > > > From: Jim G

Re: insert in perl tk

2012-08-24 Thread Irfan Sayed
thanks. it worked! regards irfan From: Shekar To: Irfan Sayed Cc: Jim Gibson ; Perl Beginners Sent: Friday, August 24, 2012 12:23 PM Subject: Re: insert in perl tk Try this. $t->insert("end", &gettime); -- Shekar On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed

Re: insert in perl tk

2012-08-23 Thread Shekar
$c = localtime(); > return $c; > } > > so whenever i call insert method , it shud call function gettime and print > the latest time in the text box > please suggest > > regards > irfan > > > > > > > From: Jim Gibson >

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
_ From: Jim Gibson To: Perl Beginners Sent: Friday, August 24, 2012 11:13 AM Subject: Re: insert in perl tk On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote: > thanks. this will help to print the contents of array on separate line. > however, if at all we need to ca

Re: insert in perl tk

2012-08-23 Thread Jim Gibson
On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote: > thanks. this will help to print the contents of array on separate line. > however, if at all we need to call function then what is the syntax, how we > can call that ? What function do you want to call? When do you want to call it? What does the

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
Sent: Thursday, August 23, 2012 11:40 PM Subject: Re: insert in perl tk On Thu, 23 Aug 2012 10:51:09 -0700 (PDT) Irfan Sayed wrote: > i need to print the contents of array on separate line , so , i > thought , i should write one function where i will print the contents > of array on

Re: insert in perl tk

2012-08-23 Thread Shawn H Corey
On Thu, 23 Aug 2012 10:51:09 -0700 (PDT) Irfan Sayed wrote: > i need to print the contents of array on separate line , so , i > thought , i should write one function where i will print the contents > of array on each line Do you mean you want each item from an array on each line? If so: $t-

Re: insert in perl tk

2012-08-23 Thread Jim Gibson
On Aug 23, 2012, at 10:51 AM, Irfan Sayed wrote: > it was quite rude. anyway What was quite rude? > lets say if i have to display the contents of array using insert method. > if i just type : $t->insert("end", "@arr1"); > then surely , it will print the contents of array but on the same line

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
ne , so , i thought , i should write one function where i will print the contents of array on each line and call that function from insert method please suggest regards irfan From: John SJ Anderson To: "beginners@perl.org" Sent: Thursday, August 23,

Re: insert in perl tk

2012-08-23 Thread John SJ Anderson
On Thursday, August 23, 2012 at 10:15 AM, Irfan Sayed wrote: > can someone please suggest ? > Explain what you're actually trying to achieve, instead of asking how to do what you think will let you accomplish what you're trying to achieve. Yes, if you write the insert() method properly, you cou

Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
can someone please suggest ? regards irfan From: Irfan Sayed To: "beginners@perl.org" Sent: Thursday, August 23, 2012 4:15 PM Subject: insert in perl tk hi, can we call function in the insert method of perl tk ? i have code like this:  $t->insert("end",

Re: insert

2012-05-08 Thread Uri Guttman
On 05/07/2012 04:47 PM, timothy adigun wrote: sub get_data { my ($file) = @_; my $arr_ref = []; open my $fh, '<', $file or die "can't open this file: $!"; while (<$fh>) { chomp; push @$arr_ref, $_; } close $fh or die "can't close file:$!"; ret

Re: insert

2012-05-07 Thread timothy adigun
On Mon, May 7, 2012 at 11:29 PM, John W. Krahn wrote: > timothy adigun wrote: > >> >> On Mon, May 7, 2012 at 8:36 AM, lina wrote: >> >> I have two files, one with >>> >>> 3 >>> 2 >>> 1 >>> >>> another is: >>> >>> 3 1 >>> 3 2 >>> 6 3 >>> >>> How can I insert the first file into the middle of the

Re: insert

2012-05-07 Thread John W. Krahn
timothy adigun wrote: On Mon, May 7, 2012 at 8:36 AM, lina wrote: I have two files, one with 3 2 1 another is: 3 1 3 2 6 3 How can I insert the first file into the middle of the second file, This is one way to do it: #!/usr/bin/perl use warnings; use strict; my $part1 = get_data(

Re: insert

2012-05-07 Thread timothy adigun
Hi lina On Mon, May 7, 2012 at 8:36 AM, lina wrote: > Hi, > > I have two files, one with > > 3 > 2 > 1 > > another is: > > 3 1 > 3 2 > 6 3 > > How can I insert the first file into the middle of the second file, > This is one way to do it: #!/usr/bin/perl use warnings; use strict; my $part1

Re: insert

2012-05-07 Thread Jim Gibson
On May 7, 2012, at 5:51 AM, lina wrote: > On Mon, May 7, 2012 at 7:52 PM, Shawn H Corey wrote: >> On 12-05-07 03:36 AM, lina wrote: >>> >>> How can I insert the first file into the middle of the second file, >> >> >> What code have you tried so far and please provide the expected output for >

Re: insert

2012-05-07 Thread lina
On Mon, May 7, 2012 at 7:52 PM, Shawn H Corey wrote: > On 12-05-07 03:36 AM, lina wrote: >> >> How can I insert the first file into the middle of the second file, > > > What code have you tried so far and please provide the expected output for > your example. > I can only write some preamble, her

Re: insert

2012-05-07 Thread Shawn H Corey
On 12-05-07 03:36 AM, lina wrote: How can I insert the first file into the middle of the second file, What code have you tried so far and please provide the expected output for your example. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and

Re: insert a . every four characters

2012-03-09 Thread Jim Gibson
At 8:37 PM -0800 3/9/12, Noah wrote: Hi there, I am trying to insert a '.' every four characters. Say I have a $it = '123456789012' and want the result to be '1234.5678.9012' whats one of the smoothest ways to do that? You could adapt the method suggested by 'perldoc -q commas' "How can I

Re: insert a . every four characters

2012-03-09 Thread Owen
> On 3/9/12 8:37 PM, Noah wrote: >> Hi there, >> >> I am trying to insert a '.' every four characters. Say I have a $it >> = >> '123456789012' and want the result to be '1234.5678.9012' >> >> whats one of the smoothest ways to do that? > > > okay I answered my own question. I am wondering if ther

Re: insert a . every four characters

2012-03-09 Thread Noah
On 3/9/12 8:37 PM, Noah wrote: Hi there, I am trying to insert a '.' every four characters. Say I have a $it = '123456789012' and want the result to be '1234.5678.9012' whats one of the smoothest ways to do that? okay I answered my own question. I am wondering if there is a different way?

Re: insert keyword

2008-11-11 Thread Sharan Basappa
>> Hi, >> >> I have a string that has value delimited by space >> e.g. 1 2 10 8 etc. >> >> I need to add a keyword wherever there is a space. >> I wrote a small code to try this out: >> >> $str = "one two three"; >> $str =~ s/\s/x /g; >> >> In this case, I am trying to insert x where there is a spa

Re: insert keyword

2008-11-11 Thread Chas. Owens
On Mon, Nov 10, 2008 at 09:26, Sharan Basappa <[EMAIL PROTECTED]> wrote: > Hi, > > I have a string that has value delimited by space > e.g. 1 2 10 8 etc. > > I need to add a keyword wherever there is a space. > I wrote a small code to try this out: > > $str = "one two three"; > $str =~ s/\s/x /g; >

Re: insert and query a db

2008-01-16 Thread Tri Trinh
On Jan 7, 12:31 am, [EMAIL PROTECTED] wrote: > Hi > I'm trying to write a script that reads the data below, parses it, and > then inserts it into the "info" table. > > 1:Karl Heiz:1:444-555-:441-551-6661:5:1:1:1 > 2:Helmut Schmidt:1:222-333-1234:222-555-4321:2:1:1:1 > 3:Udo Lindenberg:3:111-555

Re: insert and query a db

2008-01-11 Thread Tom Phoenix
On Jan 10, 2008 10:50 PM, <[EMAIL PROTECTED]> wrote: > Only the content of the first 2 fields is displayed: In your shoes, I would check that 'use warnings' and 'use strict' are in place, and other basics, then I'd start debugging at the database. Check out the tracing facility, documented in th

Re: insert and query a db

2008-01-11 Thread bbrecht56
On Jan 7, 1:50 pm, [EMAIL PROTECTED] (John Moon) wrote: > [>>] ... > > Please try (not tested). Placeholders help me a lot: > > my $sth_insert = $dbh->prepare('Insert into info (id, name, grade, > phone, cell, house, car) >values (?,?,?,?,?,?,?)') > or die DBI->errstr;

RE: insert and query a db

2008-01-07 Thread Moon, John
[>>] ... Please try (not tested). Placeholders help me a lot: my $sth_insert = $dbh->prepare('Insert into info (id, name, grade, phone, cell, house, car) values (?,?,?,?,?,?,?)') or die DBI->errstr; while (){ #---# #

Re: Insert value in existing record

2006-05-18 Thread John W. Krahn
Saboo, Nandakishore wrote: > Hi, Hello, > As Tom Phoenix said there are many ways to do it, this is one of the way we > can do it. > > +++ > $string = > "one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|"; > $added = "abc|"; > > @tmp_array = split(/

RE: Insert value in existing record

2006-05-18 Thread Saboo, Nandakishore
Hi, As Tom Phoenix said there are many ways to do it, this is one of the way we can do it. +++ $string = "one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|thirteen|fourteen|"; $added = "abc|"; @tmp_array = split(/\|/,$string,4); for ($i=0;$i<$#tmp_array;$i++) {

Re: Insert value in existing record

2006-05-18 Thread Tom Phoenix
On 5/18/06, Gerald Wheeler <[EMAIL PROTECTED]> wrote: Wondering how I can insert a value: "abc|" There's more than one way to do it. One way would be a substitution (s///). Another would be to use split and join: split the line, do whatever you need to do with the elements, then join the piece

RE: insert data with Perl into multiple MySQL tables

2004-09-17 Thread Bob Showalter
Maxipoint Rep Office wrote: > How insert data with Perl into multiple MySQL tables? You need multiple INSERT statements. Use a transaction if they all need to complete or fail together. I don't use MySQL, so I don't know how transactions work for it specifically, but typically you just use a combi

Re: Insert Var in Regex Problem

2002-07-10 Thread John W. Krahn
Connie Chan wrote: > > > > From: Connie Chan [mailto:[EMAIL PROTECTED]] > > > > > > Say, I have an input $x = "ABCDEF"; > > > and I will try to remove $x from a string, > > > what can I do ? > > > > > > Is there something like : > > > > > > $x =~ s/$x//g; > > Sorry everybody I've make a mist

Re: Insert Var in Regex Problem

2002-07-10 Thread Connie Chan
Sorry everybody I've make a mistake on forgetting to add a /i operator... my problem happens just becasue of case not match Rgds, Connie > > > > > > > -Original Message- > > From: Connie Chan [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, July 10, 2002 3:06 PM > > To: [E

Re: Insert Var in Regex Problem

2002-07-10 Thread George Schlossnagle
That example compiles and works fine (does what you want it to) as is. On Wednesday, July 10, 2002, at 06:26 PM, Connie Chan wrote: > >> It sounds like you want something more like: >> >> $string = "ABCDEFGHIJKLMNOP"; >> $x = "ABCDEF"; >> $string =~ s/$x//g; >> >> Or am I misunderstanding? >> >

Re: Insert Var in Regex Problem

2002-07-10 Thread Connie Chan
> It sounds like you want something more like: > > $string = "ABCDEFGHIJKLMNOP"; > $x = "ABCDEF"; > $string =~ s/$x//g; > > Or am I misunderstanding? > YES!! That's exactly my case haha... sorry didn't telling in clear... (actually, logic error, my sample seem the var kills itself) Please

Re: Insert Var in Regex Problem

2002-07-10 Thread Felix Geerinckx
on Wed, 10 Jul 2002 22:05:58 GMT, Connie Chan wrote: > Say, I have an input $x = "ABCDEF"; > and I will try to remove $x from a string, > what can I do ? > > Is there something like : > > $x =~ s/$x//g; That's just a complicated way to say $x = ''; But this works: #! perl -w u

RE: Insert Var in Regex Problem

2002-07-10 Thread Timothy Johnson
It sounds like you want something more like: $string = "ABCDEFGHIJKLMNOP"; $x = "ABCDEF"; $string =~ s/$x//g; Or am I misunderstanding? -Original Message- From: Connie Chan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 3:06 PM To: [EMAIL PROTECTED] Subject: Insert Var in Re

Re: insert in a browseentry

2002-04-16 Thread John W. Krahn
Jorge Goncalvez wrote: > > Hi, I have this: > > opendir(DIR,"$_Globals{CDROM}:/DHS3MGR/$tel_version/DHS3Linux"); > foreach (readdir(DIR)){ > unless (/([Comm]+)/){ > $box3->insert('end', $_); > } > > $box3 is a browse entry. > It works fine but > > My problem is ther

Re: Insert delimiter between number and alpha

2002-02-07 Thread Jeff 'japhy' Pinyan
On Feb 7, Frank Newland said: >I want to put a delimiter (#) between the rightmost number and the left most >alpha s/(\d)([^\W\d])/$1#$2/; You can't just say (\d)(\w), because \w INCLUDES \d. You could write something like (\d)(?!\d)(\w), which requires that the \w character after the \d NOT

Re: Insert delimiter between number and alpha

2002-02-07 Thread Frank
On Thu, Feb 07, 2002 at 11:27:53AM -0600, Frank wrote: > All, > > My input looks like this > == > 5544#1341343BORIS > 6200#321BOWSER > 89232652#6213VERONICA > === > I want to put a delimiter (#) between the rightmost number and the left most > alpha > Resulting in >

RE: Insert delimiter between number and alpha

2002-02-07 Thread Nikola Janceski
s/(\d)([a-z])/$1#$2/i; that's not a very good way to store women's phone numbers. I like to us a little black book. -Original Message- From: Frank Newland [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 12:28 PM To: [EMAIL PROTECTED] Subject: Insert delimiter between number

Re: Insert text in HTML page...

2001-12-17 Thread William.Ampeh
I hope you do not forget before dumping the contents of the file. -- #!/opt/local/bin/perl $my_file = "aa.txt"; open(IN, $my_file) or die "\n\ncannot open file\n\n"; @aa = ; print < @aa EOF ; __ William Ampeh (x3939) Federal Reser

Re: Insert text in HTML page...

2001-12-17 Thread Agustin Rivera
You can create a template html file, then insert a phrase in the middle that is searched-and-replaced. Such as .. INSERTTEXT Then the perl script would do.. $textfile="file.txt"; open(IN, $textfile) or die $!; while() {$text.=$_;} close(IN); ## then do the same for $htmlfile $htmlfile=~ s/INSER