Re: Sharing instances of objects between packages

2004-01-05 Thread R. Joseph Newton
Shawn McKinley wrote: > Hello all, > I am wondering if you can have object inherited between > packages when the child packages have their own object > creation without explicitly setting the parent object in > the child? Is there a way to inherit the parent object? > Example below (sorry for t

RE: Sharing instances of objects between packages

2004-01-05 Thread Shawn McKinley
Hello again, Replying to this one since it is the shortest... Thanks for the responses... The illustration, admittedly, was sparse at best master Drieux :-) However, I do want to have independent instances beyond the A.pm. Maybe I am making this too difficult, not sure yet, but I will do some

Re: Net -> SCP - errstr uninitialized

2004-01-05 Thread R. Joseph Newton
Paul Kraus wrote: > Code > > #!/usr/bin/perl > > use strict; > use warnings; > > &dhcpd; > > sub dhcpd { > use Text::DHCPparse; > use Net::SCP qw( scp iscp ); > my $scp = Net::SCP -> new( 'hylafax', 'pkraus' ); Could it be that you are using or die one line too late? Joseph -- To u

Re: Learning Objects, destroy methods

2004-01-05 Thread R. Joseph Newton
Gary Stainburn wrote: > On Monday 05 January 2004 2:09 pm, Dan Anderson wrote: > > > My problem is one of destroying a block (object), making sure that I have > > > no memory leakage. > > > > Out of curiosity, when you say memory leakage do you mean that the > > memory persists after the Perl proc

Re: Getting the total size of a directory

