[22595] in Perl-Users-Digest
Perl-Users Digest, Issue: 4816 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 4 14:06:22 2003
Date: Fri, 4 Apr 2003 11:05:07 -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, 4 Apr 2003 Volume: 10 Number: 4816
Today's topics:
<script language=PerlScript> <founder@pege.org>
Re: comments within complex structures <wksmith@optonline.net>
Re: cpan (Helgi Briem)
Re: cpan <me@privacy.net>
Re: cpan <tassilo.parseval@rwth-aachen.de>
Re: cpan <nobody@dev.null>
Re: cpan <nobody@dev.null>
Re: cpan <annoyed@you.now>
CSV parse to array <sclozza123@yahoo.NOFUCKINGSPAM.com>
Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: Formatting output in columns: (evolutionx1945@yahoo.com)
Help needed for using Mail::Box CPAN Module ( perl Newb (bhat)
IPC::Open2 and bad file descriptor (Thomas Erskine)
Re: line sorting question <barryk2@SPAM-KILLER.mts.net>
Re: line sorting question <nobody@dev.null>
Re: Need to build a "sheduler" (Timer) - advice please. <peter@nospam.calweb.com>
Next token ??? Error <sbour@niaid.nih.gov>
Re: open COMMAND with a pipe news@roaima.freeserve.co.uk
Re: Problem with redirecting STDOUT and STDERR (Scott)
Re: subroutine ref makes a script hang using strict <usenet@tinita.de>
Re: Text::ParseWords <Use-Author-Supplied-Address-Header@[127.1]>
Re: Trouble addressing a variable <barryk2@SPAM-KILLER.mts.net>
Re: Using useradd and groupadd under Perl <nobody@dev.null>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 4 Apr 2003 17:52:30 +0200
From: =?Windows-1252?Q?Roland_M=F6sl?= <founder@pege.org>
Subject: <script language=PerlScript>
Message-Id: <3e8daa15$0$15934$91cee783@newsreader02.highway.telekom.at>
Who else uses Perl as scripting language
inside HTML pages?
Is practicall for program development,
because the browser can be used as
the GUI
--
Roland Mösl
http://www.pege.org Clear targets for a confused civilization
http://web-design-suite.com Web Design starts at the search engine
------------------------------
Date: Fri, 04 Apr 2003 16:22:33 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: comments within complex structures
Message-Id: <djija.22804$B8.6663489@news4.srv.hcvlny.cv.net>
"qanda" <fumail@freeuk.com> wrote in message
news:62b4710f.0304032230.2a4b2e3@posting.google.com...
--snip--
>
> So unless I've missed something I'll settle for the following (showing
> only the definition)...
>
> my %complex_set1 = ( # Complex set 1.
> fld_set1 => { # Field set 1.
> fs1_fld1 =>'', # fs1 field 1.
> fs1_fld2 =>'', # fs1 field 2.
> },
> fld_set2 => { # Field set 2.
> fs2_fld1 => '', # fs2 field 1.
> fs2_fld2 => '', # fs2 field 2.
> },
> );
>
This kind of definition is seldom used in perl except to set initial
values. Remember that perl cannot enforce correct usage of the
structure the way C can. As long as your intention is only to document
the structure, the entire statement could be commented out or included
in POD. This in fact would make its purpose more clear.
Bill
------------------------------
Date: Fri, 04 Apr 2003 11:10:55 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: cpan
Message-Id: <3e8d6540.540668540@news.cis.dfn.de>
On 4 Apr 2003 10:20:25 GMT, "Tassilo v. Parseval"
<tassilo.parseval@rwth-aachen.de> wrote:
>Also sprach Helgi Briem:
>
>> North America is a continent. America is not.
>
>And South America? I learnt that there are five contintents:
Seven North America is one. South America is another.
> 1) Asia
> 2) America
> 3) Africa
> 4) Europe
> 5) Australia
>
>Following your logic, there would be six?
You forgot Antarctica. Think geology, Tassilo. Up until 5
million years ago, South and North America were completely
separate. They are completely independent
entities geologically, connected by a narrow and very
recent land bridge (Central America).
See:
http://www.silurian.com/geology/timeline.htm
--
Regards, Helgi Briem
helgi DOT briem AT decode DOT is
------------------------------
Date: Fri, 4 Apr 2003 21:21:22 +1000
From: "Tintin" <me@privacy.net>
Subject: Re: cpan
Message-Id: <b6jprh$5urql$1@ID-172104.news.dfncis.de>
"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3E8CD896.46A0A17A@earthlink.net...
> Ian wrote:
> > Anno Siegel wrote:
> > It did not accept America canada quebec or anything
> > else I typed
>
> Those are countries, not continents.
With the exception of America which is North America and South Americia.
------------------------------
Date: 4 Apr 2003 11:53:37 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: cpan
Message-Id: <b6jro1$aoi$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Helgi Briem:
> On 4 Apr 2003 10:20:25 GMT, "Tassilo v. Parseval"
><tassilo.parseval@rwth-aachen.de> wrote:
>
>>Also sprach Helgi Briem:
>>
>>> North America is a continent. America is not.
>>
>>And South America? I learnt that there are five contintents:
>
> Seven North America is one. South America is another.
>
>> 1) Asia
>> 2) America
>> 3) Africa
>> 4) Europe
>> 5) Australia
>>
>>Following your logic, there would be six?
>
> You forgot Antarctica. Think geology, Tassilo. Up until 5
> million years ago, South and North America were completely
> separate. They are completely independent
> entities geologically, connected by a narrow and very
> recent land bridge (Central America).
But such an argumentation would equally well justify that we only have
one contintent because initially it was all one huge land-mass. You have
to draw the line at some point in history. It looks pretty arbitrary to
me (with naming five continents not less arbitrary, though).
Anyway, grossly off-topic here. F'up suggested but I don't know the
appropriate groups to set one myself.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 04 Apr 2003 15:06:43 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: cpan
Message-Id: <3E8D9EFD.9040205@dev.null>
Tintin wrote:
> "Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
> news:3E8CD896.46A0A17A@earthlink.net...
>
>>Ian wrote:
>>
>>>Anno Siegel wrote:
>>>It did not accept America canada quebec or anything
>>>else I typed
>>>
>>Those are countries, not continents.
>>
>
> With the exception of America which is North America and South Americia.
And Quebec, which is not a country either, for the time being.
------------------------------
Date: Fri, 04 Apr 2003 15:15:13 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: cpan
Message-Id: <3E8DA0FA.9060509@dev.null>
news@roaima.freeserve.co.uk wrote:
>
> [...] What CPAN is trying to help you
> select is a mirror site that has high bandwidth and low latency *for you*.
What exactly does latency mean in this context? The only meaning I'm
familiar with is "being hidden," which does not quite jive here. You're
not trying to say a network with high latency is *late* in responding,
are you?
------------------------------
Date: Fri, 04 Apr 2003 09:22:47 -0600
From: Ivan Marsh <annoyed@you.now>
Subject: Re: cpan
Message-Id: <b6k7tr$uhp$1@grandcanyon.binc.net>
Andras Malatinszky wrote:
> Tintin wrote:
>
>> "Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
>> news:3E8CD896.46A0A17A@earthlink.net...
>>
>>>Ian wrote:
>>>
>>>>Anno Siegel wrote:
>>>>It did not accept America canada quebec or anything
>>>>else I typed
>>>>
>>>Those are countries, not continents.
>>>
>> With the exception of America which is North America and South Americia.
>
> And Quebec, which is not a country either, for the time being.
That's funny... At least one person that has apparently never seen a map of
the planet they reside on and one person that made a subtle and quite funny
joke about Canadian politics in the same post.
i.m.
--
All views, opinions and alleged facts expressed by this tactless moron
should be taken as good natured and friendly unless specifically stated
otherwise.
I.M.
------------------------------
Date: Fri, 04 Apr 2003 17:40:16 GMT
From: "sclozza" <sclozza123@yahoo.NOFUCKINGSPAM.com>
Subject: CSV parse to array
Message-Id: <4sjja.10153$ft3.78089@news-server.bigpond.net.au>
I have a script that (among other things) reads in a list of files, in the
form "file.html, file2.html, file3.html"
I want to put file.html into @index[0], file2.html into @index[1] and so on
elsif ($_ =~ /^DirectoryIndex:\s/) {
$count++; # counter
$csvindex = substr($_, 16); #count in 16 places
$csvindex =~ s/,//g; # remove ','
my @tmp = split(" ", $csvindex);
my $item;
foreach $item ( @tmp ) {
$item =~ s/^ *//; # kill leading
$item =~ s/ *$//; # and trailing spaces
push (@index, $item);
}
}
I cant get it to push the data into the array properly
Anyone lend a hand?
--
When you use Ethernet you are using Communism...The answer is Token Ring.
PGP Key - http://elmo.murdoch.edu.au/~sclozza/pgp.txt
--
------------------------------
Date: 04 Apr 2003 11:17:34 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1049454983@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto <jari.aalto@poboxes.com>
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Unix Windows port (for Unix die-hards):
install http://www.cygwin.com/ which includes native Emacs 21.x.
XEmacs port is bundled in XEmacs setup.exe available from
XEmacs site.
o Pure Native Windows port
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/ => Emacs resource page
Emacs Perl Modules
Cperl -- Perl programming mode
ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
http://www.perl.com/CPAN-local/misc/emacs/cperl-mode/
<ilya@math.ohio-state.edu> Ilya Zakharevich
CPerl is major mode for editing perl files. Forget the default
`perl-mode' that comes with Emacs, this is much better. Comes
standard in newest Emacs.
TinyPerl -- Perl related utilities
http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Grep through all Perl manpages (.pod)
o Follow POD references e.g. [perlre] to next pod with RETURN
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o Update `$VERSION' variable with YYYY.MMDD on save.
o Load source code into Emacs, like Devel::DProf.pm
o Prepare script (version numbering) and Upload it to PAUSE
o Generate autoload STUBS (Devel::SelfStubber) for you
Perl Module (.pm)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in Tiny Tools Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up dattabases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to to do the search, You can adjust
recursive grep options, set search case sensitivity, add user grep
options etc.
You can find latest `igrep.el' module at
<http://groups.google.com/groups?group=gnu.emacs.sources> The
maintainer is Jefin Rodgers <kevinr@ihs.com>.
TinyCompile -- To Browse grep results in Emacs *compile* buffer
TinyCompile is a minor mode for *compile* buffer from where
you can collapse unwanted lines or shorten file URLs:
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: 4 Apr 2003 07:16:57 -0800
From: evolutionx1945@yahoo.com (evolutionx1945@yahoo.com)
Subject: Re: Formatting output in columns:
Message-Id: <7566e799.0304040716.3a0e3064@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3E8D20AC.D71400B2@earthlink.net>...
> Tore Aursand wrote:
> >
> > On Thu, 03 Apr 2003 09:02:24 -0800, evolutionx1945@yahoo.com wrote:
> > > I thouroughly searched newsgroups and faq, but I couldn't find the
> > > answer to my question
> >
> > I don't believe you. 'perldoc -q format' gives you _excactly_ what
> > you're after.
>
> I didn't see any such answer under 'perldoc -q format'.
>
> Maybe you meant "perldoc perlform" ?
>
> Although write() and 'format NAME = ...' have been part of perl since
> nearly the very beginning, nowadays they are a very obscure feature of
> perl.
>
> Futhermore, there's nothing there for putting data *vertically* in
> columns, as opposed to horizontally.
>
> That is, you can easily get:
> a b c
> d e f
> g h i
> j
> But there's nothing describing how to get:
> a e i
> b f
> c g
> d h
>
> Also, the OP's sample output implied that there should be a total of 4
> rows, regardless of how many items there were, which makes the use of
> write() rather hard.
>
> The easiest solution is to process a column at a time, adding a bit at a
> time to each of 4 rows, then print out the rows.
>
> use strict;
> use warnings;
> my @items = ("str01" .. "str13", "...");
> my $m = -1; $m = length() if $m < length for @items;
> $m += 2;
> my @rows = ("") x 4;
> while( my @col = splice @items, 0, 4 ) {
> $rows[$_] .= sprintf "%-${m}s", $col[$_]
> for 0 .. $#col;
> }
> print $_, "\n" for @rows;
>
> --
> $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
> );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
> ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
Thank you very much!!!!
Actually, since I had to wait for 9 hours for my original post to come
through the google, I came up with my own script which implements the
similar algorithm, but a lot less pretty:))) I will use your code
instead
thanks again!
------------------------------
Date: 4 Apr 2003 03:29:39 -0800
From: rnbhat89@yahoo.com (bhat)
Subject: Help needed for using Mail::Box CPAN Module ( perl Newbie )
Message-Id: <4f49dc09.0304040329.36ca9bb2@posting.google.com>
Hello,
I want to use the above module in one of the perl programs. How can i
access a message from the POP3 server. I tried the below but it
doesn't work.
my $mgr = new Mail::Box::Manager;
my $folder = $mgr->open(type => 'pop3', username =>
'xxx@yyy.net',password => 'xx', server_name => 'mail.yy.net');
foreach my $message ($folder->messages) {
my $body = $message->body;
my Mail::Message::Body $mmsg = $message->decoded;
my $part = $mmsg->body->part(2);
}
I am not able to fetch the body part in the plain text format it
contains html tags also. Any help would be appreciated.
Thanks and Regards,
Roopa
------------------------------
Date: 4 Apr 2003 06:43:20 -0800
From: thomaserskine@yahoo.com (Thomas Erskine)
Subject: IPC::Open2 and bad file descriptor
Message-Id: <45d5984a.0304040643.42b4283f@posting.google.com>
Hi folks.
I've been using IPC::Open2 to:
- invoke another program
- pass it something to do
- the other program does its thing and passes back the result
The application is too large to post here. The core code looks like:
$pid = open2( $rdfh, $wrfh, @cmd) or die "open2: $!";
print $wrfh "GO\n" or die "go: $!";
The invoked program does some initialization and then:
print STDOUT "IDLE\n" or die "idle: $!";
and that's what gives me the "bad file descriptor" error.
The other program works fine running it interactively with the same
args.
It works fine in my test harness, that I built using IPC::Open2.
What would cause "bad file descriptor" here?
The programs both "use strict" and "use warnings".
Perl is "v5.8.0 built for i386-linux-thread-multi".
Os is "Linux tsdev2 2.4.18-14 #1 Wed Sep 4 12:13:11 EDT 2002 i686
athlon i386 GNU/Linux" (Redhat 8.0).
------------------------------
Date: Fri, 4 Apr 2003 08:31:01 -0600
From: Barry Kimelman <barryk2@SPAM-KILLER.mts.net>
Subject: Re: line sorting question
Message-Id: <MPG.18f7531e744b7c798977f@news.mts.net>
[This followup was posted to comp.lang.perl.misc]
In article <Lp3ja.814$rA3.805@newssvr16.news.prodigy.com>, manj dodda
(dmanjunath@yahoo.com) says...
> I have a list of lines like
>
> VADA tmp4 final temp2
> BAT tmp1 error missing
> ADA tmp2 missing error
> AAA temp2 tmp1 tmp2
> ............
>
> It is in a array as
> @myArray
> $myArray[0] = "VADA tmp4 final temp2" ;
> $myArray[1] = "BAT tmp1 error missing" ;
> $myArray[2] =
>
> Now i want to sort the array based on the first element of the
> line.
> What i want is finally
> $myArray[0] = "AAA temp2 tmp1 tmp2" ;
> $myArray[1] = "ADA tmp2 missing error" ;
> $myArray[2] = "BAT tmp1 error missing" ;
>
> How is this done ?.
>
> Thanks in advance for your help
>
> md
@sorted = sort { (split(/\s/,$b))[0] cmp (split(/\s/,$a))[0] } @myArray;
--
---------
Barry Kimelman
Winnipeg, Manitoba, Canada
email : bkimelman@hotmail.com
------------------------------
Date: Fri, 04 Apr 2003 14:55:03 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: line sorting question
Message-Id: <3E8D9C41.9040309@dev.null>
manj dodda wrote:
> I have a list of lines like
>
> VADA tmp4 final temp2
> BAT tmp1 error missing
> ADA tmp2 missing error
> AAA temp2 tmp1 tmp2
> ............
>
> It is in a array as
> @myArray
> $myArray[0] = "VADA tmp4 final temp2" ;
> $myArray[1] = "BAT tmp1 error missing" ;
> $myArray[2] =
>
> Now i want to sort the array based on the first element of the
> line.
> What i want is finally
> $myArray[0] = "AAA temp2 tmp1 tmp2" ;
> $myArray[1] = "ADA tmp2 missing error" ;
> $myArray[2] = "BAT tmp1 error missing" ;
>
> How is this done ?.
How is that different from regular alphabetical sorting?
------------------------------
Date: Fri, 04 Apr 2003 10:30:56 -0800
From: Penguinista <peter@nospam.calweb.com>
Subject: Re: Need to build a "sheduler" (Timer) - advice please...
Message-Id: <3e8dcf14$0$53692$d368eab@news.newshosting.com>
Tony wrote:
> Where I have got "stuck" is in how to aproach the "event"
> scheduling. Are there modules for that sort of
> task? (I have not found any)
You can easily find the current time(). Your config tells you when the
next event is. sleep()
>
> It is also unclear to me what type of structure should
> be used in the schedule file. I think a basic coma delimited
> row by column approach would seem a good idea (Like a
> spread sheet). This will also enable a relatively easy
> way of building a web page to enter the events
> and output "channels" of the events
>
> Tony
>
records delimited by \n, fields by ',', is a usefull structure, though
it's a hastle if those characters are part of the data.
------------------------------
Date: Fri, 04 Apr 2003 13:57:46 -0500
From: Stephan Bour <sbour@niaid.nih.gov>
Subject: Next token ??? Error
Message-Id: <BAB33FDA.6F22%sbour@niaid.nih.gov>
I have the following script that emails me my current IP address. When I try
to run it I get a syntax error with a ³next token ???² explanation. Any idea
why the my variables are not initialized? If I replace the $To references in
{send_mail ("Today's IP address", $To, $To);} by real email addresses
everything works fine.
#!/usr/bin/perl -w
use SendMail 2.09
use strict
my $To = "jdoe\@foo.com";
my $errors_to = "jdoe\@foo.com";
my $SMTP = "smtp.foo.com";
$output = `ifconfig`;
@split = split (/inet/, $output);
@split2 = split (/netmask/, $split[5]);
{send_mail ("Today's IP address", $To, $To);}
{
#Send the actual email
#(0=Subject, 1=To, 2=From)
sub send_mail
{
$smobj = new SendMail ($SMTP);
$smobj->setDebug($smobj->ON);
$smobj->ErrorsTo($errors_to);
$smobj->Subject($_[0]);
$smobj->To($_[1]);
$smobj->From($_[2]);
$smobj->setMailBody("Your IP address is $split2[0] on ".`date`);
if ($smobj->sendMail() != 0)
{
print $smobj->{'error'}."\n";
exit -1;
}
print "Done\n\n";
exit 0;
}
}
Thank you,
Stephan.
------------------------------
Date: Fri, 4 Apr 2003 12:13:45 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: open COMMAND with a pipe
Message-Id: <9dpj6b.nr1.ln@moldev.cmagroup.co.uk>
J. VerSchave <carlisle411@yahoo.com> wrote:
> open COMMAND, "make -f Makefile |";
> while(<COMMAND>)
> {
> print;
> }
> close COMMAND;
> But now I need to check the return value of 'make.' I need to know
> if it was successful or if it failed.
perldoc -f close
If the file handle came from a piped open "close" will additionally
return false if one of the other system calls involved fails or if
the program exits with non-zero status. (If the only problem was
that the program exited non-zero "$!" will be set to "0".)
[...]
and implicitly puts the exit status value of that command into "$?".
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
------------------------------
Date: 4 Apr 2003 05:16:53 -0800
From: googlegroups@scottsavarese.com (Scott)
Subject: Re: Problem with redirecting STDOUT and STDERR
Message-Id: <677a147d.0304040516.e2591dd@posting.google.com>
Steve Grazzini <grazz@nyc.rr.com> wrote in message news:<bI1ja.5324$an1.814@twister.nyc.rr.com>...
> $SIG{__WARN__} = sub { print STDERR @_ };
This doesn't help. I still get the same message.
bash-2.03$ ./newsyswatch.pl
Successful startup, daemonizing...
bash-2.03$ Can't locate object method "do_check" via package
"Plugins::foo" at lib/Plugins/fo.pm line 48.
However, when I change it to 'sub {print @_}; it works fine... So my
guess is that I am not redirecting STDERR correctly...
I've spent a couple of hours on this and came up with some clues... 1)
If I tie STDOUT and STDERR seperately perl will create two instances
of the log module which is bad... I've also found that open( STDERR,
">&STDOUT" ) doesn't work either... So once I tie STDOUT to the Log
module, how can I redirect STDERR to do the same thing as STDOUT?
Thanks,
Scott
------------------------------
Date: 4 Apr 2003 17:40:56 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: subroutine ref makes a script hang using strict
Message-Id: <tinhctygr$229$tina@news01.tinita.de>
joe <tunmaster@hotmail.com> wrote:
> Ok, I've got slightly stuck at the following piece of code, using 'strict'.
> $::action = param('a');
> $::action = ($::action =~ /^(\w*)$/) ? $1:"";
> if (defined &$::action) {&$::action}
> else {&printPage}
you could do:
my $action = param('a');
$action = $action =~ m/^(\w+)$/ ? $1 : '';
if (my $code = main->can($action)) {
$code->();
}
else {
printPage();
}
but a dispatch table, like it was suggested,
for allowing only a list of subs would be
even better.
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://www.perlquotes.de/ \ \ _,_\ __/\ __/_| /__/ perception
http://www.tinita.de/peace/link.html - Spread Peace
------------------------------
Date: Fri, 4 Apr 2003 10:28:31 -0800
From: Robert Brooks <Use-Author-Supplied-Address-Header@[127.1]>
Subject: Re: Text::ParseWords
Message-Id: <200304041828.h34ISVEb030181@www.aarg.net>
In article <3e8d359e@news.victoria.tc.ca>
yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
>
>
> Bob Walton (bwalton@rochester.rr.com) wrote:
> : Robert Brooks wrote:
>
> : > In article <3E8B9266.5020205@rochester.rr.com>
> : > Bob Walton <bwalton@rochester.rr.com> wrote:
> : >
>
> : >> Robert Brooks wrote:
> : ...
>
> : >>> my $string = ' alpha beta';
> : ...
> : > I dismissed out-of-hand, and refused to believe,
> : > that anyone would write a parser that returns
> : > an empty value. Another example of TMTOWTDI
> : ...
>
>
> : Well, the reason Text::ParseWords returned an empty value was because
> : your text started with a delimiter (whitespace). The word before the
> : delimiter was, well, empty. Perhaps it is hard to believe anyone would
> : give a parser text which starts with a delimiter?
>
> Yes, but shellwords does claim to parse the same way as various shells,
> and I don't think any normal shells parse that way.
Thank you Malcolm, for pointing out what most reasonable programmers
would assume to be normal, user-friendly expected behaviour.
As for how hard it may be to believe that anyone would give
text which starts with a delimiter to a parser..., we can't
always choose what an established application might return
to us. And some established applications are very badly
written.
------------------------------
Date: Fri, 4 Apr 2003 08:35:22 -0600
From: Barry Kimelman <barryk2@SPAM-KILLER.mts.net>
Subject: Re: Trouble addressing a variable
Message-Id: <MPG.18f7542445996323989780@news.mts.net>
[This followup was posted to comp.lang.perl.misc]
In article <dc3b4479.0304040053.6f54e87@posting.google.com>, Andrew Fayle
(andrew.fayle@dilithiumnetworks.com) says...
> Hi,
>
> I have a set of arrays numbered @OLC_0 through @OLC_9. I need to write
> some code that will allow me to access any of these arrays depending
> on the vailue of $num. I know this sound like I should just use a 2
> dimensional array but that is not possible because this data needs to
> be shared between two threads.
> I have tried the code below but it doesn't work. Does anyone know how
> to change this code so that it will doi what I want.
>
> my $num=0;
> my $vars = "@OLC_$num";
> print STDOUT $vars."\n";
> push("$vars", 5);
> printf STDOUT "NUMBER = ".$OLC_0[0]."\n";
>
>
> Any help is greatly appreciated
> Andrew
>
$array_name = "OLC_$num";
print "Contents of $array_name : ",join(", ",@$array_name),"\n";
--
---------
Barry Kimelman
Winnipeg, Manitoba, Canada
email : bkimelman@hotmail.com
------------------------------
Date: Fri, 04 Apr 2003 15:02:07 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: Using useradd and groupadd under Perl
Message-Id: <3E8D9DE8.4040402@dev.null>
stephanj wrote:
> Hi all,
>
> What would be the easiest way to create a Perl script that uses these 2
> Linux
> commands?
Use backticks/system/exec to invoke the commands from within Perl?
------------------------------
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.
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 V10 Issue 4816
***************************************