[11135] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4735 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 24 09:07:11 1999

Date: Sun, 24 Jan 99 06:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 24 Jan 1999     Volume: 8 Number: 4735

Today's topics:
    Re: ********* BEST GIRLS ******* (FirstAGYG)
        a beginner's question: about making a chatroom <you@know.that>
    Re: A question about filehandle <newsposter@cthulhu.demon.nl>
    Re: A question about filehandle <tumtum73@yahoo.com>
    Re: CGI.pm and Redirection question <ebohlman@netcom.com>
        Do you know a good Perl debugger free ? <jean@spirituel.com>
        GOT IT; Re: need Fcntl.pm and SDBM_File. Where to get i <karl@nospamaddYproline.at>
    Re: HELP WANTED: Appending a text file. (Sales Dept.)
    Re: help!?: how to a convert a sting ( "10" ) into a va <ljz@asfast.com>
    Re: help!?: how to a convert a sting ( "10" ) into a va (Matthew Bafford)
        Help:Scripts/perl dvar@dvar.com
        how do I insert this in my HTML code? <emulovNOSPAM@sin.khk.be>
    Re: how do I insert this in my HTML code? (Alastair)
    Re: How do I split this string? <mds-resource@mediaone.net>
    Re: How do I split this string? ptimmins@netserv.unmc.edu
    Re: How long would the Unixes last without Perl? <dgris@moiraine.dimensional.com>
        How to insert newline break into a long string (Abraham Grief)
        Interested in maintaining the Perl page of the Cetus Li <manfred.schneider@rhein-neckar.de>
        Loop + rand (Cim)
    Re: Matching Numbers from a string. scott.craig@moh.hnet.bc.ca
    Re: Missing lines. (Andre L.)
    Re: need Fcntl.pm and SDBM_File. Where to get it? <karl@nospamaddYproline.at>
    Re: Perl  & IIS problem <Martin.Bodenstedt@talknet.de>
    Re: Perl For Dummys (FirstAGYG)
    Re: PostgreSQL - query attribute types? (David M. Cook)
        Problem with dbm hash (Steve)
    Re: Running CGI Progs. (FirstAGYG)
    Re: uncuddled elses (Andre L.)
    Re: uncuddled elses <staffan@ngb.se>
        using search pattern <brettr@beci.net>
    Re: using search pattern <ebohlman@netcom.com>
        Why range (..) operator *not* decrement ??? <mds-resource@mediaone.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 24 Jan 1999 05:36:46 GMT
From: firstagyg@aol.com (FirstAGYG)
Subject: Re: ********* BEST GIRLS *******
Message-Id: <19990124003646.19995.00001976@ng-ft1.aol.com>

Do these "Best babes" do any perl programming?

John


------------------------------

Date: Sun, 24 Jan 1999 16:27:09 +0800
From: "unknown" <you@know.that>
Subject: a beginner's question: about making a chatroom
Message-Id: <78elo2$eik$1@imsp009a.netvigator.com>

i've visited some chatrooms. they seem to poll all clients  enter the
chatroom to execute the server-side perl script to refresh the content
displayed, how to do this?




------------------------------

Date: Sun, 24 Jan 1999 03:05:11 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: A question about filehandle
Message-Id: <36AAD436.7177B756@cthulhu.demon.nl>

Zhengdong Zhang wrote:
> 
>          open(IN, "$in") || die "$!";

> My current working directory is /zzhang. When I run the program I enter
> /zzhang/data/a at the prompt. I get an error message like "No such
> file." Is it possible to specify the directory of a file at run time
> when open a filehandle?

$in may not contain what you think it does. Try
   open(IN, $in) || die "Could not open <$in>: $!";

