I can't seem to find explicit documentation for $# in perldoc.
Yes, I know what it is, and I can see implicit references in places like perllol and perldsc, but I can't seem to find anything standalone.
What's really surprising is that it doesn't have it's own section in perlvar.
Does such documentation exist? If so, where?
...
My Perl script gets a UDP response that is built out of 2 integers + float numbers. The problem is that the UDP stream is one long stream of bytes.
How do I cast the stream into parameters using Perl?
...
Possible Duplicate:
DBD::Oracle and utf8 issue
I set my NLS_LANG variable as 'AMERICAN_AMERICA.AL32UTF8' in the perl file that connects to oracle and tries to insert the data.
However when I insert a record with one value having this 'ñ' character the sql fails.
But if I use 'Ñ' it inserts just fine.
What am I doing wrong he...
Seems like in Perl this should be easy or a module, but I have not found an easy answer yet. I have a calculated z normal score and the mean, but have not found an easy method to calculate the percentage. The solutions I have found are for looking it up using a statistics table, but it seems like something that common would have a modul...
Possible Duplicate:
How can I get a working Data::Alias in Perl 5.12?
I'm trying to install the Data::Alias package from CPAN and I'm getting compile errors from gcc. I'm on Windows Server 2008:
Writing Makefile for Data::Alias
cp lib/Data/Alias.pm blib\lib\Data\Alias.pm
C:\strawberry\perl\bin\perl.exe "-Iinc" C:\strawberry\...
Say I define an abstract My::Object and concrete role implementations My::Object::TypeA and My::Object::TypeB. For maintainability reasons, I'd like to not have a hardcoded table that looks at the object type and applies roles. As a DWIMmy example, I'm looking for something along these lines in My::Object:
has => 'id' (isa => 'Str', req...
I'm trying to stream a file from a remote website to a local command and am running into some problems when trying to detect errors.
The code looks something like this:
use IPC::Open3;
my @cmd = ('wget','-O','-','http://10.10.1.72/index.php');#any website will do here
my ($wget_pid,$wget_in,$wget_out,$wget_err);
if (!($wget_pid = o...
I can use IxHash to remember the insertion order of a hash.
use Tie::IxHash;
my %hash;
tie(%hash, 'Tie::IxHash');
%hash = (
x => 10,
z => 20,
q => { a1 => 1, a3 => 5, a2=>2,},
y => 30,
);
printf("keys %s\n", join(" ", keys %hash));
=> keys x z q y
How about the nested hash?
printf("keys %s\n", join(" ", keys %{$hash{q}}));...
I'm trying to understand the behavior of the fields pragma, which I find poorly documented, regarding fields prefixed with underscores. This is what the documentation has to say about it:
Field names that start with an underscore character are made private to the class and are not visible to subclasses. Inherited fields can be overri...
If I have a command line like:
my_script.pl -foo -WHATEVER
My script knows about --foo, and I want Getopt to set variable $opt_foo, but I don't know anything about -WHATEVER. How can I tell Getopt to parse out the options that I've told it about, and then get the rest of the arguments in a string variable or a list.
An example:
use...
This is a general design question about how to make a web application that will receive a large amount of uploaded data, process it, and return a result, all without the dreaded spinning beach-ball for 5 minutes or a possible HTTP timeout.
Here's the requirements:
make a web form where you can upload a CSV file containing a list of UR...
I have Perl program based on IO::Async, and it sometimes just exits after a few hours/days without printing any error message whatsoever. There's nothing in dmesg or /var/log either. STDOUT/STDERR are both autoflush(1) so data shouldn't be lost in buffers. It doesn't actually exit from IO::Async::Loop->loop_forever - print I put there ju...
What is the difference between these two code snippets?
open (MYFILE, '>>data.txt');
open (MYFILE, '>data.txt');
...
I'm noticing some problems with the perlio layer in perl. Took me a good day to track it down and was hoping some other people knew something about this? The scariest thing about this is that since its so low-level, I'm worried it'll reduce the code's portability.
Server code:
use strict;
use Socket;
socket(my $sock, AF_INET, SOCK_S...
As part of an InstallationCheck script on OS X I need to use finder dialogs to let the user browse for files. When I'm done I want to move the installer application up front again so that the user can easily continue with the installation.
I have already tried the simple:
tell application "Installer" to activate
This does not work be...
I am having a problem with HTML::TreeBuilder; it shows mojibake/weird characters in the output. Please help me. Thanks in advance.
use strict;
use WWW::Curl::Easy;
use HTML::TreeBuilder;
my $cookie_file ='/tmp/pcook';
my $curl = new WWW::Curl::Easy;
my $response_body;
my $charset = 'utf-8';
$DocOffline::charset = undef;
$curl->setopt (C...
I've slurped in a big file using File::Slurp but given the size of the file I can see that I must have it in memory twice or perhaps it's getting inflated by being turned into 16 bit unicode. How can I best diagnose that sort of a problem in Perl?
The file I pulled in is 800mb in size and my perl process that's analysing that data has ...
I'd love like to read books properly on my Kindle.
To achieve my dream, I need a script to fix broken lines in a txt file.
For example, if the txt file has this line:
He watched Kahlan as she walked with her shoulders slumped
down.
... then it should fix it by deleting the newline before the word "down":
He watched Kahlan as she wa...
I'm using openldap on Mac OS X Server 10.6 and need to generate a vcard for all the users in a given group. By using the ldapsearch I can list all the memberUid's for all users in that group. I found a perl script (Advanced LDAP Search or ALS) that was written by someone that will generate the vcard easily. ALS can be found here http://w...
In a script you must include a #! on the first line followed by the path to the program that will execute the script (e.g.: sh, perl). As far as I know though, the # character denotes the start of a comment and that line is supposed to be ignored by the program executing the script. It would seem though, that this first line is at some p...