[26620] in Perl-Users-Digest
Perl-Users Digest, Issue: 8730 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 4 18:05:24 2005
Date: Sun, 4 Dec 2005 15:05:04 -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 Sun, 4 Dec 2005 Volume: 10 Number: 8730
Today's topics:
[ANNOUNCE] Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: No Print output <joe@inwap.com>
Re: No Print output <joe@inwap.com>
Re: Strange string formatting error <joe@inwap.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 04 Dec 2005 05:29:53 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: [ANNOUNCE] Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1133674146@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
Maintainer: Jari Aalto A T cante net
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.
and XEmacs port
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
http://math.berkeley.edu/~ilya/software/emacs/
by Ilya Zakharevich
CPerl is major mode for editing perl files. Also included in
latest Emacs, but newest version is at Ilya's site. Note that
the directrory at CPAN is out of date:
http://www.cpan.org/modules/by-authors/id/ILYAZ/cperl-mode/
Compared to default `perl-mode' that comes with Emacs, this
one has more features.
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: Sun, 04 Dec 2005 01:20:15 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: No Print output
Message-Id: <3I2dndcyOdFCKQ_enZ2dnUVZ_t2dnZ2d@comcast.com>
William wrote:
> 25 $desk='/mkapp/webapps/mxrt-cgi/accmgr?action=getDesk';
> 26 print $desk;
Do you understand the distinction between
$desk='/mkapp/webapps/mxrt-cgi/accmgr?action=getDesk';
and
$desk=`/mkapp/webapps/mxrt-cgi/accmgr?action=getDesk`;
? And are you aware that one CGI program cannot call another
CGI program using the syntax you're using?
It appears that you are under the mistaken impression that
a perl script treats URLs the same way that a browser does.
For URLs pointing to an external server, use LWP::Simple.
For CGI scripts running on the same server as the perl script,
you have to set up the right environment before executing
the second script, and use either backticks or pipe to read
the results.
-Joe
------------------------------
Date: Sun, 04 Dec 2005 01:25:19 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: No Print output
Message-Id: <E7Odnc23veiSKw_enZ2dnUVZ_tSdnZ2d@comcast.com>
William wrote:
> but still no output.
>
>>> 61 $desk='/mkapp/webapps/mxrt-cgi/accmgr?action=getDesk';
>>> 62 print $desk;
Are you sure that line 61 is being executed?
Have you tried setting $| or adding "\n" to the output?
-Joe
------------------------------
Date: Sun, 04 Dec 2005 01:49:05 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Strange string formatting error
Message-Id: <PaCdnTFQqv0JJg_enZ2dnUVZ_sGdnZ2d@comcast.com>
sjp wrote:
> I've written some helper perl scripts to pull data from a mysql database
> and output the data to a textfile for inclusion on a web front page that
> I am using.
>
> When I output the data directly from a script, I get strange garbled
> characters rather than expected punctuation.
>
> http://test.bluesites.net/topstory.html
Using Firefox with View -> Character Encoding -> Western (ISO-8859-1):
the “rule of law” everywhere...This isn’t a trivial matter.
Using Firefox with View -> Character Encoding -> Unicode (UTF-8):
the rule of law everywhere ... This isnt a trivial matter.
Getting rid of the smart quotes and using plain " and ' instead:
the "rule of law" everywhere ... This isn't a trivial matter.
The latter is what the drupal rendering engine is doing.
-Joe
http://www.inwap.com/mybin/list-files.pl?unsmartquote
#!/usr/local/bin/perl -p
# Name: unsmartquote 04-Sep-2001
# Purpose: Translates charset=windows-1252 to charset=iso-8859-1
# Fixes apostrophes, open and close double quotes, the British pound
# sign, and long dashes. (When using MSIE's "Save As" function, the
# saved HTML is converted from the standard international character set
# to Microsoft's 1252 code page. This script undoes the damage.)
tr/\306\364\366\372/'""\243/; # Single&double quotes, British pound
s/\371/--/g; # em-dash
------------------------------
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 8730
***************************************