Re: subs that return references to hashes and AnyDBM_File

2002-09-01 Thread John W. Krahn
Joseph Jones wrote: > > if I have a subroutine that returns a references to a hash how would I get > that hash in a hash that is tied to a DBM i.e. > > my %h; > my $db_name = "test.dbmx"; > > tie(%h, 'AnyDBM_File', $db_name, O_RDWR|O_CREAT, 0640) >or die("can't create \%h: $!"); > > $temp

Re: finding invalide options in getopt

2002-09-01 Thread Steve Grazzini
Paul Tremblay <[EMAIL PROTECTED]> wrote: > I would like to have my script print a short help message and then > quit if a user uses an invalid option. I am using the Getopt::Long > module. > > Also, I've noticed that some scripts have a trick whereby if a user > types > > scriptname --help > >

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
On Sunday, September 1, 2002, at 02:44 , John W. Krahn wrote: [..] > According to getpwent(3) on my system it just reads from /etc/passwd. I believe we both agree on some of the language of getpwent(3), the vol 3 manual page, and that it asserts: "The functions getpwnam() and getpwuid() sea

subs that return references to hashes and AnyDBM_File

2002-09-01 Thread Joseph Jones
if I have a subroutine that returns a references to a hash how would I get that hash in a hash that is tied to a DBM i.e. my %h; my $db_name = "test.dbmx"; tie(%h, 'AnyDBM_File', $db_name, O_RDWR|O_CREAT, 0640) or die("can't create \%h: $!"); $temp = $nntp->newsgroups(); $temp is a referenc

Re: Skipping the UID above 60000

2002-09-01 Thread John W. Krahn
Drieux wrote: > > On Sunday, September 1, 2002, at 01:53 , John W. Krahn wrote: > [..] > > The only UID that should be above 6 is the user "nobody" whose UID > > is 65534. > > you know and I know - what would be 'reasonable' > and what happens > [..] > > > > while ( my( undef, undef, $ui

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
On Sunday, September 1, 2002, at 01:53 , John W. Krahn wrote: [..] > The only UID that should be above 6 is the user "nobody" whose UID > is 65534. you know and I know - what would be 'reasonable' and what happens [..] > > while ( my( undef, undef, $uid ) = getpwent ) { > $highestuid

Re: Skipping the UID above 60000

2002-09-01 Thread John W. Krahn
Anidil Rajendran wrote: > > Hi Perl Gurus, Hello, > This is a newbie question ofcourse. Since it is not working for me I am asking here. > I am trying to skip UID above 6. The only UID that should be above 6 is the user "nobody" whose UID is 65534. > $passwd = "/etc/passwd"; > $skip

Re: How did perl -d find perldb.pl?

2002-09-01 Thread chris
Did more digging. The registry key that governs both my perl distribution is under HKLM\SOFTWARE\perl (default)c:\perl BinDirc:\perl\bin\perl.exe PERLDB BEGIN {require q } Looks like I will have to muck around with this to switch debuggers. Not nice. On Sun, 1 Sep 2002 13:43:39

finding invalide options in getopt

2002-09-01 Thread Paul Tremblay
I would like to have my script print a short help message and then quit if a user uses an invalid option. I am using the Getopt::Long module. Also, I've noticed that some scripts have a trick whereby if a user types scriptname --help The script prints on the pod. There is a link on perldoc.com

Re: How did perl -d find perldb.pl?

2002-09-01 Thread chris
There must be some other method used. perldb.pl is not in any of the folders listed by @INC and PERL5LIB is not set as an environment variable. Still a mystery. On Sun, 1 Sep 2002 10:14:39 -0700, [EMAIL PROTECTED] (Drieux) wrote: > >On Sunday, September 1, 2002, at 08:37 , chris wrote: >[..] >>

Re: How did perl -d find perldb.pl?

2002-09-01 Thread Dave K
Chris, I have Activestate Perl and perl from a cygwin distribution. I keep the seperate by the calling method. For cgi scripts that is the #!/path/to/the/perl/I_need from the command line /usr/bin/perl or F:/Perl/bin/perl The perl that accessed the debugger has it in it's @INC array as drieux

Re: How did perl -d find perldb.pl?

2002-09-01 Thread drieux
On Sunday, September 1, 2002, at 08:37 , chris wrote: [..] > How did perl -d manage to find perldb.pl? I think the question you are asking is how does perl find modules that are not in the current directory the answer to that is @INC the 'include list' that perl is bu

How did perl -d find perldb.pl?

2002-09-01 Thread chris
I am working with 2 perl distributions on Windows, ActiveState and another 5.6.1 perl on the same computer. I am able to work with one or the another except when debugging. Somehow, perl -d finds perldb.pl when perldb.pl is not in the current folder and not in the system path. The only perl enviro

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
On Sunday, September 1, 2002, at 12:46 , ANIDIL RAJENDRAN wrote: [..] > $passwd = "/etc/passwd"; > $skip = 6; > open(PW,$passwd) or die "Can't open $passwd:$!\n"; > while (){ > @fields = split(/:/); > next if $fields[2] > $skip; > $highestuid = ($highestuid < $fields[2]) ? $fields

Skipping the UID above 60000

2002-09-01 Thread ANIDIL RAJENDRAN
Hi Perl Gurus, This is a newbie question ofcourse. Since it is not working for me I am asking here. I am trying to skip UID above 6. $passwd = "/etc/passwd"; $skip = 6; open(PW,$passwd) or die "Can't open $passwd:$!\n"; while (){ @fields = split(/:/); next if $fields[2] > $skip;