[10064] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3657 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 8 04:07:22 1998

Date: Tue, 8 Sep 98 01:00:23 -0700
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, 8 Sep 1998     Volume: 8 Number: 3657

Today's topics:
    Re: Beginner's question (Tim Gim Yee)
        Berkeley DB / DB File Concurrence Problem <szaijan@ternea.com>
    Re: Died at line x? (Martien Verbruggen)
    Re: Died at line x? (Larry Rosler)
    Re: Died at line x? (Abigail)
    Re: Died at line x? (Larry Rosler)
    Re: fork problem: two children finishes at the same tim <lembark@wrkhors.com>
    Re: getting the dimensions of images? (Andre L.)
    Re: HELP NEEDED!! (Martien Verbruggen)
    Re: Help with a bug in a soft (Andre L.)
    Re: History of Perl - round 1 (Norman UNsoliciteds)
    Re: I need Perl 5.004 for Windows 98 <schultesm@hotmail.com>
        localtime and Y2K james_della_porta@ansett.com.au
    Re: localtime and Y2K (Martien Verbruggen)
    Re: localtime and Y2K (Larry Rosler)
    Re: Looking for scheduling app back end <lembark@wrkhors.com>
        News-Scan-0.51 and Data::Dumper: (Roland Schneider)
    Re: Perl Programmer Needed <merlyn@stonehenge.com>
    Re: Perl scripts running as NT services <schultesm@hotmail.com>
    Re: Perl Source Needed <lembark@wrkhors.com>
    Re: print:location woes <alf@orion.it>
    Re: reading a file backward (Larry Rosler)
    Re: reading a file backward <uri@sysarch.com>
        shell execution problem p.edlund@telestet.gr
    Re: shell execution troubles <lembark@wrkhors.com>
    Re: Total Newbie:  Forms and accented characters (Andre L.)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 08 Sep 1998 03:21:47 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: Beginner's question
Message-Id: <35f596ee.292629796@news.oz.net>

On Mon, 7 Sep 1998 08:46:21 GMT, ijg@csc.liv.ac.uk (I.J. Garlick)
wrote:

>Also I have never been able to make '$/' strip the
>character/phrase/word/pattern from what was then read in without doing
>something like:-
>
>	s/$pattern//;

perldoc -f chomp



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

Date: Mon, 07 Sep 1998 21:48:29 -0700
From: Michael Jones <szaijan@ternea.com>
Subject: Berkeley DB / DB File Concurrence Problem
Message-Id: <35F4B71C.2935A92B@ternea.com>

Hi Folks,

I've been using Berkeley DB 1.86 with Perl DB File as the data engine
for
several CGI sites I've built.  Recently, trying to improve robustness,
I've
started using $db->fd and locking the DB Files with the file handle I
can
then generate.  Ideally, I'd like each of the data objects to be able to

create
a DB_File object that points to the correct db file and lock the file
only
when reading or writing.

The Problem:

when I have multiple objects pointing at the same db file, such as

$db1 = tie ( %HASH1, 'DB_file' , "$file_name1", O_RDWR, undef, $DB_HASH
)
$db2 = tie ( %HASH2, 'DB_file' , "$file_name1", O_RDWR, undef, $DB_HASH
)
$db3 = tie ( %HASH3, 'DB_file' , "$file_name1", O_RDWR, undef, $DB_HASH
)

if I print from any of the objects like so:
my $value1;
print $db1->fetch ( 'key', $value1 )

I get the correct return value from each.

However, if I write to the database like so:
$value2 = 'some value';
$db2->put ( 'key', $value2 );

and then perform a fetch of 'key' from each db object, $db2 fetches the
correct
vslue but $db1 and $db3 do not reflect the updates.

Is there some way to make this work?  I've written put methods that sync

the db object and the db file everytime a write is performed, but this
only
updates the db file to reflect the db object from which the sync was
called,
it does not update all other objects that point to the db file.

Any help would be greatly appreciated.

Thanks.

Michael Jones



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

Date: Tue, 08 Sep 1998 02:58:22 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Died at line x?
Message-Id: <i31J1.681$oa3.1884@nsw.nnrp.telstra.net>

In article <6t22db$95s@cabernet.niagara.com>,
	tekkin@hotmail.com (Ken Williams) writes:

> Is there a switch for perl that tells it not to send this message to
> stdout or sterr and just die silently?

Use exit instead of die. Bad advice, but then, ignoring error messages
is bad anyway.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: Mon, 7 Sep 1998 21:44:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Died at line x?
Message-Id: <MPG.105e55f32c7c19bc989836@nntp.hpl.hp.com>

