comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: Active State perl for windows not working.         


Author: Thrill5
Date: Jan 8, 2008 20:59

Add the "perl/bin" (whatever it is for your installation, but the default is
"C:\perl\bin" for ActiveState installations) directory in your PATH
environment variable.

"Caduceus" fusemail.com> wrote in message
news:dhn7o3hannpg0ugh7okc1t5k466m4gdogb@4ax.com...
> When I try to type in perl -v, perl -h,perl -w, or perl -procinv.pl
> nothing happens. Is there something I can do for this? TIA Steve
no comments
  Re: Active State perl for windows not working.         


Author: Reagan Revision
Date: Jan 8, 2008 20:28

"Caduceus" fusemail.com> wrote in message
news:dhn7o3hannpg0ugh7okc1t5k466m4gdogb@4ax.com...
> When I try to type in perl -v, perl -h,perl -w, or perl -procinv.pl
> nothing happens. Is there something I can do for this? TIA Steve

In order for the perl command to do anything in my AS installation, I have
to use a dos prompt in the \perl\bin directory.

To that end, I use the following shortcut:

%%windir%%\system32\cmd.exe /K CD /D \perl\bin

--
Reagan Revision

"We are being told that a competent, trustworthy president is someone
who brandishes his religion like a neon sign, loads a gun and goes out
hunting for beautiful winged creatures, and tries to imitate a past
president who, by the way, never shot a bird or felt the need to imitate
anybody."

~~ Patti Davis Is Not Flattered by GOP Candidates' Pale Imitations of
Her Father
Show full article (1.10Kb)
6 Comments
  FAQ 7.24 How can I catch accesses to undefined variables, functions, or methods?         


Author: PerlFAQ Server
Date: Jan 8, 2008 18:03

This is an excerpt from the latest version perlfaq7.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

7.24: How can I catch accesses to undefined variables, functions, or methods?

The AUTOLOAD method, discussed in "Autoloading" in perlsub and
"AUTOLOAD: Proxy Methods" in perltoot, lets you capture calls to
undefined functions and methods.

When it comes to undefined variables that would trigger a warning under
"use warnings", you can promote the warning to an error.

use warnings FATAL => qw(uninitialized);

--------------------------------------------------------------------
Show full article (1.42Kb)
no comments
  Re: Active State perl for windows not working.         


Author: Ted Zlatanov
Date: Jan 8, 2008 16:01

On Tue, 08 Jan 2008 16:34:38 -0400 Caduceus fusemail.com> wrote:
C> When I try to type in perl -v, perl -h,perl -w, or perl -procinv.pl
C> nothing happens. Is there something I can do for this? TIA Steve

Your keyboard is unplugged, or at least the following keys are not
working:

p
e
r
l
SPACE
-
v
h
w
o
c
i
n
.
Show full article (0.36Kb)
no comments
  HELP! File Copy, Move and Rename will not work in my script!         


Author: kwalike57
Date: Jan 8, 2008 15:20

Hello.

I have a perplexing question that seems like it should be very
simple. I have a perl script that in a nutshell, reads a directory
and then looks for a specific file naming convention which is matched...
Show full article (1.74Kb)
8 Comments
  Re: Active State perl for windows not working.         


Author: Jürgen Exner
Date: Jan 8, 2008 15:02

Caduceus fusemail.com> wrote:
>When I try to type in perl -v, perl -h,perl -w, or perl -procinv.pl
>nothing happens. Is there something I can do for this?

Nothing? You really get nothing? Not even an error message?
Then someone must have created a perl.bat or perl.com or perl.exe that
immediately terminates and replaced perl's perl.exe with that program.

jue
no comments
  every($key, $interval) function         


Author: Ted Zlatanov
Date: Jan 8, 2008 14:18

I find this function very useful:

{
my %%counters = ();
sub every
{
my $id = shift @_;
my $when = shift @_;

return (0 == ++$counters{$id} %% $when);
}
}

I call it like this:

print "debug info: ..."
if every("debug spot", 50);

print "extra info: ..."
if every("extra spot", 100);

So the debug info will be printed on every 50th call to every(). It's
small and convenient, but I have to make up a new ID every time.
Show full article (0.93Kb)
15 Comments
  Using CPAN "lightweight"         


Author: Bernie Cosell
Date: Jan 8, 2008 14:01

Is there a way to use the CPAN module *without* its creating a directory
and doing all sorts of fancy initialization and such? I want to set up a
program that I'd intended to "use CPAN" and do some mucking about with
modules and such, but when I try to run it I get barraged with dialogs and
it stashes away config stuff and who knows what... I'd like to run it
"self contained", no readline, no ".cpan" directories... just run?

I just tried and when it can't find a $HOME/.cpan dir with its config info
it launches into config-mode again... not so nice for a background task.
Can I somehow predefine all of the vbls that CPAN is looking for so it'll
just find 'em and be happy and not go poking around in the filesystem?
[also, is there a 'quiet' mode -- even when it finds what it wants I get
"Loading LWP...OK.. Fetching with LWP" and all of that stuff].

Thanks!
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
6 Comments
  FAQ 7.27 How can I comment out a large block of perl code?         


Author: PerlFAQ Server
Date: Jan 8, 2008 12:03

This is an excerpt from the latest version perlfaq7.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

7.27: How can I comment out a large block of perl code?

You can use embedded POD to discard it. Enclose the blocks you want to
comment out in POD markers. The <=begin> directive marks a section for a
specific formatter. Use the "comment" format, which no formatter should
claim to understand (by policy). Mark the end of the block with <=end>.

# program is here

=begin comment

all of this stuff

here will be ignored
by everyone

=end comment

=cut

# program continues
Show full article (1.86Kb)
no comments
  remove special characters in front of the file names         


Author: wong_powah
Date: Jan 8, 2008 11:07

I want to remove all special characters in front of a list of file
names (which may be generated by the "find" or other commands).
How to do that?
This does not work:
$ find . -type f -print | perl -pe 's/([?|*.\'"])/\\$1/g'
>
$ find . -type f -print | perl -pe "s/([?|*.\'"])/\\$1/g"
bash: syntax error near unexpected token `)'
8 Comments
1 2