[28941] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 185 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 2 06:12:39 2007

Date: Fri, 2 Mar 2007 03: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           Fri, 2 Mar 2007     Volume: 11 Number: 185

Today's topics:
        changed to OT Re: DocumentHTML ? <g_m@remove-comcast.net>
    Re: changed to OT Re: DocumentHTML ? <uri@stemsystems.com>
    Re: changed to OT Re: DocumentHTML ? <spamtrap@dot-app.org>
    Re: changed to OT Re: DocumentHTML ? <g_m@remove-comcast.net>
    Re: Disable warnings from specific module <ced@blv-sam-01.ca.boeing.com>
    Re: Error In DBI - Cannot execute multiple statements <pankaj_wolfhunter@yahoo.co.in>
    Re: Error In DBI - Cannot execute multiple statements <paduille.4060.mumia.w+nospam@earthlink.net>
        format issue <robertchen117@gmail.com>
    Re: format issue <prawnMUNG@prawn.me.uk>
    Re: format issue <prawnMUNG@prawn.me.uk>
    Re: format issue anno4000@radom.zrz.tu-berlin.de
        how to find the "yesterday" logfile name? <robertchen117@gmail.com>
        mod_perl error:  (120000) exit was called at <sean115=at@=reeve.nl>
    Re: mod_perl error:  (120000) exit was called at <noreply@gunnar.cc>
        mod_perl errors <sean115=at@=reeve.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 2 Mar 2007 03:37:46 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: changed to OT Re: DocumentHTML ?
Message-Id: <xo-dnU1BurvQf3rYnZ2dnUVZ_r-onZ2d@comcast.com>

Sinan > wrote
> I don't know what to make of you.



Sinan,
  I wrote the following post just after I read your post.

And if you read it you'll see why I didn't post it then.
And why I decided not to post it at all.

I often write this way.
And almost never post this way.
And I'm sure I'll never do it again here.

But I just I kept thinking about you saying
you don't know what to make of me!

And that started making me feel very lonely.

And that's why I've decided to post this after all.
Just so you'll know what to make of me.

In this one instance anyway.

But please understand me --the temperament that
appears here is not anything that ever lasts in me
for more than a minute.

It just so happened that around the time this thread occurred,
I happened to be searching for something in Google,
and it seemed to me that every single promising looking
hit I followed --- wound up in a empty red-herring like
post - just like Tad's is in this thread.

And that's the whole point I want to make.

All the rest here is "colored bubbles".

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


>>>  -- 
>>>    Tad McClellan
>>>    SGML consulting
>>>    tadmc@augustmail.com
>>>    Perl programming
>>>    Fort Worth, Texas
>>>
>>
>>  please don't spam.

> Greg:
>
> I don't know what to make of you. What is the point of that remark? Tad's
> signature is just that: A standard sig which is separated from the body of
> the post with the proper sequence of characters so that any reasonable
> newsreader can automatically snip it in replies.
> If you haven't read the posting guidelines yet, you should read them and
> follow them so as to maximize the chances of getting useful responses.
>
> Sinan
> -- 

~~~~~~~~~


> What is the point of that remark?

Well, Sinan,
  What is the point of Tad's contribution to this thread?


Please break out of the little world here for a second
and read it objectively.

It is a nasty, insulting, trivializing, pontificating,
officious  -- and - content-wise - a completely
empty thing.


    ~greg t> wrote:
    > Gentlemen, I'm old.
    Me too. Bummer eh?
    >  It would never have occurred to me that explicit
    > "use strict"
    > and "use warnings" is a courtesy to others.
    Please see the Posting Guidelines that are posted
    here frequently.
    > I will do it from now on.
    Thank you.
    [ snip TOFU.
      Please don't do that either.
    ]


I had said to you (Sinan) that I will
use the "use..." stuff from now on.

So what was Tad's point in bringing it up again?
right after I said I would?,
- in his quoting me saying so?,
--and in his chiming-in with  (--what emoticon?)
"Thank you" ?

(The answer is that he was being passive agressive.)

Morevoer, and more tellingly,
-- I do not find anything at all in Tad's famous guidelines
about "use strict" and "use warnings' !