In article <i31J1.681$oa3.1884@nsw.nnrp.telstra.net> on Tue, 08 Sep 1998 
02:58:22 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> In article <6t22db$95s@cabernet.niagara.com>,
> 	tekkin@hotmail.com (Ken Williams) writes:
> > Is there a switch for perl that tells it not to send this message to
> > stdout or sterr and just die silently?
> 
> Use exit instead of die. Bad advice, but then, ignoring error messages
> is bad anyway.

Assuming that the 'die' you are trying to shut up is in a module that you 
don't want to modify (by changing the 'die' to 'exit' directly), you 
could wrap it like this:

eval {
  $ENV{__DIE__} = sub { exit };
  sub_containing_die();
}

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 8 Sep 1998 06:07:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Died at line x?
Message-Id: <6t2hi6$das$2@client3.news.psi.net>

Larry Rosler (lr@hpl.hp.com) wrote on MDCCCXXXIV September MCMXCIII in
<URL: news:MPG.105e55f32c7c19bc989836@nntp.hpl.hp.com>:
++ In article <i31J1.681$oa3.1884@nsw.nnrp.telstra.net> on Tue, 08 Sep 1998 
++ 02:58:22 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
++ > In article <6t22db$95s@cabernet.niagara.com>,
++ > 	tekkin@hotmail.com (Ken Williams) writes:
++ > > Is there a switch for perl that tells it not to send this message to
++ > > stdout or sterr and just die silently?
++ > 
++ > Use exit instead of die. Bad advice, but then, ignoring error messages
++ > is bad anyway.
++ 
++ Assuming that the 'die' you are trying to shut up is in a module that you 
++ don't want to modify (by changing the 'die' to 'exit' directly), you 
++ could wrap it like this:
++ 
++ eval {
++   $ENV{__DIE__} = sub { exit };
++   sub_containing_die();
++ }


Uhm, if you replace $ENV with $SIG, I think it will work, but why
wrap it in an eval{}? In case the 'exit' throws an error and you
want to catch that?



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())))))))))))))))))))))))


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

Date: Tue, 8 Sep 1998 00:04:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Died at line x?
Message-Id: <MPG.105e76cf7bbdde0e989838@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6t2hi6$das$2@client3.news.psi.net> on 8 Sep 1998 06:07:02 
GMT, Abigail <abigail@fnx.com> says...
> Larry Rosler (lr@hpl.hp.com) wrote on MDCCCXXXIV September MCMXCIII in
> <URL: news:MPG.105e55f32c7c19bc989836@nntp.hpl.hp.com>:
 ...
> ++ eval {
> ++   $ENV{__DIE__} = sub { exit };
> ++   sub_containing_die();
> ++ }
> 
> Uhm, if you replace $ENV with $SIG, I think it will work, but why
> wrap it in an eval{}? In case the 'exit' throws an error and you
> want to catch that?

Because of brain rot since MDCCCXXXIV September MCMXCIII.  The 'eval' 
suppressed the 'die' because I typed $ENV instead of $SIG.  You are quite 
correct:
 
    $SIG{__DIE__} = sub { exit };
    sub_containing_die();

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 07 Sep 1998 22:44:07 -0500
From: Steven Lembark <lembark@wrkhors.com>
Subject: Re: fork problem: two children finishes at the same time!
Message-Id: <35F4A807.B56A36A@wrkhors.com>

> I've got a perl program where I do a lot of forking. Each fork prints a string
> to STDOUT and each fork takes some seconds to complete.
> 
> My problem is that sometimes two children finishes at the same time and then
> one or both of the children doesn't print to STDOUT. I wan't to be sure that
> two children don't finish at the same time. I can't 'sleep' for a random
> number seconds because they can finish at the same time anyway.
> 
> Is there a solution to this problem?

(1) don't use stdout, have them write to separate disk files 
    and cat the result together.  also makes it a bit easier
    to pick up the pieces after a major crash.

(2) use syslog.  you can log the stuff at full speed and let the
    syslogd serialize -- and timestamp -- it all for you.  i 
    use syslog regularly and havn't found any slowdown because 
    of it.  additionally you can separate out the data into
    'debug' and 'info' to get a running commentary on what the
    fork-ed children are doing.

(3) have them pass the message back to their parent on exit
    via shared memory.  

(4) use a semaphore on the write sequence.  get and set it 
    before exiting.

	the last two are a bit exotic for most folks but since
	you are a forkaphile there's no telling how far your 
	tastes range.


