[28890] in Perl-Users-Digest
Perl-Users Digest, Issue: 134 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 13 14:10:17 2007
Date: Tue, 13 Feb 2007 11:09:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 13 Feb 2007 Volume: 11 Number: 134
Today's topics:
Re: a cgi for view unix logs? <tadmc@augustmail.com>
Re: a cgi for view unix logs? <cwilbur@chromatico.net>
Re: a cgi for view unix logs? <spamtrap@dot-app.org>
Re: Accessing Access (Marc Espie)
Re: bypass shell - pipe into child pid and receive otpu <nospam-abuse@ilyaz.org>
Meditation on inside-out classes anno4000@radom.zrz.tu-berlin.de
Re: Meditation on inside-out classes <abigail@abigail.be>
Re: Meditation on inside-out classes anno4000@radom.zrz.tu-berlin.de
Re: Meditation on inside-out classes <abigail@abigail.be>
Re: Meditation on inside-out classes anno4000@radom.zrz.tu-berlin.de
Re: Meditation on inside-out classes <bik.mido@tiscalinet.it>
set "From" header <larry.grant.dc@gmail.com>
Re: Syntax Error? <ced@blv-sam-01.ca.boeing.com>
Re: Syntax Error? anno4000@radom.zrz.tu-berlin.de
timeout problem shurikgefter@gmail.com
Re: timeout problem <glex_no-spam@qwest-spam-no.invalid>
Re: timeout problem xhoster@gmail.com
Re: works now ! was: bypass shell - pipe into child pid <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Feb 2007 05:53:13 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: a cgi for view unix logs?
Message-Id: <slrnet39l9.6re.tadmc@tadmc30.august.net>
robertchen117@gmail.com <robertchen117@gmail.com> wrote:
> I am trying to use this to output the last 100 lines to a cgi page,
> but because it do not print \n in HTML, so everything is mess up. I do
> not want to try to open a file, read the last 100 lines and close the
> file. Because I think it would be slow than Unix "tail".
>
> $done = system("tail -100 $filename")
print map "$_<br>", qx/ tail -100 $filename /;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Feb 2007 10:10:16 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: a cgi for view unix logs?
Message-Id: <874ppqnlev.fsf@mithril.chromatico.net>
>>>>> "rc" == robertchen117@gmail com <robertchen117@gmail.com> writes:
rc> I am trying to use this to output the last 100 lines to a cgi
rc> page, but because it do not print \n in HTML, so everything is
rc> mess up.
In most cases, HTML treats white space as interchangeable, so there's
no difference between a \n and a space. If you use your browser's
"View Source" function, you'll be able to see that the newlines are
actually present.
The solution is to bring the way you send the output and the way you
expect the output to appear into agreement. If you want the newlines
in your output to be meaningful, send a Content-Type of text/plain.
If you want to send HTML, alter the output you produce so that it
produces the appearance you want. Neither of these is a Perl-specific
problem.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Tue, 13 Feb 2007 11:39:27 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: a cgi for view unix logs?
Message-Id: <m2hctqau68.fsf@local.wv-www.com>
Andrew DeFaria <Andrew@DeFaria.com> writes:
In HTML. Please don't do that; we're not all using HTML-aware news readers.
Have you read the posting guidelines for this group?
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
>
>
>
>
>
> mailto:robertchen117@gmail.com wrote:
> <blockquote
> cite="mid1171352707.666035.281460@a34g2000cwb.googlegroups.com"
> type="cite">I am trying to use this to output the last 100 lines to a
> cgi page,
> but because it do not print \n in HTML, so everything is mess up. I do
> not want to try to open a file, read the last 100 lines and close the
> file. Because I think it would be slow than Unix "tail".
>
> $done = system("tail -100 $filename")
>
> tail in cgi page, No return/new lines:
...
>
> </blockquote>
> Use the <pre> tag. That's what it's for!
Good idea, if you want the log lines to appear as part of an enclosing web
page. You could also just return text/plain content, if all you want is just
the log lines, and nothing else.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Tue, 13 Feb 2007 11:47:24 +0000 (UTC)
From: espie@lain.home (Marc Espie)
Subject: Re: Accessing Access
Message-Id: <eqs8gc$39u$1@biggoron.nerim.net>
In article <bg5Ah.2444$g82.1459@trndny09>, <QoS@domain.invalid.com> wrote:
>I would like to know if this or something similar to this will work on
>both the linux, and windows platforms?
Unfortunately, no. At least not for free.
Been there, done that.
On a Unix platform, if you really want to connect
to an Access database, you either have to go DBD::Proxy, or to buy some
commercial components for ODBC support. To the best of my knowledge
there is no free linux ODBC connector that can be used with database
products such as Access.
------------------------------
Date: Tue, 13 Feb 2007 14:01:59 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: bypass shell - pipe into child pid and receive otput
Message-Id: <eqsgcn$2mft$1@agate.berkeley.edu>
[A complimentary Cc of this posting was NOT [per weedlist] sent to
Ilya Zakharevich
<nospam-abuse@ilyaz.org>], who wrote in article <eqq7gb$v7t$1@agate.berkeley.edu>:
> [A complimentary Cc of this posting was NOT [per weedlist] sent to
> Uri Guttman
> <uri@stemsystems.com>], who wrote in article <x7bqjzxsuj.fsf@mail.sysarch.com>:
> > i browsed the docs of htmldoc and i found nothing that lets it read from
> > stdin. it seems to require a real input file (or more than one). it will
> > print to stdout if no output option is used. so it seems the OP is stuck
> > with calling qx (or maybe open |-) with a real file for input.
>
> With contemporary Unices one could use something like /proc/self/stdin (sp?).
Looks like the correct spelling is /proc/self/fd/0 .
Hope this helps,
Ilya
------------------------------
Date: 13 Feb 2007 12:44:44 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Meditation on inside-out classes
Message-Id: <53dq5sF1s02ruU1@mid.dfncis.de>
I'd like to draw the attention of those interested in the development
of inside-out techniques to a write-up I have posted on perlmonks under
http://www.perlmonks.org/?node_id=599394. It begins:
With inside-out classes it can be arranged that the class itself behaves
like an object, which I'll call its generic object. The generic object
can be initialized and normal accessors can be used with it to set and
retrieve values. It is, however, not a real object in the sense of a
blessed reference. Different classes have (represent? are?) different
generic objects.
What it amounts to is that every object method of such a class can also
be used as a class method.
It goes on to show how this can be implemented and mentions possible
applications. A brief discussion with other perlmonks follows.
Anno
------------------------------
Date: 13 Feb 2007 14:55:34 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Meditation on inside-out classes
Message-Id: <slrnet3kar.19h.abigail@alexandra.abigail.be>
anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
on MMMMCMXIV September MCMXCIII in <URL:news:53dq5sF1s02ruU1@mid.dfncis.de>:
^^ I'd like to draw the attention of those interested in the development
^^ of inside-out techniques to a write-up I have posted on perlmonks under
^^ http://www.perlmonks.org/?node_id=599394. It begins:
^^
^^ With inside-out classes it can be arranged that the class itself behaves
^^ like an object, which I'll call its generic object. The generic object
^^ can be initialized and normal accessors can be used with it to set and
^^ retrieve values. It is, however, not a real object in the sense of a
^^ blessed reference. Different classes have (represent? are?) different
^^ generic objects.
^^
^^
^^ What it amounts to is that every object method of such a class can also
^^ be used as a class method.
^^
^^ It goes on to show how this can be implemented and mentions possible
^^ applications. A brief discussion with other perlmonks follows.
I've used something similar - keying on class names, but not yet
for methods that could be called either as class method, or as
object method.
Interesting technique of mixing them, just don't make class names
consisting of just numbers. ;-)
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
------------------------------
Date: 13 Feb 2007 15:35:18 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Meditation on inside-out classes
Message-Id: <53e45mF1s8uepU1@mid.dfncis.de>
Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
> on MMMMCMXIV September MCMXCIII in <URL:news:53dq5sF1s02ruU1@mid.dfncis.de>:
> ^^ I'd like to draw the attention of those interested in the development
> ^^ of inside-out techniques to a write-up I have posted on perlmonks under
> ^^ http://www.perlmonks.org/?node_id=599394. It begins:
> ^^
> ^^ With inside-out classes it can be arranged that the class itself behaves
> ^^ like an object, which I'll call its generic object. The generic object
> ^^ can be initialized and normal accessors can be used with it to set and
> ^^ retrieve values. It is, however, not a real object in the sense of a
> ^^ blessed reference. Different classes have (represent? are?) different
> ^^ generic objects.
> ^^
> ^^
> ^^ What it amounts to is that every object method of such a class can also
> ^^ be used as a class method.
> ^^
> ^^ It goes on to show how this can be implemented and mentions possible
> ^^ applications. A brief discussion with other perlmonks follows.
>
>
> I've used something similar - keying on class names, but not yet
> for methods that could be called either as class method, or as
> object method.
>
> Interesting technique of mixing them, just don't make class names
> consisting of just numbers. ;-)
Perl won't let me, not easily.
I'm somewhat worried about another aspect -- subclassing may not
work if one class supports "generic objects" and the other doesn't.
Suppose class "Base" has a method ->foo which it calls through a class
name, assuming that this will work as a "generic object". If a class
"Client", which is not so enabled, inherits from "Base", but overrides
->foo with its otherwise perfectly compatible own ->foo, things go
wrong when Base calls SomeClass->foo( ...). It could crash, it could
warn, it could silently do the wrong thing and it could even apparently
work under some circumstances.
In any case, the hallmark of inside-out classes, (almost) unlimited
inheritance, is compromised. In that view, I hesitate to encourage
the use of this technique.
Anno
------------------------------
Date: 13 Feb 2007 15:43:30 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: Meditation on inside-out classes
Message-Id: <slrnet3n4o.1hf.abigail@alexandra.abigail.be>
anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
on MMMMCMXIV September MCMXCIII in <URL:news:53e45mF1s8uepU1@mid.dfncis.de>:
^^ Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
^^ > anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
^^ > on MMMMCMXIV September MCMXCIII in <URL:news:53dq5sF1s02ruU1@mid.dfncis.de>:
^^ > ^^ I'd like to draw the attention of those interested in the development
^^ > ^^ of inside-out techniques to a write-up I have posted on perlmonks under
^^ > ^^ http://www.perlmonks.org/?node_id=599394. It begins:
^^ > ^^
^^ > ^^ With inside-out classes it can be arranged that the class itself behaves
^^ > ^^ like an object, which I'll call its generic object. The generic object
^^ > ^^ can be initialized and normal accessors can be used with it to set and
^^ > ^^ retrieve values. It is, however, not a real object in the sense of a
^^ > ^^ blessed reference. Different classes have (represent? are?) different
^^ > ^^ generic objects.
^^ > ^^
^^ > ^^
^^ > ^^ What it amounts to is that every object method of such a class can also
^^ > ^^ be used as a class method.
^^ > ^^
^^ > ^^ It goes on to show how this can be implemented and mentions possible
^^ > ^^ applications. A brief discussion with other perlmonks follows.
^^ >
^^ >
^^ > I've used something similar - keying on class names, but not yet
^^ > for methods that could be called either as class method, or as
^^ > object method.
^^ >
^^ > Interesting technique of mixing them, just don't make class names
^^ > consisting of just numbers. ;-)
^^
^^ Perl won't let me, not easily.
^^
^^ I'm somewhat worried about another aspect -- subclassing may not
^^ work if one class supports "generic objects" and the other doesn't.
^^
^^ Suppose class "Base" has a method ->foo which it calls through a class
^^ name, assuming that this will work as a "generic object". If a class
^^ "Client", which is not so enabled, inherits from "Base", but overrides
^^ ->foo with its otherwise perfectly compatible own ->foo, things go
^^ wrong when Base calls SomeClass->foo( ...). It could crash, it could
^^ warn, it could silently do the wrong thing and it could even apparently
^^ work under some circumstances.
^^
^^ In any case, the hallmark of inside-out classes, (almost) unlimited
^^ inheritance, is compromised. In that view, I hesitate to encourage
^^ the use of this technique.
Well, if you mask a method that is callable as both a class and an
object method in such a way it's no longer callable as both a class
and an object method, then that implementation is wrong. I don't see
that as being compromised. After all, what inside-out means is that Base
promises to SomeClass that its implementation of 'foo' will not restrict
how SomeClass implements 'foo'.
However, that doesn't mean SomeClass is free to change whatever the caller
is to expect from 'foo'. Inside-out is about promises up and down the
inheritance chain - not between caller and callee.
Abigail
--
# Count the number of lines; code doesn't match \w. Linux specific.
()=<>;$!=$=;($:,$,,$;,$")=$!=~/.(.)..(.)(.)..(.)/;
$;++;$*++;$;++;$*++;$;++;`$:$,$;$" $. >&$*`;
------------------------------
Date: 13 Feb 2007 17:38:45 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Meditation on inside-out classes
Message-Id: <53ebd5F1rbqjvU1@mid.dfncis.de>
Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
> on MMMMCMXIV September MCMXCIII in <URL:news:53e45mF1s8uepU1@mid.dfncis.de>:
> ^^ Abigail <abigail@abigail.be> wrote in comp.lang.perl.misc:
> ^^ > anno4000@radom.zrz.tu-berlin.de (anno4000@radom.zrz.tu-berlin.de) wrote
> ^^ > on MMMMCMXIV September MCMXCIII in
> <URL:news:53dq5sF1s02ruU1@mid.dfncis.de>:
[...]
> ^^ I'm somewhat worried about another aspect -- subclassing may not
> ^^ work if one class supports "generic objects" and the other doesn't.
[...]
> ^^ In any case, the hallmark of inside-out classes, (almost) unlimited
> ^^ inheritance, is compromised. In that view, I hesitate to encourage
> ^^ the use of this technique.
>
>
> Well, if you mask a method that is callable as both a class and an
> object method in such a way it's no longer callable as both a class
> and an object method, then that implementation is wrong. I don't see
> that as being compromised. After all, what inside-out means is that Base
> promises to SomeClass that its implementation of 'foo' will not restrict
> how SomeClass implements 'foo'.
>
> However, that doesn't mean SomeClass is free to change whatever the caller
> is to expect from 'foo'. Inside-out is about promises up and down the
> inheritance chain - not between caller and callee.
I believe you're right, I was over-anxious.
Any class would have to make public which methods are used as both
class- and object methods, for potential overriders to beware.
Whether the behavior is implemented via the "generic object" or
otherwise is irrelevant.
Thanks for clearing this up, I would have hated to deprecate the
neat feature.
Anno
------------------------------
Date: Tue, 13 Feb 2007 19:07:42 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Meditation on inside-out classes
Message-Id: <5jv3t2pn80nj3jk56cae1rvpj85lgpgt89@4ax.com>
On 13 Feb 2007 12:44:44 GMT, anno4000@radom.zrz.tu-berlin.de wrote:
>I'd like to draw the attention of those interested in the development
>of inside-out techniques to a write-up I have posted on perlmonks under
>http://www.perlmonks.org/?node_id=599394. It begins:
++
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 13 Feb 2007 10:14:18 -0800
From: "Larry" <larry.grant.dc@gmail.com>
Subject: set "From" header
Message-Id: <1171390458.588743.132930@q2g2000cwa.googlegroups.com>
Forgive me if this is the wrong group, but I already posted this on
the "sendmail" group and never got any response.
I have an "announcements" type mail list set up in majordomo. I
configured the list with a "restrict_post" setting, which points to a
file of email addresses which are authorized to send mail to the
list. (In case it matters, this file of "authorized senders" is small
and seldom changes.)
The list is basically working, except that when an authorized sender
sends a mail to the list, the "From" header shows the real address of
the sender. I would rather the "From" header be a generic "list
owner" address, no matter who actually sends the mail. How can I do
this?
------------------------------
Date: 13 Feb 2007 06:50:19 -0800
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Syntax Error?
Message-Id: <1171378216.773132.34880@m58g2000cwm.googlegroups.com>
On Feb 9, 8:11 am, anno4...@radom.zrz.tu-berlin.de wrote:
> <g41...@motorola.com> wrote in comp.lang.perl.misc:
>
>
>
> > > I doubt that TomC posted that code. "system" cannot be followed
> > > by a block, that's a syntax error by itself. Please give a reference.
>
> > > Anno
> > Hi
>
> > I searched for "exit status from system with tee" and got the
> > following message, which that code
> > was at the bottom:
>
> >http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thre...
>
> Ugh. That's a thread of 6 articles, none of which is by Tom
> Christiansen. It took me a while to find that what you mean is
> a posting by Charles DeRykus who quotes TomC's solution.
> Unfortunately there's a typo -- there should be a "q" before
> the first "{", making quoted text out of what looks like a bare
> block. Change that and the code will run -- whatever it is
> supposed to do.
>
Apologies for the dropped 'q'. Humbled though I am, this was
probably a "paste-o", not a "typo". I'm not sure why you've
added the dismissive "-- whatever it is supposed to do" either.
TomC's incantation with a clever series of redirections rolled
up inside a backtick to capture initial upstream pipe status still
works. For example, if myprogram is a simple shell script that
just does an 'exit 2', the following Perl:
system q{ exec 3>&1;exit `((myprogram;echo $? 1>&4 3>&- 4>&-)| tee
afile.log 1>&3
3>&1 4>&1) 4>&1`};
if ($?) { warn "myprogram failed: $?" }
generates: myprogram failed: 512 at ./test.pl line 7
Perhaps, there's a more elegant way nowdays though.
--
Charles DeRykus
------------------------------
Date: 13 Feb 2007 15:43:50 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Syntax Error?
Message-Id: <53e4lmF1s8uepU2@mid.dfncis.de>
comp.llang.perl.moderated <ced@blv-sam-01.ca.boeing.com> wrote in comp.lang.perl.misc:
> On Feb 9, 8:11 am, anno4...@radom.zrz.tu-berlin.de wrote:
> > <g41...@motorola.com> wrote in comp.lang.perl.misc:
[...]
> Apologies for the dropped 'q'. Humbled though I am, this was
> probably a "paste-o", not a "typo". I'm not sure why you've
> added the dismissive "-- whatever it is supposed to do" either.
Sorry if that sounded dismissive. I intended to indicate that
I hadn't followed the intricate code inside the quote but only
fixed the quoting mechanism.
Anno
------------------------------
Date: 13 Feb 2007 05:16:09 -0800
From: shurikgefter@gmail.com
Subject: timeout problem
Message-Id: <1171372568.187170.3040@a34g2000cwb.googlegroups.com>
Hi,
I run the following script in apache.
-----------------------------------------------------------------------
#!/usr/local/bin/perl
print "Content-type:text/html\n\n";
print "<html><body>";
`/tmp/bin/unpack.pl `;
$comm_status = $?;
if( $comm_status eq "0" ) {
print "Done";
} else {
print "Error";
}
print "</body></html>";
-----------------------------------------------------------------------
the unpack.pl run ~10 minutes ( the default timeout is 5 minute ) and
when its finished I dont get the script output ( Done or Error ).
How I can solve it without change the default definition of timeout in
httpd.conf.
Thanks
------------------------------
Date: Tue, 13 Feb 2007 09:47:56 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: timeout problem
Message-Id: <45d1dd7d$0$695$815e3792@news.qwest.net>
shurikgefter@gmail.com wrote:
> Hi,
>
> I run the following script in apache.
> -----------------------------------------------------------------------
> #!/usr/local/bin/perl
> print "Content-type:text/html\n\n";
> print "<html><body>";
>
> `/tmp/bin/unpack.pl `;
> $comm_status = $?;
>
> if( $comm_status eq "0" ) {
> print "Done";
> } else {
> print "Error";
> }
>
> print "</body></html>";
> -----------------------------------------------------------------------
>
> the unpack.pl run ~10 minutes ( the default timeout is 5 minute ) and
> when its finished I dont get the script output ( Done or Error ).
> How I can solve it without change the default definition of timeout in
> httpd.conf.
http://www.stonehenge.com/merlyn/WebTechniques/col20.html
------------------------------
Date: 13 Feb 2007 17:27:39 GMT
From: xhoster@gmail.com
Subject: Re: timeout problem
Message-Id: <20070213122832.993$PR@newsreader.com>
shurikgefter@gmail.com wrote:
> Hi,
>
> I run the following script in apache.
> -----------------------------------------------------------------------
> #!/usr/local/bin/perl
> print "Content-type:text/html\n\n";
> print "<html><body>";
## This might interfere with the system commands, but
## in my hands it doesn't.
## Also, this placates my server's (and browser's) timeout, but your server
## may vary.
$SIG{ALRM}=sub {print ".\n"; alarm 10};
alarm 10;
> `/tmp/bin/unpack.pl `;
#Why use backticks if you aren't doing anything with the results?
alarm 0;
print "<hr>";
...
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Tue, 13 Feb 2007 13:49:05 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: works now ! was: bypass shell - pipe into child pid and receive otput
Message-Id: <2ja3t25sdp6hhsrv1ei5hfh7inenb60jrb@4ax.com>
On Tue, 13 Feb 2007 04:51:59 +0100, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:
>sub print_mem { # BSD specific?
I think so.
> my (undef, $file, $line) = caller;
> $file =~ s~ .*/ ~~msx;
>
> if (open my $fh, q{<}, q{/proc/curproc/map}) {
Under Linux you would inspect something in /proc/self/, probably
/proc/self/statm (after a quick look in proc(5)).
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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.
#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 V11 Issue 134
**************************************