[28420] in Perl-Users-Digest
Perl-Users Digest, Issue: 9784 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 30 09:05:48 2006
Date: Sat, 30 Sep 2006 06:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 30 Sep 2006 Volume: 10 Number: 9784
Today's topics:
Re: can't locate method new IO::Socket::INET <sisyphus1@nomail.afraid.org>
catching "Use of uninitialized value" warnings <badarisj@gmail.com>
Re: catching "Use of uninitialized value" warnings <skimba@dambo.di>
Re: catching "Use of uninitialized value" warnings vparseval@gmail.com
Re: FAQ 3.24 Why don't Perl one-liners work on my DOS/M <justin@purestblue.com>
how can I print multiple lines without escaping '$' and bennett@peacefire.org
Re: how can I print multiple lines without escaping '$' <attn.steven.kuo@gmail.com>
Re: how can I print multiple lines without escaping '$' charley@pulsenet.com
need help finding a pop up example ToddAndMargo@gbis.com
Re: need help finding a pop up example <zentara@highstream.net>
need syntax help ToddAndMargo@gbis.com
new CPAN modules on Sat Sep 30 2006 (Randal Schwartz)
Re: Perl Asyn <toddenglish@gmail.com>
Re: Perl Asyn <DJStunks@gmail.com>
Re: Questions about Inline::C <sisyphus1@nomail.afraid.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 30 Sep 2006 08:40:34 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: can't locate method new IO::Socket::INET
Message-Id: <451da1fb$0$5107$afc38c87@news.optusnet.com.au>
"ten8ciousb" <brent.honadel@lawson.com> wrote in message
.
.
> All I did was add print statements. Now, same site but
> a new server and the print statements aren't helping anymore.
>
Sounds like something might be configured a little differently on the new
server and the print()ing is going somewhere else. Try opening a filehandle
to a log file, and have the debug statements print() to that filehandle.
(Or perhaps those print statements are already being written to some error
log ?)
Cheers,
Rob
------------------------------
Date: 29 Sep 2006 16:38:57 -0700
From: "badarisj@gmail.com" <badarisj@gmail.com>
Subject: catching "Use of uninitialized value" warnings
Message-Id: <1159573137.935851.143920@m7g2000cwm.googlegroups.com>
folks,
now and then we see
Use of uninitialized value in xxx
warning messages while running a perl program.
is there a way to catch such warning messages that perl throws and
display
the stack that is leading to the warning message?
thanks,
-badari
------------------------------
Date: Sat, 30 Sep 2006 06:34:30 +0300
From: Oobi Van Doobi <skimba@dambo.di>
Subject: Re: catching "Use of uninitialized value" warnings
Message-Id: <K5lTg.22897$LI3.14546@reader1.news.jippii.net>
badarisj@gmail.com wrote:
> folks,
>
> now and then we see
> Use of uninitialized value in xxx
> warning messages while running a perl program.
>
> is there a way to catch such warning messages that perl throws and
> display
> the stack that is leading to the warning message?
>
> thanks,
> -badari
umm, a good thing to do would be to check if variables you use are
inizialised. you can do so with for example:
if ( defined($variable) )
{
...code here...
}
------------------------------
Date: 30 Sep 2006 00:31:46 -0700
From: vparseval@gmail.com
Subject: Re: catching "Use of uninitialized value" warnings
Message-Id: <1159601506.694851.174390@m7g2000cwm.googlegroups.com>
badarisj@gmail.com wrote:
> now and then we see
> Use of uninitialized value in xxx
> warning messages while running a perl program.
>
> is there a way to catch such warning messages that perl throws and
> display
> the stack that is leading to the warning message?
For development purposes you can install a SIGWARN handler that will
print a stacktrace when the warning message conforms to certain
criteria:
#!/usr/bin/perl
use warnings;
$SIG{__WARN__} = sub {
if ($_[0] =~ /^Use of uninitialized value/) {
require Carp;
Carp::cluck();
} else {
warn @_;
}
};
sub foo {
print undef;
}
sub bla {
foo();
}
bla(42);
__END__
at cluck.pl line 6
main::__ANON__('Use of uninitialized value in print at
cluck.pl line 13.\x{a}') called at cluck.pl line 13
main::foo() called at confess.pl line 17
main::bla(42) called at confess.pl line 20
Cheers,
Tassilo
------------------------------
Date: Sat, 30 Sep 2006 12:45:31 +0100
From: Justin C <justin@purestblue.com>
Subject: Re: FAQ 3.24 Why don't Perl one-liners work on my DOS/Mac/VMS system?
Message-Id: <2006093012453116807-justin@purestbluecom>
On 2006-09-30 02:03:02 +0100, PerlFAQ Server <brian@stonehenge.com> said:
> 3.24: Why don't Perl one-liners work on my DOS/Mac/VMS system?
>
> The problem is usually that the command interpreters on those systems
> have rather different ideas about quoting than the Unix shells under
> which the one-liners were created. On some systems, you may have to
> change single-quotes to double ones, which you must *NOT* do on Unix or
> Plan9 systems. You might also have to change a single % to a %%.
>
> For example:
>
> # Unix
> perl -e 'print "Hello world\n"'
>
> # DOS, etc.
> perl -e "print \"Hello world\n\""
>
> # Mac
> print "Hello world\n"
> (then Run "Myscript" or Shift-Command-R)
I'm not sure this is still correct... though I'm not in a position to
thoroughly check it (not enough Perl knowledge / experience and only
just got my Mac).
I ran:
perl -e 'print "hello world\n"'
and got output as expected. Maybe the FAQ is based on pre OS X behaviour?
--
Justin C, by the sea.
------------------------------
Date: 29 Sep 2006 17:38:56 -0700
From: bennett@peacefire.org
Subject: how can I print multiple lines without escaping '$' and other characters?
Message-Id: <1159576735.928928.274420@m73g2000cwd.googlegroups.com>
Suppose I want to print multiple lines of output which contain dollar
signs. The following will not work:
print <<EOF ;
A loaf of bread costs $1.
A jug of milk costs $2.
EOF
because Perl will interpret the dollar signs. How can I print it
without having to put a backslash in front of every $ sign?
For example, I want to write a Perl script that prints out another Perl
script as output, I don't want to have to write the second Perl script
once using dollar signs and other special characters, then go back and
insert backslashes in front of every special character.
------------------------------
Date: 29 Sep 2006 17:45:59 -0700
From: "attn.steven.kuo@gmail.com" <attn.steven.kuo@gmail.com>
Subject: Re: how can I print multiple lines without escaping '$' and other characters?
Message-Id: <1159577159.426190.82050@h48g2000cwc.googlegroups.com>
benn...@peacefire.org wrote:
> Suppose I want to print multiple lines of output which contain dollar
> signs. The following will not work:
>
> print <<EOF ;
> A loaf of bread costs $1.
> A jug of milk costs $2.
> EOF
>
> because Perl will interpret the dollar signs. How can I print it
> without having to put a backslash in front of every $ sign?
#!/usr/bin/perl
print <<'__STOP__';
Prevent interpolation
of $var by using
single quotes around
the here-doc start tag
__STOP__
--
Hope this helps,
Steven
------------------------------
Date: 29 Sep 2006 18:06:35 -0700
From: charley@pulsenet.com
Subject: Re: how can I print multiple lines without escaping '$' and other characters?
Message-Id: <1159578395.487225.176690@h48g2000cwc.googlegroups.com>
bennett@peacefire.org wrote:
> Suppose I want to print multiple lines of output which contain dollar
> signs. The following will not work:
>
> print <<EOF ;
> A loaf of bread costs $1.
> A jug of milk costs $2.
> EOF
>
> because Perl will interpret the dollar signs. How can I print it
> without having to put a backslash in front of every $ sign?
Here docs are explained here.
http://perldoc.perl.org/perlop.html
Scroll down to 'Regexp Quote-Like Operators'
Chris
------------------------------
Date: 29 Sep 2006 21:34:45 -0700
From: ToddAndMargo@gbis.com
Subject: need help finding a pop up example
Message-Id: <1159590885.288129.294090@m7g2000cwm.googlegroups.com>
Hi All,
I am a bit new to Perl. (My experience is with Modula2
and Linux bash script.)
I need to write a win32 Perl program that will 1) pop up
a windows with a message to the user, 2) only appear in the
task bar when it pops up, and 3) blink (read: annoy the user)
its block on the task bar until the user dismisses the
message.
Can some kind person point me to an appropriate
example? (I love all the examples, but am a bit
overwhelmed by the quantity of them!)
Many thanks,
--T
------------------------------
Date: Sat, 30 Sep 2006 11:34:42 GMT
From: zentara <zentara@highstream.net>
Subject: Re: need help finding a pop up example
Message-Id: <c6lsh25p4k61kohga8o3aaf1phbu1mjmfb@4ax.com>
On 29 Sep 2006 21:34:45 -0700, ToddAndMargo@gbis.com wrote:
>Hi All,
>
> I am a bit new to Perl. (My experience is with Modula2
>and Linux bash script.)
>
> I need to write a win32 Perl program that will 1) pop up
>a windows with a message to the user, 2) only appear in the
>task bar when it pops up, and 3) blink (read: annoy the user)
>its block on the task bar until the user dismisses the
>message.
>
> Can some kind person point me to an appropriate
>example? (I love all the examples, but am a bit
>overwhelmed by the quantity of them!)
>Many thanks,
>--T
First, I don't use windows, but.....
Check out Win32::GUI::NotifyIcon.
Here is a script (not written by me ). I think I saw this
on http://perlmonks.org
It may help you get started.
#!/usr/bin/perl
use warnings;
use strict;
#The function name is defined as "Win32::GUI::NotifyIcon".
#You will need to be carefull about the order of your sub...
#Here a sample script to let's you see, just choose a nice win32 ico and
#name it god.ico in the same dir from where you will launch this script:
#---------------
BEGIN{
use Win32::Console;
Win32::Console::Free();
}
use Win32::GUI;
use Tk;
$mw = MainWindow -> new;
$mw -> wm('geometry', '0x0+0+0');
$mw->overrideredirect(1);
&do_win32_stuff;
MainLoop;
#--------------------------------
sub do_win32_stuff{
$mw_win32 = new Win32::GUI::DialogBox(
-width => 0,
-height => 0,
-name => 'MainWindow');
$icon = new Win32::GUI::Icon('god.ico');
new Win32::GUI::NotifyIcon(
$mw_win32,
-name => "Notify",
-id => 1,
-icon => $icon,
-tip => "I\'am in the Systray!");
$call = Win32::GUI::Dialog();
$mw_win32->Notify->Delete(-id => 1);
sub Notify_Click{
&my_menu;
}
}
#--------------------------------
sub my_menu{
$popup = $mw->Menu(Name => 'popupMenu', -tearoff => 0);
$popup->command(-label => 'Number 1',-command => [\&do_label,1] );
$popup->command(-label => 'Number 2',-command => [\&do_label,2]);
$popup->separator;
$popup->command(-label => 'Number 3', -command => [\&do_label,3]);
$popup->command(-label => 'Number 4', -command => [\&do_label,4]);
$popup->command(-label => 'Number 5', -command => [\&do_label,5]);
$popup->separator;
$popup->command(-label => 'Quit', -command => [ \&stop]);
$popup->Popup(-popover => 'cursor', -popanchor => 'nw');
}
#--------------------------------
sub stop{
exit;
}
#--------------------------------
sub do_label{
if(Exists($top)){
$label-> configure(-text => "I\'am $_[0]");
} else {
$top = $mw ->Toplevel;
$top->title(" Numbers");
$top->focus;
$label = $top->Label (-text => "I\'am $_[0]",
-relief => 'groove',
-width => '24')->pack;
}
}
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: 29 Sep 2006 21:30:01 -0700
From: ToddAndMargo@gbis.com
Subject: need syntax help
Message-Id: <1159590601.359868.121700@i3g2000cwc.googlegroups.com>
Hi All,
I was over at
http://search.cpan.org/~fkolodny/Net-Rexec-0.12/Rexec.pm
looking at the rexec example. (I have rexec working on a server I want
to read the tape drive status off of.)
Okay, I know, just try it an see, but I will not be out to the
location for a while and I was hoping someone would put
me out of my ignorance
Syntax question: how do I enter "mt -f /dev/st0 status; grep -i
online"
into the "command" field below? Do I put quotes around it?
How do I separate my command from the "userid" and
"password"? I am concerned that the line below will
confuse "-f" for the userid, etc..
use Net::Rexec 'rexec';
($rc, @output) = rexec(host, command, [userid, [password]]);
Many thanks,
--T
------------------------------
Date: Sat, 30 Sep 2006 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Sep 30 2006
Message-Id: <J6E2E9.qtC@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
BatchSystem-SBS-0.03
http://search.cpan.org/~alexmass/BatchSystem-SBS-0.03/
a Simple Batch System
----
Brackup-0.90
http://search.cpan.org/~bradfitz/Brackup-0.90/
Flexible backup tool. Slices, dices, encrypts, and sprays across the net.
----
Brackup-0.91
http://search.cpan.org/~bradfitz/Brackup-0.91/
Flexible backup tool. Slices, dices, encrypts, and sprays across the net.
----
CGI-Application-Dispatch-2.03
http://search.cpan.org/~wonko/CGI-Application-Dispatch-2.03/
Dispatch requests to CGI::Application based objects
----
CPAN-Reporter-0.22
http://search.cpan.org/~dagolden/CPAN-Reporter-0.22/
Provides Test::Reporter support for CPAN.pm
----
CPAN-Reporter-0.23
http://search.cpan.org/~dagolden/CPAN-Reporter-0.23/
Provides Test::Reporter support for CPAN.pm
----
Data-Alias-1.01
http://search.cpan.org/~xmath/Data-Alias-1.01/
Comprehensive set of aliasing operations
----
DateTime-Simple-Cron-0.3-RC
http://search.cpan.org/~ferreira/DateTime-Simple-Cron-0.3-RC/
----
File-Size-0.04
http://search.cpan.org/~ofer/File-Size-0.04/
Get the size of files and directories
----
Geo-Coder-YahooJapan-0.03
http://search.cpan.org/~kuma/Geo-Coder-YahooJapan-0.03/
a simple wrapper for Yahoo Japan Geocoder API
----
HTML-Widget-1.10
http://search.cpan.org/~cfranks/HTML-Widget-1.10/
HTML Widget And Validation Framework
----
ICS-Simple-0.04
http://search.cpan.org/~wilsond/ICS-Simple-0.04/
Simple interface to CyberSource ICS2
----
Image-ImageShack-0.00_01
http://search.cpan.org/~plank/Image-ImageShack-0.00_01/
Perl extension for uploading images to imageshack.us
----
Ingres-Utility-Netutil-0.01
http://search.cpan.org/~worm/Ingres-Utility-Netutil-0.01/
API to Netutil Ingres RDBMS utility
----
JavaScript-RPC-0.3
http://search.cpan.org/~bricas/JavaScript-RPC-0.3/
(DEPRECATED) Remote procedure calls from JavaScript
----
Linux-Inotify2-1.1
http://search.cpan.org/~mlehmann/Linux-Inotify2-1.1/
scalable directory/file change notification
----
Mail-Outlook-0.10
http://search.cpan.org/~barbie/Mail-Outlook-0.10/
mail module to interface with Microsoft (R) Outlook (R).
----
Mail-vpopmail-0.52
http://search.cpan.org/~jkister/Mail-vpopmail-0.52/
Utility to get information about vpopmail managed email addresses
----
Module-CPANTS-Site-0.63
http://search.cpan.org/~domm/Module-CPANTS-Site-0.63/
Catalyst based application
----
Mozilla-nsID-0.01
http://search.cpan.org/~bosu/Mozilla-nsID-0.01/
Perl extension wrapping Mozilla nsID class.
----
POE-Component-Server-IRC-1.02
http://search.cpan.org/~bingos/POE-Component-Server-IRC-1.02/
a fully event-driven networkable IRC server daemon module.
----
Path-Class-Iterator-0.05
http://search.cpan.org/~karman/Path-Class-Iterator-0.05/
walk a directory structure
----
TM-1.20
http://search.cpan.org/~drrho/TM-1.20/
Topic Maps, Base Class
----
Test-Class-0.12
http://search.cpan.org/~adie/Test-Class-0.12/
Easily create test classes in an xUnit/JUnit style
----
Test-Class-0.13
http://search.cpan.org/~adie/Test-Class-0.13/
Easily create test classes in an xUnit/JUnit style
----
Text-Lorem-More-0.01
http://search.cpan.org/~rkrimen/Text-Lorem-More-0.01/
More methods to create a wider variety of Latin-looking text.
----
Text-Lorem-More-0.02
http://search.cpan.org/~rkrimen/Text-Lorem-More-0.02/
More methods to create a wider variety of Latin-looking text.
----
Time-HiRes-1.91
http://search.cpan.org/~jhi/Time-HiRes-1.91/
High resolution alarm, sleep, gettimeofday, interval timers
----
WWW-AA-0.03
http://search.cpan.org/~aruteido/WWW-AA-0.03/
The function to undergo plastic operation on the character string displayed in a browser is possessed though it is a MS P Gothic font of 12 points
----
WWW-Mechanize-Pliant-0.01
http://search.cpan.org/~reitman/WWW-Mechanize-Pliant-0.01/
----
WWW-Mechanize-Pliant-0.1
http://search.cpan.org/~reitman/WWW-Mechanize-Pliant-0.1/
----
WWW-Mechanize-Pliant-0.11
http://search.cpan.org/~reitman/WWW-Mechanize-Pliant-0.11/
----
WWW-Shorten-0rz-0.04
http://search.cpan.org/~gugod/WWW-Shorten-0rz-0.04/
Shorten URL using 0rz.tw
----
WebService-KakakuCom-0.04
http://search.cpan.org/~naoya/WebService-KakakuCom-0.04/
Handle WebAPI of kakaku.com.
----
WebService-PhotoZou-0.01
http://search.cpan.org/~jiro/WebService-PhotoZou-0.01/
Easy-to-use Interface for PhotoZou Web Services
----
Win32-InstallShield-0.1
http://search.cpan.org/~kbaucom/Win32-InstallShield-0.1/
InstallShield data file interface
----
makepatch-2.02
http://search.cpan.org/~jv/makepatch-2.02/
create script to update a source tree
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 29 Sep 2006 15:11:47 -0700
From: "Todd English" <toddenglish@gmail.com>
Subject: Re: Perl Asyn
Message-Id: <1159567907.120027.114310@m73g2000cwd.googlegroups.com>
btatnall@gmail.com wrote:
> Todd English wrote:
> > # This doesn't work
> > # while ( (my $name, $proc) = each %proc_result)
>
> Did you mean:
>
> while ( my ($name, $proc) = each %proc_result )
>
> notice the location of my
Doh, typo on my part. That was what I meant and that was what I tested
(it doesn't work either). Thank you for the reply though, you are the
only person thus far to do so. Any other comments or ideas? I've
written to Mark-Jason Dominus (the author) several times and have not
heard back from him.
Anything would be helpful.
-T
------------------------------
Date: 29 Sep 2006 15:34:21 -0700
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Perl Asyn
Message-Id: <1159569261.761084.224820@e3g2000cwe.googlegroups.com>
Todd English wrote:
> btatnall@gmail.com wrote:
> > Todd English wrote:
> > > # This doesn't work
> > > # while ( (my $name, $proc) = each %proc_result)
> >
> > Did you mean:
> >
> > while ( my ($name, $proc) = each %proc_result )
> >
> > notice the location of my
>
> Doh, typo on my part. That was what I meant and that was what I tested
> (it doesn't work either). Thank you for the reply though, you are the
> only person thus far to do so. Any other comments or ideas? I've
> written to Mark-Jason Dominus (the author) several times and have not
> heard back from him.
>
> Anything would be helpful.
Could you boil all this down into one _short_ but _complete_ script
which exhbits the problem you're describing? I, and I'm sure others as
well due to your lack of responses, can't be bothered to wade through
134 lines of code and problem description to try and figure out what it
is you're trying to do and what's not working as you intended it.
Be absolutely sure that whatever you post compiles and runs clean with
both use warnings and use strict in effect.
HTH,
-jp
------------------------------
Date: Sat, 30 Sep 2006 08:44:06 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Questions about Inline::C
Message-Id: <451da2d6$0$25207$afc38c87@news.optusnet.com.au>
"January Weiner" <january.weiner@gmail.com> wrote in message
.
.
> but I still
> do not know what XPUSHs is).
>
perldoc perlapi :-)
Cheers,
Rob
------------------------------
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 V10 Issue 9784
***************************************