-- 
 Steven Lembark                                   2930 W. Palmer St.
 Workhorse Computing                             Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582
---------------------------------------------------------------------
  The opinions expressed here are those of this company.
  I am the company.
---------------------------------------------------------------------


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

Date: Tue, 08 Sep 1998 02:36:46 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: getting the dimensions of images?
Message-Id: <alecler-0809980236460001@dialup-514.hip.cam.org>

In article <6t1rvo$h8u$2@msunews.cl.msu.edu>, Dan Nguyen
<nguyend7@msu.edu> wrote:

> jamesht <jamesht@idt.net> wrote:
> : I need to get the dimentions of images from a script, so I can insert
> : them into an html page. How would I do this?
> 
> Try going and opening the image in your browser.  It'll show the size
> in the title of the page.  If your too lazy to do this, just leave
> them blank.

Whistle! Two minutes penalty for rudeness. (The question _is_ legit.)

Andre


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

Date: Tue, 08 Sep 1998 02:57:08 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP NEEDED!!
Message-Id: <821J1.680$oa3.1884@nsw.nnrp.telstra.net>

In article <35F46917.6D66C336@correo.uniovi.es>,
	Roberto <uov01026@correo.uniovi.es> writes:
> Hi everybody, I'm a spanish student of Computing sciences.
> I've done a perl course this summer and I have to do a project in perl.
> It consists on a perl program that should make the following:
> You have a given banner in a navigator window and when you click it
> twice should appear other given banner in other navigator window.
> As simply as this.
> If any of you could help me or let me know where to found a script
> that could make this I would be very grateful.

Would you really learn anything by not doing your assignment? Do you
realise why you are getting assignments? Was the assignment: Go bother
other people and beg for a solution to this problem? or was it: Write
a perl program that does the following... ?

BTW. If what you typed really is the assignment, then your teacher
should get a bit of a course as well.

> Thank you very much. :-))

I do hope that it was helpful. You won't learn a thing if you have an
attitude like that.

If you are still determined to be a lazy bastard after this, try
www.cgi-resources.com. That place is loaded with CGI scripts.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: Tue, 08 Sep 1998 01:00:47 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Help with a bug in a soft
Message-Id: <alecler-0809980100470001@dialup-514.hip.cam.org>

In article <6t13gc$rq0$1@eol.dd.chalmers.se>, f94stbe+news@dd.chalmers.se
(Stefan Berglund) wrote:

> Plate Forme Jeunes Diplomes <plateforme@wanadoo.fr> wrote:
> > $offre=$1 if /\b (Offre\b.*\bX)/;
> > $date=$2 if /\b (Date\b.*\b98)/;
> > $Ale=$3 if /\b (Ale\b.*\bTD)/;
> > $duree=$4 if /\b (Recherche\b.*\bFONT)/;
> > $descriptif=$5 if /\b (CENTER\b.*\bFONT)/;
> > $lieu=$6 if /\b (Lieu\b.*\bFONT)/;
> > $horaires=$7 if /\b (Horaires\b.*\bFONT)/;
> 
> Change all $[2-7] to $1
> The counter starts from the beginning for each new regexp.


That is correct, but there's also the small matter of there being nothing
in $_, according to the example posted:

q{
   open (FILE,"Dr129a.htm");

   $offre=$1 if /\b (Offre\b.*\bX)/;
   $date=$2 if /\b (Date\b.*\b98)/;
   etc.
}

Andre


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

Date: Tue, 08 Sep 1998 13:05:00 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: History of Perl - round 1
Message-Id: <No.unsoiliciteds-0809981305010001@cs11l05.ppp.infoweb.or.jp>

In article <KcBI1.8$qx3.716475@burlma1-snr1.gtei.net>, "Elaine
-HappyFunBall- Ashton" <eashton@bbnplanet.com> wrote:

> >Capitals, proper punctuation, spelling, and grammar makes text easier
> >to read. But, if you want to limit your audience, don't bother with those.
> 
> 
>  i lurked here and posted
> occasionally as a guy, same style, never flamed. in one weeks time, as my
> female self, i have been flamed no less than 3 times for my lack of
> punctuation. now, i draw my own conclusions, you can draw yours.

To be fair old Abbigail flames anyone regardless of sex. Something of a
rarity - an indiscriminate biggot

-- 
It took a learned man to teach me the true meaning 
of ignorance - the willingness to believe learning 
is finite
Norman Unsoliciteds -The Wilderness Years, Boscara Press 1967


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