2004-01-05 Thread Randal L. Schwartz
> "Tim" == Tim Johnson <[EMAIL PROTECTED]> writes: Tim> find(sub{ -f and ( $size += -s ) }, $dir ); Beware that -s has only a rough correlation with the actual disk a file takes. You want (stat)[12] for that. The -s number will be far too huge for holey files (blocks aren't allocated), and

Re: help with "user vars qw"

2004-01-05 Thread Randal L. Schwartz
> "Ricardo" == Ricardo Pichler <[EMAIL PROTECTED]> writes: Ricardo> Hi, I'm beginner in the perl world, I having see very files .pl to learn and I have one question... Ricardo> In this script, what do make the parts in bold? Ricardo> #!/usr/bin/perl Ricardo> use strict; Ricardo> $|=0; Ric

Re: Learning Objects, destroy methods

2004-01-05 Thread R. Joseph Newton
"R. Joseph Newton" wrote: Whoops. Forgot the most important function. Inine > Overall, I would suggest that you steer clear of internal references in your > objects when possible. It is much better to make a container class, then delete > contained objects from the container. Generally you wo

Re: Sharing instances of objects between packages

2004-01-05 Thread Randal L. Schwartz
> "Shawn" == Shawn McKinley <[EMAIL PROTECTED]> writes: Shawn> I am wondering if you can have object inherited between Shawn> packages when Objects don't get inherited. Objects inherit methods (subroutines) from other classes (packages). Can you recast your question using terminology tha

Re: Making A Library of Perl Subroutines

2004-01-05 Thread Randal L. Schwartz
> "R" == R Huber <[EMAIL PROTECTED]> writes: R> I am writing several subroutines that I want to make R> available to other programs without directly including R> the code in those programs. Can anyone explain how to R> do this or where to go to find out how to do it. Besides the bits and piec

Re: Learning Objects, destroy methods

2004-01-05 Thread Randal L. Schwartz
> "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: Gary> I create a new track block such: Gary> my $T1=Trainset->track('T1','Block'); Gary> This also created $Trainset::_BLOCKS{T1} which references the object. Gary> My problem is how can I destroy the object when I no longer want it? Y

Re: large directory handling

2004-01-05 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> You could forget about diagnosing the problem and just use Rob> my $n = unlink grep -f, glob '/test/directory/klee*'; Rob> print "$n files deleted\n"; Unless you're running an older Perl, where that'll fire off a shell to do the glob(

Re: deleting a hash ref's contents

2004-01-05 Thread Randal L. Schwartz
> "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: Gary> Now when I wish to DESTROY the hash, I need to free the memory Gary> used by the hash, including the two arrays _Links and _Signals. Gary> Am I right in thinking that the arrays, along with the scalars Gary> will be deleted by the g

Re: Learning Objects, destroy methods

2004-01-05 Thread R. Joseph Newton
Gary Stainburn wrote: > Hi folks, > > My first forrey into Perl objects sees me trying to model a railway. I've got > a hash of named blocks of track, which is added to when I create a new block > object. > > My problem is one of destroying a block (object), making sure that I have no > memory le

Re: Help find info for CPAN update config questions

2004-01-05 Thread J Ingersoll
--- Daniel Staal <[EMAIL PROTECTED]> wrote: > > --As for the rest, it is mine. > > Well, if you are having problems I'd say yes. ;-) > > FTP has issues with firewalls. (The design doesn't work well with > them.) If you are behind a firewall you probably only can do > 'passive' ftp. Eithe

Re: deleting a hash ref's contents

2004-01-05 Thread R. Joseph Newton
James Edward Gray II wrote: > Since we didn't see anything outside of the constructor in the posted > code, I assumed (possibly incorrectly) that $blocks was some form of > class data. I see no problem with setting some class data from the > constructor, if needed. Good point. I'm afraid I enti

Re: passing datastructure from one.pl to other.pl

2004-01-05 Thread drieux
On Jan 5, 2004, at 1:48 PM, Johan Meskens CS3 jmcs3 wrote: [..] i create a datastructure in one.pl and would like to make it travel to other.pl so i can process the datastructure there how do i go about it ? a direction to point me to ? pipe ? module ? [..] the first part of the problem is wheth

Re: Sharing instances of objects between packages

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 6:30 PM, drieux wrote: On Jan 5, 2004, at 2:51 PM, James Edward Gray II wrote: sub new { my $class = shift; my $self = $class->SUPER::new( @_ }; # call class A constructor --^ oopsie should have been a ")" Good catch. Sorry

passing datastructure from one.pl to other.pl

2004-01-05 Thread Johan Meskens CS3 jmcs3
hola i create a datastructure in one.pl and would like to make it travel to other.pl so i can process the datastructure there how do i go about it ? a direction to point me to ? pipe ? module ? i would like to keep the 2 files seperate thanks for your help jmcs3 -- To unsubscribe, e-mai

Re: Sharing instances of objects between packages

2004-01-05 Thread drieux
On Jan 5, 2004, at 2:51 PM, James Edward Gray II wrote: On Jan 5, 2004, at 2:44 PM, Shawn McKinley wrote: Hello all, I am wondering if you can have object inherited between packages when the child packages have their own object creation without explicitly setting the parent object in the child?

Re: Sharing instances of objects between packages

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 2:44 PM, Shawn McKinley wrote: Hello all, I am wondering if you can have object inherited between packages when the child packages have their own object creation without explicitly setting the parent object in the child? Is there a way to inherit the parent object? Example be

Re: help with "user vars qw"

2004-01-05 Thread Daniel Staal
--As off Monday, January 5, 2004 7:20 PM -0300, Ricardo Pichler is alleged to have said: Hi, I'm beginner in the perl world, I having see very files .pl to learn and I have one question... In this script, what do make the parts in bold? Umm, Bold? You sent text/plain. There is no bold. # !/u

Re: help with "user vars qw"

2004-01-05 Thread Rob Dixon
Ricardo Pichler wrote: > > #!/usr/bin/perl > use strict; > $|=0; > use vars qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf > %DBIConf %NetworkConf %IfCfgConf %WIPLConf > %WANInitConf %LANInitConf > %NetworkRemoteConf %WRRRemoteConf

help with "user vars qw"

2004-01-05 Thread Ricardo Pichler
Hi, I'm beginner in the perl world, I having see very files .pl to learn and I have one question... In this script, what do make the parts in bold? #!/usr/bin/perl use strict; $|=0; use vars qw (%WRRConf %DHCPDConf %IPTablesConf %GeneralConf %DBIConf %NetworkConf %IfCfgCon

Re: Sharing instances of objects between packages

2004-01-05 Thread drieux
On Jan 5, 2004, at 12:44 PM, Shawn McKinley wrote: Hello all, I am wondering if you can have object inherited between packages when the child packages have their own object creation without explicitly setting the parent object in the child? Is there a way to inherit the parent object? Example b

Re: Microsoft Services for UNIX/LINUX

2004-01-05 Thread Kevin Old
William, On Mon, 2004-01-05 at 12:32, [EMAIL PROTECTED] wrote: > Are there any tools with the capabilities of (SFU 3.0) that allow users to > transparently run ?[ULi]nix-based applications (say, shell scripts) from a > Windows environment? It's funny you wrote this today at this time, as I had ju

Re: Net -> SCP - errstr uninitialized

2004-01-05 Thread drieux
On Jan 5, 2004, at 12:32 PM, drieux wrote: On Jan 5, 2004, at 10:49 AM, Paul Kraus wrote: Code #!/usr/bin/perl use strict; use warnings; &dhcpd; sub dhcpd { use Text::DHCPparse; use Net::SCP qw( scp iscp ); my $scp = Net::SCP -> new( 'hylafax', 'pkraus' ); $scp -> get ( 'dhcpd.leases

Re: Microsoft Services for UNIX/LINUX

2004-01-05 Thread Dan Anderson
On Mon, 2004-01-05 at 15:03, drieux wrote: > On Jan 5, 2004, at 9:32 AM, <[EMAIL PROTECTED]> wrote: > [..] > > I was wondering if anyone on this list have had any luck with this > > technique of executing UNIX-based applications. One thing that comes > > to > > mind is CGI-scripting, but this is

Sharing instances of objects between packages

2004-01-05 Thread Shawn McKinley
Hello all, I am wondering if you can have object inherited between packages when the child packages have their own object creation without explicitly setting the parent object in the child? Is there a way to inherit the parent object? Example below (sorry for the length). TIA, Shawn A.pm pac

Re: Net -> SCP - errstr uninitialized

2004-01-05 Thread drieux
On Jan 5, 2004, at 10:49 AM, Paul Kraus wrote: Code #!/usr/bin/perl use strict; use warnings; &dhcpd; sub dhcpd { use Text::DHCPparse; use Net::SCP qw( scp iscp ); my $scp = Net::SCP -> new( 'hylafax', 'pkraus' ); $scp -> get ( 'dhcpd.leases' ) or die $scp->{errstr}; print "hello\n

Re: Microsoft Services for UNIX/LINUX

2004-01-05 Thread drieux
On Jan 5, 2004, at 9:32 AM, <[EMAIL PROTECTED]> wrote: [..] I was wondering if anyone on this list have had any luck with this technique of executing UNIX-based applications. One thing that comes to mind is CGI-scripting, but this is not an option for me. [..] I agree with Tim that essentially y

Re: Off Topic: Active Perl Native Windows / cygwin perl

2004-01-05 Thread Jenda Krynicky
From: "Paul Kraus" <[EMAIL PROTECTED]> > I have both activestate windows native perl installed and the default > cygwin perl. > > How can I have the cygwin shell use the windows perl rather then the > cygwin compiled perl? Most probably you just have to change the PATH system variable. jenda ===

Net -> SCP - errstr uninitialized

2004-01-05 Thread Paul Kraus
Code #!/usr/bin/perl use strict; use warnings; &dhcpd; sub dhcpd { use Text::DHCPparse; use Net::SCP qw( scp iscp ); my $scp = Net::SCP -> new( 'hylafax', 'pkraus' ); $scp -> get ( 'dhcpd.leases' ) or die $scp->{errstr}; print "hello\n"; } Error - Use of uninitilazed value in

Off Topic: Active Perl Native Windows / cygwin perl

2004-01-05 Thread Paul Kraus
I have both activestate windows native perl installed and the default cygwin perl. How can I have the cygwin shell use the windows perl rather then the cygwin compiled perl? Paul Kraus --- PEL Supply Company Network Administrator --- 800 321-1264 Toll

Re: Learning Objects, destroy methods

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > On Monday 05 January 2004 3:12 pm, Rob Dixon wrote: > > Gary Stainburn wrote: > [snip] > > > sufficient, or will this still tie up memory? Is there a better way? > > > > Hi Gary. > > > > We really need to see your 'delete' and 'DESTROY' methods. But you can get > > aroun

Re: Microsoft Services for UNIX/LINUX

2004-01-05 Thread Jenda Krynicky
From: <[EMAIL PROTECTED]> > My current working environment consists of Windows-XP boxes and Sun > Servers. Users first log on through an Windows-XP terminal, and are > then granted access to UNIX services through putty-eXceed. Once > connected through eXceed, they run applications either through

Re: deleting a hash ref's contents

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 10:11 AM, Rob Dixon wrote: James Edward Gray II wrote: On Jan 5, 2004, at 9:24 AM, R. Joseph Newton wrote: Gary Stainburn wrote: sub new { my $this=shift;# allow for CLASS->new() my $class=ref($this) || $this; # or $obj->new(); The docs that suggested this

RE: Microsoft Services for UNIX/LINUX

2004-01-05 Thread Tim Johnson
This is not really a Perl question, but I would say that your chances of running UNIX apps directly off of a UNIX share are pretty slim. As for the X-Windows, Xmanager from NetSarang works pretty well. You can run X-Windows based applications from Windows. -Original Message- From: [EMA

Microsoft Services for UNIX/LINUX

2004-01-05 Thread William.Ampeh
Hello, The start of another year means new projects and hence more questions. Are there any tools with the capabilities of (SFU 3.0) that allow users to transparently run ?[ULi]nix-based applications (say, shell scripts) from a Windows environment? My current working environment consists of

Re: Learning Objects, destroy methods

2004-01-05 Thread Gary Stainburn
On Monday 05 January 2004 3:12 pm, Rob Dixon wrote: > Gary Stainburn wrote: [snip] > > sufficient, or will this still tie up memory? Is there a better way? > > Hi Gary. > > We really need to see your 'delete' and 'DESTROY' methods. But you can get > around the problem by setting $T1 to anything th

Re: Learning Objects, destroy methods

2004-01-05 Thread Gary Stainburn
On Monday 05 January 2004 2:09 pm, Dan Anderson wrote: > > My problem is one of destroying a block (object), making sure that I have > > no memory leakage. > > Out of curiosity, when you say memory leakage do you mean that the > memory persists after the Perl process exits, or just while it is > ru

Weekly list FAQ posting

2004-01-05 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

Re: deleting a hash ref's contents

2004-01-05 Thread Steve Grazzini
On Jan 5, 2004, at 10:44 AM, James Edward Gray II wrote: DESTROY() is the traditionally accepted place to do something like break a circular reference Bzzzt! :-) DESTROY can't be called *until* the circular reference is broken (or the script exits and everything gets destroyed, regardless of refc

Re: deleting a hash ref's contents

2004-01-05 Thread Rob Dixon
James Edward Gray II wrote: > > On Jan 5, 2004, at 9:24 AM, R. Joseph Newton wrote: > > > Gary Stainburn wrote: > > > >> sub new { > >> my $this=shift;# allow for CLASS->new() > >> my $class=ref($this) || $this; # or $obj->new(); > > > > The docs that suggested this are in the p

Re: deleting a hash ref's contents

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 9:24 AM, R. Joseph Newton wrote: Gary Stainburn wrote: sub new { my $this=shift;# allow for CLASS->new() my $class=ref($this) || $this; # or $obj->new(); The docs that suggested this are in the process of being deprecated. It is not a good idea to have obj

Re: deleting a hash ref's contents

2004-01-05 Thread R. Joseph Newton
Gary Stainburn wrote: > Hi folks, > > I'm working for the first time with object, my $self being a ref to an > anonymous hash, i.e. Couple not so good things here. > > > sub new { > my $this=shift;# allow for CLASS->new() > my $class=ref($this) || $this; # or $obj->new(); Th

Re: Learning Objects, destroy methods

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > My first forrey into Perl objects sees me trying to model a railway. I've got > a hash of named blocks of track, which is added to when I create a new block > object. > > My problem is one of destroying a block (object), making sure that I have no > memory leakage. > > I

Re: deleting a hash ref's contents

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > > Gary Stainburn wrote: > > > I'm working for the first time with object, my $self being a ref to an > > > anonymous hash, i.e. > [snip] > > > Now when I wish to DESTROY the hash, I need to free the memory used by > > > the hash, including the two arrays _Links and _Signal

Re: large directory handling

2004-01-05 Thread Charles Harvey
The code below works. Thanks for the pointers on the unless loop, haven't used that before. It appears that the limitation I was running into was only on my Mac perl config; the code works fine under linux. #!/usr/bin/perl -w #open directory and load contents into hash use strict; my $dir="/te

Re: large directory handling

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 2:23 AM, [EMAIL PROTECTED] wrote: I tried explicitly declaring DIR as an array, but I guess handles don't do that. How do I load all of the directory into an array, or more specifically why am I only getting half? #!/usr/bin/perl use strict; use warnings; my $dir = shift; #

RE: Squid Log Parser

2004-01-05 Thread Paul Kraus
Never mind Text-DHCPparse. Paul Kraus --- PEL Supply Company Network Administrator > -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED] > Sent: Monday, January 05, 2004 8:59 AM > To: [EMAIL PROTECTED] > Subject: Squid Log Parser > > For kicks I am try

Re: Learning Objects, destroy methods

2004-01-05 Thread Dan Anderson
> My problem is one of destroying a block (object), making sure that I have no > memory leakage. Out of curiosity, when you say memory leakage do you mean that the memory persists after the Perl process exits, or just while it is running? And have you verified this? And, is the program a daemon

Learning Objects, destroy methods

2004-01-05 Thread Gary Stainburn
Hi folks, My first forrey into Perl objects sees me trying to model a railway. I've got a hash of named blocks of track, which is added to when I create a new block object. My problem is one of destroying a block (object), making sure that I have no memory leakage. I create a new track block

Squid Log Parser

2004-01-05 Thread Paul Kraus
For kicks I am trying to write a squid log parser. The access.log file is the easy part. I am having trouble with translating the ip information in the dhcpd.leases file. The way I see it I will need to read the file backwards. Analyzing each lease block and skipping lease blocks which I have alrea

Re: deleting a hash ref's contents

2004-01-05 Thread Gary Stainburn
On Monday 05 January 2004 1:37 pm, Rob Dixon wrote: > Gary Stainburn wrote: > > I'm working for the first time with object, my $self being a ref to an > > anonymous hash, i.e. [snip] > > Now when I wish to DESTROY the hash, I need to free the memory used by > > the hash, including the two arrays _L

Re: deleting a hash ref's contents

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > I'm working for the first time with object, my $self being a ref to an > anonymous hash, i.e. > > sub new { > my $this=shift;# allow for CLASS->new() > my $class=ref($this) || $this; # or $obj->new(); > my ($name,$type)[EMAIL PROTECTED]; > my $self=

Re: deleting a hash ref's contents

2004-01-05 Thread Dan Anderson
IIRC, Perl's garbage collection system sits in the background waiting until it finds a chunk of memory not referenced by any variable and then deletes it. So references to anything keep the memory connected to the reference in play until either Perl dies or there are no variables which con

deleting a hash ref's contents

2004-01-05 Thread Gary Stainburn
Hi folks, I'm working for the first time with object, my $self being a ref to an anonymous hash, i.e. sub new { my $this=shift;# allow for CLASS->new() my $class=ref($this) || $this; # or $obj->new(); my ($name,$type)[EMAIL PROTECTED]; my $self={}; bless $self,$class;

Which is better: GTK or TK

2004-01-05 Thread Dan Anderson
I am trying to extend my perl skills to the point of being able to create programs with GUIs. I found a tutorial to both GTK and TK -- but the TK tutorial did in one line what the GTK tutorial did in many. I was wondering what the pros and cons of TK and GTK were, and whether GTK involves signifi

Re: large directory handling

2004-01-05 Thread Rob Dixon
Charles Harvey wrote: > > I have a Mac client that is grabbing pictures and writing them > to a netatalk share, and the files prefix with klee and then are > one-up serialized (not my design, I just do networking). The PC > client grabs the images via samba share and displays them. This > is par

Re: change last twp digits

2004-01-05 Thread Rob Dixon
Asif Iqbal wrote: > > I am trying to relace any 7 digit number to to a new 7 digit number of > which last two digits are 9 > > lets pick a random 7 digit number as 1347236. > > so I want 1347236 --> 1347299 using perl > > I can do it with sed > > NUMBER=1347236 > NUMBER=`echo $NUMBER | sed 's/\([0-

RE: large directory handling

2004-01-05 Thread soops
> That looks very, very wrong. You're binding a scalar to > something other than a regular expression. Tell us what you > are attempting to do here. > > HTH, > > Charles K. Clarkson yeah, I agree. Here is the scenario: I have a Mac client that is grabbing pictures and writing them to a ne

Re: large directory handling

2004-01-05 Thread soops
On Jan 05 12:13, Ramprasad A Padmanabhan <[EMAIL PROTECTED]> wrote: > > > But why do you want to do it in perl ( why not rm -f $dir/* $dir/.* ) > , If you are removing all the 4000 files everytime it might make sense > to remove the entire directory and recreate it. > > > Ram > That is what

Re: change last twp digits

2004-01-05 Thread Asif Iqbal
Asif Iqbal wrote: > Hi All > > I am trying to relace any 7 digit number to to a new 7 digit number of > which last two digits are 9 > > lets pick a random 7 digit number as 1347236. > > so I want 1347236 --> 1347299 using perl > > I can do it with sed > > NUMBER=1347236 > NUMBER=`echo $NUMBER

Re: Getting the total size of a directory

2004-01-05 Thread Rus Foster
On Sun, 4 Jan 2004 [EMAIL PROTECTED] wrote: > I'm running out of web space and want to write a script that tell me the size > of certain directories so I can see where the hog is. > > Can anyone give me some quick code? A shell script might be even faster with du -s /tmp | sort -n Rus -- e: [E

change last twp digits

2004-01-05 Thread Asif Iqbal
Hi All I am trying to relace any 7 digit number to to a new 7 digit number of which last two digits are 9 lets pick a random 7 digit number as 1347236. so I want 1347236 --> 1347299 using perl I can do it with sed NUMBER=1347236 NUMBER=`echo $NUMBER | sed 's/\([0-9]\{5\}\)[0-9]\{2\}/\199/'` s