I had written >>

    >>  It would never have occurred to me that explicit
    >> "use strict"
    >> and "use warnings" is a courtesy to others.
    >> I will do it from now on.

And he answered:

    > Please see the Posting Guidelines that are posted
    >here frequently.

and then:

    >Thank you.

Is there something, - anything, - specific in his guidelines
that he wanted me to see?

Some generality, perhaps, of obvious applicability
to "use strict" "use warnings"??

Or is his mentioning his guidelines
on every pretext he can think of,
to everyone he can get away with it,
--simply a completely empty mechanical habit with him? .

Is his doing it, therefore, spam?

~~~

I did see one interesting thing in Tad's guidelines.

And you have asked me. So I will tell you.

The meaning of my remark was not the same thing as the point of it.
But the meaning of it was this: ....

Right near the very top of Tad's
"Posting Guidelines for comp.lang.perl.misc ($Revision: 1.7 $)"
it says:

  "This newsgroup, commonly called clpmisc,
    is a technical newsgroup intended to be used for discussion
    of Perl related issues  (except job postings), ..."

And near the middle it says:
   "Never quote a .signature
    (unless that is what you are commenting on)."

And near the bottom it says:

  "AUTHOR
   Tad McClellan <tadmc@augustmail.com>
   and many others on the
   comp.lang.perl.misc newsgroup. "

~~


I am now commenting on Tad's .signature.

Note especially the specifically-mentioned parenthetical exception:
    "(except job postings)"

Note how it is given pride of place,
right near the very top of Tad's document.

So apparently Tad has written just for himself
some kind of secret-exemption to this rule.

So. Now.
Why does Tad tell everybody to go read his guidelines?

And why does he put "except job postings" right at the top of it?

Well, this is the reason: ...
It's so that any other "SGML consultant" who chances by,
and who wants to follow all "the rules", to be polite,
- will decide not to advertise himself
in the same way that (only) Tad is permitted to do,
in his .signature.

Thus giving Tad the market advantage.

And that's what's called Spam.

The sneaky effort to achieve an unfair market advantage.

~~~

But don't blame me!
I wasn't among the so-called "many others"
involved in the authoring of Tad's "guidelines."

~~~

Now, honestly, I don't care at all about little hypocrisies like that.
(Big ones in the government are much more fun to spot.)

And I don't have any grudge at all against Tad.
Certainly not a personal one.
After all, I only know of him from that single post!
Obviously I am pre-judging him, based on some
past experience with a certain type of character
that that single post reminds me of.

More than that. I do know that Tad has done
a lot of good here. In fact I suspect that he is probably
the most responsible for much of the efficiency of this newsgroup.
- exactly what makes this place such a
pleasure to romp through.

Guidelines are good things.
And I always try to follow them, whether or not I agree with them.


But, having said that,  .....

~~~

What, pray tell, was Tad's point in commenting to me
the way he did?
--this way? : ...

>  ~greg > wrote:
> > Gentlemen, I'm old.
> Me too. Bummer eh?

That remark would have sounded very different
if it had a clear purpose. Or if it had been
elaborated in some friendly way.

As it stands, though, it is pure monkey business.
It's a razz. It doesn't have any point at all
other than being catty.

And my point, - the one you asked me about,
was simply to respond in-kind!

--- the better to  help Tad become a kinder,
gentler old man.

In Peter Jackson's King Kong,
Kong thinks it's so funny the way he keeps knocking
Ann Darrow (Naomi Watts) down. Until she makes him
stop. And then he throws a tantrum. And then a rock
falls on his head. And then, just a few seconds later,
he gets the connection. And he becomes (almost) human.


If you, Sinan, honestly believe that it is ok for Tad to be
as nasty and as irrelevant as he wants to be,
- to any one he so happens to feel like being nasty to

- and if you also honestly believe that it is not ok
for anybody else to respond in-kind to him
--under penalty of being ostracized,
(-- and not just by Tad, and perhaps you,
--but by everybody here --- you two speaking for everybody! ...)

Well, then, Sinan, that is what I would call
"megalomania by proxy".


( Your comment:
  > "maximize the chances of getting useful responses".
   is a blatant euphemism for
  "if you don't follow Tad's rules to the letter, you'll be ostracized here".
)