Date: Mon, 7 Sep 1998 21:19:58 -0700
From: "Sam Schulte" <schultesm@hotmail.com>
Subject: Re: I need Perl 5.004 for Windows 98
Message-Id: <6t2cm7$pks$3@news13.ispnews.com>

http://www.perl.com/CPAN-local/ports/win32/Standard/x86/perl5.00402-bind
ist04-bc.zip

enjoy


joshi@ee.tamu.edu wrote in message <6suvlh$mo8$1@nnrp1.dejanews.com>...
>Hi experts,  I want to try out CGI scripts in Perl and I think I have a
Perl
>5 interprter here on my Win 98 machine. WHere do I get the 5.004
version?
>COuld you please point out the EXACT location/URL as it is hard to look
>around if only a general URL is given. I dont think Perl 5 supports
CGI.pm,
>right?
>
>Thanks
>Sanjay
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

Date: Tue, 08 Sep 1998 05:51:51 GMT
From: james_della_porta@ansett.com.au
Subject: localtime and Y2K
Message-Id: <6t2gln$95a$1@nnrp1.dejanews.com>

Hi,

I'm just going through some scripts of mine, and others written
by collegues.  I understand that localtime does not give a proper
representation of the year, and that you need to add 1900 to it.
My question is,  will this always be the case, or will things change
at some later stage?  eg.  at the year 2001, will the year from
localtime() return 101, or could it possibly come back with 01?
Are the standards for Perl set in concrete?  I'm still pretty new to Perl,
so don't bite my head off if this is a little obvious.  I just want to make
sure, as no-one wants their applications to come crashing down
around them in a couple of years.

If things stay as they are, is the following theory OK?

@date = localtime(time);

$year = (1900 + $date[5]);

Also, are there any other problems associated with Perl and Y2K?

Regards,

James.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 08 Sep 1998 06:59:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: localtime and Y2K
Message-Id: <VA4J1.725$oa3.124700@nsw.nnrp.telstra.net>

In article <6t2gln$95a$1@nnrp1.dejanews.com>,
	james_della_porta@ansett.com.au writes:
> Hi,
> 
> I'm just going through some scripts of mine, and others written
> by collegues.  I understand that localtime does not give a proper
> representation of the year, and that you need to add 1900 to it.
> My question is,  will this always be the case, or will things change
> at some later stage?  eg.  at the year 2001, will the year from
> localtime() return 101, or could it possibly come back with 01?

Do you realise that this question gets asked here at least once a
week? Do you know that dejanews archives this group, as well as many
others, and that you can search through those archives? If not, I hope
that in the future you will try that first. http://www.dejanews.com/
Oh, and of course, you should check out
http://www.perl.com/pace/pub/Does_Perl_Have_a_Y2K_Problem? which is
linked off the main page for perl at http://www.perl.com/ and read Tom
Christiansen's article about the y2k lies.

To answer the question:

The perlfunc man page says this about localtime:

# perldoc -f localtime
[snip]
All array elements are numeric, and come straight out of a struct tm.
In particular this means that $mon has the range 0..11 and $wday has
the range 0..6 with sunday as day 0.  Also, $year is the number
of years since 1900, that is, $year is 123 in year 2023.
[snip]

So, in 2001, the 6th element (index 5) of what localtime returns will
be 101. it is incredibly unlikely that that will change, because it
would break too much existing code.

> Are the standards for Perl set in concrete?

The perl developers have done a very good job in keeping perl backward
compatible. And in this case, I don't think you need to worry at all,
since I believe that perl just returns the tm_year member of a tm
struct. It's even more unlikely that that will suddenly change.

> If things stay as they are, is the following theory OK?
> 
> @date = localtime(time);
> 
> $year = (1900 + $date[5]);

correct.

> Also, are there any other problems associated with Perl and Y2K?

See the abovementioned link.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I think there is a world market for
Commercial Dynamics Pty. Ltd.       | maybe five computers. --Thomas Watson,
NSW, Australia                      | chairman IBM, 1943


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

Date: Tue, 8 Sep 1998 00:17:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime and Y2K
Message-Id: <MPG.105e79d2f8ff70a989839@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6t2gln$95a$1@nnrp1.dejanews.com> on Tue, 08 Sep 1998 05:51:51 
GMT, james_della_porta@ansett.com.au <james_della_porta@ansett.com.au> 
says...
 ...
>   I understand that localtime does not give a proper
> representation of the year, and that you need to add 1900 to it.

