[23122] in Perl-Users-Digest
Perl-Users Digest, Issue: 5343 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 11 09:06:11 2003
Date: Mon, 11 Aug 2003 06:05:08 -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 Mon, 11 Aug 2003 Volume: 10 Number: 5343
Today's topics:
Re: "Undefined subroutine" error (but it's defined, I t <abigail@abigail.nl>
Re: "Undefined subroutine" error (but it's defined, I t valerian@no.valid.email
Re: A simple doubt :-/ <REMOVEsdnCAPS@comcast.net>
Re: connecting to a database (with no web server) <member32241@dbforums.com>
Re: connecting to a database (with no web server) <r_reidy@comcast.net>
Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: FTP doesn't add Carriage Return from VMS to NT? (Villy Kruse)
Re: help needed making unicode entities <jidanni@jidanni.org>
Re: help needed making unicode entities <flavell@mail.cern.ch>
Re: How do you simulate "." or "source" in a perl scrip (Chris Marshall)
Re: How do you simulate "." or "source" in a perl scrip (Chris Marshall)
Re: How do you simulate "." or "source" in a perl scrip <abigail@abigail.nl>
How to find the info from documentation quickly?? <dhouremove@rohan.sdsu.edu>
Re: How to find the info from documentation quickly?? <simon@unisolve.com.au>
Re: How to find the info from documentation quickly?? <grazz@pobox.com>
Re: How to find the info from documentation quickly?? <dhou@rohan.sdsu.edu>
Re: How to find the info from documentation quickly?? <simon@unisolve.com.au>
Re: How to find the info from documentation quickly?? <ndronen@io.frii.com>
Re: How to find the info from documentation quickly?? <tassilo.parseval@rwth-aachen.de>
Re: How to find the info from documentation quickly?? <NOSPAM@bigpond.com>
Re: How to find the info from documentation quickly?? <tp601553@cia.gov>
Regexp problem <jill_krugman@yahoo.com>
Re: Regexp problem (Sam Holden)
Re: Script displays in dos window, not browser <a@c.com>
Re: Win32-OLE excel cell reference. <spikey-wan@bigfoot.com>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Aug 2003 06:45:01 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: "Undefined subroutine" error (but it's defined, I think?)
Message-Id: <slrnbjeerc.jn9.abigail@alexandra.abigail.nl>
Bob Walton (bwalton@rochester.rr.com) wrote on MMMDCXXX September
MCMXCIII in <URL:news:3F357BE8.1080704@rochester.rr.com>:
``
`` Note in:
``
`` perldoc -f use
``
`` that use() calls require(). Note in
``
`` perldoc -f require
``
`` that require() keeps track of which modules have been loaded in %INC (a
`` global variable, always in package main). Therefore, when the use()
`` function is called, it will do something only if that module has not
`` already been loaded. So each module will be loaded exactly once.
`` Subsequent calls to use() will not do anything. Therefore, when you use
`` Exporter; to export your sub's, it only happens during the first use()
`` of your module. Thus, the export of your sub names happens only the
`` first time a given modules is use()'d.
That's not quite true. Yes, a module is *COMPILED* only once using
this mechanism. But importing is done via the import() routine, which
is called for each time "use" appears.
If things happened as you discribe, one could use only one constant
in each program, you could use 'strict' in only one module, etc, etc.
`` Basically, you are misusing (pun intended) the module mechanism in an
`` attempt to simply define subs. If all you want is for all your subs to
`` be present even though they are defined in other files, simply do() the
`` other files, and forget modules and packages. When you properly use
`` modules, you do not share subs (in modules, properly called methods).
``
`` From the docs for Exporter:
``
`` "Do not export method names!
``
`` Do not export anything else by default without a good reason!
``
`` Exports pollute the namespace of the module user. If you must
`` export try
`` to use @EXPORT_OK in preference to @EXPORT and avoid short or common
`` symbol names to reduce the risk of name clashes."
``
`` You are trying to use use() wrong. Read up on the various
`` object-oriented docs and buy "Object Oriented Perl" and read it.
Where do object come in? The OP isn't using OO programming (and rightly so).
Abigail
--
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
------------------------------
Date: Mon, 11 Aug 2003 08:17:09 GMT
From: valerian@no.valid.email
Subject: Re: "Undefined subroutine" error (but it's defined, I think?)
Message-Id: <slrnbjek84.j5n.valerian@core.invalid.tld>
In article <3F357BE8.1080704@rochester.rr.com>, Bob Walton wrote:
>> even though I made sure the caller (here Misc.pm) had imported all the
>> functions of the other module. Hence, I don't understand the reason
>
> No you didn't. See comments at end.
Alright, I went and spent some intimate time with 'man perlmod', 'man
perlmodlib', 'man Exporter', 'perldoc use', 'perldoc require', 'perldoc
do', and all their friends... :-)
But none of those explain why the 'use DB;' line in Misc.pm is not
importing the functions in the @EXPORT of DB.pm. The only way I can
get this to work right is either by fully qualifying the function
name (&My:DB:DB_Disconnect) or by inserting the line 'import My::DB;'
somewhere in the My::Misc::SafeError sub. But adding the import line
outside that scope doesn't work. That's what I don't understand. That
sub belongs to the My::Misc package, so why doesn't it honor the pragmas
in that package?
And to make it even more confusing, in the 'real' modules (not the
skeleton ones I listed previously) there are some subs that do honor the
package pragmas, and some that don't. In both cases I'm talking about
subs in the same package making identical calls to the same function in
another package. Frex, in My::DB, several subs call My::Misc::GetDate,
and in some cases I have to fully qualify it, and in some cases I don't.
I can't seem to find a pattern though. :-(
> Note in:
>
> perldoc -f use
>
> that use() calls require(). Note in
>
> perldoc -f require
>
> that require() keeps track of which modules have been loaded in %INC (a
> global variable, always in package main). Therefore, when the use()
> function is called, it will do something only if that module has not
> already been loaded. So each module will be loaded exactly once.
> Subsequent calls to use() will not do anything. Therefore, when you use
> Exporter; to export your sub's, it only happens during the first use()
> of your module. Thus, the export of your sub names happens only the
> first time a given modules is use()'d.
I rather like having everything exported as soon as possible. It's a
mod_perl app, with all the modules preloaded by startup.pl, to avoid as
many delays as possibly...
I'm not sure what difference it makes that %INC is a global var though.
That shouldn't negatively affect My::Misc, as the 'use DB;' line would
just cause the 'require' step to be skipped and simply go on to import
the @EXPORT subs in My::DB from the copy already in memory, right?
> Basically, you are misusing (pun intended) the module mechanism in an
> attempt to simply define subs. If all you want is for all your subs to
> be present even though they are defined in other files, simply do() the
> other files, and forget modules and packages. When you properly use
> modules, you do not share subs (in modules, properly called methods).
Well I only have a rudimentary understanding of OO Perl (having read the
introductory OO chapter in Advanced Perl Programming--which incidentally
I found easier to follow than the stuff in the camel book), so I'm not
quite ready to take the plunge yet. And besides, I've already got well
over 10,000 lines of procedural code that I have to finish testing ASAP,
so there's no time to start tearing things up. Maybe next project... :-)
Still, I don't think it's a total waste to use modules for just plain
old procedural code. I make judicious use of @EXPORT, @EXPORT_OK and
use specific sub names based on the package name to avoid namespace
clashes (frex, DB_Disconnect and other DB_ prefixed subs are in the
My::DB package).
------------------------------
Date: Mon, 11 Aug 2003 04:37:19 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: A simple doubt :-/
Message-Id: <Xns93D43915CF884sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
pkent <pkent77tea@yahoo.com.tea> wrote in
news:pkent77tea-C1BDAB.23551610082003@usenet.force9.net:
> In article <slrnbjd36p.m0g.sholden@flexal.cs.usyd.edu.au>,
> sholden@flexal.cs.usyd.edu.au (Sam Holden) wrote:
>
>> On Fri, 8 Aug 2003 19:20:49 +0000 (UTC),
>> Louis Erickson <wwonko@rdwarf.com> wrote:
>> >
>> > I haven't found a way to use mod_perl that wasn't horribly
>> > difficult. This may be my missing something obvious, and if it is,
>> > I'd very much love to be hit with the clue stick. None of the
>> > tutorials or documentation I've seen talks about how to take a
>> > functioning, cleanly written CGI program and make it run correctly
>> > under mod_perl.
>
> IME if your program really is a cleanly written CGI it runs Just Fine
> under mod_perl.
As long as you don't use any file-scope lexical variables... Or is that
not "clean"?
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPzdjp2PeouIeTNHoEQJ+cwCgl8WXL4vcO/BZz7w1q096Tx7RJRAAoOtW
J3clfVcx87XROTNPWpRoghLb
=zGyM
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 11 Aug 2003 06:56:20 +0000
From: dominant <member32241@dbforums.com>
Subject: Re: connecting to a database (with no web server)
Message-Id: <3223679.1060584980@dbforums.com>
To Ron Reidy
Although, i have the DBI documents(perldoc DBI), however, when i tried
to run "perldoc DBD::Oracle" i didn't recieve any results. That means i
have the DBD for the Oracle, (nor Mysql).
Should i download extra packages?
--------------
I understood that the $host variable must be specified as the private IP
within the private network.
--
Posted via http://dbforums.com
------------------------------
Date: Mon, 11 Aug 2003 05:11:01 -0600
From: Ron Reidy <r_reidy@comcast.net>
Subject: Re: connecting to a database (with no web server)
Message-Id: <3F3779C5.8080606@comcast.net>
You can access them online:
http://search.cpan.org/author/TIMB/DBD-Oracle-1.14/Oracle.pm
http://search.cpan.org/author/RUDY/DBD-mysql-2.9002/lib/DBD/mysql.pm
To install DBD::Oracle for AS Perlm you will need to install Perl v5.6.x
(I recommend 5.6.1), since Perl 5.8.0 does not have a ppm for DBD::Oracle.
--
Ron Reidy
Oracle DBA
dominant wrote:
> To Ron Reidy
>
> Although, i have the DBI documents(perldoc DBI), however, when i tried
> to run "perldoc DBD::Oracle" i didn't recieve any results. That means i
> have the DBD for the Oracle, (nor Mysql).
>
> Should i download extra packages?
>
> --------------
>
> I understood that the $host variable must be specified as the private IP
> within the private network.
>
> --
> Posted via http://dbforums.com
--
Ron Reidy
Oracle DBA
------------------------------
Date: 11 Aug 2003 08:17:59 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1060589799@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: 11 Aug 2003 07:30:12 GMT
From: vek@station02.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: FTP doesn't add Carriage Return from VMS to NT?
Message-Id: <slrnbjejeb.7b7.vek@station02.ohout.pharmapartners.nl>
On 9 Aug 2003 22:20:50 -0700,
Mike O'Neal <mjoneal@bpa.gov> wrote:
>
>Jim, I read your issue, and if it's notepad you need to read it in,
>just use Wordpad! Voila, problem solved, since it is content to use
>LF as a terminator. My problem is proprietary software that NEEDS the
>expected CR/LF. I know I can post-process the files, but there's a
>bunch and I'd like a better solution if possible.
>
>Does anyone know if the "A" module I mention above is the right place,
>or perhaps elsewhere?
It is the sending daemon which should convert to CR/LF format which is
the on-the-wire format for text transferred with ftp. Unix clients
then convert CR/LF to LF and MS win clients don't translate.
Villy
------------------------------
Date: Mon, 11 Aug 2003 09:47:43 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: Re: help needed making unicode entities
Message-Id: <87wudlj77k.fsf@jidanni.org>
Alan> binmode(STDOUT, ":utf8");
Bad news, only the first one works:
echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
PERLIO=:utf8 perl -wple 's/./"&#".ord($&).";"/eg'
積丹尼
echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
perl -wple 'binmode(STDIN,":utf8");s/./"&#".ord($&).";"/eg'
積丹尼
echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
perl -wple 'binmode(STDOUT,":utf8");s/./"&#".ord($&).";"/eg'
積丹尼
echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
perl -wple 'binmode(STDOUT,":utf8");binmode(STDIN,":utf8");s/./"&#".ord($&).";"/eg'
積丹尼
perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
------------------------------
Date: Mon, 11 Aug 2003 11:56:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: help needed making unicode entities
Message-Id: <Pine.LNX.4.53.0308111139590.15834@lxplus069.cern.ch>
On Mon, Aug 11, Dan Jacobson inscribed on the eternal scroll:
> Alan> binmode(STDOUT, ":utf8");
>
> Bad news, only the first one works:
> echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
> PERLIO=:utf8 perl -wple 's/./"&#".ord($&).";"/eg'
> 積丹尼
Seems to be one of the possibilities documented in perlrun, so that's
good.
> echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
> perl -wple 'binmode(STDIN,":utf8");s/./"&#".ord($&).";"/eg'
> 積丹尼
I have to confess, I have no familiarity with the details of this part
of the -p option. I'm really not a great one-liner, I'm afraid.
> echo =E7=A9=8D=E4=B8=B9=E5=B0=BC|mmencode -u -q|
> perl -wple 'binmode(STDOUT,":utf8");s/./"&#".ord($&).";"/eg'
> 積丹尼
Since you're not trying to send any utf-8-encoded characters (other
than those which are trivially us-ascii) to STDOUT, I'm not sure why
you're suggesting binmode(STDOUT, ...) as being possibly relevant.
Well, it looks as if you have one option which works.
I plead lack of knowledge on the other one, but it's at least
plausible that setting binmode on STDIN ought to work. Maybe someone
reading this who understands the -p processing better than I do would
care to comment - maybe even try reporting a bug - or at least getting
it documented in perlrun?
cheers
------------------------------
Date: 11 Aug 2003 03:35:32 -0700
From: c_j_marshall@hotmail.com (Chris Marshall)
Subject: Re: How do you simulate "." or "source" in a perl script ?
Message-Id: <cb9c7b76.0308110235.523629f1@posting.google.com>
James Willmore <jwillmore@cyberia.com> wrote in message news:<20030808111536.71614720.jwillmore@cyberia.com>...
> > Specifically I would like to set environment variables inside a perl
> > script which are stored inside a separate config file (used by many
> > other programs)
> >
> > At the moment I have a separate ksh script wrapper around my perl
> > script which simply does something like
> >
> > #!/bin/ksh
> >
> > . /dir/config.sh
> >
> > /dir/perlscript.pl
>
> No offense, but what's the issue with this? It seems like it does
> what you wnat it to do. If you want ALL scripts to have the SAME
> environmental variables, why not set them from within .profile or
> .bashrc or.cshrc or some variation of the three based upon your shell?
>
Only that it means having two scripts instead of one - and it seems a
shame that the perl script would be reliable on a ksh script to run.
------------------------------
Date: 11 Aug 2003 03:46:53 -0700
From: c_j_marshall@hotmail.com (Chris Marshall)
Subject: Re: How do you simulate "." or "source" in a perl script ?
Message-Id: <cb9c7b76.0308110246.6b6c0990@posting.google.com>
Abigail <abigail@abigail.nl> wrote in message news:<slrnbj7gfm.39l.abigail@alexandra.abigail.nl>...
> Chris Marshall (c_j_marshall@hotmail.com) wrote on MMMDCXXVIII September
> MCMXCIII in <URL:news:cb9c7b76.0308070721.2f4cd3f5@posting.google.com>:
> && Is there a good way of simulating the bourne shell's "." command - or
> && csh's "source" command inside a perl script ?
> &&
> The code below runs in combination with the Korn shell, and probably any
> other Bourne shell decendent, including the POSIX shell. I don't know
> whether this works in the standard Windows shell - probably not due to
> quoting issues, but getting it to run under Cygwin/bash should not be
> a problem.
>
<snip most of the code example>
> exec << " --";
> source '$ENVIRONMENT'
> exec $0 --sourced_environment @ARGV;
Brilliant - thank you.
BTW I changed "source" in your script to be "." to get it working with
ksh. Should source have worked ? I thought that source was just for
csh.
------------------------------
Date: 11 Aug 2003 12:46:35 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How do you simulate "." or "source" in a perl script ?
Message-Id: <slrnbjf41b.q6t.abigail@alexandra.abigail.nl>
Chris Marshall (c_j_marshall@hotmail.com) wrote on MMMDCXXXII September
MCMXCIII in <URL:news:cb9c7b76.0308110246.6b6c0990@posting.google.com>:
!! Abigail <abigail@abigail.nl> wrote in message news:<slrnbj7gfm.39l.abigail@alexandra.abigail.nl>...
!! > Chris Marshall (c_j_marshall@hotmail.com) wrote on MMMDCXXVIII September
!! > MCMXCIII in <URL:news:cb9c7b76.0308070721.2f4cd3f5@posting.google.com>:
!! > && Is there a good way of simulating the bourne shell's "." command - or
!! > && csh's "source" command inside a perl script ?
!! > &&
!!
!! > The code below runs in combination with the Korn shell, and probably any
!! > other Bourne shell decendent, including the POSIX shell. I don't know
!! > whether this works in the standard Windows shell - probably not due to
!! > quoting issues, but getting it to run under Cygwin/bash should not be
!! > a problem.
!! >
!! <snip most of the code example>
!! > exec << " --";
!! > source '$ENVIRONMENT'
!! > exec $0 --sourced_environment @ARGV;
!!
!!
!! Brilliant - thank you.
!! BTW I changed "source" in your script to be "." to get it working with
!! ksh. Should source have worked ? I thought that source was just for
!! csh.
The piece of code is coming from a program I wrote that works on
HP-UX, using its default shell, which is the Korn shell.
I cannot recall every working with a shell that uses '.' to source
files, that don't also accept 'source', but that doesn't mean there
are no such shells.
Anyway, if '.' works for you, and 'source' doesn't, use '.'.
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: 11 Aug 2003 01:26:46 GMT
From: hou <dhouremove@rohan.sdsu.edu>
Subject: How to find the info from documentation quickly??
Message-Id: <bh6rcm$eu$1@gondor.sdsu.edu>
Hello everyone,
I am new to perl. How can I get the information I need quickly from
the perl documentation??
For example:
Now I am confused with function "glob" and "*INPUT = *STDIN".
I typed "perldoc -q typeglob", but I got nothing.
Would you please share some experiences with me?
Thank you very much
Dean
------------------------------
Date: Mon, 11 Aug 2003 11:35:51 +1000
From: Simon Taylor <simon@unisolve.com.au>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <bh6s0e$smf$1@otis.netspace.net.au>
> I am new to perl. How can I get the information I need quickly from
> the perl documentation??
>
> For example:
> Now I am confused with function "glob" and "*INPUT = *STDIN".
> I typed "perldoc -q typeglob", but I got nothing.
>
> Would you please share some experiences with me?
Happy to.
Try:
perldoc -f glob
perldoc File::Glob
perldoc -q glob
Simon Taylor
------------------------------
Date: Mon, 11 Aug 2003 02:07:00 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <8TCZa.4839$794.4758@nwrdny02.gnilink.net>
Simon Taylor <simon@unisolve.com.au> wrote:
>> Now I am confused with function "glob" and "*INPUT = *STDIN".
>> I typed "perldoc -q typeglob", but I got nothing.
>
> perldoc -f glob
> perldoc File::Glob
> perldoc -q glob
And for the typeglobs:
perldoc perldata
perldoc perlmod
--
Steve
------------------------------
Date: 11 Aug 2003 02:13:16 GMT
From: hou <dhou@rohan.sdsu.edu>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <bh6u3s$1c2$1@gondor.sdsu.edu>
Simon Taylor <simon@unisolve.com.au> wrote:
> Happy to.
> Try:
> perldoc -f glob
> perldoc File::Glob
> perldoc -q glob
> Simon Taylor
Hi Mr. Taylor,
Actually, my question was "what is the first(,second,and third...)
thing I need to do in order to find info quickly using perldoc?".
You are an experienced programmer, so you know where to locate
information you need. But I am just a newbie, how do I know
I should look for File::Glob?
I mean, there should be a way to narrow down the search when I
encounter any type of question in perl.
So I won't waste the space here by asking some very basic question
,which I could find in perldoc.
Thank you very much
Dean
------------------------------
Date: Mon, 11 Aug 2003 12:42:47 +1000
From: Simon Taylor <simon@unisolve.com.au>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <bh6vtv$tkf$1@otis.netspace.net.au>
Hello Dean,
> Actually, my question was "what is the first(,second,and third...)
> thing I need to do in order to find info quickly using perldoc?".
>
> You are an experienced programmer, so you know where to locate
> information you need. But I am just a newbie, how do I know
> I should look for File::Glob?
>
> I mean, there should be a way to narrow down the search when I
> encounter any type of question in perl.
> So I won't waste the space here by asking some very basic question
> ,which I could find in perldoc.
Well in this specific case, it was the perldoc for the glob function
itself that told me to look into File::Glob.
Yours is a tough question to answer.
Unconsciously I probably follow a heirarchy like this:
1. The perl cookbook. This is by far the most heavily used
reference book in our office, it's great.
2. If I'm looking for documentation on a function, I know that I can
use the perldoc "-f" flag, as in perldoc -f functionname.
3. If I suspect that there may be something in the perl FAQs on the
topic, I'll use the perldoc "-q" flag, as in perldoc -q array
I hope this helps
Simon Taylor
------------------------------
Date: 11 Aug 2003 02:54:04 GMT
From: Nicholas Dronen <ndronen@io.frii.com>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <3f37054c$0$198$75868355@news.frii.net>
Simon Taylor <simon@unisolve.com.au> wrote:
ST> Hello Dean,
>> Actually, my question was "what is the first(,second,and third...)
>> thing I need to do in order to find info quickly using perldoc?".
>>
>> You are an experienced programmer, so you know where to locate
>> information you need. But I am just a newbie, how do I know
>> I should look for File::Glob?
>>
>> I mean, there should be a way to narrow down the search when I
>> encounter any type of question in perl.
>> So I won't waste the space here by asking some very basic question
>> ,which I could find in perldoc.
ST> Well in this specific case, it was the perldoc for the glob function
ST> itself that told me to look into File::Glob.
ST> Yours is a tough question to answer.
ST> Unconsciously I probably follow a heirarchy like this:
ST> 1. The perl cookbook. This is by far the most heavily used
ST> reference book in our office, it's great.
ST> 2. If I'm looking for documentation on a function, I know that I can
ST> use the perldoc "-f" flag, as in perldoc -f functionname.
ST> 3. If I suspect that there may be something in the perl FAQs on the
ST> topic, I'll use the perldoc "-q" flag, as in perldoc -q array
There's also the index in "perldoc perl" itself.
Regards,
Nicholas
--
"Why shouldn't I top-post?" http://www.aglami.com/tpfaq.html
"Meanings are another story." http://www.ifas.org/wa/glossolalia.html
------------------------------
Date: 11 Aug 2003 05:31:32 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <bh79nk$54h$1@nets3.rz.RWTH-Aachen.DE>
Also sprach hou:
> Hello everyone,
> I am new to perl. How can I get the information I need quickly from
> the perl documentation??
>
> For example:
> Now I am confused with function "glob" and "*INPUT = *STDIN".
> I typed "perldoc -q typeglob", but I got nothing.
>
> Would you please share some experiences with me?
If it's a builtin function (like glob()):
perldoc -f function
If you assume your problem might be covered in the FAQs:
perldoc -q keyword
where 'keyword' is actually a regex.
For all other things you first need to find the manpage that deals with
it. See 'perldoc perltoc'. If you scan this document for 'typeglob', the
first hit would be
perldata - Perl data types
DESCRIPTION
Variable names
Context
Scalar values
Scalar value constructors
List value constructors
Slices
Typeglobs and Filehandles
SEE ALSO
so you look up 'perldoc perldata'. If you want a terse overview over all
the manpage and what they deal with, see 'perldoc perl'.
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: Mon, 11 Aug 2003 16:45:19 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <bh7e1r$urm46$1@ID-202028.news.uni-berlin.de>
"hou" <dhouremove@rohan.sdsu.edu> wrote in message
news:bh6rcm$eu$1@gondor.sdsu.edu...
> Hello everyone,
> I am new to perl. How can I get the information I need quickly from
> the perl documentation??
I look at http://perldoc.com/ & http://www.rexswain.com/perl5.html
gtoomey
------------------------------
Date: Mon, 11 Aug 2003 11:11:48 GMT
From: Tweetie Pooh <tp601553@cia.gov>
Subject: Re: How to find the info from documentation quickly??
Message-Id: <Xns93D47C123232ETweetiePooh@62.253.162.109>
Simon Taylor <simon@unisolve.com.au> honoured comp.lang.perl.misc on Mon 11
Aug 2003 03:42:47a with news:bh6vtv$tkf$1@otis.netspace.net.au:
> 1. The perl cookbook. This is by far the most heavily used
> reference book in our office, it's great.
>
>
As an aside, I believe there is a new edition of this out later Aug 2003.
------------------------------
Date: Mon, 11 Aug 2003 01:08:37 +0000 (UTC)
From: J Krugman <jill_krugman@yahoo.com>
Subject: Regexp problem
Message-Id: <bh6qal$8ea$1@reader2.panix.com>
Suppose I have some lengthy and/or complicated sub-regexp such as
'(foo|bar|...)', how do I write a regexp that will match it, followed
by some white space, followed by something that is neither foo or
bar? I.e. I want this to match:
bar frobozz
but not this:
bar foo
TIA,
Jill
------------------------------
Date: 11 Aug 2003 01:26:24 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Regexp problem
Message-Id: <slrnbjds5v.61s.sholden@flexal.cs.usyd.edu.au>
On Mon, 11 Aug 2003 01:08:37 +0000 (UTC),
J Krugman <jill_krugman@yahoo.com> wrote:
>
>
> Suppose I have some lengthy and/or complicated sub-regexp such as
> '(foo|bar|...)', how do I write a regexp that will match it, followed
> by some white space, followed by something that is neither foo or
> bar? I.e. I want this to match:
By translating your english into perl regular expression syntax:
match it: (foo|bar|...)
white space: \s+
something: \S
neither foo or bar : (?!foo|bar)
The neither bit if the only not so common construct, see "perldoc perlre"
for details.
And putting it all together:
/(foo|bar|...)\s+(?!foo|bar)\S/s
I made a bunch of assumptions about what your words meant, things like
"some" being 1 or more, "something" being 1 or more non-whitespace
characters. If they are wrong, then the regex will be wrong.
I also assumed you didn't want:
"foo barn"
to match, but did want:
"foo seafood"
to match. Again, if that's wrong the regex is wrong (but easily fixed).
--
Sam Holden
------------------------------
Date: Mon, 11 Aug 2003 02:31:42 -0700
From: "Alan C." <a@c.com>
Subject: Re: Script displays in dos window, not browser
Message-Id: <vjeok03u3v0r10@corp.supernews.com>
"Joe Burnett" <joe@burnettworks.com> wrote in message
news:KluZa.113785$Ho3.14438@sccrnsc03...
> Hello,
>
> I am trying to run a trivial perl script, but the results either get
> displayed in a dos window,
> or the source code gets displayed in a browser. The former happens when I
> open the script
> in IE with a pl extension. The latter happens if I open the script with a
> cgi extension.
But how is the open accomplished? is it like do you enter into the address
bar of the browser something near/like:
http://localhost/cgi-bin/myscript.cgi
>Both
> scripts reside in "C:\Program Files\Apache Group\Apache2\cgi-bin".
File location looks ok. What happen if U do
localhost/cgi-bin/scriptname.cgi as I mentioned further above
--
http://perl.about.com/cs/beginningperl/
http://perl.about.com/cs/intermediateperl/
very near those above two is also some cgi info. a "Perl 101 class" which
focuses on Perl cgi & web server a few basics
--
Alan.
------------------------------
Date: Mon, 11 Aug 2003 11:30:03 +0100
From: "Richard S Beckett" <spikey-wan@bigfoot.com>
Subject: Re: Win32-OLE excel cell reference.
Message-Id: <bh7r9n$ill$1@newshost.mot.com>
"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3F35A2D0.5020409@rochester.rr.com...
> Richard S Beckett wrote:
>
> ...> It seems that the Range command likes data like (A14), or (A14:B26),
and I
> > am happy with this.
> ...
>
>
> > I have had success with Cells(1,14), but I cannot for the life of me
work
> > out how to reference an area of cells like this...
> >
> > Cells(1,14:5,28)
> ...
>
>
> > R.
>
>
> Well, despite its plural name, the Cells property only returns a Range
> which is a single cell. You can do:
>
> ...Range(Cells(1,14),Cells(5,28))...
>
> The main reason for the Cells property is to permit the manipulation of
> a Range given row and column index numbers, rather than strings like
> "B3:E7", which are a bit harder to manipulate (especially in VB).
Great, just what I needed, thanks.
> Use Excel's object browser to help look up stuff like that. Your
> question really isn't a Perl question, but, close enough I guess.
I don't understand. This is my biggest problem, I'm sure the information is
available somewhere, but I have no idea where, or how to access it.
Thanks.
R.
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
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 5343
***************************************