[12822] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 232 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 23 01:07:21 1999

Date: Thu, 22 Jul 1999 22:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 22 Jul 1999     Volume: 9 Number: 232

Today's topics:
    Re: a bit of a bind.. (Dave Meyer)
    Re: basename regexp? (elephant)
    Re: checking if address is active (Tad McClellan)
    Re: How to give Passwords on STDIN (elephant)
    Re: Is '' equivalent to ""? (Ronald J Kimball)
    Re: Is '' equivalent to ""? (Abigail)
    Re: Is '' equivalent to ""? <swiftkid@bigfoot.com>
    Re: Is '' equivalent to ""? (Michael Stillwell)
    Re: Mod_perl weird behaviour... (Abigail)
    Re: Newbie: Arrays & Comparing Arrays <scoobyshake@earthlink.net>
    Re: Opne3 on Win32? Really nobody knows? Or primitive p (elephant)
    Re: output of print map ( { unless (/^#/) {} } ("#") ); (Abigail)
    Re: Perl CGI vs VB ASP (elephant)
    Re: perl cgi (Abigail)
    Re: Perl Examples on Parsing HTML (Abigail)
    Re: Perl Power Tools (PPT): get rid of other shells ? (Abigail)
    Re: Perl usuage and Graphical Representation (Abigail)
    Re: problem with hash of arrays (Anno Siegel)
        Q - Mapping to complex, nested data structures? dwolfe5272@my-deja.com
    Re: Q - Mapping to complex, nested data structures? (Anno Siegel)
    Re: teach-me <uri@sysarch.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 23 Jul 1999 04:54:47 GMT
From: dmeyer@news.bellatlantic.net (Dave Meyer)
Subject: Re: a bit of a bind..
Message-Id: <7n8sdb$4bp$1@jhereg.dmeyer.org>

According to Tom Christiansen  <tchrist@mox.perl.com>:
> Which is pretty much just a nasty and slow way of writing it in
> 100% Pure Perl.  I'd be more apt to do something like this:
> 
>     my $fh = do { local *FH };
>     open($fh, $filename) || die "can't open $filename: $!";

Could you enlighten me about the difference between
    my $fh=do { local *FH };
and
    my $fh=local *FH;
and
    my $fh=\*FH;
and
    my $fh=*FH;
and
    my $fh=gensym;

and any other variants on this kind of thing?  I've noticed what a
monster IO::File is, and am looking for the right way to pass around
file handles.

	Thanks,
	Dave
-- 
David M. Meyer
meyer@virtc.com


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

Date: Thu, 22 Jul 1999 21:48:05 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: basename regexp?
Message-Id: <MPG.1201b001ac4b68cd989b70@news-server>

Bart Lateur writes ..
>Andreas Fehr wrote:
>
>>>Change it to:
>>>
>>>m/([^\\\/]+)$/;
>>>
>>>This covers / and \
>>>
>>
>>No MacPerl here :(
>>I don't know its delimiter.
>
>The colon. Hey, that's special in DOS too.
>
>	/([^\\\/:]+)$/;

just quietly the '\' and the ':' are valid UNIX filename characters .. so 
you lose portability anyway with doing this

also - in case you're interested .. the ':' is sort of a valid NT (can't 
test DOS) filename character .. even though neither the cmd.exe shell nor 
explorer.exe recognise the filename .. the filename still exists (at 
least on an NTFS partition) and I can edit it and save data to it

-- 
 jason - remove all hyphens for email reply -


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

Date: Thu, 22 Jul 1999 19:07:10 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: checking if address is active
Message-Id: <u688n7.o5b.ln@magna.metronet.com>

Steve . (syarbrou@nospam.enteract.com) wrote:

: We have a problem with a web site going down often.  I need to write a
: program that will basically hit the web site and return a value to a
: log, whether it successfully is running or not.


-----------------------------
#!/usr/bin/perl -w

use strict;
use LWP::Simple;           # get the libwww bundle from CPAN
                           # LWP::UserAgent is more powerful

my $url = 'http://localhost';

if (defined get $url)
   { print "$url is alive\n" }
else
   { print "$url has a problem\n" }
-----------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 23 Jul 1999 13:39:35 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: How to give Passwords on STDIN
Message-Id: <MPG.12028f02db8e58ae989b72@news-server>

Martien Verbruggen writes ..
># perldoc -q password
>=head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq8.pod
>
>=head2 How do I ask the user for a password?

if you weren't so busy trying to be smart you might have noticed that in 
the original question Osman asked for a method of doing this that didn't 
require the use of ReadKey.pm

moreover .. this question is asked-and-answered .. if you're not seeing 
the answers then I suggest you check your newsfeed

>Whoops. it does turn out to be a FAQ. Am I ever glad that I didn't
>post this question, but instead decided to consult the documentation
>and the FAQ.

there's something to be said for EVERYONE reading and processing the 
information that's available to them .. be it FAQ or just a Q on usenet 
 .. because to be perfectly honest .. Osman's original question 
(mentioning wanting to read a password without using ReadKey) implies 
fairly clearly to me that Osman was interested in a non-echoing read from 
STDIN .. IMHO those with their $x = <STDIN> answers don't add much to the 
newsgroup

-- 
 jason - remove all hyphens for email reply -


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

Date: Thu, 22 Jul 1999 23:12:49 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Is '' equivalent to ""?
Message-Id: <1dvd9fc.zszj11qlt0crN@p5.tc14.metro.ma.tiac.com>

Michael Stillwell <mist@yoyo.cc.monash.edu.au> wrote:

> Is '' always equivalent to ""?  (Or q{}, for that matter.)

Yes.  They're just different ways of specifying the null string.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 22 Jul 1999 22:10:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Is '' equivalent to ""?
Message-Id: <slrn7pfn8t.1a1.abigail@alexandra.delanet.com>

Michael Stillwell (mist@yoyo.cc.monash.edu.au) wrote on MMCLII September
MCMXCIII in <URL:news:slrn7pfit2.cb.mist@fangorn.cs.monash.edu.au>:
:: Is '' always equivalent to ""?  (Or q{}, for that matter.)

Yes. In *Perl* that is.

:: $ perl -e '$s = "Hello, World!"; substr($s, 0, 1, ""); print $s, "\n";'
:: ello, World!
:: $ perl -e '$s = "Hello, World!"; substr($s, 0, 1, ''); print $s, "\n";'
             ^                                       ^^                  ^
             |                                       ||                  |

Perl won't see any of those 's. Perl sees:
              $s = "Hello, World!"; substr($s, 0, 1, ); print $s, "\n";

Hence:

:: Hello, World!

:: Actually replacing characters does work as expected:
:: 
:: $ perl -e '$s = "Hello, World!"; substr($s, 0, 2, "Hu"); print $s, "\n";'
:: Hullo, World!
:: $ perl -e '$s = "Hello, World!"; substr($s, 0, 2, 'Hu'); print $s, "\n";'
:: Hullo, World!


Try the latter one with -Mstrict.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 23 Jul 1999 07:53:38 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Is '' equivalent to ""?
Message-Id: <7n9opm$grp1@news.cyber.net.pk>

: Is '' always equivalent to ""?  (Or q{}, for that matter.)

$str = "cool thingy";

print "my string is: $str" . "\n";
print 'my string is: $str' . "\n";
print qq{my string is: $str} . "\n";
print q{my string is: $str} . "\n";

1 = 3
2 = 4

:)




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

Date: 23 Jul 1999 04:47:09 GMT
From: mist@yoyo.cc.monash.edu.au (Michael Stillwell)
Subject: Re: Is '' equivalent to ""?
Message-Id: <slrn7pfsuc.57p.mist@fangorn.cs.monash.edu.au>

Abigail <abigail@delanet.com> wrote:
: Michael Stillwell (mist@yoyo.cc.monash.edu.au) wrote on MMCLII September
: MCMXCIII in <URL:news:slrn7pfit2.cb.mist@fangorn.cs.monash.edu.au>:
: :: Is '' always equivalent to ""?  (Or q{}, for that matter.)
: 
: Yes. In *Perl* that is.
: 
: :: $ perl -e '$s = "Hello, World!"; substr($s, 0, 1, ""); print $s, "\n";'
: :: ello, World!
: :: $ perl -e '$s = "Hello, World!"; substr($s, 0, 1, ''); print $s, "\n";'
:              ^                                       ^^                  ^
:              |                                       ||                  |
: 
: Perl won't see any of those 's. Perl sees:
:               $s = "Hello, World!"; substr($s, 0, 1, ); print $s, "\n";

Err ... *embarassment*

To explain a little:

I was originally having problems with '' vs "" in a script, and in
trying to generate a simple case I came up with this, somehow missing
the shell quoting problem.  (Actually, I often make this sort
of mistake, but usually it results in an obviously broken script.)

Immediately after I posted I tried the same line with -w, not
seriously thinking this would produce anything different, and was very
surprised to find that now perl was complaining about a "Useless use
of substr in void context".  I couldn't understand this error at all,
but since it wasn't what I expected, I decided to cancel my original
post and investigate further.  I'm quite surprised my original post
got so far and got so many replies---there was only a minute or so
between the post and the cancel.

I'm certainly never going take -w for granted again!



Michael

-- 
:::: mjs@beebo.org ::::::::::::::::::::::::::::: http://beebo.org ::::
:::: mjs@beebo.org ::::::::::::::::::::::::::::: http://beebo.org ::::
:::: mjs@beebo.org ::::::::::::::::::::::::::::: http://beebo.org ::::


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

Date: 22 Jul 1999 22:16:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Mod_perl weird behaviour...
Message-Id: <slrn7pfnip.1a1.abigail@alexandra.delanet.com>

christian.sylvestre@cetelem.fr (christian.sylvestre@cetelem.fr) wrote on
MMCLI September MCMXCIII in <URL:news:7n6l89$m9r$1@nnrp1.deja.com>:
 .. Hi! we got a server running mod perl and by looking at our access log we
 .. saw some request listed at night (eventhought this server is not used at
 .. night).

Oh, you have ghosts using vi to edit the access log! Cooooooool!

 .. The request line looks like that:
 .. 
 .. 1XX.XXX.XXX.XXX - - [05/Jul/1999:20:17:22 +0200] "HEAD / HTTP/1.0" 200 0
 .. 
 .. (Where the 1XX.XXX.XXX.XXX correspond to the ip address of this server).
 .. 
 .. And this occurs every 45 seconds. So, is it mod perl actually requesting
 .. the Header of the doc root every 45 second a normal behaviour?

I'm sure it can be configured that way.

 .. If not is there any reasons why the server is actually reqyesting itself
 .. the header every 45 seconds ?


You tell us. You can have tens of thousands of programs running on that
machine that request /.

Is there any reason you post your question here? Shouldn't this belong
in rec.food.penguin.bbq or so?



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 22 Jul 1999 22:10:20 -0500
From: James Deleon <scoobyshake@earthlink.net>
To: Larry Rosler <lr@hpl.hp.com>, paolo.noya@inferentia.it
Subject: Re: Newbie: Arrays & Comparing Arrays
Message-Id: <3797DD1B.3AB0D4C9@earthlink.net>

Thank you both for the help.

The script is now working.  I don't have a good understanding on what's going on
in that part of the script so I'll have to investigate hash, keys, map....

Getting a script to work correctly is better than...... No not that good, but
almost.

james

Larry Rosler wrote:

> [Posted and a courtesy copy sent.]
>
> In article <379543F5.864DF1AA@earthlink.net> on Tue, 20 Jul 1999
> 22:52:22 -0500, James Deleon <scoobyshake@earthlink.net> says...
> > Sorry.  The previous message should have looked as follows.
> >
> > I've created 2 arrays that consists of lines from a file that contain a
> > particular word. The resulting arrays looks like:
> >
> > word1 word2 word3 word4    # Array1. All lines contain word1
> > word1 word5 word6 word7
> > word1 word8 word9 word10
> >
> > word11 word2 word13 word14    #Array 2. All lines contain word11
> > word11 word5 word16 word17
> > word11 word18 word19 word20
> >
> > How do print words from array1-column2 that do not exist in array2-column2,
> > and words from array2-column2 that are not in array1-column2?
> >
> > Output should be:
> > # words in array1 not array2 (column2)
> > word8
> > # words in array2 not array1 (column2)
> > word18
>
> Read the section on Arrays in perlfaq4 to get a better handle on what's
> going on in this program.
>
> #!/usr/local/bin/perl -w
> use strict;
>
> my @array1 = (
>   'word1 word2 word3 word4',
>   'word1 word5 word6 word7',
>   'word1 word8 word9 word10',
> );
>
> my @array2 = (
>   'word11 word2 word13 word14',
>   'word11 word5 word16 word17',
>   'word11 word18 word19 word20',
> );
>
> my (%hash1, %hash2);
> @hash1{map { (split)[1] } @array1} = ();
> @hash2{map { (split)[1] } @array2} = ();
>
> print "# words in array1 not array2 (column2)\n";
> print map "$_\n", sort grep !exists $hash2{$_}, keys %hash1;
> print "# words in array2 not array1 (column2)\n";
> print map "$_\n", sort grep !exists $hash1{$_}, keys %hash2;
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com




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

Date: Thu, 22 Jul 1999 21:49:15 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Opne3 on Win32? Really nobody knows? Or primitive problem?
Message-Id: <MPG.1201b046fe4e0036989b71@news-server>

Pavel Kotala writes ..
>So I realized to change order of variables to:
>
>open3( \*WRITE, \*READ, \*ERR, 'cmd');

yes .. sorry - a transposing error .. please see your email (I replied 
there because you didn't tell me you'd posted here as well)

-- 
 jason - remove all hyphens for email reply -


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

Date: 22 Jul 1999 22:28:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: output of print map ( { unless (/^#/) {} } ("#") );
Message-Id: <slrn7pfo94.1a1.abigail@alexandra.delanet.com>

Michael Wang (mwang@tech.cicg.ml.com) wrote on MMCLI September MCMXCIII
in <URL:news:7n7ag7$5re$1@news.ml.com>:
== What should be the output of the following?
== 
== (1) map ( { unless (/^#/) {} } ("#") );
== (2) print map ( { if (/^#/) {} } ("#") );
== (3) print map ( { if ( !/^#/) {} } ("#") );
== 
== And why? Thanks. 
== 
== It is my opinion that neither of the 3 above should produce ANYTHING.
== but (1) produce "1" which I do not know why. How can I prevent it
== from produce this unwanted "1". Thanks again. 


What do you mean by "producing"? As given, the map is in void context,
anything "produced" will be thrown away. And it doesn't have side effects,
so what exactly is the problem?

Now, you might have something else there that captures the result of map,
a print, or an assignment. Now, map {} will evaluate the block for each
element of the list, in list context. It looks like the result of "unless
(/^#/) {}" is 1, if $_ eq '#'. Perhaps not quite the result you expect,
but you have to admit, "unless (/^#/) {}" is a pretty weird expression.



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 23 Jul 1999 13:55:16 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Perl CGI vs VB ASP
Message-Id: <MPG.120292b219b784bd989b73@news-server>

[ item posted to comp.lang.perl.misc and CCed to Eisen Chao ]

Eisen Chao writes ..
>I'm familiar with using Perl within CGI,
>but not with VB & ASP.
>
>What are the advantages of the Perl/CGI
>combination over using the Micro$oft
>product ? 

I'm fairly shocked at the lack of depth of the responses that you've 
received so far .. although maybe people can't be bothered because it's 
such a simple question to answer

there are a massive number of things that are a pain in the arse to do in 
VB - but are second nature to perl .. and you need to do MOST of these 
things when you program CGI scripts (btw .. I use that term a little 
differently that you - to encompass everything that uses the CGI 
interface .. this includes a call to a VBscrip ASP - it's all CGI)

let's go through a quick list .. let me know if you need any elaboration 
 .. though I would imagine that these things are fairly self-explanatory 
 .. roughly listed in order from most to least significant for the 
individual programmer

+ advanced regex
+ plethora of free modules
+ execution speed
+ OS and web server portability
+ shared skill set

actually .. let me explain that last one .. because it's an important 
hidden cost of choosing VBscript/ASP .. and it becomes very significant 
over time for any organisation

both VBscript works on one platform and the specific knowledge of 
VBscript through the ASP model workes on one platform in one product .. 
ie. on Windows under IIS4 .. from a corporate (and personal) perspective 
investing in training (be it internal - on-the-job .. or formal) for a 
staff member to learn VBscript/ASP gets you a staff member who can write 
programs for IIS4 web server and that's all

investing in training for someone to learn Perl gets you a staff member 
who can do virtually anything .. on virtually any platform .. in 
virtually any environment .. and obviously - that makes much more 
business sense

-- 
 jason - remove all hyphens for email reply -


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

Date: 22 Jul 1999 22:29:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl cgi
Message-Id: <slrn7pfoc0.1a1.abigail@alexandra.delanet.com>

msdb159@my-deja.com (msdb159@my-deja.com) wrote on MMCLI September
MCMXCIII in <URL:news:7n5s86$dvh$1@nnrp1.deja.com>:
`` Why doesn't straight Perl CGI scale?


Because it gets distracted when there are too many members of the
opposite sex.

Try gay Perl.


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 22 Jul 1999 22:34:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Examples on Parsing HTML
Message-Id: <slrn7pfoll.1a1.abigail@alexandra.delanet.com>

Martien Verbruggen (mgjv@comdyn.com.au) wrote on MMCLI September MCMXCIII
in <URL:news:1Gvl3.191$0S6.7605@nsw.nnrp.telstra.net>:
[] 
[] use HTML::Parser
[] 
[] You can obtain it from CPAN. It probably has some examples in the
[] distribution or so. It does a good job.

For certain values of "good".

HTML::Parser is a big misnomer. It doesn't parse, and it has no HTML
knowledge. Summer::Butterfly would have been a less misleading name.

HTML::Parser happens to work for simple documents, provided they are
syntactically correct, and written in a subset of HTML.

Of course, HTML::Parser doesn't do a worse job than the average browser
out there, but that doesn't mean much - one might as well be satisfied
with Windows 95.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 22 Jul 1999 22:38:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Power Tools (PPT): get rid of other shells ?
Message-Id: <slrn7pfosn.1a1.abigail@alexandra.delanet.com>

Bruno Pagis (pagib@aur.alcatel.com) wrote on MMCLI September MCMXCIII in
<URL:news:37977A3C.72078698@aur.alcatel.com>:
-- With all UNIX commands ported in Perl (see http://language.perl.com/ppt/),
-- the next step is to be able to call
-- a Perl shell when logging in onto a unix/x/y/... machine, and be right away in
-- the perl interpreter with all the PPT commands accessible.
-- No more csh/tcsh/ksh/blabla/...
--
-- I am dreaming, or has it been done already ?


Well, there is:

      perl -wlneeval



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 22 Jul 1999 22:49:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl usuage and Graphical Representation
Message-Id: <slrn7pfphq.1a1.abigail@alexandra.delanet.com>

whos_john_galt@my-deja.com (whos_john_galt@my-deja.com) wrote on MMCL
September MCMXCIII in <URL:news:7n5cgk$85t$1@nnrp1.deja.com>:
^^ Thanks for the assistance and the patience:
^^ 
^^ I am a student of Perl. I am learning through trial and error, and a as
^^ many books as I am able to grasp. I am able to confidently manipulate
^^ database information through the need of a Web based classified
^^ publication, I maintain. I use a Unix vitual server and am starting to
^^ venture towards the NT world. If I were needing to manipulate database
^^ information on a LAN, I believe I could tackle the process of providing
^^ graphical representation of searches, reports, etc., using HTML and a
^^ browser. But, is that an elementary way of doing things? I have read
^^ posts where programmers tell that they use Perl daily and have never
^^ used it for CGI. If I had Perl operating locally on an NT and wanted to
^^ display information graphically, what would I use?

I use Perl daily, I haven't use Perl for CGI in eons, and I display 
information graphically. I have an NT machine on my desk, but that's
a very stable box, more stable than any Unix computer: it's unplugged,
and collecting dust.

To display my graphical information, I have a monitoring program that
collects data, and stores it in a database. Another programs retrieves
the data from the database, and plots nice graphs [1]. The plotting is done
using gnuplot [2], while the final images are made using several programs
from the netpbm tools package. Perl is glue. Glueing Sybase, gnuplot
and netpbm together. The images can then be viewed with a webbrowser,
or with xli, or xv, or whatever. CGI is irrelevant for this.


[1] Number of users, CPU/busy, CPU/IO, machine load, disk reads,
    disk writes, disk errors, downtime. With a sample time of 1 minute,
    24 x 365.
[2] Kudos to Lincoln Stein for his article in the latest TPJ.


Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 23 Jul 1999 03:33:52 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: problem with hash of arrays
Message-Id: <7n8nr0$37$1@lublin.zrz.tu-berlin.de>

Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote in comp.lang.perl.misc:
>Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>
>> I don't know about MLDBM, but any the modules I know that tie
>> hashes to a database will stringify references before storing
>> them away, which makes them useless.  The following bit demonstrates
>> this:
>
>Obviously you don't know about MLDBM.  The ML is for multi-level; it is
>specifically designed to allow storage and retrieval of multi-level data
>structures.

Oh, okay.  Thanks, this sounds interesting.

Anno


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

Date: Fri, 23 Jul 1999 03:00:49 GMT
From: dwolfe5272@my-deja.com
Subject: Q - Mapping to complex, nested data structures?
Message-Id: <7n8lsu$c4j$1@nnrp1.deja.com>

Hello, all.  I was wondering if someone could give me some advice on
using Perl and System V shared memory (or maybe mmap) to communicate
with a C program that uses complex data structures.  My C program stores
data in a top-level structure that looks something like:

typedef struct {
    Suspension_Type   Suspension[drvNUM_SUSPENSIONS];
    Vehicle_Type      Vehicle[drvNUM_VEHICLES];

    float             vib_order;

    int               num_cases;
} Vibration_Generation_Type;

The subbordinate structures contained in this top-level structure can,
in general, contain other structures, so that there are several levels
of nesting.

I have a pretty good handle on how to use shmget to map to and read/
write from a shared memory area that contains simple shorts, longs,
doubles, etc, but I don't really know where to begin with a more
complicated structure of user-defined types.  Can anyone recommend a
document somewhere that might help me figure this out?

TIA,

--
*-*-*-*-*-*-*-*-*-*-*-*-*
Dave Wolfe
gForce Technologies Inc.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 23 Jul 1999 03:52:58 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Q - Mapping to complex, nested data structures?
Message-Id: <7n8ouq$5k$1@lublin.zrz.tu-berlin.de>

 <dwolfe5272@my-deja.com> wrote in comp.lang.perl.misc:
>Hello, all.  I was wondering if someone could give me some advice on
>using Perl and System V shared memory (or maybe mmap) to communicate
>with a C program that uses complex data structures.  My C program stores
>data in a top-level structure that looks something like:
>
>typedef struct {
>    Suspension_Type   Suspension[drvNUM_SUSPENSIONS];
>    Vehicle_Type      Vehicle[drvNUM_VEHICLES];
>
>    float             vib_order;
>
>    int               num_cases;
>} Vibration_Generation_Type;
>
>The subbordinate structures contained in this top-level structure can,
>in general, contain other structures, so that there are several levels
>of nesting.
>
>I have a pretty good handle on how to use shmget to map to and read/
>write from a shared memory area that contains simple shorts, longs,
>doubles, etc, but I don't really know where to begin with a more
>complicated structure of user-defined types.  Can anyone recommend a
>document somewhere that might help me figure this out?

That's what unpack is for (among other things).  For reference see
perldoc -f pack and perldoc -f unpack.

Anno


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

Date: 23 Jul 1999 00:02:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: teach-me
Message-Id: <x7wvvsui6t.fsf@home.sysarch.com>

>>>>> "g" == grig  <grig@mic.ro> writes:

  g> Hello e-body!  Daniel G

goodbye.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

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


Administrivia:

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 V9 Issue 232
*************************************


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