'proper'?  year - 1900 is proper enough.  What would be improper?

> My question is,  will this always be the case, or will things change
> at some later stage?  eg.  at the year 2001, will the year from
> localtime() return 101, or could it possibly come back with 01?
> Are the standards for Perl set in concrete?

This behavior is derived directly from the ANSI/ISO C Standard Library 
specification of a structure called 'tm', and is as set in concrete as 
any 'soft'ware can ever be.

>   I'm still pretty new to Perl,
> so don't bite my head off if this is a little obvious.  I just want to make
> sure, as no-one wants their applications to come crashing down
> around them in a couple of years.

No guarantees about poorly written applications, but Perl won't cause any 
problems (at least until 2038 :-).
 
> If things stay as they are, is the following theory OK?
> 
> @date = localtime(time);
> 
> $year = (1900 + $date[5]);

For ever and ever (at least until 2038 :-).

> Also, are there any other problems associated with Perl and Y2K?

How surprised would you be to find this in perlfaq4: "Does Perl have a 
year 2000 problem?"

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 08 Sep 1998 02:29:05 -0500
From: Steven Lembark <lembark@wrkhors.com>
Subject: Re: Looking for scheduling app back end
Message-Id: <35F4DCC1.8B65A988@wrkhors.com>

> I've been asked to build an application to enable company employees to
> dynamically sign up for conference rooms through a web browser.  Currently,
> changes are made by an administrator using MS Schedule + , then static HTML
> is posted to the internal site.

sounds like glorious fun for whomever does the checking and
posting.  do it perl... :-)

> I've considered DBI with mySQL, or plain flat files, using DateManip.  But
> I am wondering if there's a scheduling/ calendar back end for Linux or
> Solaris out there that would be better.
> 
> Or maybe I'll find that MS Schedule + is a wonderful example of open
> architecture with a newsgroup full of happy DBI-using advocates.

given that conference rooms are scheduled on, say, hourly basis
you could use a tied hash with {conference.time} as the index.
either the room is checked out or it isn't.  if it is then whomever
has it checked will be in the hash for that many periods.  time 
could either be converted to unix time via mktime or as a string
like YYYYMMDDHH.  to show a calendar for some conference room 
you simply select the keys for the room and stuff them into html.

alternative is a multi-level hash w/ freeze-thaw where 
	
	$confroom{roomno}{timeslot} = "who has it checked out"

and you only $who can uncheck it out.  since the timeslot is 
sequential anyway on the range [0..23] a has of arrays would
work nicely.

	$confroom{roomid}{date}[hour] = $who;