And ofcourse, check that the path is actually valid/readable etc.
(Does 'cat /zzhang/data/a' work ?

Erik
-- 
Sure, doesn't everyone sign up for internet service so as to have
their mailbox stuffed with megabytes of postage-due rubbish every day?
Absolutely.  And everyone who owns a car intends that it be used as a
portable dumpster.  Any unwanted garbage in their vehicle they can
simply throw away, after all.


------------------------------

Date: Sun, 24 Jan 1999 22:23:34 -0600
From: "Stephen Correia" <tumtum73@yahoo.com>
Subject: Re: A question about filehandle
Message-Id: <78f742$dhe$1@news1.marinemwr.or.jp>

Zhengdong Zhang wrote in message <36A8C722.32D7@bayou.uh.edu>...
>Hello everyone.
>I have a question about how to open a filehandle associated with a file
>in a directory other than the current working directory.
>I can specify the directory in the "open" function, like so:
>         open(FILE_A, "/zzhang/data/a") || die "$!";
>But if I use the following code and input the name(including the path)
>of a file in a directory other than the current working directory, I
>will get an error message.
>         print "Enter the filename: ";
>         $in = <STDIN>;
>         chomp $in;
>         open(IN, "$in") || die "$!";
>My current working directory is /zzhang. When I run the program I enter
>/zzhang/data/a at the prompt. I get an error message like "No such
>file." Is it possible to specify the directory of a file at run time
>when open a filehandle?
>
>Thanks,
>Z.Zhang

Use variables!  Don't specify a file and path at runtime.   Load that file
into a variable once in the beginning of the program and make your life much
easier.

Steve




------------------------------

Date: Sun, 24 Jan 1999 07:26:51 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: CGI.pm and Redirection question
Message-Id: <ebohlmanF61zCr.6wK@netcom.com>

Steve Miles <nsurfer@bellsouth.net> wrote:
: In my script, I've used the CGI.pm module and have this at the beginning
: of my script:
: use CGI qw (:standard);
: $query = new CGI;
: print header;

This causes CGI.pm to send out some header information telling it that 
it's about to receive an HTML document.

: Then, in one of the subroutines I'm using later on I want to redirect
: the user so I put this:
: print $query->redirect(-location=>'http://www.yahoo.com');
: exit;

This sends out some header information that, if it were the *first* thing 
the browser got, would tell it to redirect itself.  But since the browser 
was told that it was about to get an HTML document, it interprets the 
header as being part of the document and displays it.

The solution is not to invoke CGI.pm's header method until you know for 
sure that you're going to be sending out some HTML.  Do it right before 
sending the HTML, rather than at the beginning of the program.



------------------------------

Date: 24 Jan 1999 13:31:59 GMT
From: Jean Carfantan <jean@spirituel.com>
Subject: Do you know a good Perl debugger free ?
Message-Id: <78f7cf$idu$1@front3.grolier.fr>

Do you know a good Perl debugger free ?
Thank you
Jean Carfantan




------------------------------

Date: Sun, 24 Jan 1999 11:12:54 +0100
From: "Karl" <karl@nospamaddYproline.at>
Subject: GOT IT; Re: need Fcntl.pm and SDBM_File. Where to get it?
Message-Id: <78ermj$q03$1@fleetstreet.Austria.EU.net>

thanks for the tip. found it in the standard distribution. still looking for
the error why perl doesn4t find them.

best regards,

karl


Karl schrieb in Nachricht <78eoof$onr$1@fleetstreet.Austria.EU.net>...
>i use Perl 5.005_02 on FreeBSD 2.2.7
>
>
>best regards,
>
>karl
>
>M.J.T. Guy schrieb in Nachricht <78dnft$69v$1@pegasus.csx.cam.ac.uk>...
>>Karl <karl@nospamaddYproline.at> wrote:
>>>I got a script with an application witch needs:
>>>
>>>use Fvntl qw(:flock);
>>>use SDBM_File;
>>>
>>>or alternativly Fcntl.
>>>
>>>Tried on CPAN, but only found directories and no moduls inside. any ideas
>>>are greatly appreziated.
>>
>>Both Fcntl.pm and SDBM_File.pm are part of the standard distribution.
>>I deduce that your Perl is either out-of-date or incorrectly installed.
>>
>>But since you provide no version information, I'm only guessing.
>>
>>
>>Mike Guy
>
>




------------------------------

Date: Sun, 24 Jan 1999 10:33:55 GMT
From: networks@skynet.co.uk (Sales Dept.)
Subject: Re: HELP WANTED: Appending a text file.
Message-Id: <36aaf6cf.394765@news.skynet.co.uk>

I'd like to thank everyone who has replied - THANKS


------------------------------

Date: 24 Jan 1999 07:10:15 -0500
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: help!?: how to a convert a sting ( "10" ) into a value ( 10 )
Message-Id: <ltzp78an2w.fsf@asfast.com>

[ Note:  `comp.lang.perl' has been superseded by `comp.lang.perl.misc'
          for several years now.  Followups set accordingly. ]

"Julian Kuiters" <j.kuiters@bigpond.com(nospam)> writes:

> Can some one tell me how the hell you convert a string to a value?
> 
> eg: 
> the string: $age = "10" 
> and string: $since = "2"
> then if you do: $now = $age + $since
> $now = "102"
> 
> what I want it to do is to make $now = 12 (as a number, not a string)

???  You will not get "102" as a result of the operations you outlined
above.  It doesn't appear as if you tried the code you're asking about,
for if you did, you'd get your desired answer of 12 as the result.  Try
this:

  $age = "10";
  $since = "2";
  $now = $age + $since;
  print "now == $now\n";

You should see the following result:

  now == 12


Perl's values are generally interpreted as either strings or numbers,
depending on the context.  If you use a value in a string context,
it will be handled as a string ... in a numeric context, it will be
handled as a number.

In Perl, `+' is the addition operator, which means that its operands
are interpreted as numbers whenever possible.  On the other hand, `.'
is the operator for string concatenation, which means that it will
interpret its operands as strings.  Contrast the following code
fragment with the one above:

  $age = 10;
  $since = 2;
  $now = $age . $since;     # uses string concatenation
  print "$now == $now\n";

This is what you'll see:

  now == 102

I hope that this helps.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -le '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x"'


------------------------------

Date: Sun, 24 Jan 1999 13:56:38 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: help!?: how to a convert a sting ( "10" ) into a value ( 10 )
Message-Id: <slrn7am9e8.h4.dragons@Server.Network>

On Sat, 23 Jan 1999 19:22:26 -0800,
in article <<Pine.LNX.4.05.9901231920170.24096-100000@hill.ucr.edu>>,
Abraham Grief <abey@hill.ucr.edu> wrote:
=> 
=> You could just initialize with integers, like $age = 10, but if it's
=> already a string, just use int($age) to turn it into an integer value.

Wrong.

It works, but it is useless.
 
=> On 24 Jan 1999, Julian Kuiters wrote:
=> > the string: $age = "10" 
=> > and string: $since = "2"
=> > then if you do: $now = $age + $since
=> > $now = "102"

Are you so sure?

Perhaps you should try running your code before you tell us what it does.

Especially when you are still learning the ins and outs of Perl.

=> > Thanx!

HTHz!

=> > Julian Kuiters

--Matthew
-- 
comp.lang.perl is dead...  Try comp.lang.perl.moderated and
comp.lang.perl.misc for a much better chance at getting
answers to your questions.


------------------------------

Date: Sun, 24 Jan 1999 09:15:26 +0100
From: dvar@dvar.com
Subject: Help:Scripts/perl
Message-Id: <36AAD69E.6D4F@dvar.com>

Hi all,

WHo can give me info on where I can find a good working scripts for an
automatic advertising website.(Or help me out with one) At the moment
I'm doing that manually and that eats my time...it can be easier!

What the perl/scripts must produce:

A code to each visitor who wants to place an AD. With this code can the
respective visitor changes or removes their ad/ads. The placed ads must
be automatically removed after, let's say, about 10 days.
Of course, the editor must be in a position to delete unwanted ads.

Thanking you in anticipation.
http://www.dvar.com
PS: Please reply to my email address for I don't come here very often.


------------------------------

Date: Sun, 24 Jan 1999 12:44:50 +0100
From: "Emulov" <emulovNOSPAM@sin.khk.be>
Subject: how do I insert this in my HTML code?
Message-Id: <78f0vq$f7g$1@nickel.uunet.be>

Hi,

I am just starting with CGI and Perl, and have this little question:

Let's say I have a simple CGI script that just displays a line of
text, or a counter or something. I want this line to be displayed on a
 .htm page. Which code do I put in my HTML code to achieve this?

Thanx for any useful help...

--
Emulov<emulov@sin.khk.be>
the C/C++ base:
 http://www.sin.khk.be/~emulov/progr_section/c_and_cpp/index.htm
the Programming Section:
 http://www.sin.khk.be/~emulov/progr_section/
--





------------------------------

Date: Sun, 24 Jan 1999 12:57:58 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: how do I insert this in my HTML code?
Message-Id: <slrn7am687.5r.alastair@calliope.demon.co.uk>

Emulov <emulovNOSPAM@sin.khk.be> wrote:
>Hi,
>
>I am just starting with CGI and Perl, and have this little question:
>
>Let's say I have a simple CGI script that just displays a line of
>text, or a counter or something. I want this line to be displayed on a
>.htm page. Which code do I put in my HTML code to achieve this?

This is not the appropriate newsgroup for this question. Look for 'server side
includes' (SSI) and, if you have problems, ask in a CGI group e.g.

comp.infosystems.www.authoring.cgi

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


------------------------------

Date: Sun, 24 Jan 1999 00:58:18 -0600
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Re: How do I split this string?
Message-Id: <36AAC48A.C20D1DC2@mediaone.net>

What about:

my $string = 'inet addr:192.168.0.1  Bcast:192.168.0.255 
Mask:255.255.255.0';
my @ip = $string =~ /[\d.]*/g;
for (@ip) {
	next if /^$/;
	print $_, "\n";
}
# OR ???
$string =~ s/[^\d.:]*//g;
my ($IP, $BC, $MASK) = (split /:/, $string)[-3,-2,-1];
print "IP => $IP ; BC => $BC ; MASK => $MASK\n";

What do you think?

Ken Williams wrote:
> 
> inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
> 
> The above is from ifconfig.  I need to pull the IP's out.  Specifically the
> first.  How do I split with a starting character of : and an ending character
> of space?
> 
> For example:
> 
> ($IP, $BC, $MASK) = split (/: ??? /);

-- 

Best Regards,

mds
mds resource
888.250.3987

"Dare to fix things before they break . . . "

"Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . . "


------------------------------

Date: Sun, 24 Jan 1999 09:39:56 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: How do I split this string?
Message-Id: <78eppc$fdv$1@nnrp1.dejanews.com>

In article <36aaa246.0@news.cgocable.net>,
  tekkin@hotmail.com (Ken Williams) wrote:

> inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
>
> The above is from ifconfig.  I need to pull the IP's out.  Specifically the
> first.  How do I split with a starting character of : and an ending character
> of space?
>
> For example:
>
> ($IP, $BC, $MASK) = split (/: ??? /);
>
> Anyone?

Don't split ... regex:

$_ = "inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0";
($IP, $BC, $MASK) = /inet addr:(.*)\s*Bcast:(.*)\s*Mask:(.*)\s*/;

Patrick Timmins
$monger{Omaha}[0]

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: 23 Jan 1999 22:53:43 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: How long would the Unixes last without Perl?
Message-Id: <m3k8ydqkrc.fsf@moiraine.dimensional.com>

Kent Perrier <kperrier@blkbox.com> writes:

>                                            I don't consider RedHat a 
> commercial unix.

Ummmmm.... so is it not unix, or not commercial?

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: Sat, 23 Jan 1999 22:19:46 -0800
From: abey@cs.ucr.edu (Abraham Grief)
Subject: How to insert newline break into a long string
Message-Id: <RXyq2.5513$IJ3.45316927@WReNphoon2>

Try adding this:
$content =~ s/(.{0,70}) /$1\n/g;
Adjust the 70 to however long you want the maximum length of a line to be,
provided
that there are no words longer than the length of the line.

Hi everyone,

     I have a very long string say 1000 characters called $content. If I
want send it to a friend like:

     print <<Mail;

     $content

     Mail

     It will be a very long line in the message. I want to insert newline
break into this long string at
     certain interval. Could you give me a hint ?

     Thanks,

     Sun



*** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ***


------------------------------

Date: Sun, 24 Jan 1999 09:26:41 +0100
From: Manfred Schneider <manfred.schneider@rhein-neckar.de>
Subject: Interested in maintaining the Perl page of the Cetus Links ?
Message-Id: <36AAD941.518854C0@rhein-neckar.de>

Hi,

the Cetus Links (http://www.cetus-links.org/) are a collection of 
pointers to various information about Object-Orientation and 
Component-Orientation. 

The web site contains 13,000+ links and 60+ page. During '98 the site was 
visited more than 500,000 times. The collection is developed and maintained 
by a team (http://www.cetus-links.org/team.html) of several people from 
different countries.

To enhance and to improve the site we are currently looking for someone
who would like to take over the page

   Perl   (http://www.cetus-links.org/oo_perl.html)
   
If you are interested to join the Cetus Team and to maintain and 
enhance this page for a longer period of time please let me know.

The Cetus Team welcomes your help and support very much.

Cheers, Manfred

+-------+---------------------+------------------------+---------------+
| Cetus |    O B J E C T S    | Thousands of links     | 18 mirrors in |
| Links | C O M P O N E N T S | on Object-Orientation  | 15 countries  |
+-------+------+--------------+------------------------+---------------+
| Central site | http://www.cetus-links.org            |   61 pages    |
| Mirror index | http://www.cetus-links.org/sites.html |   about OO    |
+--------------+---------------------------------------+---------------+


------------------------------

Date: Sun, 24 Jan 1999 13:26:06 GMT
From: cim@online.ee (Cim)
Subject: Loop + rand
Message-Id: <36ab1daf.3148007@news.online.ee>

I have an array.
I take a random element from that array,
Open a file and check if a condition is true. If true it should get
another element from that array.
I made a loop and it works fine, but how to check that the next
element taken from the array is not any of the ones previously already
checked. I need to do it fast. I think if I make another array
(elements checked) and then check if current random element is already
in @elements_checked it will not be very fast.

the number of elements at @array will probably be less than 10.

all help appreciated. thanks.


------------------------------

Date: Sun, 24 Jan 1999 06:27:58 GMT
From: scott.craig@moh.hnet.bc.ca
Subject: Re: Matching Numbers from a string.
Message-Id: <78eeh9$7oi$1@nnrp1.dejanews.com>

In article <36A6F7A1.640DAC6B@mihy.mot.com>,
  rpsarathi@usa.net wrote:
> Hi,
>
> You can match a number by using '\d'.
>
> Darko Tunukovic wrote:
>
> > I have a little problem with matching number from a string.
> >        Like this:      $pattern = "Test Number: 1";
> > How can I get only the number from this string ?
>
> $pattern =~ /(\d*)/;
> $numbers = $1;
>

Actually, the pattern to use is /(\d+)/.  We want to match at least one
number. /(\d*)/ will match the empty string at the beginning of "Test Number:
1".

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Sun, 24 Jan 1999 00:26:31 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Missing lines.
Message-Id: <alecler-2401990026310001@dialup-574.hip.cam.org>

In article <78df52$5v2$1@news6.svr.pol.co.uk>, "OM"
<om@republica.freeserve.co.uk> wrote:

> I want to read in a file, but want to discard the first few lines.
> 
> I thought the following code would do it.
> 
> while(<DATA>)
> {
>      for($t = 0; $t < $numberoflinestomiss; $t++) {next;}
>     ............ now work on the part I want ............
> }

   while (<DATA>) {
      next if $. <= $num_lines_to_skip;
      ... now get to business ...
   }

HTH,
Andre


------------------------------

Date: Sun, 24 Jan 1999 10:22:41 +0100
From: "Karl" <karl@nospamaddYproline.at>
Subject: Re: need Fcntl.pm and SDBM_File. Where to get it?
Message-Id: <78eoof$onr$1@fleetstreet.Austria.EU.net>

i use Perl 5.005_02 on FreeBSD 2.2.7


best regards,

karl

M.J.T. Guy schrieb in Nachricht <78dnft$69v$1@pegasus.csx.cam.ac.uk>...
>Karl <karl@nospamaddYproline.at> wrote:
>>I got a script with an application witch needs:
>>
>>use Fvntl qw(:flock);
>>use SDBM_File;
>>
>>or alternativly Fcntl.
>>
>>Tried on CPAN, but only found directories and no moduls inside. any ideas
>>are greatly appreziated.
>
>Both Fcntl.pm and SDBM_File.pm are part of the standard distribution.
>I deduce that your Perl is either out-of-date or incorrectly installed.
>
>But since you provide no version information, I'm only guessing.
>
>
>Mike Guy




------------------------------

Date: Sun, 24 Jan 1999 12:51:55 +0100
From: Martin Bodenstedt <Martin.Bodenstedt@talknet.de>
Subject: Re: Perl  & IIS problem
Message-Id: <36AB095A.684B8DAA@talknet.de>



"E. Kolve" schrieb:

> I have installed activestate's perl distribution for NT and I am able to
> run your basic "hello world" app, but when I try to run a perl script
> that uses the WIN32 module, or any module for that matter, the program
> crashes and no output is returned.  I re-installed the modules using ppm
> to make sure they were there, but that still did not help.  Any help
> would be appreciated.
>
> thanks,
>
> eric

have you registered the file extensions with IIS ?

Martin



------------------------------

Date: 24 Jan 1999 05:45:04 GMT
From: firstagyg@aol.com (FirstAGYG)
Subject: Re: Perl For Dummys
Message-Id: <19990124004504.19995.00001979@ng-ft1.aol.com>

Actually, i think a good starter book was in your title "perl for dummies". I
know you guys love the o'reilly books, i do as well, i have learning perl. but
i went straight through perl for dummies and it explained things much better
for a first timer...the O'reilly book expects some experience in my opinion.

John


------------------------------

Date: Sun, 24 Jan 1999 07:24:45 GMT
From: davecook@home.com (David M. Cook)
Subject: Re: PostgreSQL - query attribute types?
Message-Id: <slrn7alj0g.ai.davecook@sputnik.escnd1.sdca.home.com>

On 23 Jan 1999 21:36:44 GMT, Richard Kilgore <rkilgore@sidney.kilgore.com>
wrote:

>Does anyone know how to query PostgreSQL (preferably in perl) for
>the _types_ of the columns (i.e., attributes) in a given table

The FAQ says that that info is tucked away in 

pgsql/src/tutorial/syscat.source

Dave Cook


------------------------------

Date: Sun, 24 Jan 1999 09:24:16 GMT
From: root@coredcs.com (Steve)
Subject: Problem with dbm hash
Message-Id: <36aae45c.964292606@news.coredcs.com>

Hello,

I'm having a problem with a hash database file.  I need to store
multiple values in one key and thus I'm using an array(per the Perl
Cookbook).  My problem is in syntax for viewing the data once entered.

I can input the values into the hash and they seem to be correct and
getting into the hash array variable.  However when, on the next run,
I try to view any of the previously entered data, nothing comes up.  I
_know_ I am doing something syntactically and simply wrong.

Here's an example of one of the portions(there are 6) that gather
input:

print "Enter notes: ";
$notes = <STDIN>;
chomp $notes;
push( @{$TASKLIST{$taskkey}}, "$notes");
print "@{$TASKLIST{$taskkey}}\n"; 

The 'print' is there for testing.  This is the last variable that gets
pushed into the array and thus this print shows all the data in the
@{$TASKLIST}{$taskkey}.

Here's the problem .  In trying to view it, I followed both examples
in the Perl Cookbook relating to this and was unable to bring up the
data.

foreach $taskkey (sort keys %TASKLIST) {
        print "testthetaskkey: $taskkey\n";
        foreach $taskname (sort @{$TASKLIST{$taskkey}}) {
                print "test these: $taskname, $taskkey\n";
                @array = (@array, $taskname);
                $valout = $array[$count];
	   $count++;
}
}

It never appears to even get to the second 'foreach' because it
doesn't print the "test these" line even once.

Any help for the complicate subject would be appreciated.

Steve


------------------------------

Date: 24 Jan 1999 05:33:01 GMT
From: firstagyg@aol.com (FirstAGYG)
Subject: Re: Running CGI Progs.
Message-Id: <19990124003301.19995.00001973@ng-ft1.aol.com>

Gavin,

i know the problem also. for me, the soloution was as easy as making sure i
accessed it in my browser as "http://" instead of "c://"

i have a web server installed though, just for playing with my scripts...so
that may have something to do with it. if you ever want, go to
http://www.sambar.com and download the free server. you'l see in the info in
the doc... your "web site" will be at http://localhost, on your hard drive. you
can then create practice scripts and run them.

that was how i fixed it, hope it helps.
John




------------------------------

Date: Sun, 24 Jan 1999 00:09:36 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: uncuddled elses
Message-Id: <alecler-2401990009360001@dialup-574.hip.cam.org>

In article <Pine.LNX.4.05.9901231759130.22167-100000@hill.ucr.edu>,
Abraham Grief <abey@hill.ucr.edu> wrote:

> In the perlstyle man page, one of the tips is to use uncuddled elses.
> Can someone please show me what an uncuddled else is as opposed to a
> cuddled one?  Thanks in advance.

   Cuddled else:             Uncuddled else:

   } else {                  }
                             else {

HTH,
Andre


------------------------------

Date: Sun, 24 Jan 1999 11:15:26 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: uncuddled elses
Message-Id: <36AAF2BE.9961CF1A@ngb.se>

Hi!

> In the perlstyle man page, one of the tips is to use uncuddled elses.
> Can someone please show me what an uncuddled else is as opposed to a
> cuddled one?  Thanks in advance.

This question was asked a week ago or so. There was quite a debate on
which to prefer.

## Cuddled else

if( $something ){

} else {

}

## The else is "cuddled" between the } and {
## Uncuddled

if( $something ){

} 
else {

}

## Third possibility -- also uncuddled

if( $something )
{

} 
else
{

}

It's all about personal preference.

Staffan


------------------------------

Date: Sun, 24 Jan 1999 01:25:41 -0600
From: "brettr" <brettr@beci.net>
Subject: using search pattern
Message-Id: <36aacd14.0@news.usunwired.net>

How would I extract the last.html file from the string below?

/dir/dir/last.html

Kind regards,
brettr




------------------------------

Date: Sun, 24 Jan 1999 08:49:04 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: using search pattern
Message-Id: <ebohlmanF6235s.F0q@netcom.com>

brettr <brettr@beci.net> wrote:
: How would I extract the last.html file from the string below?

: /dir/dir/last.html

I'd use File::Basename, which should already be installed on your system.



------------------------------

Date: Sun, 24 Jan 1999 01:14:30 -0600
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Why range (..) operator *not* decrement ???
Message-Id: <36AAC856.179436D9@mediaone.net>

I know that the range (..) operator will increment across the range,
even if the range consists of only negative numbers:

my $string = 'inet addr:192.168.0.1  Bcast:192.168.0.255 
Mask:255.255.255.0';
$string =~ s/[^\d.:]*//g;
my ($IP, $BC, $MASK) = (split /:/, $string)[-3..-1];
print "IP => $IP ; BC => $BC ; MASK => $MASK\n";

But, why can't it *decrement* across the range?

my ($MASK, $BC, $IP) = (split /:/, $string)[-1..-3];

I know that they must be integers; but, why hardcode the vector only in
plus direction?

Camel says, "... counting (by ones) from the left value to the right
value."  Does this *not* comply?
	-3
	-2
	-1

-- 

Best Regards,

mds
mds resource
888.250.3987

"Dare to fix things before they break . . . "

"Our capacity for understanding is inversely proportional to how much we
think we know.  The more I know, the more I know I don't know . . . "


------------------------------

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4735
**************************************

home help back first fref pref prev next nref lref last post