I prefer plain language.

(by the way,
"the guidelines" has it slightly different:
In "the guidelines" it's: "maximize your chances of getting meaningful replies"
-- ie, "meaingful',
- not "useful".
(--the difference is that "useful" is a dime a dozen,
whereas "meaningful" is close to the essence of humanity.)

It's possible, - just possible, --that you, Sinan -- in quoting that, and all,
- were throwing just a Tad-bit of a curve in your post.
But I'll probably never know.)


~~~~


I know it was  ... something...., of me to admit that I'm old.

But - quite unlike Tad's monkeying of it
- my saying it had a clear purpose.
Clear enough anyway that you got the point, since
you wrote:
  "As I wrote that message, I replaced your script with the
   copy-pasted version of my script but gave no indication
   of the fact that I had changed a single line in it.
   That's my fault."


There is probably a rule about it somewhere.
Something like

   "when you add improvements or make corrections
    or in any other way alter somebody else's code,
    please comment on what you've done, above the code,
    so that old people, who don't see so good, and don't
    scan so well no more, can better see that a change
    has been made, so that they can then better
    apportion their dwindling ability to concentrate to better effect."

If there is such a rule, and if I were Tad,
I could say:

  "please COCK. thank you."

"COCK" meaning
  "(please) Comment Over Changes, (you) Krazy (person!)"
or something equally obvious as that.

I mean really --- if Tad is permitted to tell me:
   >   "  [ snip TOFU.
  >  Please don't do that either.
  >  ]

making me having to guess that "T" stands for "TOP"
(--which I did immediately, because immediately
after posting the offending "TOFU", when it was too late,
I had already, all by myself, realized the goof .)

