comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
March 2008
motuwethfrsasuw
     12 9
3456789 10
10111213141516 11
17181920212223 12
24252627282930 13
31       14
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
  FAQ 8.1 How do I find out which operating system I'm running under?         


Author: PerlFAQ Server
Date: Mar 28, 2008 18:03

This is an excerpt from the latest version perlfaq8.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 .

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

8.1: How do I find out which operating system I'm running under?

The $^O variable ($OSNAME if you use English) contains an indication of
the name of the operating system (not its release number) that your perl
binary was built for.

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

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.
Show full article (1.22Kb)
2 Comments
  FAQ 7.30 What does "bad interpreter" mean?         


Author: PerlFAQ Server
Date: Mar 28, 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.30: What does "bad interpreter" mean?

(contributed by brian d foy)

The "bad interpreter" message comes from the shell, not perl. The actual
message may vary depending on your platform, shell, and locale settings.

If you see "bad interpreter - no such file or directory", the first line
in your perl script (the "shebang" line) does not contain the right path
to perl (or any other program capable of running scripts). Sometimes
this happens when you move the script from one machine to another and
each machine has a different path to perl--/usr/bin/perl versus
/usr/local/bin/perl for instance. It may also indicate that the source
machine has CRLF line terminators and the destination machine has LF
only: the shell tries to find /usr/bin/perl, but can't.
Show full article (2.21Kb)
no comments
  Error.pm still maintained?         


Author: Michael Slass
Date: Mar 28, 2008 11:02

Hi:

I'm finding some bugs in Error.pm, and searches for Error on the perl
groups return only older (+1Y) postings. Is Error.pm still being
maintained? If not, is there a better try/catch/finally for perl5?
If so, what?

Thank you.

--
Mike Slass
2 Comments
  Capturing CPU and other execution Stats         


Author: pgodfrin
Date: Mar 28, 2008 09:57

Greetings,

Is there a way to capture runtime stats? I like to report stuff at the
end of my run, including how many CPU seconds and Elapsed seconds.
I've already used Time:HiRes clock(), but I'm looking for some more
granularity. Eventually I'll be setting up some simulations and I'd
like to see what kind of stats I can get out of my programs.

Any thoughts?

thanks,
pg
3 Comments
  child process dying if syswrite fails?         


Author: Konstantinos Agouros
Date: Mar 28, 2008 08:36

Hi,

I encountered a strange problem. I have an application that has a few
sockets open. To notify the other side that I am 'finished' I do a
shutdown on the socket. Because I am lazy I do a syswrite on the socket
after the shutdown which of course fails. However I found that the whole
childprocess doing this dies if I do the syswrite. This used not to happen.
The whole thing is on Gentoo Linux using perl 5.8.8.

Anybody can comment on this?

Regards,

Konstantin
--
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not survive the forming of the cosmos." B'Elana Torres
2 Comments
  Visualising / overview tools         


Author: Grant Denkinson
Date: Mar 28, 2008 08:29

Hi all.
I'm taking over a scientific programming project from a colleague,
part
of which is in about 60000 lines of perl.

Does anyone have recommendations for good tools to help me get an
overview of the code, perhaps some sort of visualisation of what calls
what etc.? We run Linux.

Grant
1 Comment
  Win32::OLE different connections methods produce different results         


Author: HmJ
Date: Mar 28, 2008 07:46

Hi,
It seems what when using perl Win32::OLE for WMI queries it produces
different results depending on method used to connect to server,
examples bellow, can somebody explain this issue?

Examples

Using ConnectServer() I get
ActiveSessions: 0
TotalSessions: 0

Script
#!/usr/bin/perl

use strict;
use Win32::OLE('in');

use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;

my $computer = "server";
my $user = 'DOMAIN\USER';
my $pwd = "password";
my $wmipath = 'root\\cimv2';
Show full article (4.31Kb)
no comments
  FAQ 7.13 What's a closure?         


Author: PerlFAQ Server
Date: Mar 28, 2008 06: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.13: What's a closure?

Closures are documented in perlref.

*Closure* is a computer science term with a precise but hard-to-explain
meaning. Usually, closures are implemented in Perl as anonymous
subroutines with lasting references to lexical variables outside their
own scopes. These lexicals magically refer to the variables that were
around when the subroutine was defined (deep binding).
Show full article (4.18Kb)
no comments
  5.10.         


Author: greymaus
Date: Mar 28, 2008 02:36

I have downloaded, compiled, and `make install' perl5.10.0, ok
3 Questions,`
1) even if I `./configure --prefix=/usr', it still installs
to `/usr/local'. How do I get it to instal to /usr/? (Just 'mv
/usr/local/bin/perl5.10 /usr/bin'?

2) Do I just relink /usr/bin/perl /usr/local/bin/perl5.10 to have it
run from the command line ('perl -e (whatever')

3) Is there any way of reloading the modules i have under perl5.8.8
quickly ?

--
Greymaus

Anything that can not kill you is a boring experience.
1 Comment
  empty variables - getting rid of "uninitialized value" warnings?         


Author: Tomasz Chmielewski
Date: Mar 28, 2008 02:34

I have perl code which should do some action only if:

- the variable does not begin with "#" (commented out),
- the variable is not empty

use strict;
use warnings;

my @array = ("# Comment", "/usr/bin/binary --test", "");

foreach my $var (@array) {

my @execargs = split(/#/, $var);

if ( $execargs[0] ne '' ) { print "$var 0: |$execargs[0]|\n" }

}

Unfortunately, it shows uninitialized value warnings for the empty
variable (""):

$ perl test.pl
/usr/bin/binary --test 0: |/usr/bin/binary --test|
Use of uninitialized value $execargs[0] in string ne at test.pl line 14.

Using:

if ( defined $execargs[0] ) { print "$var 0: |$execargs[0]|\n" }

is not a solution either, because $execargs[0] will be defined for a
case with "# Comment" and an undesired action will be made for this element:
Show full article (1.16Kb)
15 Comments
 
1 2