Re: import perl module after edit

2007-08-13 Thread Chas Owens
On 8/13/07, Chris Pax <[EMAIL PROTECTED]> wrote: snip > but I have it so, if you pass it a value like: ./myprog.pl update, it > will update the callbacks file and exit. > otherwise it will run the program. > > what I want to happen is for it to write in the new functions on the > fly while running

Re: import perl module after edit

2007-08-13 Thread Chris Pax
On Aug 13, 5:26 pm, [EMAIL PROTECTED] (Chas Owens) wrote: > On 8/12/07, Chris Pax <[EMAIL PROTECTED]> wrote: > snip> so I tried require and do. > > I guess its best to explain my goal here. I am using perl for gtk > > programming. The main code will use the glade bindings and use a > > separate fil

Re: import perl module after edit

2007-08-13 Thread Chas Owens
On 8/12/07, Chris Pax <[EMAIL PROTECTED]> wrote: snip > so I tried require and do. > I guess its best to explain my goal here. I am using perl for gtk > programming. The main code will use the glade bindings and use a > separate file for call backs. I want to make it so that if a new > callback/fun

Re: import perl module after edit

2007-08-13 Thread Mr. Shawn H. Corey
Chris Pax wrote: so I tried require and do. I guess its best to explain my goal here. I am using perl for gtk programming. The main code will use the glade bindings and use a separate file for call backs. I want to make it so that if a new callback/function is defined in the glade file, that func

Re: import perl module after edit

2007-08-12 Thread Chris Pax
On Aug 12, 12:17 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote: > Paul Lalli wrote: > > On Aug 11, 7:18 pm, [EMAIL PROTECTED] (Chris Pax) wrote: > >> i have two files > > >> ###callbacks.pm### > >> sub foo{ > >> return "foo"; > >> } > > >> sub bar{ > >> return "foo"

Re: import perl module after edit

2007-08-12 Thread Paul Lalli
On Aug 12, 12:17 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote: > Since the use statement comes after the package statement, the subroutines > are add to that package, not the main. The program will work up to the > subroutine moo, which is not defined. I stand corrected. I didn't realize t

Re: import perl module after edit

2007-08-12 Thread Mr. Shawn H. Corey
Paul Lalli wrote: On Aug 11, 7:18 pm, [EMAIL PROTECTED] (Chris Pax) wrote: i have two files ###callbacks.pm### sub foo{ return "foo"; } sub bar{ return "foo"; } 1; # main.pl## #!/usr/bin/perl #PSUDO CODE# #open callbacks.

Re: import perl module after edit

2007-08-12 Thread Paul Lalli
On Aug 11, 7:18 pm, [EMAIL PROTECTED] (Chris Pax) wrote: > i have two files > > ###callbacks.pm### > sub foo{ > return "foo"; > } > > sub bar{ > return "foo"; > } > > 1; > # > > main.pl## > #!/usr/bin/perl > > #PSUDO CODE# > #ope

Re: import perl module after edit

2007-08-12 Thread Jeff Pang
-Original Message- >From: Chris Pax <[EMAIL PROTECTED]> >Sent: Aug 11, 2007 7:18 PM >To: beginners@perl.org >Subject: import perl module after edit > >i have two files > >###callbacks.pm### >sub foo{ > return "foo&q

Re: import perl module after edit

2007-08-12 Thread Mr. Shawn H. Corey
Chris Pax wrote: you see here what i want to happen. what I am doing is writing a new function to the callbacks file, then I want to import the file. the real code fallows the same logic. i tested the read and write stuff, and it works. but when I do it this way, it does not. I had a similar si

import perl module after edit

2007-08-12 Thread Chris Pax
i have two files ###callbacks.pm### sub foo{ return "foo"; } sub bar{ return "foo"; } 1; # main.pl## #!/usr/bin/perl #PSUDO CODE# #open callbacks.pm #remove 1; #write "sub moo{\n\treturn \"moo\";\n}\n" #write "1;" package ma