- then, certainly, I should be permitted to tell Tad:
"PDMAWOPFFNGR"
(--"Please Don't Monkey Around With Other People's
Feelings For No Good Reason")


So I got the "T" part no problem.

But there is no way that I or anybody else
could ever guess the rest of "TOFU" :
"TOP OVER, FULLQUOTE UNDER".

For one thing, "fullquote" isn't a real word.

So I had to waste my valuable time looking up "TOFU".
(Bean curd.)

Which I bothered doing, - only because I suspected
that the "FU" part meant something quite different.

(Which it probably does, for the cognoscent,
since, again, 'fullquote' isn't a real word.)

Whereas I'd thought that the whole point in having rules in the first place
was to help people avoid wasting other people's time!

~~

I know that Tad is truthful when he tells me that he's old too.
Because this kind of pointless cutesy acronym did once
play a vital role in Usenet. Back when connections were
full-duplex 300 baud over phone lines.

Today however they are more often used
only by obnoxious adolescent cliques,
(And some dwindlingly percentage of us troglodytes.)


As for my "TOFU" blunder
-- I had really thought that it was pretty obvious that I had
simply forgotten, in my hast, to delete the automatically quoted part.
Quite obviously so, to anybody who read the post,
because the bottom quoted part isn't referred to
at all in the "TOP OVER" part.

Being in hast is not a sin.
Spelling mistakes are not a sin.

Posting to newsgroups is not the same thing as publishing
active legal documents.

~~

I have posted perhaps a dozen posts in total to this newsgroup,
over the last 7 years. So I don't know.

Maybe I have made this same mistake before?

If so, then it would mean that it is a persistently bad habit with me.
And, if so, then I would have to be grateful to anybody who
pointed it out and made me stop.

However,  when a mistake is made just once, or twice,
it isn't the mistake that wastes people's time.

It is obsessive commenting on this kind of trivia,
- the way that some people seem to be addicted to doing,
for whatever inscrutable pleasure they derive from it,
- that is the greatest waste of our time.

~~~~


But I have to tell you the real reason that I am going on like this!

It is because the greatest frustration in Google newsgroup searching
is clicking on the about 20% of the Re: posts that look promising
for an answer, --only to have to scroll down to one or another
variation on:
   "This is not an appropriate question to be asking in this
    (read: 'my') newsgroup.
     Go ask somewhere else."

Or, for another example, anything like:
    >   "  [ snip TOFU.
    >  Please don't do that either.
    >  ]

Can't you-all see, those of you who habitually post
blanks like that how much happier the whole world
at large would be if only ---when you have nothing to say,
-- you simply refrained from saying anything?

If everybody did obey my little rule,
then, when I go through a Google return list
and see that a particular post doesn't have
any responses,
- I won't have to waste my time on red herring!

When somebody doesn't get a response in a particular newsgroup,
why can't you-all conceive that they just might be intelligent enough
to figure  out for themselves that it's just probably the wrong group
to ask the question in?

If they persist, obviously, then you must tell them.
You must put them out of their misery.

But, honestly, how often does that happen?

No. Some people are just way too-cocked for jumping
on the heads of rules-violators -- for me to believe
them when they say that they are just doing
the rest of us a service.

Because the truth is, clearly, that they derive
some sort of perverse pleasure in playing the
authority and telling people off.

Read Foucault.
  "His work concerning power and the relation
 between power and knowledge, ...
 have been widely discussed and applied...." - Wikipedia.


It's precisely the incessant picayune carping that wastes the most
of people's time. Negative comments are always, whatever their
claimed holy intent, a waste of time. And when they become
too high a percentage in somebody's overall contribution
then, --bummer: --  maybe that person really is just too old
and dried up, and ought to be let out to pasture.


Sinan > wrote
  > What is the point of that remark?

There was no point, Sinan.
I was joking.
Just responding in-kind to Tad.


> ERIKSSON: Pardon me sir, what's your point, sir?
>
> HILL: There ain't no point, Eriksson. I'm simply
> trying to illuminate the terrain in which we currently
> find ourselves deployed. You don't mind that, do you?
>   And if you do ...
> (- "Casualties of War").



Vietnam was "my" war.

And we had a word
- a rule -
for the way to deal with Taliban-like self-appointed prefects:

"frag 'em".

--
~greg.




(but please understand!
I am old.
And I have just been to the dentist!

And that is, honestly, the only reason
this post sounds the way it does.)






























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

Date: Fri, 02 Mar 2007 03:50:50 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: changed to OT Re: DocumentHTML ?
Message-Id: <x7k5y0t4et.fsf@mail.sysarch.com>


<snip>

what a sad waste of precious pixels.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Fri, 02 Mar 2007 03:59:21 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: changed to OT Re: DocumentHTML ?
Message-Id: <m23b4oowba.fsf@local.wv-www.com>

"~greg" <g_m@remove-comcast.net> writes:

> Sinan > wrote
>> I don't know what to make of you.
>
> And if you read it you'll see why I didn't post it then.
> And why I decided not to post it at all.
>
> I often write this way.
> And almost never post this way.
> And I'm sure I'll never do it again here.

Well, at least now we know what to make of you.

Bye.

*plonk*

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Fri, 2 Mar 2007 04:42:56 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: changed to OT Re: DocumentHTML ?
Message-Id: <dcWdna4ZqdMNbHrYnZ2dnUVZ_oGlnZ2d@comcast.com>


"sherm" "plonked" me,
but this is for him too...



I completely agree with both of you.


I'm sure you noticed that I retitled this
Off Topic,
--so I have no idea why you read it,
much less why you bothered responding.

I assume it's brotherhood.

Anyway, you two aren't the problem that I was talking about.
I just clicked on a bunch of your posts and they
are almost exclusively technical. I could learn
a lot (a lot technical) from every one of them.
None of them would bother me if they came
up in a google search.
So they aren't the time-wasters I was talking about.

Also, your few nasty comments in your posts
are almost always clearly deserved and relevant
to the posts that they're in response to.
(Even in this case, I admit.)

So. Now.
Please! - Just do me this one favor.
Answer me this:

Tell me why Tad responded to my:

    >> (I'm not a professional)
    >>  It would never have occurred to me
    >> that explicit "use strict"
    >> and "use warnings"
    >> is a courtesy to others.

with

 >Please see the Posting Guidelines that are posted
 > here frequently.

When there is nothing whatever
in his guidelines about "use strict"
and "use warnings'!

--and when I had immediately added : ...
    >> I will do it from now on

?

If you can just answer that,
then of course I'll have to take it all back.

(which I'd do anyway if I could.
it posted at 4am.
But that's not your problem. You don't have
a problem. Not with me anyway.

Thank you for righting my boat.






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

Date: 1 Mar 2007 22:15:13 -0800
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Disable warnings from specific module
Message-Id: <1172816113.143286.263230@64g2000cwx.googlegroups.com>

On Feb 27, 11:52 am, "Paul Lalli" <mri...@gmail.com> wrote:
> On Feb 27, 11:38 am, snu...@gmail.com wrote:
>
>....
>
> You could try wrapping a call to any of those experimental features in
> a block in which $SIG{__WARN__} has been changed to ignore warnings.
> Or you could try locally setting $^W to 0 in a block around those
> features (though I don't think that would handle the case where the
> module's code is specifically generating a warning using the warn()
> function).
>
> {
>   local $SIG{__WARN__} = sub { 1 };
>   do_something_experimental();
>
> }

Ugly but you could filter stderr entirely...
I think:


open( SAVE, '>&STDERR') or die $!;
{   open(STDERR, '>', File::Spec->devnull);
    do_something_experimental();
}
open( STDERR, '>&SAVE' ) or die $!;
 ...

--
Charles DeRykus



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

Date: 1 Mar 2007 23:15:17 -0800
From: "pankaj_wolfhunter@yahoo.co.in" <pankaj_wolfhunter@yahoo.co.in>
Subject: Re: Error In DBI - Cannot execute multiple statements
Message-Id: <1172819717.813783.12100@t69g2000cwt.googlegroups.com>

On Mar 1, 8:48 pm, "Mumia W." <paduille.4060.mumia.w
+nos...@earthlink.net> wrote:
> On 03/01/2007 06:09 AM, pankaj_wolfhun...@yahoo.co.in wrote:
>
>
>
>
>
> > Greetings,
>
> > Sample script
>
> > #!/usr/bin/perl -w
>
> > use DBI;
>
> > $dbh = DBI->connect("DBI:Oracle:dbname","username","password") || die
> > "Cannot connect to Database : $DBI::errstr\n";
>
> > $dbh->do(q{
> >         spool test.sql
> >         select sysdate from dual
> >         spool off
> >     });
>
> > Error:
>
> > DBD::Oracle::db do failed: ORA-00900: invalid SQL statement (DBD
> > ERROR: error possibly near <*> indicator at char 10 in '
> >         <*>spool test.sql
> >         select sysdate from dual
> >         spool off
> >     ') [for Statement "
> >         spool test.sql
> >         select sysdate from dual
> >         spool off
> >     "] at hi.txt line 8.
>
> > What is wrong with the query?
>
> > Help would be appreciated
>
> > TIA
>
> It sounds like your database software is configured to disallow multiple
> SQL statements to be put into a single query. Break the statements up:
>
> $dbh->do(q{ spool test.sql });
> $dbh->do(q{ select sysdate from dual });
> $dbh->do(q{ spool off });
>
> Note that I have no knowledge of Oracle.- Hide quoted text -
>
> - Show quoted text -

Thanks Paul, Mumia.

As Paul suggested, I tried with

Script:

#!usr/bin/perl -w

use DBI;

$dbh = DBI->connect("DBI:Oracle:dbname","username","password") || die
"Database Connection not Made : $DBI::errstr\n";

my ($date) = $dbh->selectrow_array('select sysdate from dual');
open my $ofh, '>', 'test.sql' or die $1;
print $ofh "$date\n";

$dbh->disconnect();

It works. One question, if some error occurs from oracle side then it
gets displayed on console.
How can I redirect the output of a query (error or not) to another
file without displaying it on screen?

TIA



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

Date: Fri, 02 Mar 2007 09:03:47 GMT
From: "Mumia W." <paduille.4060.mumia.w+nospam@earthlink.net>
Subject: Re: Error In DBI - Cannot execute multiple statements
Message-Id: <TLRFh.7590$_73.6547@newsread2.news.pas.earthlink.net>

On 03/02/2007 01:15 AM, pankaj_wolfhunter@yahoo.co.in wrote:
> [ script snipped ]
> It works. One question, if some error occurs from oracle side then it 
> gets displayed on console.
> How can I redirect the output of a query (error or not) to another 
> file without displaying it on screen?
> 
> TIA
> 

The command "perldoc -f open" will show you how to redirect STDERR to a 
file. It's best to do this only temporarily.



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

Date: 1 Mar 2007 22:31:51 -0800
From: "robertchen117@gmail.com" <robertchen117@gmail.com>
Subject: format issue
Message-Id: <1172817111.217366.255490@j27g2000cwj.googlegroups.com>

My perl use printf to print:

 printf "Tasks number\tTask\tLibrary\tTargets\tBytes\n";
 printf "%-6d\t%-s\t%-s\t%-5d\t%-10d\n", $task_hash{$task},$2, $1,
$task_targets{$task}, $task_bytes{$task};

Tasks number    Task    Library Targets Bytes
1050    cmd_tsk maint_tl        1050    7340950
1000    vcs     maint_tl        1000    953032
384     discover        maint_tl        384     27290
213     get_v2_build_tsk        relmgmt_tl      339     36951
136     runScriptUnix   relmgmt_tl      136     1438804
120     wilc_tsk        maint_tl        120     96432
73      v3sync_tsk      maint_tl        73      19355

The format not alignment good...

I also tried this way:
printf "Number of tasks    Task      Library      Targets      Bytes
\n";
printf "%5d     %s          %s        %8d          %10d\n", $value,$2,
$1, $task_targets{$task}, $task_bytes{$task};

Anyone has good solution for print ?



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

Date: Fri, 2 Mar 2007 07:51:30 +0000 (UTC)
From: prawn <prawnMUNG@prawn.me.uk>
Subject: Re: format issue
Message-Id: <es8l22$s1b$1@registered.motzarella.org>

On Thu, 01 Mar 2007 22:31:51 -0800, robertchen117@gmail.com wrote:

> I also tried this way:
> printf "Number of tasks    Task      Library      Targets      Bytes
> \n";
> printf "%5d     %s          %s        %8d          %10d\n", $value,$2,
> $1, $task_targets{$task}, $task_bytes{$task};
> 
> Anyone has good solution for print ?

format may well help you out here.

See: 
 
perldoc -m perlform


-- 
p BotM#1 LotR#9


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

Date: Fri, 2 Mar 2007 07:51:30 +0000 (UTC)
From: prawn <prawnMUNG@prawn.me.uk>
Subject: Re: format issue
Message-Id: <es8l22$s1c$1@registered.motzarella.org>

On Thu, 01 Mar 2007 22:31:51 -0800, robertchen117@gmail.com wrote:

> I also tried this way:
> printf "Number of tasks    Task      Library      Targets      Bytes
> \n";
> printf "%5d     %s          %s        %8d          %10d\n", $value,$2,
> $1, $task_targets{$task}, $task_bytes{$task};
> 
> Anyone has good solution for print ?

format may well help you out here.

See: 
 
perldoc -m perlform


-- 
p BotM#1 LotR#9


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

Date: 2 Mar 2007 08:29:11 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: format issue
Message-Id: <54q5inF21e9qeU1@mid.dfncis.de>

robertchen117@gmail.com <robertchen117@gmail.com> wrote in comp.lang.perl.misc:
> My perl use printf to print:
> 
>  printf "Tasks number\tTask\tLibrary\tTargets\tBytes\n";
>  printf "%-6d\t%-s\t%-s\t%-5d\t%-10d\n", $task_hash{$task},$2, $1,
> $task_targets{$task}, $task_bytes{$task};
> 
> Tasks number    Task    Library Targets Bytes
> 1050    cmd_tsk maint_tl        1050    7340950
> 1000    vcs     maint_tl        1000    953032
> 384     discover        maint_tl        384     27290
> 213     get_v2_build_tsk        relmgmt_tl      339     36951
> 136     runScriptUnix   relmgmt_tl      136     1438804
> 120     wilc_tsk        maint_tl        120     96432
> 73      v3sync_tsk      maint_tl        73      19355
> 
> The format not alignment good...
> 
> I also tried this way:
> printf "Number of tasks    Task      Library      Targets      Bytes
> \n";
> printf "%5d     %s          %s        %8d          %10d\n", $value,$2,
> $1, $task_targets{$task}, $task_bytes{$task};
> 
> Anyone has good solution for print ?

That's a job for Text::Table, available from CPAN.

    use Text::Table;

    my $tb = Text::Table->new(
        'Tasks number', qw( Task Library Targets Bytes),
    );
    $tb->add( split) while <DATA>;
    print $tb;

    __DATA__
    1050    cmd_tsk maint_tl        1050    7340950
    1000    vcs     maint_tl        1000    953032
    384     discover        maint_tl        384     27290
    213     get_v2_build_tsk        relmgmt_tl      339     36951
    136     runScriptUnix   relmgmt_tl      136     1438804
    120     wilc_tsk        maint_tl        120     96432
    73      v3sync_tsk      maint_tl        73      19355

Anno


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

Date: 2 Mar 2007 01:04:43 -0800
From: "robertchen117@gmail.com" <robertchen117@gmail.com>
Subject: how to find the "yesterday" logfile name?
Message-Id: <1172826283.909769.93000@31g2000cwt.googlegroups.com>

see if my directory has many logfiles like this:

log022607.log
log022707.log
log022807.log
log030107.log

today is 030207(03/02/07), I want to find the "yesterday" log, how
could I do in perl?
When time is 04/01/07, to get the "yesterday' log, which is
log033107.log maybe need some special handle, also when process for
year end...?

thanks very much!



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

Date: Fri, 02 Mar 2007 11:02:39 +0100
From: Seansan <sean115=at@=reeve.nl>
Subject: mod_perl error:  (120000) exit was called at
Message-Id: <45e7f655$0$75574$dbd45001@news.wanadoo.nl>

Hi there,

I have just moved my server to an new hosting provider. Now I am seeing 
a lot of error messages in the server log related to "([error] 
ModPerl::Util::exit: (120000) exit was called at  ...". I have pasted 
the coded below that causes the error.

The error is caused at the line "exit 1;". I have always used this code 
before, only now it causes an error. This code come from a PM module 
that I call from my main .PL file/program.

How would I do this correctly so that ModPerl does not complain?

<code>
sub PRINT_ERROR($) {
  my ($msg) = shift; $msg = 'Unknown error' if (!$msg);
  my $tmp=&READ_FILE($error_tmp);
  print $tmp;
  exit 1; # <== ERROR HERE
}
</code>

Kind regards, Sean


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

Date: Fri, 02 Mar 2007 12:06:24 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: mod_perl error:  (120000) exit was called at
Message-Id: <54qemfF227ip5U1@mid.individual.net>

Seansan wrote:
> I have just moved my server to an new hosting provider. Now I am seeing 
> a lot of error messages in the server log related to "([error] 
> ModPerl::Util::exit: (120000) exit was called at  ...". I have pasted 
> the coded below that causes the error.
> 
> The error is caused at the line "exit 1;". I have always used this code 
> before, only now it causes an error. This code come from a PM module 
> that I call from my main .PL file/program.
> 
> How would I do this correctly so that ModPerl does not complain?
> 
> <code>
> sub PRINT_ERROR($) {
>  my ($msg) = shift; $msg = 'Unknown error' if (!$msg);
>  my $tmp=&READ_FILE($error_tmp);
>  print $tmp;
>  exit 1; # <== ERROR HERE
> }
> </code>

I'm using this function to prevent exit() issues in mod_perl:

   sub myexit {
     if ($ENV{MOD_PERL}) {
       if ($] < 5.006)	{
         require Apache;
         Apache::exit();
       }
     }
     exit;
   }

It may or may not address the issue you are experiencing.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Fri, 02 Mar 2007 11:11:17 +0100
From: Seansan <sean115=at@=reeve.nl>
Subject: mod_perl errors
Message-Id: <45e7f85c$0$96554$dbd45001@news.wanadoo.nl>

How can I force mod_perl to show the errors that the script makes in 
debug mode to the screen?

I would like some more information then :

Internal Server Error
The server encountered an internal error or misconfiguration and was 
unable to complete your request.


Kind regards, Seansan


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

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


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