makes it easy to display the hours for a conference room for 
a day: get the room and date from the user and then list the
hours w/ who has them checked out -- or `***' if you don't want
to show the names.

useful trick would be finding any conference room open at a 
particular time or the next time a conference room is open --
both can be done via walking down the hash chain.

thinking about it...  

-- 
 Steven Lembark                                   2930 W. Palmer St.
 Workhorse Computing                             Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582
---------------------------------------------------------------------
  The opinions expressed here are those of this company.
  I am the company.
---------------------------------------------------------------------


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

Date: Tue, 08 Sep 1998 05:02:28 GMT
From: rs@9809.fish.ch (Roland Schneider)
Subject: News-Scan-0.51 and Data::Dumper:
Message-Id: <35f4b154.9728458@news.lan>

I am trying to install News::Scan 0.51 on FreeBSD 2.2.7 Stable

=46irst with Perl 5.004_04 and Data::Dumper 2.07, 2.08, 2.09
(in this order!) and finally deleted and upgraded everything to
Perl 5.005_02 which has Data::Dumper included in the distribution.

There are always the same errors.

=46irst error when running news-scan:
(this error is not even documented in my 'Programming Perl')

>Encountered CODE ref, using dummy placeholder at
>/usr/local/lib/perl5/5.00502/Data/Dumper.pm line 411.

Line 410 in Dumper.pm:

>sub DumperX {
>  return Data::Dumper->Dumpxs([@_], []);
>}

Using Dumper instead of DumperX gives me the error:

>Encountered CODE ref, using dummy placeholder at
>./news-scan line 50

Line 50 in news-scan:

>print Dumper $scan;

Anyway, the dump gets written and when running news-stats:

(next two lines only when using Dumper, but the whole dump is
in one single line, so this message wont help at all)

>Undefined value assigned to typeglob at (eval 7) line 1, <DUMP> chunk 1.
>Undefined value assigned to typeglob at (eval 7) line 1, <DUMP> chunk 1.

And always the fatal error:

>Can't call method "name" without a package or object reference
>at ./news-stats line 96.

Line 96 in news-stats:

>my $group    =3D $scan->name;


Since the test-file 'test.dump' from the News::Scan-Distribution
works fine, I suspect the Data::Dumper makes something nasty
when writing to the dump.


TIA for any hints :)

Roland


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

Date: Tue, 08 Sep 1998 04:38:24 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Perl Programmer Needed
Message-Id: <8cpvd7nrrm.fsf@gadget.cscaper.com>

>>>>> "Richard" == Richard  <Richard@WowMe.com> writes:

Richard> My point still stands, I not only didn't hurt anyone by my
Richard> post, I am helping others.  HONESTLY.  Perhaps if you flame
Richard> me enough you will stay off some other HONEST SMALL
Richard> BUSINESSES trying to offer money to people who want to use
Richard> their HARD LEARNED talents to put FOOD on their table and
Richard> clothes on their kids backs.  Like in my own case!

And you still haven't told me why a post in misc.jobs.offered wouldn't
have helped you.  I'm certainly not saying "please don't post perl
jobs".  I'm just saying that there *already* exists a place for it.
And it's *not* comp.lang.perl.misc.

There are even web sites that pull the stuff from the job groups and
sort it by region and skill.  If your candidate can't learn to use the
proper newsgroups and websites, why would you want to hire him in the
first place?

<Insert sound of boggled mind here.>

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 7 Sep 1998 21:46:07 -0700
From: "Sam Schulte" <schultesm@hotmail.com>
Subject: Re: Perl scripts running as NT services
Message-Id: <6t2cse$pvl$1@news13.ispnews.com>

you are so nice and helpful Dan ;^(

what's with the signature line on love and your un-loveable posts?

Dan Nguyen wrote in message <6si580$n68$1@msunews.cl.msu.edu>...
>Scott Pasnikowski <spasnikowski@symantec.com> wrote:
>
>Thank you so much for posting the same thing again.
>
>
>--
>           Dan Nguyen            | There is only one happiness in
>        nguyend7@msu.edu         |   life, to love and be loved.
>http://www.cse.msu.edu/~nguyend7 |                   -George Sand
>




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

Date: Tue, 08 Sep 1998 02:33:05 -0500
From: Steven Lembark <lembark@wrkhors.com>
Subject: Re: Perl Source Needed
Message-Id: <35F4DDB1.F202A477@wrkhors.com>

Tom Christiansen wrote:
> 
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc,
>     Michael Hodge <mhodge@netcom.ca> writes:
> :Can anyone point out a reliable source for "good" Perl source? What I
> :would prefer to do is learn by example.
> 
> There are examples of this in
> 
>     http://www.perl.com/CPAN-local/authors/Tom_Christiansen/scripts/
> 
> The code for the Perl Cookbook is also fetchable from the Camel Critique page.
> 
> --tom
> --
> /* Force them to make up their mind on "@foo". */
>     --Larry Wall, from toke.c in the v5.0 perl distribution

also check Effective Perl Programming for good examples and
ways to apply them.

-- 
 Steven Lembark                                   2930 W. Palmer St.
 Workhorse Computing                             Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582
---------------------------------------------------------------------
  The opinions expressed here are those of this company.
  I am the company.
---------------------------------------------------------------------


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

Date: 27 Aug 1998 09:29:39 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: print:location woes
Message-Id: <m3lnoa3msc.fsf@aldebaran.orion.it>

Greetings.

"Daniel Adams" <dan@fearsome.net> writes:

> I was wondering if anyone else had run into a similar problem....the three
> lines below are all perfectly valid, right?:
> 

Everybody would run into the same problem.

[...]
> OK, fine. However, when I run them together thusly:
[...]
> print "Location: http://fearsome.net/rants/$path/board\.htm\n\n";
> 
> the script simply prints "Location: etc" to the screen next to "Goodbye,
> cruel World".
[..]

Of course.

> Either this script is being exceedingly naughty and doesn't deserve
> its hot cocoa, or else I am scrweing something up somewhere - anyone care to
> elaborate? 

Screwing up, but not in the script.

See, the way CGI output is understood by a browser is:

Everything up to the first empty line constitutes headers;
Everything after that *up to the end of the transaction* is content.

So, there is no way to feed more headers to a browser after you
have output the \n\n thing.
What you want is a meta tag - the one that has to do with refresh,
not sure which exact one.

You may also notice that the dreaded word 'perl' was not mentioned
in my post - that's beacause you'd have the same problem  even
if your prg was written in Forth - assuming such a beast is conceivable.

You need to work on your CGI protocol knowledge. The O'Reilly
'mouse' book - CGI programming for the world wide web - helped me
a lot on that one.

Cheers,
	Alessandro

-- 
One standard to rule them all, one standard to find them,
One standard to bring them all, and in darkness bind them.
In the land of Microsoft, where the Shadow lie.

Alessandro Forghieri              http://www.orion.it/~alf


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

Date: Mon, 7 Sep 1998 22:26:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: reading a file backward
Message-Id: <MPG.105e5fc364115c95989837@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <6t22dm$d6c$1@csnews.cs.colorado.edu> on 8 Sep 1998 01:48:38 
GMT, Tom Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, 
>     lr@hpl.hp.com (Larry Rosler) writes:
> :What I posted originally was a simple existence proof that contradicted 
> :Jonathan Stowe's assertion, which I then quoted from the Bighorn Sheep 
> :(that won't go over as well as the Llama or the Camel, I fear), anyway 
> 
> It's the Ram Book.

Cool.

> :The Perl Cookbook, Recipe 8.4, p. 282:  "You must read the lines into 
> :memory, then process them in reverse order.  Needless to say, this 
> :requires at least as much available memory as the size of the file."  
> 
> I think you are taking this too strongly.  I was trying to provide a nice
> simple solution.  Notice the simple solution beats the fancy one
> in time.

No quarrel.  It just happens to be a solution that doesn't fit the 
problem requirements.  *You* didn't suggest it for this problem.  I used 
your recipe to back up /J\s assertion, which told the submitter it 
couldn't be done for his huge log file.  Which I then refuted.

 ... 
> There are of course many ways of ``reading a file backwards'', one of
> which is to implement a shadow version as a doubly linked list on disk.
> That's certainly not my recommendation.  I just wanted something simple.

And, *if* the file fits in memory, optimal.

> Note also that the I/O system is highly optimized for forward reading.
> That's why it does look-ahead.  If you run backwards in the file, you
> thrash it -- just like the Vax-killers of old that would murder VM by
> doing the same thing in memory.

That is a good point, which another correspondent mentioned to me by e-
mail.  But if it's needed to get the job done...

This seems like a good time to summarize.  Here again is the original 
post:

:> Subject: reading a file backward
:> From: sekchye <sekchye@singnet.com.sg>
:> Organization: Singapore Telecommunications Ltd
:> 
:> Hi.  I need to read in a huge log file line by line starting from last
:> line to the first line.  
:> 
:> How do I do this in PERL?  (Not by using `tac` or reading the whole
:> file into array and then reverse the array)

I submitted a few lines of code that solved the problem, albeit with less 
than optimal efficiency.  Mark-Jason Dominus instigated, and Uri Guttman 
volunteered to implement, a module to encapsulate a more efficient 
algorithm.  And Tim Gim Yee posted working code for such a module.

All in all, pretty good work for a US-holiday weekend!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 08 Sep 1998 03:27:48 -0400
From: Uri Guttman <uri@sysarch.com>
To: lr@hpl.hp.com (Larry Rosler)
Subject: Re: reading a file backward
Message-Id: <x767ez12tn.fsf@sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> I submitted a few lines of code that solved the problem, albeit
  LR> with less than optimal efficiency.  Mark-Jason Dominus instigated,
  LR> and Uri Guttman volunteered to implement, a module to encapsulate
  LR> a more efficient algorithm.  And Tim Gim Yee posted working code
  LR> for such a module.

i am working on my version. i will have it in a day after some more
debugging.

it will need some modularization. also it can be made more efficient if
i can get read with POSITION working and if 4 arg substr is used.

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Tue, 08 Sep 1998 05:52:17 GMT
From: p.edlund@telestet.gr
Subject: shell execution problem
Message-Id: <6t2gmg$95c$1@nnrp1.dejanews.com>

I have a problem with executing shell commands from within a perl script.
Standard shell commands, such as `sleep 10`; and system("sleep 10"); poses no
problem but when I do something like this:

qx/su - newuser -c sleep 10/;

the shell escape never returns to the perl script.

Could this be a perl related problem or is it something inherent in the
(Bourne) shell?

(I run perl 5.004_4 on a Digital 8400 with OSF1 v4.0B)

Any help is appreciated
//peter.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Tue, 08 Sep 1998 02:30:54 -0500
From: Steven Lembark <lembark@wrkhors.com>
Subject: Re: shell execution troubles
Message-Id: <35F4DD2E.B82835CC@wrkhors.com>

ped2202@my-dejanews.com wrote:
> 
> I have a somewhat annoying problem with executing shell commands from within a
> perl script.
> 
> A standard shell cmd might look like this:
> qx/sleep 10/; or system("sleep 10");
> and this works just as it should. The script forks out a process that could
> look like something like this:
> 
> myuser    1323 10149  0.1 19:15:39 ttyp4        0:00.01 sleep 10
> myuser   10149 32029  0.0 19:18:07 ttyp4        0:00.01 perl -w foo.pl
> 
> and will return to the perl script nicely.
> 
> The problem crops up when you try something like this:
> 
> qx/su - newuser -c sleep 10/;
> 
> Here, perl obviously checks for several commands and to be sure everything
> works allright it adds a 'sh -c' (eg. fork a new shell and execute whatever
> is after the '-c' flag)
> 
> the processes that comes out of this would look like this:
> 
> newuser   2598   842  0.1 19:18:07 ttyp4        0:00.02 -ksh -c sleep 10 (ksh)
> myuser     842 32029  0.0 19:18:07 ttyp4        0:00.01 perl -w foo.pl
> 
> And this is where the new process never returns to the original perl script.
> Strange. Hmm, well there's another way as well that produces yet another
> result:
> 
> If you would do this instead:
> 
> qx/su - newuser -c 'sleep 10'/; (which is the way it
> 
> you would get an extra process that might be of some explanation:
> 
> newuser    3476 30427  0.2 19:22:57 ttyp4        0:00.02 -ksh -c sleep 5 (ksh)
> myuser    30427  2848  0.1 19:22:57 ttyp4        0:00.01 sh -c su - newuser -c
> 'sleep 5'
> myuser     2848 32029  0.0 19:22:57 ttyp4        0:00.01 perl -w foo.pl
> 
> basically, here you get two '-c' (:command) flags to execute.
> 
> Any help will be greatly appreciated.
> 
> Best regards,
> //peter.
> 
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

if you're not root then su is going to stop and ask you for
a password.  no password, no execution.

-- 
 Steven Lembark                                   2930 W. Palmer St.
 Workhorse Computing                             Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582
---------------------------------------------------------------------
  The opinions expressed here are those of this company.
  I am the company.
---------------------------------------------------------------------


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

Date: Tue, 08 Sep 1998 03:14:53 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Total Newbie:  Forms and accented characters
Message-Id: <alecler-0809980314530001@dialup-514.hip.cam.org>

In article <harley-0709981302240001@ppp-5200-0117.tor.total.net>,
harley@dreamribbon.com (Harley Jacoubsen) wrote:

> Hi!
> 
> I have a question in regards to submitting words with accented characters
> in forms, and the resulting output.  The following problem happens when
> the popular FormMail.pl script from Matt's Perl Archive
> (http://www.worldwidemart.com) and the Subscribe Me mail list script from
> the CGI Script Center (http://cgi.elitehost.com) are used to process the
> form content.
> 
> The problems is thus:  when words with accented characters are used (such
> as some French words), the email message resulting from the form
> substitutes those accented characters with weird characters.  For
> example:  "` l'icole ga-va" becomes "} l'Hcole Aa-va" in the resulting
> email
> 
> I think the problem could be one of the following three things:
> 
> 1)  When the script says "print MAIL" it should be specifying the
> character set or something (like ISO-LATIN blah, blah)
> 
> 2)  The web server's SENDMAIL program is not configured to handle accented
> characters.
> 
> 3)  The computer/browser that receives  the email results from the form
> does not have the correct "character set" setting, or some similar
> misconfiguration.
> 
> Are any of the three above assumptions correct, or am I way off?
> 
> Thanks in advance for any response!
> 
> Regards!


The body of the message should be encoded in quoted-printable. This is
easily done using Gisle Aas's MIME::Quoted print module (available at
http://www.cpan.org).

Also, to let the mail client know about the encoding, the following
headers should be put in the message:

Mime-version: 1.0
Content-type: text/plain
Content-transfer-encoding: quoted-printable

(When inserting the headers, make sure a blank line gets printed between
the last header and the body.)

And, to make sure the browser sends the form data to the CGI in the
correct character set (not guaranteed with Netscape), this META tag,
placed in the HEAD section of the HTML document that contains the form,
appears to do the trick:

<META HTTP-EQUIV="Content-type" CONTENT="text/html;charset=iso-8859-1">


HTH,
Andre


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 3657
**************************************

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